New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@r2u/viewer

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r2u/viewer - npm Package Compare versions

Comparing version 1.5.5 to 1.5.6

2

dist/index.js
/*! For license information please see index.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r="object"==typeof exports?t(require("react")):t(e.react);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,(e=>(()=>{var t,r,o={58:(e,t,r)=>{"use strict";var o=r(594),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return o.isMemo(e)?a:s[e.$$typeof]||n}s[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[o.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,o){if("string"!=typeof r){if(p){var n=g(r);n&&n!==p&&e(t,n,o)}var a=u(r);d&&(a=a.concat(d(r)));for(var s=l(t),m=l(r),h=0;h<a.length;++h){var y=a[h];if(!(i[y]||o&&o[y]||m&&m[y]||s&&s[y])){var M=f(r,y);try{c(t,y,M)}catch(e){}}}}return t}},516:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,l=n(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))r.call(a,u)&&(l[u]=a[u]);if(t){s=t(a);for(var d=0;d<s.length;d++)o.call(a,s[d])&&(l[s[d]]=a[s[d]])}}return l}},697:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,M=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case d:case i:case s:case a:case g:return e;default:switch(e=e&&e.$$typeof){case c:case f:case h:case m:case l:return e;default:return t}}case n:return t}}}function w(e){return j(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=h,t.Memo=m,t.Portal=n,t.Profiler=s,t.StrictMode=a,t.Suspense=g,t.isAsyncMode=function(e){return w(e)||j(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return j(e)===c},t.isContextProvider=function(e){return j(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return j(e)===f},t.isFragment=function(e){return j(e)===i},t.isLazy=function(e){return j(e)===h},t.isMemo=function(e){return j(e)===m},t.isPortal=function(e){return j(e)===n},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===a},t.isSuspense=function(e){return j(e)===g},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===g||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===M||e.$$typeof===v||e.$$typeof===b||e.$$typeof===y)},t.typeOf=j},594:(e,t,r)=>{"use strict";e.exports=r(697)},94:(e,t,r)=>{"use strict";r(516);var o=r(156),n=60103;if("function"==typeof Symbol&&Symbol.for){var i=Symbol.for;n=i("react.element"),i("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var o,i={},c=null,u=null;for(o in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,o)&&!l.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},512:(e,t,r)=>{"use strict";e.exports=r(94)},7:e=>{e.exports=function(e,t,r,o){var n=r?r.call(o,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(n=r?r.call(o,u,d,c):void 0)||void 0===n&&u!==d)return!1}return!0}},156:t=>{"use strict";t.exports=e}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>167===e?"vendors.f67ae33fc1a23991db96.bundle.js":628===e?"threeExperience.bundle.js":27===e?"vendors.46242851acce02152166.bundle.js":322===e?"dracoCompress.bundle.js":void 0,i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@r2u/viewer:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+n){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var f=(r,o)=>{s.onerror=s.onload=null,clearTimeout(g);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},g=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="https://unpkg.com/@r2u/viewer@1.5.5/dist/",(()=>{var e={179:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,[a,s,l]=r,c=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);l&&l(i)}for(t&&t(r);c<a.length;c++)n=a[c],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{"use strict";i.r(a),i.d(a,{default:()=>at});var e=i(512),t=i(156),r=i.n(t);const o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNjkiIHZpZXdCb3g9IjAgMCA3MCA2OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE4Ml85NDcpIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xODJfOTQ3KSI+CjxwYXRoIGQ9Ik01NC4wNDU5IDQwLjgzNjNMNDEuMTQyNSAzNC42MzJDNDAuNjU5NCAzNC40Mzk4IDQwLjE0NzggMzQuMzMgMzkuNjA3OCAzNC4zM0MzOC40MTQ4IDM0LjMzIDM3LjQ0NzcgMzMuMzYyOSAzNy40NDc3IDMyLjE3VjE3Ljg1ODNDMzcuNDQ3NyAxNS41Nzk3IDM1LjU0MzUgMTMuNzQwNCAzMy4xODQ1IDEzLjc0MDRDMzAuODI1NSAxMy43NDA0IDI4LjkyMTMgMTUuNTc5NyAyOC45MjEzIDE3Ljg1ODNWMzcuNTU3OEMyOC45MjEzIDQyLjYxNDggMjQuMjg3OCA0Ni40MDMxIDE5LjMzMTYgNDUuMzk4MkwxOS4xNzI3IDQ1LjM2NkMxOC45NDUzIDQ1LjMzODYgMTguNzQ2NCA0NS4yODM3IDE4LjQ5MDYgNDUuMjgzN0MxNy42MDk1IDQ1LjI4MzcgMTYuODEzNyA0NS42NDA2IDE2LjI0NTMgNDYuMTg5NkMxNS4wMTU3IDQ3LjM5MjMgMTUuMDIxOSA0OS4zNzI5IDE2LjI1OTEgNTAuNTY3OUwyOC4wNDAyIDYxLjk0NzVDMjguODA3NiA2Mi42ODg4IDI5Ljg4NzYgNjMuMTU1NSAzMS4wNTI5IDYzLjE1NTVINTAuMzUxMUM1Mi40ODI3IDYzLjE1NTUgNTQuMTMxMiA2MS42NDU2IDU0LjQ0MzggNTkuNjQxNUw1Ni41NzU0IDQ1LjE3MzlDNTYuNjAzOCA0NC45ODE3IDU2LjYzMjMgNDQuNzg5NSA1Ni42MzIzIDQ0LjYyNDhDNTYuNjMyMyA0Mi45MjI3IDU1LjU1MjIgNDEuNDQwMyA1NC4wNDU5IDQwLjgzNjNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjAuNzYxOCAxOS44MjYzQzIxLjM5MTUgMjQuMTk1NCAyNi4xMDUyIDIyLjQxMjYgMjYuMTA1MiAxNy45OTgyQzI2LjEwNTIgMTQuMTY2OCAyOS4xNzA1IDExLjA1NzMgMzIuOTQ3NSAxMS4wNTczQzM2LjcyNDQgMTEuMDU3MyAzOS43ODk3IDE0LjE2NjggMzkuNzg5NyAxNy45OTgyQzM5Ljc4OTcgMjIuNDEyNiA0NC41MDM0IDI0LjE5NTQgNDUuMTMzMSAxOS44MjYzQzQ1LjIxOTEgMTkuMjI5OCA0NS4yNjM2IDE4LjYxOTQgNDUuMjYzNiAxNy45OTgyQzQ1LjI2MzYgMTEuMDg1IDM5Ljc2MjQgNS41MDQ1MiAzMi45NDc1IDUuNTA0NTJDMjYuMTMyNSA1LjUwNDUyIDIwLjYzMTMgMTEuMDg1IDIwLjYzMTMgMTcuOTk4MkMyMC42MzEzIDE4LjYxOTQgMjAuNjc1OCAxOS4yMjk4IDIwLjc2MTggMTkuODI2M1oiIGZpbGw9IiNEREREREQiLz4KPC9nPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMTgyXzk0NyIgeD0iMTIuMzI3MSIgeT0iMi41MDQ1MiIgd2lkdGg9IjUxLjMwNTIiIGhlaWdodD0iNjcuNjUxIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHg9IjIiIGR5PSIyIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIuNSIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4yNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzE4Ml85NDciLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTgyXzk0NyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xODJfOTQ3Ij4KPHJlY3Qgd2lkdGg9IjcwIiBoZWlnaHQ9IjY4LjgwNjgiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";var n=i(594),s=i(7),l=i.n(s);const c=function(e){function t(e,o,l,c,f){for(var g,p,m,h,b,w=0,I=0,A=0,N=0,x=0,z=0,E=m=g=0,Y=0,P=0,R=0,Z=0,B=l.length,U=B-1,Q="",H="",_="",F="";Y<B;){if(p=l.charCodeAt(Y),Y===U&&0!==I+N+A+w&&(0!==I&&(p=47===I?10:47),N=A=w=0,B++,U++),0===I+N+A+w){if(Y===U&&(0<P&&(Q=Q.replace(d,"")),0<Q.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:Q+=l.charAt(Y)}p=59}switch(p){case 123:for(g=(Q=Q.trim()).charCodeAt(0),m=1,Z=++Y;Y<B;){switch(p=l.charCodeAt(Y)){case 123:m++;break;case 125:m--;break;case 47:switch(p=l.charCodeAt(Y+1)){case 42:case 47:e:{for(E=Y+1;E<U;++E)switch(l.charCodeAt(E)){case 47:if(42===p&&42===l.charCodeAt(E-1)&&Y+2!==E){Y=E+1;break e}break;case 10:if(47===p){Y=E+1;break e}}Y=E}}break;case 91:p++;case 40:p++;case 34:case 39:for(;Y++<U&&l.charCodeAt(Y)!==p;);}if(0===m)break;Y++}if(m=l.substring(Z,Y),0===g&&(g=(Q=Q.replace(u,"").trim()).charCodeAt(0)),64===g){switch(0<P&&(Q=Q.replace(d,"")),p=Q.charCodeAt(1)){case 100:case 109:case 115:case 45:P=o;break;default:P=O}if(Z=(m=t(o,P,m,p,f+1)).length,0<T&&(b=s(3,m,P=r(O,Q,R),o,k,D,Z,p,f,c),Q=P.join(""),void 0!==b&&0===(Z=(m=b.trim()).length)&&(p=0,m="")),0<Z)switch(p){case 115:Q=Q.replace(j,a);case 100:case 109:case 45:m=Q+"{"+m+"}";break;case 107:m=(Q=Q.replace(y,"$1 $2"))+"{"+m+"}",m=1===C||2===C&&i("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=Q+m,112===c&&(H+=m,m="")}else m=""}else m=t(o,r(o,Q,R),m,c,f+1);_+=m,m=R=P=E=g=0,Q="",p=l.charCodeAt(++Y);break;case 125:case 59:if(1<(Z=(Q=(0<P?Q.replace(d,""):Q).trim()).length))switch(0===E&&(g=Q.charCodeAt(0),45===g||96<g&&123>g)&&(Z=(Q=Q.replace(" ",":")).length),0<T&&void 0!==(b=s(1,Q,o,e,k,D,H.length,c,f,c))&&0===(Z=(Q=b.trim()).length)&&(Q="\0\0"),g=Q.charCodeAt(0),p=Q.charCodeAt(1),g){case 0:break;case 64:if(105===p||99===p){F+=Q+l.charAt(Y);break}default:58!==Q.charCodeAt(Z-1)&&(H+=n(Q,g,p,Q.charCodeAt(2)))}R=P=E=g=0,Q="",p=l.charCodeAt(++Y)}}switch(p){case 13:case 10:47===I?I=0:0===1+g&&107!==c&&0<Q.length&&(P=1,Q+="\0"),0<T*L&&s(0,Q,o,e,k,D,H.length,c,f,c),D=1,k++;break;case 59:case 125:if(0===I+N+A+w){D++;break}default:switch(D++,h=l.charAt(Y),p){case 9:case 32:if(0===N+w+I)switch(x){case 44:case 58:case 9:case 32:h="";break;default:32!==p&&(h=" ")}break;case 0:h="\\0";break;case 12:h="\\f";break;case 11:h="\\v";break;case 38:0===N+I+w&&(P=R=1,h="\f"+h);break;case 108:if(0===N+I+w+S&&0<E)switch(Y-E){case 2:112===x&&58===l.charCodeAt(Y-3)&&(S=x);case 8:111===z&&(S=z)}break;case 58:0===N+I+w&&(E=Y);break;case 44:0===I+A+N+w&&(P=1,h+="\r");break;case 34:case 39:0===I&&(N=N===p?0:0===N?p:N);break;case 91:0===N+I+A&&w++;break;case 93:0===N+I+A&&w--;break;case 41:0===N+I+w&&A--;break;case 40:0===N+I+w&&(0===g&&(2*x+3*z==533||(g=1)),A++);break;case 64:0===I+A+N+w+E+m&&(m=1);break;case 42:case 47:if(!(0<N+w+A))switch(I){case 0:switch(2*p+3*l.charCodeAt(Y+1)){case 235:I=47;break;case 220:Z=Y,I=42}break;case 42:47===p&&42===x&&Z+2!==Y&&(33===l.charCodeAt(Z+2)&&(H+=l.substring(Z,Y+1)),h="",I=0)}}0===I&&(Q+=h)}z=x,x=p,Y++}if(0<(Z=H.length)){if(P=o,0<T&&void 0!==(b=s(2,H,P,e,k,D,Z,c,f,c))&&0===(H=b).length)return F+H+_;if(H=P.join(",")+"{"+H+"}",0!=C*S){switch(2!==C||i(H,2)||(S=0),S){case 111:H=H.replace(v,":-moz-$1")+H;break;case 112:H=H.replace(M,"::-webkit-input-$1")+H.replace(M,"::-moz-$1")+H.replace(M,":-ms-input-$1")+H}S=0}}return F+H+_}function r(e,t,r){var n=t.trim().split(m);t=n;var i=n.length,a=e.length;switch(a){case 0:case 1:var s=0;for(e=0===a?"":e[0]+" ";s<i;++s)t[s]=o(e,t[s],r).trim();break;default:var l=s=0;for(t=[];s<i;++s)for(var c=0;c<a;++c)t[l++]=o(e[c]+" ",n[s],r).trim()}return t}function o(e,t,r){var o=t.charCodeAt(0);switch(33>o&&(o=(t=t.trim()).charCodeAt(0)),o){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(h,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function n(e,t,r,o){var a=e+";",s=2*t+3*r+4*o;if(944===s){e=a.indexOf(":",9)+1;var l=a.substring(e,a.length-1).trim();return l=a.substring(0,e).trim()+l+";",1===C||2===C&&i(l,1)?"-webkit-"+l+l:l}if(0===C||2===C&&!i(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(x,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(l=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+l+a;case 1005:return g.test(a)?a.replace(f,":-webkit-")+a.replace(f,":-moz-")+a:a;case 1e3:switch(t=(l=a.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=a.replace(b,"tb");break;case 232:l=a.replace(b,"tb-rl");break;case 220:l=a.replace(b,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+l+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,s=(l=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(l,"-webkit-"+l)+";"+a.replace(l,"-ms-"+l+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return l=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+l+"-ms-flex-"+l+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(I,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(I,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===N.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?n(e.replace("stretch","fill-available"),t,r,o).replace(":fill-available",":stretch"):a.replace(l,"-webkit-"+l)+a.replace(l,"-moz-"+l.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===r+o&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+a}return a}function i(e,t){var r=e.indexOf(1===t?":":"{"),o=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),E(2!==t?o:o.replace(A,"$1"),r,t)}function a(e,t){var r=n(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(w," or ($1)").substring(4):"("+t+")"}function s(e,t,r,o,n,i,a,s,l,u){for(var d,f=0,g=t;f<T;++f)switch(d=z[f].call(c,e,g,r,o,n,i,a,s,l,u)){case void 0:case!1:case!0:case null:break;default:g=d}if(g!==t)return g}function l(e){return void 0!==(e=e.prefix)&&(E=null,e?"function"!=typeof e?C=1:(C=2,E=e):C=0),l}function c(e,r){var o=e;if(33>o.charCodeAt(0)&&(o=o.trim()),o=[o],0<T){var n=s(-1,r,o,o,k,D,0,0,0,0);void 0!==n&&"string"==typeof n&&(r=n)}var i=t(O,o,r,0,0);return 0<T&&void 0!==(n=s(-2,i,o,o,k,D,i.length,0,0,0))&&(i=n),S=0,D=k=1,i}var u=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,g=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,M=/::(place)/g,v=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,j=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,I=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,N=/stretch|:\s*\w+\-(?:conte|avail)/,x=/([^-])(image-set\()/,D=1,k=1,S=0,C=1,O=[],z=[],T=0,E=null,L=0;return c.use=function e(t){switch(t){case void 0:case null:T=z.length=0;break;default:if("function"==typeof t)z[T++]=t;else if("object"==typeof t)for(var r=0,o=t.length;r<o;++r)e(t[r]);else L=0|!!t}return e},c.set=l,void 0!==e&&l(e),c},u={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var d=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const f=(g={},function(e){return void 0===g[e]&&(g[e]=(t=e,d.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91)),g[e];var t});var g,p=i(58),m=i.n(p);function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var y=function(e,t){for(var r=[e[0]],o=0,n=t.length;o<n;o+=1)r.push(t[o],e[o+1]);return r},M=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,n.typeOf)(e)},v=Object.freeze([]),b=Object.freeze({});function j(e){return"function"==typeof e}function w(e){return e.displayName||e.name||"Component"}function I(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",N="undefined"!=typeof window&&"HTMLElement"in window,x=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY);function D(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var k=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,o=r.length,n=o;e>=n;)(n<<=1)<0&&D(16,""+e);this.groupSizes=new Uint32Array(n),this.groupSizes.set(r),this.length=n;for(var i=o;i<n;i++)this.groupSizes[i]=0}for(var a=this.indexOfGroup(e+1),s=0,l=t.length;s<l;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),o=r+t;this.groupSizes[e]=0;for(var n=r;n<o;n++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],o=this.indexOfGroup(e),n=o+r,i=o;i<n;i++)t+=this.tag.getRule(i)+"/*!sc*/\n";return t},e}(),S=new Map,C=new Map,O=1,z=function(e){if(S.has(e))return S.get(e);for(;C.has(O);)O++;var t=O++;return S.set(e,t),C.set(t,e),t},T=function(e){return C.get(e)},E=function(e,t){t>=O&&(O=t+1),S.set(e,t),C.set(t,e)},L="style["+A+'][data-styled-version="5.3.3"]',Y=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P=function(e,t,r){for(var o,n=r.split(","),i=0,a=n.length;i<a;i++)(o=n[i])&&e.registerName(t,o)},R=function(e,t){for(var r=(t.textContent||"").split("/*!sc*/\n"),o=[],n=0,i=r.length;n<i;n++){var a=r[n].trim();if(a){var s=a.match(Y);if(s){var l=0|parseInt(s[1],10),c=s[2];0!==l&&(E(c,l),P(e,c,s[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(a)}}},Z=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},B=function(e){var t=document.head,r=e||t,o=document.createElement("style"),n=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var o=t[r];if(o&&1===o.nodeType&&o.hasAttribute(A))return o}}(r),i=void 0!==n?n.nextSibling:null;o.setAttribute(A,"active"),o.setAttribute("data-styled-version","5.3.3");var a=Z();return a&&o.setAttribute("nonce",a),r.insertBefore(o,i),o},U=function(){function e(e){var t=this.element=B(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,o=t.length;r<o;r++){var n=t[r];if(n.ownerNode===e)return n}D(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),Q=function(){function e(e){var t=this.element=B(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),o=this.nodes[e];return this.element.insertBefore(r,o||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),H=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),_=N,F={isServer:!N,useCSSOMInjection:!x},G=function(){function e(e,t,r){void 0===e&&(e=b),void 0===t&&(t={}),this.options=h({},F,{},e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&N&&_&&(_=!1,function(e){for(var t=document.querySelectorAll(L),r=0,o=t.length;r<o;r++){var n=t[r];n&&"active"!==n.getAttribute(A)&&(R(e,n),n.parentNode&&n.parentNode.removeChild(n))}}(this))}e.registerId=function(e){return z(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(h({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,o=t.useCSSOMInjection,n=t.target,e=r?new H(n):o?new U(n):new Q(n),new k(e)));var e,t,r,o,n},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(z(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(z(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(z(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,o="",n=0;n<r;n++){var i=T(n);if(void 0!==i){var a=e.names.get(i),s=t.getGroup(n);if(a&&s&&a.size){var l=A+".g"+n+'[id="'+i+'"]',c="";void 0!==a&&a.forEach((function(e){e.length>0&&(c+=e+",")})),o+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return o}(this)},e}(),$=/(a)(d)/gi,W=function(e){return String.fromCharCode(e+(e>25?39:97))};function X(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=W(t%52)+r;return(W(t%52)+r).replace($,"$1-$2")}var V=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},J=function(e){return V(5381,e)};function q(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(j(r)&&!I(r))return!1}return!0}var K=J("5.3.3"),ee=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&q(e),this.componentId=t,this.baseHash=V(K,t),this.baseStyle=r,G.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var o=this.componentId,n=[];if(this.baseStyle&&n.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(o,this.staticRulesId))n.push(this.staticRulesId);else{var i=ye(this.rules,e,t,r).join(""),a=X(V(this.baseHash,i)>>>0);if(!t.hasNameForId(o,a)){var s=r(i,"."+a,void 0,o);t.insertRules(o,a,s)}n.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=V(this.baseHash,r.hash),u="",d=0;d<l;d++){var f=this.rules[d];if("string"==typeof f)u+=f;else if(f){var g=ye(f,e,t,r),p=Array.isArray(g)?g.join(""):g;c=V(c,p+d),u+=p}}if(u){var m=X(c>>>0);if(!t.hasNameForId(o,m)){var h=r(u,"."+m,void 0,o);t.insertRules(o,m,h)}n.push(m)}}return n.join(" ")},e}(),te=/^\s*\/\/.*$/gm,re=[":","[",".","#"];function oe(e){var t,r,o,n,i=void 0===e?b:e,a=i.options,s=void 0===a?b:a,l=i.plugins,u=void 0===l?v:l,d=new c(s),f=[],g=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,o,n,i,a,s,l,c,u,d){switch(r){case 1:if(0===u&&64===o.charCodeAt(0))return e(o+";"),"";break;case 2:if(0===c)return o+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(n[0]+o),"";default:return o+(0===d?"/*|*/":"")}case-2:o.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),p=function(e,o,i){return 0===o&&-1!==re.indexOf(i[r.length])||i.match(n)?e:"."+t};function m(e,i,a,s){void 0===s&&(s="&");var l=e.replace(te,""),c=i&&a?a+" "+i+" { "+l+" }":l;return t=s,r=i,o=new RegExp("\\"+r+"\\b","g"),n=new RegExp("(\\"+r+"\\b){2,}"),d(a||!i?"":i,c)}return d.use([].concat(u,[function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(r)>0&&(n[0]=n[0].replace(o,p))},g,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||D(15),V(e,t.name)}),5381).toString():"",m}var ne=r().createContext(),ie=(ne.Consumer,r().createContext()),ae=(ie.Consumer,new G),se=oe();function le(){return(0,t.useContext)(ne)||ae}function ce(e){var o=(0,t.useState)(e.stylisPlugins),n=o[0],i=o[1],a=le(),s=(0,t.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,t.useMemo)((function(){return oe({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,t.useEffect)((function(){l()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]),r().createElement(ne.Provider,{value:s},r().createElement(ie.Provider,{value:c},e.children))}var ue=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=se);var o=r.name+t.hash;e.hasNameForId(r.id,o)||e.insertRules(r.id,o,t(r.rules,o,"@keyframes"))},this.toString=function(){return D(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),de=/([A-Z])/,fe=/([A-Z])/g,ge=/^ms-/,pe=function(e){return"-"+e.toLowerCase()};function me(e){return de.test(e)?e.replace(fe,pe).replace(ge,"-ms-"):e}var he=function(e){return null==e||!1===e||""===e};function ye(e,t,r,o){if(Array.isArray(e)){for(var n,i=[],a=0,s=e.length;a<s;a+=1)""!==(n=ye(e[a],t,r,o))&&(Array.isArray(n)?i.push.apply(i,n):i.push(n));return i}return he(e)?"":I(e)?"."+e.styledComponentId:j(e)?"function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!t?e:ye(e(t),t,r,o):e instanceof ue?r?(e.inject(r,o),e.getName(o)):e:M(e)?function e(t,r){var o,n,i=[];for(var a in t)t.hasOwnProperty(a)&&!he(t[a])&&(Array.isArray(t[a])&&t[a].isCss||j(t[a])?i.push(me(a)+":",t[a],";"):M(t[a])?i.push.apply(i,e(t[a],a)):i.push(me(a)+": "+(o=a,(null==(n=t[a])||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||o in u?String(n).trim():n+"px")+";")));return r?[r+" {"].concat(i,["}"]):i}(e):e.toString();var l}var Me=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function ve(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return j(e)||M(e)?Me(ye(y(v,[e].concat(r)))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:Me(ye(y(e,r)))}new Set;var be=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function we(e){return e.replace(be,"-").replace(je,"")}function Ie(e){return"string"==typeof e&&!0}var Ae=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ne=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function xe(e,t,r){var o=e[r];Ae(t)&&Ae(o)?De(o,t):e[r]=t}function De(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];for(var n=0,i=r;n<i.length;n++){var a=i[n];if(Ae(a))for(var s in a)Ne(s)&&xe(e,a[s],s)}return e}var ke=r().createContext();ke.Consumer;var Se={};function Ce(e,o,n){var i=I(e),a=!Ie(e),s=o.attrs,l=void 0===s?v:s,c=o.componentId,u=void 0===c?function(e,t){var r="string"!=typeof e?"sc":we(e);Se[r]=(Se[r]||0)+1;var o=r+"-"+function(e){return X(J(e)>>>0)}("5.3.3"+r+Se[r]);return t?t+"-"+o:o}(o.displayName,o.parentComponentId):c,d=o.displayName,g=void 0===d?function(e){return Ie(e)?"styled."+e:"Styled("+w(e)+")"}(e):d,p=o.displayName&&o.componentId?we(o.displayName)+"-"+o.componentId:o.componentId||u,y=i&&e.attrs?Array.prototype.concat(e.attrs,l).filter(Boolean):l,M=o.shouldForwardProp;i&&e.shouldForwardProp&&(M=o.shouldForwardProp?function(t,r,n){return e.shouldForwardProp(t,r,n)&&o.shouldForwardProp(t,r,n)}:e.shouldForwardProp);var A,N=new ee(n,p,i?e.componentStyle:void 0),x=N.isStatic&&0===l.length,D=function(e,r){return function(e,r,o,n){var i=e.attrs,a=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,d=e.target,g=function(e,t,r){void 0===e&&(e=b);var o=h({},t,{theme:e}),n={};return r.forEach((function(e){var t,r,i,a=e;for(t in j(a)&&(a=a(o)),a)o[t]=n[t]="className"===t?(r=n[t],i=a[t],r&&i?r+" "+i:r||i):a[t]})),[o,n]}(function(e,t,r){return void 0===r&&(r=b),e.theme!==r.theme&&e.theme||t||r.theme}(r,(0,t.useContext)(ke),s)||b,r,i),p=g[0],m=g[1],y=function(e,r,o,n){var i=le(),a=(0,t.useContext)(ie)||se;return r?e.generateAndInjectStyles(b,i,a):e.generateAndInjectStyles(o,i,a)}(a,n,p),M=o,v=m.$as||r.$as||m.as||r.as||d,w=Ie(v),I=m!==r?h({},r,{},m):r,A={};for(var N in I)"$"!==N[0]&&"as"!==N&&("forwardedAs"===N?A.as=I[N]:(c?c(N,f,v):!w||f(N))&&(A[N]=I[N]));return r.style&&m.style!==r.style&&(A.style=h({},r.style,{},m.style)),A.className=Array.prototype.concat(l,u,y!==u?y:null,r.className,m.className).filter(Boolean).join(" "),A.ref=M,(0,t.createElement)(v,A)}(A,e,r,x)};return D.displayName=g,(A=r().forwardRef(D)).attrs=y,A.componentStyle=N,A.displayName=g,A.shouldForwardProp=M,A.foldedComponentIds=i?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):v,A.styledComponentId=p,A.target=i?e.target:e,A.withComponent=function(e){var t=o.componentId,r=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(o,["componentId"]),i=t&&t+"-"+(Ie(e)?e:we(w(e)));return Ce(e,h({},r,{attrs:y,componentId:i}),n)},Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=i?De({},e.defaultProps,t):t}}),A.toString=function(){return"."+A.styledComponentId},a&&m()(A,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),A}var Oe,ze=function(e){return function e(t,r,o){if(void 0===o&&(o=b),!(0,n.isValidElementType)(r))return D(1,String(r));var i=function(){return t(r,o,ve.apply(void 0,arguments))};return i.withConfig=function(n){return e(t,r,h({},o,{},n))},i.attrs=function(n){return e(t,r,h({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},i}(Ce,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){ze[e]=ze(e)})),Oe=function(e,t){this.rules=e,this.componentId=t,this.isStatic=q(e),G.registerId(this.componentId+1)}.prototype,Oe.createStyles=function(e,t,r,o){var n=o(ye(this.rules,t,r,o).join(""),""),i=this.componentId+e;r.insertRules(i,i,n)},Oe.removeStyles=function(e,t){t.clearRules(this.componentId+e)},Oe.renderStyles=function(e,t,r,o){e>2&&G.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,o)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var r=Z();return"<style "+[r&&'nonce="'+r+'"',A+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?D(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return D(2);var o=((t={})[A]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=Z();return n&&(o.nonce=n),[r().createElement("style",h({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new G({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?D(2):r().createElement(ce,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return D(3)}}();const Te=ze,Ee=Te.div`
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r="object"==typeof exports?t(require("react")):t(e.react);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,(e=>(()=>{var t,r,o={58:(e,t,r)=>{"use strict";var o=r(594),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return o.isMemo(e)?a:s[e.$$typeof]||n}s[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[o.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,o){if("string"!=typeof r){if(p){var n=g(r);n&&n!==p&&e(t,n,o)}var a=u(r);d&&(a=a.concat(d(r)));for(var s=l(t),m=l(r),h=0;h<a.length;++h){var y=a[h];if(!(i[y]||o&&o[y]||m&&m[y]||s&&s[y])){var M=f(r,y);try{c(t,y,M)}catch(e){}}}}return t}},516:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,l=n(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))r.call(a,u)&&(l[u]=a[u]);if(t){s=t(a);for(var d=0;d<s.length;d++)o.call(a,s[d])&&(l[s[d]]=a[s[d]])}}return l}},697:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,g=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,M=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case d:case i:case s:case a:case g:return e;default:switch(e=e&&e.$$typeof){case c:case f:case h:case m:case l:return e;default:return t}}case n:return t}}}function w(e){return j(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=h,t.Memo=m,t.Portal=n,t.Profiler=s,t.StrictMode=a,t.Suspense=g,t.isAsyncMode=function(e){return w(e)||j(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return j(e)===c},t.isContextProvider=function(e){return j(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return j(e)===f},t.isFragment=function(e){return j(e)===i},t.isLazy=function(e){return j(e)===h},t.isMemo=function(e){return j(e)===m},t.isPortal=function(e){return j(e)===n},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===a},t.isSuspense=function(e){return j(e)===g},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===g||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===M||e.$$typeof===v||e.$$typeof===b||e.$$typeof===y)},t.typeOf=j},594:(e,t,r)=>{"use strict";e.exports=r(697)},94:(e,t,r)=>{"use strict";r(516);var o=r(156),n=60103;if("function"==typeof Symbol&&Symbol.for){var i=Symbol.for;n=i("react.element"),i("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var o,i={},c=null,u=null;for(o in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,o)&&!l.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},512:(e,t,r)=>{"use strict";e.exports=r(94)},7:e=>{e.exports=function(e,t,r,o){var n=r?r.call(o,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(n=r?r.call(o,u,d,c):void 0)||void 0===n&&u!==d)return!1}return!0}},156:t=>{"use strict";t.exports=e}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>167===e?"vendors.f67ae33fc1a23991db96.bundle.js":628===e?"threeExperience.bundle.js":27===e?"vendors.46242851acce02152166.bundle.js":322===e?"dracoCompress.bundle.js":void 0,i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@r2u/viewer:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+n){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var f=(r,o)=>{s.onerror=s.onload=null,clearTimeout(g);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},g=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="https://unpkg.com/@r2u/viewer@1.5.6/dist/",(()=>{var e={179:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,[a,s,l]=r,c=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);l&&l(i)}for(t&&t(r);c<a.length;c++)n=a[c],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{"use strict";i.r(a),i.d(a,{default:()=>at});var e=i(512),t=i(156),r=i.n(t);const o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNjkiIHZpZXdCb3g9IjAgMCA3MCA2OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE4Ml85NDcpIj4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xODJfOTQ3KSI+CjxwYXRoIGQ9Ik01NC4wNDU5IDQwLjgzNjNMNDEuMTQyNSAzNC42MzJDNDAuNjU5NCAzNC40Mzk4IDQwLjE0NzggMzQuMzMgMzkuNjA3OCAzNC4zM0MzOC40MTQ4IDM0LjMzIDM3LjQ0NzcgMzMuMzYyOSAzNy40NDc3IDMyLjE3VjE3Ljg1ODNDMzcuNDQ3NyAxNS41Nzk3IDM1LjU0MzUgMTMuNzQwNCAzMy4xODQ1IDEzLjc0MDRDMzAuODI1NSAxMy43NDA0IDI4LjkyMTMgMTUuNTc5NyAyOC45MjEzIDE3Ljg1ODNWMzcuNTU3OEMyOC45MjEzIDQyLjYxNDggMjQuMjg3OCA0Ni40MDMxIDE5LjMzMTYgNDUuMzk4MkwxOS4xNzI3IDQ1LjM2NkMxOC45NDUzIDQ1LjMzODYgMTguNzQ2NCA0NS4yODM3IDE4LjQ5MDYgNDUuMjgzN0MxNy42MDk1IDQ1LjI4MzcgMTYuODEzNyA0NS42NDA2IDE2LjI0NTMgNDYuMTg5NkMxNS4wMTU3IDQ3LjM5MjMgMTUuMDIxOSA0OS4zNzI5IDE2LjI1OTEgNTAuNTY3OUwyOC4wNDAyIDYxLjk0NzVDMjguODA3NiA2Mi42ODg4IDI5Ljg4NzYgNjMuMTU1NSAzMS4wNTI5IDYzLjE1NTVINTAuMzUxMUM1Mi40ODI3IDYzLjE1NTUgNTQuMTMxMiA2MS42NDU2IDU0LjQ0MzggNTkuNjQxNUw1Ni41NzU0IDQ1LjE3MzlDNTYuNjAzOCA0NC45ODE3IDU2LjYzMjMgNDQuNzg5NSA1Ni42MzIzIDQ0LjYyNDhDNTYuNjMyMyA0Mi45MjI3IDU1LjU1MjIgNDEuNDQwMyA1NC4wNDU5IDQwLjgzNjNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMjAuNzYxOCAxOS44MjYzQzIxLjM5MTUgMjQuMTk1NCAyNi4xMDUyIDIyLjQxMjYgMjYuMTA1MiAxNy45OTgyQzI2LjEwNTIgMTQuMTY2OCAyOS4xNzA1IDExLjA1NzMgMzIuOTQ3NSAxMS4wNTczQzM2LjcyNDQgMTEuMDU3MyAzOS43ODk3IDE0LjE2NjggMzkuNzg5NyAxNy45OTgyQzM5Ljc4OTcgMjIuNDEyNiA0NC41MDM0IDI0LjE5NTQgNDUuMTMzMSAxOS44MjYzQzQ1LjIxOTEgMTkuMjI5OCA0NS4yNjM2IDE4LjYxOTQgNDUuMjYzNiAxNy45OTgyQzQ1LjI2MzYgMTEuMDg1IDM5Ljc2MjQgNS41MDQ1MiAzMi45NDc1IDUuNTA0NTJDMjYuMTMyNSA1LjUwNDUyIDIwLjYzMTMgMTEuMDg1IDIwLjYzMTMgMTcuOTk4MkMyMC42MzEzIDE4LjYxOTQgMjAuNjc1OCAxOS4yMjk4IDIwLjc2MTggMTkuODI2M1oiIGZpbGw9IiNEREREREQiLz4KPC9nPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMTgyXzk0NyIgeD0iMTIuMzI3MSIgeT0iMi41MDQ1MiIgd2lkdGg9IjUxLjMwNTIiIGhlaWdodD0iNjcuNjUxIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHg9IjIiIGR5PSIyIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIuNSIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4yNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzE4Ml85NDciLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTgyXzk0NyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xODJfOTQ3Ij4KPHJlY3Qgd2lkdGg9IjcwIiBoZWlnaHQ9IjY4LjgwNjgiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==";var n=i(594),s=i(7),l=i.n(s);const c=function(e){function t(e,o,l,c,f){for(var g,p,m,h,b,w=0,I=0,A=0,N=0,x=0,z=0,E=m=g=0,Y=0,P=0,R=0,Z=0,B=l.length,U=B-1,Q="",H="",_="",F="";Y<B;){if(p=l.charCodeAt(Y),Y===U&&0!==I+N+A+w&&(0!==I&&(p=47===I?10:47),N=A=w=0,B++,U++),0===I+N+A+w){if(Y===U&&(0<P&&(Q=Q.replace(d,"")),0<Q.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:Q+=l.charAt(Y)}p=59}switch(p){case 123:for(g=(Q=Q.trim()).charCodeAt(0),m=1,Z=++Y;Y<B;){switch(p=l.charCodeAt(Y)){case 123:m++;break;case 125:m--;break;case 47:switch(p=l.charCodeAt(Y+1)){case 42:case 47:e:{for(E=Y+1;E<U;++E)switch(l.charCodeAt(E)){case 47:if(42===p&&42===l.charCodeAt(E-1)&&Y+2!==E){Y=E+1;break e}break;case 10:if(47===p){Y=E+1;break e}}Y=E}}break;case 91:p++;case 40:p++;case 34:case 39:for(;Y++<U&&l.charCodeAt(Y)!==p;);}if(0===m)break;Y++}if(m=l.substring(Z,Y),0===g&&(g=(Q=Q.replace(u,"").trim()).charCodeAt(0)),64===g){switch(0<P&&(Q=Q.replace(d,"")),p=Q.charCodeAt(1)){case 100:case 109:case 115:case 45:P=o;break;default:P=O}if(Z=(m=t(o,P,m,p,f+1)).length,0<T&&(b=s(3,m,P=r(O,Q,R),o,k,D,Z,p,f,c),Q=P.join(""),void 0!==b&&0===(Z=(m=b.trim()).length)&&(p=0,m="")),0<Z)switch(p){case 115:Q=Q.replace(j,a);case 100:case 109:case 45:m=Q+"{"+m+"}";break;case 107:m=(Q=Q.replace(y,"$1 $2"))+"{"+m+"}",m=1===C||2===C&&i("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=Q+m,112===c&&(H+=m,m="")}else m=""}else m=t(o,r(o,Q,R),m,c,f+1);_+=m,m=R=P=E=g=0,Q="",p=l.charCodeAt(++Y);break;case 125:case 59:if(1<(Z=(Q=(0<P?Q.replace(d,""):Q).trim()).length))switch(0===E&&(g=Q.charCodeAt(0),45===g||96<g&&123>g)&&(Z=(Q=Q.replace(" ",":")).length),0<T&&void 0!==(b=s(1,Q,o,e,k,D,H.length,c,f,c))&&0===(Z=(Q=b.trim()).length)&&(Q="\0\0"),g=Q.charCodeAt(0),p=Q.charCodeAt(1),g){case 0:break;case 64:if(105===p||99===p){F+=Q+l.charAt(Y);break}default:58!==Q.charCodeAt(Z-1)&&(H+=n(Q,g,p,Q.charCodeAt(2)))}R=P=E=g=0,Q="",p=l.charCodeAt(++Y)}}switch(p){case 13:case 10:47===I?I=0:0===1+g&&107!==c&&0<Q.length&&(P=1,Q+="\0"),0<T*L&&s(0,Q,o,e,k,D,H.length,c,f,c),D=1,k++;break;case 59:case 125:if(0===I+N+A+w){D++;break}default:switch(D++,h=l.charAt(Y),p){case 9:case 32:if(0===N+w+I)switch(x){case 44:case 58:case 9:case 32:h="";break;default:32!==p&&(h=" ")}break;case 0:h="\\0";break;case 12:h="\\f";break;case 11:h="\\v";break;case 38:0===N+I+w&&(P=R=1,h="\f"+h);break;case 108:if(0===N+I+w+S&&0<E)switch(Y-E){case 2:112===x&&58===l.charCodeAt(Y-3)&&(S=x);case 8:111===z&&(S=z)}break;case 58:0===N+I+w&&(E=Y);break;case 44:0===I+A+N+w&&(P=1,h+="\r");break;case 34:case 39:0===I&&(N=N===p?0:0===N?p:N);break;case 91:0===N+I+A&&w++;break;case 93:0===N+I+A&&w--;break;case 41:0===N+I+w&&A--;break;case 40:0===N+I+w&&(0===g&&(2*x+3*z==533||(g=1)),A++);break;case 64:0===I+A+N+w+E+m&&(m=1);break;case 42:case 47:if(!(0<N+w+A))switch(I){case 0:switch(2*p+3*l.charCodeAt(Y+1)){case 235:I=47;break;case 220:Z=Y,I=42}break;case 42:47===p&&42===x&&Z+2!==Y&&(33===l.charCodeAt(Z+2)&&(H+=l.substring(Z,Y+1)),h="",I=0)}}0===I&&(Q+=h)}z=x,x=p,Y++}if(0<(Z=H.length)){if(P=o,0<T&&void 0!==(b=s(2,H,P,e,k,D,Z,c,f,c))&&0===(H=b).length)return F+H+_;if(H=P.join(",")+"{"+H+"}",0!=C*S){switch(2!==C||i(H,2)||(S=0),S){case 111:H=H.replace(v,":-moz-$1")+H;break;case 112:H=H.replace(M,"::-webkit-input-$1")+H.replace(M,"::-moz-$1")+H.replace(M,":-ms-input-$1")+H}S=0}}return F+H+_}function r(e,t,r){var n=t.trim().split(m);t=n;var i=n.length,a=e.length;switch(a){case 0:case 1:var s=0;for(e=0===a?"":e[0]+" ";s<i;++s)t[s]=o(e,t[s],r).trim();break;default:var l=s=0;for(t=[];s<i;++s)for(var c=0;c<a;++c)t[l++]=o(e[c]+" ",n[s],r).trim()}return t}function o(e,t,r){var o=t.charCodeAt(0);switch(33>o&&(o=(t=t.trim()).charCodeAt(0)),o){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(h,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function n(e,t,r,o){var a=e+";",s=2*t+3*r+4*o;if(944===s){e=a.indexOf(":",9)+1;var l=a.substring(e,a.length-1).trim();return l=a.substring(0,e).trim()+l+";",1===C||2===C&&i(l,1)?"-webkit-"+l+l:l}if(0===C||2===C&&!i(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(x,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(l=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+l+a;case 1005:return g.test(a)?a.replace(f,":-webkit-")+a.replace(f,":-moz-")+a:a;case 1e3:switch(t=(l=a.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=a.replace(b,"tb");break;case 232:l=a.replace(b,"tb-rl");break;case 220:l=a.replace(b,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+l+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,s=(l=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(l,"-webkit-"+l)+";"+a.replace(l,"-ms-"+l+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return l=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+l+"-ms-flex-"+l+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(I,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(I,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===N.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?n(e.replace("stretch","fill-available"),t,r,o).replace(":fill-available",":stretch"):a.replace(l,"-webkit-"+l)+a.replace(l,"-moz-"+l.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===r+o&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+a}return a}function i(e,t){var r=e.indexOf(1===t?":":"{"),o=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),E(2!==t?o:o.replace(A,"$1"),r,t)}function a(e,t){var r=n(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(w," or ($1)").substring(4):"("+t+")"}function s(e,t,r,o,n,i,a,s,l,u){for(var d,f=0,g=t;f<T;++f)switch(d=z[f].call(c,e,g,r,o,n,i,a,s,l,u)){case void 0:case!1:case!0:case null:break;default:g=d}if(g!==t)return g}function l(e){return void 0!==(e=e.prefix)&&(E=null,e?"function"!=typeof e?C=1:(C=2,E=e):C=0),l}function c(e,r){var o=e;if(33>o.charCodeAt(0)&&(o=o.trim()),o=[o],0<T){var n=s(-1,r,o,o,k,D,0,0,0,0);void 0!==n&&"string"==typeof n&&(r=n)}var i=t(O,o,r,0,0);return 0<T&&void 0!==(n=s(-2,i,o,o,k,D,i.length,0,0,0))&&(i=n),S=0,D=k=1,i}var u=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,g=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,M=/::(place)/g,v=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,j=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,I=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,N=/stretch|:\s*\w+\-(?:conte|avail)/,x=/([^-])(image-set\()/,D=1,k=1,S=0,C=1,O=[],z=[],T=0,E=null,L=0;return c.use=function e(t){switch(t){case void 0:case null:T=z.length=0;break;default:if("function"==typeof t)z[T++]=t;else if("object"==typeof t)for(var r=0,o=t.length;r<o;++r)e(t[r]);else L=0|!!t}return e},c.set=l,void 0!==e&&l(e),c},u={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var d=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const f=(g={},function(e){return void 0===g[e]&&(g[e]=(t=e,d.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91)),g[e];var t});var g,p=i(58),m=i.n(p);function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var y=function(e,t){for(var r=[e[0]],o=0,n=t.length;o<n;o+=1)r.push(t[o],e[o+1]);return r},M=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,n.typeOf)(e)},v=Object.freeze([]),b=Object.freeze({});function j(e){return"function"==typeof e}function w(e){return e.displayName||e.name||"Component"}function I(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",N="undefined"!=typeof window&&"HTMLElement"in window,x=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY);function D(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var k=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,o=r.length,n=o;e>=n;)(n<<=1)<0&&D(16,""+e);this.groupSizes=new Uint32Array(n),this.groupSizes.set(r),this.length=n;for(var i=o;i<n;i++)this.groupSizes[i]=0}for(var a=this.indexOfGroup(e+1),s=0,l=t.length;s<l;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),o=r+t;this.groupSizes[e]=0;for(var n=r;n<o;n++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],o=this.indexOfGroup(e),n=o+r,i=o;i<n;i++)t+=this.tag.getRule(i)+"/*!sc*/\n";return t},e}(),S=new Map,C=new Map,O=1,z=function(e){if(S.has(e))return S.get(e);for(;C.has(O);)O++;var t=O++;return S.set(e,t),C.set(t,e),t},T=function(e){return C.get(e)},E=function(e,t){t>=O&&(O=t+1),S.set(e,t),C.set(t,e)},L="style["+A+'][data-styled-version="5.3.3"]',Y=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P=function(e,t,r){for(var o,n=r.split(","),i=0,a=n.length;i<a;i++)(o=n[i])&&e.registerName(t,o)},R=function(e,t){for(var r=(t.textContent||"").split("/*!sc*/\n"),o=[],n=0,i=r.length;n<i;n++){var a=r[n].trim();if(a){var s=a.match(Y);if(s){var l=0|parseInt(s[1],10),c=s[2];0!==l&&(E(c,l),P(e,c,s[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(a)}}},Z=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},B=function(e){var t=document.head,r=e||t,o=document.createElement("style"),n=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var o=t[r];if(o&&1===o.nodeType&&o.hasAttribute(A))return o}}(r),i=void 0!==n?n.nextSibling:null;o.setAttribute(A,"active"),o.setAttribute("data-styled-version","5.3.3");var a=Z();return a&&o.setAttribute("nonce",a),r.insertBefore(o,i),o},U=function(){function e(e){var t=this.element=B(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,o=t.length;r<o;r++){var n=t[r];if(n.ownerNode===e)return n}D(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),Q=function(){function e(e){var t=this.element=B(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),o=this.nodes[e];return this.element.insertBefore(r,o||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),H=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),_=N,F={isServer:!N,useCSSOMInjection:!x},G=function(){function e(e,t,r){void 0===e&&(e=b),void 0===t&&(t={}),this.options=h({},F,{},e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&N&&_&&(_=!1,function(e){for(var t=document.querySelectorAll(L),r=0,o=t.length;r<o;r++){var n=t[r];n&&"active"!==n.getAttribute(A)&&(R(e,n),n.parentNode&&n.parentNode.removeChild(n))}}(this))}e.registerId=function(e){return z(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(h({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,o=t.useCSSOMInjection,n=t.target,e=r?new H(n):o?new U(n):new Q(n),new k(e)));var e,t,r,o,n},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(z(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(z(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(z(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,o="",n=0;n<r;n++){var i=T(n);if(void 0!==i){var a=e.names.get(i),s=t.getGroup(n);if(a&&s&&a.size){var l=A+".g"+n+'[id="'+i+'"]',c="";void 0!==a&&a.forEach((function(e){e.length>0&&(c+=e+",")})),o+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return o}(this)},e}(),$=/(a)(d)/gi,W=function(e){return String.fromCharCode(e+(e>25?39:97))};function X(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=W(t%52)+r;return(W(t%52)+r).replace($,"$1-$2")}var V=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},J=function(e){return V(5381,e)};function q(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(j(r)&&!I(r))return!1}return!0}var K=J("5.3.3"),ee=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&q(e),this.componentId=t,this.baseHash=V(K,t),this.baseStyle=r,G.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var o=this.componentId,n=[];if(this.baseStyle&&n.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(o,this.staticRulesId))n.push(this.staticRulesId);else{var i=ye(this.rules,e,t,r).join(""),a=X(V(this.baseHash,i)>>>0);if(!t.hasNameForId(o,a)){var s=r(i,"."+a,void 0,o);t.insertRules(o,a,s)}n.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=V(this.baseHash,r.hash),u="",d=0;d<l;d++){var f=this.rules[d];if("string"==typeof f)u+=f;else if(f){var g=ye(f,e,t,r),p=Array.isArray(g)?g.join(""):g;c=V(c,p+d),u+=p}}if(u){var m=X(c>>>0);if(!t.hasNameForId(o,m)){var h=r(u,"."+m,void 0,o);t.insertRules(o,m,h)}n.push(m)}}return n.join(" ")},e}(),te=/^\s*\/\/.*$/gm,re=[":","[",".","#"];function oe(e){var t,r,o,n,i=void 0===e?b:e,a=i.options,s=void 0===a?b:a,l=i.plugins,u=void 0===l?v:l,d=new c(s),f=[],g=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,o,n,i,a,s,l,c,u,d){switch(r){case 1:if(0===u&&64===o.charCodeAt(0))return e(o+";"),"";break;case 2:if(0===c)return o+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(n[0]+o),"";default:return o+(0===d?"/*|*/":"")}case-2:o.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),p=function(e,o,i){return 0===o&&-1!==re.indexOf(i[r.length])||i.match(n)?e:"."+t};function m(e,i,a,s){void 0===s&&(s="&");var l=e.replace(te,""),c=i&&a?a+" "+i+" { "+l+" }":l;return t=s,r=i,o=new RegExp("\\"+r+"\\b","g"),n=new RegExp("(\\"+r+"\\b){2,}"),d(a||!i?"":i,c)}return d.use([].concat(u,[function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(r)>0&&(n[0]=n[0].replace(o,p))},g,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||D(15),V(e,t.name)}),5381).toString():"",m}var ne=r().createContext(),ie=(ne.Consumer,r().createContext()),ae=(ie.Consumer,new G),se=oe();function le(){return(0,t.useContext)(ne)||ae}function ce(e){var o=(0,t.useState)(e.stylisPlugins),n=o[0],i=o[1],a=le(),s=(0,t.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,t.useMemo)((function(){return oe({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,t.useEffect)((function(){l()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]),r().createElement(ne.Provider,{value:s},r().createElement(ie.Provider,{value:c},e.children))}var ue=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=se);var o=r.name+t.hash;e.hasNameForId(r.id,o)||e.insertRules(r.id,o,t(r.rules,o,"@keyframes"))},this.toString=function(){return D(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),de=/([A-Z])/,fe=/([A-Z])/g,ge=/^ms-/,pe=function(e){return"-"+e.toLowerCase()};function me(e){return de.test(e)?e.replace(fe,pe).replace(ge,"-ms-"):e}var he=function(e){return null==e||!1===e||""===e};function ye(e,t,r,o){if(Array.isArray(e)){for(var n,i=[],a=0,s=e.length;a<s;a+=1)""!==(n=ye(e[a],t,r,o))&&(Array.isArray(n)?i.push.apply(i,n):i.push(n));return i}return he(e)?"":I(e)?"."+e.styledComponentId:j(e)?"function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!t?e:ye(e(t),t,r,o):e instanceof ue?r?(e.inject(r,o),e.getName(o)):e:M(e)?function e(t,r){var o,n,i=[];for(var a in t)t.hasOwnProperty(a)&&!he(t[a])&&(Array.isArray(t[a])&&t[a].isCss||j(t[a])?i.push(me(a)+":",t[a],";"):M(t[a])?i.push.apply(i,e(t[a],a)):i.push(me(a)+": "+(o=a,(null==(n=t[a])||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||o in u?String(n).trim():n+"px")+";")));return r?[r+" {"].concat(i,["}"]):i}(e):e.toString();var l}var Me=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function ve(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return j(e)||M(e)?Me(ye(y(v,[e].concat(r)))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:Me(ye(y(e,r)))}new Set;var be=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function we(e){return e.replace(be,"-").replace(je,"")}function Ie(e){return"string"==typeof e&&!0}var Ae=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ne=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function xe(e,t,r){var o=e[r];Ae(t)&&Ae(o)?De(o,t):e[r]=t}function De(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];for(var n=0,i=r;n<i.length;n++){var a=i[n];if(Ae(a))for(var s in a)Ne(s)&&xe(e,a[s],s)}return e}var ke=r().createContext();ke.Consumer;var Se={};function Ce(e,o,n){var i=I(e),a=!Ie(e),s=o.attrs,l=void 0===s?v:s,c=o.componentId,u=void 0===c?function(e,t){var r="string"!=typeof e?"sc":we(e);Se[r]=(Se[r]||0)+1;var o=r+"-"+function(e){return X(J(e)>>>0)}("5.3.3"+r+Se[r]);return t?t+"-"+o:o}(o.displayName,o.parentComponentId):c,d=o.displayName,g=void 0===d?function(e){return Ie(e)?"styled."+e:"Styled("+w(e)+")"}(e):d,p=o.displayName&&o.componentId?we(o.displayName)+"-"+o.componentId:o.componentId||u,y=i&&e.attrs?Array.prototype.concat(e.attrs,l).filter(Boolean):l,M=o.shouldForwardProp;i&&e.shouldForwardProp&&(M=o.shouldForwardProp?function(t,r,n){return e.shouldForwardProp(t,r,n)&&o.shouldForwardProp(t,r,n)}:e.shouldForwardProp);var A,N=new ee(n,p,i?e.componentStyle:void 0),x=N.isStatic&&0===l.length,D=function(e,r){return function(e,r,o,n){var i=e.attrs,a=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,d=e.target,g=function(e,t,r){void 0===e&&(e=b);var o=h({},t,{theme:e}),n={};return r.forEach((function(e){var t,r,i,a=e;for(t in j(a)&&(a=a(o)),a)o[t]=n[t]="className"===t?(r=n[t],i=a[t],r&&i?r+" "+i:r||i):a[t]})),[o,n]}(function(e,t,r){return void 0===r&&(r=b),e.theme!==r.theme&&e.theme||t||r.theme}(r,(0,t.useContext)(ke),s)||b,r,i),p=g[0],m=g[1],y=function(e,r,o,n){var i=le(),a=(0,t.useContext)(ie)||se;return r?e.generateAndInjectStyles(b,i,a):e.generateAndInjectStyles(o,i,a)}(a,n,p),M=o,v=m.$as||r.$as||m.as||r.as||d,w=Ie(v),I=m!==r?h({},r,{},m):r,A={};for(var N in I)"$"!==N[0]&&"as"!==N&&("forwardedAs"===N?A.as=I[N]:(c?c(N,f,v):!w||f(N))&&(A[N]=I[N]));return r.style&&m.style!==r.style&&(A.style=h({},r.style,{},m.style)),A.className=Array.prototype.concat(l,u,y!==u?y:null,r.className,m.className).filter(Boolean).join(" "),A.ref=M,(0,t.createElement)(v,A)}(A,e,r,x)};return D.displayName=g,(A=r().forwardRef(D)).attrs=y,A.componentStyle=N,A.displayName=g,A.shouldForwardProp=M,A.foldedComponentIds=i?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):v,A.styledComponentId=p,A.target=i?e.target:e,A.withComponent=function(e){var t=o.componentId,r=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(o,["componentId"]),i=t&&t+"-"+(Ie(e)?e:we(w(e)));return Ce(e,h({},r,{attrs:y,componentId:i}),n)},Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=i?De({},e.defaultProps,t):t}}),A.toString=function(){return"."+A.styledComponentId},a&&m()(A,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),A}var Oe,ze=function(e){return function e(t,r,o){if(void 0===o&&(o=b),!(0,n.isValidElementType)(r))return D(1,String(r));var i=function(){return t(r,o,ve.apply(void 0,arguments))};return i.withConfig=function(n){return e(t,r,h({},o,{},n))},i.attrs=function(n){return e(t,r,h({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},i}(Ce,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){ze[e]=ze(e)})),Oe=function(e,t){this.rules=e,this.componentId=t,this.isStatic=q(e),G.registerId(this.componentId+1)}.prototype,Oe.createStyles=function(e,t,r,o){var n=o(ye(this.rules,t,r,o).join(""),""),i=this.componentId+e;r.insertRules(i,i,n)},Oe.removeStyles=function(e,t){t.clearRules(this.componentId+e)},Oe.renderStyles=function(e,t,r,o){e>2&&G.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,o)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var r=Z();return"<style "+[r&&'nonce="'+r+'"',A+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?D(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return D(2);var o=((t={})[A]="",t["data-styled-version"]="5.3.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=Z();return n&&(o.nonce=n),[r().createElement("style",h({},o,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new G({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?D(2):r().createElement(ce,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return D(3)}}();const Te=ze,Ee=Te.div`
position: absolute;

@@ -4,0 +4,0 @@ top: 50%;

@@ -33,2 +33,3 @@ import { Raycaster, Vector3 } from 'three';

isVisible: boolean;
private visibilityLastUpdate;
constructor({ id, position, cameraTarget, polarAngle, azimuthalAngle, radius }: Props);

@@ -44,3 +45,4 @@ update(raycaster: Raycaster, camera: Camera, rootModel: RootModel): void;

setRadius(radius: number): void;
shouldUpdateVisibility(): boolean;
}
export {};

@@ -1,1 +0,1 @@

"use strict";(self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[]).push([[628],{999:(e,t,i)=>{i.r(t),i.d(t,{default:()=>H});var s=i(657),a=i(531),o=i.n(a),r=i(970),n=i(687),h=i(341),l=i(884);class d extends(o()){constructor({modelSource:e,environmentSource:t,progress:i,bloomButton:a,canvas:o,renderer:d}){super(),this.progress=i,this.bloomButton=a,this.loadingManager=new s.lLk((()=>{this.progress.style.transition="opacity 1s ease-in-out",this.progress.style.opacity="0",this.bloomButton.style.transition="opacity 0.5s ease-in-out",this.bloomButton.style.opacity="1",this.bloomButton.style.height="60px",o.classList.add("active")}),((e,t,i)=>{this.progress.style.transition="",this.progress.style.transform=`scaleX(${t/i})`})),this.modelSource=e,this.environmentSource=t,this.gltfLoader=new n.E(this.loadingManager),this.dracoLoader=new r._(this.loadingManager),this.dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.1/"),this.gltfLoader.setDRACOLoader(this.dracoLoader),this.ktx2Loader=new h.a(this.loadingManager),this.ktx2Loader.setTranscoderPath("https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/").detectSupport(d.instance),this.gltfLoader.setKTX2Loader(this.ktx2Loader),this.rgbeLoader=new l.x(this.loadingManager),Promise.all([new Promise((e=>{this.gltfLoader.load(this.modelSource,e)})),new Promise((e=>{this.rgbeLoader.load(this.environmentSource,e)}))]).then((([e,t])=>{this.model=e.scene,this.animations=e.animations,this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=this.environmentSource,this.emit("modelReady"),this.emit("environmentReady"),this.emit("ready")}))}resetLoadingBar(){this.progress.style.transform="scaleX(0)",this.progress.style.transition="none",this.progress.style.opacity=""}updateEnvironment(e){this.resetLoadingBar(),this.rgbeLoader.load(e,(t=>{const i=this.environmentTexture;this.environmentTexture=t,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=e,null==i||i.dispose(),this.emit("environmentReady")}))}updateGlb(e){this.resetLoadingBar(),this.emit("modelDispose"),this.gltfLoader.load(e,(e=>{this.model=e.scene,this.animations=e.animations,this.emit("modelReady")}))}loadGlb(e){return t=this,i=void 0,a=function*(){return this.gltfLoader.loadAsync(e)},new((s=void 0)||(s=Promise))((function(e,o){function r(e){try{h(a.next(e))}catch(e){o(e)}}function n(e){try{h(a.throw(e))}catch(e){o(e)}}function h(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}h((a=a.apply(t,i||[])).next())}));var t,i,s,a}}class m extends(o()){constructor(e){super(),this.canvas=e,this.width=e.offsetWidth,this.height=e.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateSizes())),this.resizeObserver.observe(this.canvas)),window.addEventListener("resize",(()=>this.updateSizes()))}updateSizes(){this.width=this.canvas.offsetWidth,this.height=this.canvas.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),this.emit("resize")}}class c extends(o()){constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=1,window.requestAnimationFrame((()=>this.tick()))}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start,this.emit("tick"),window.requestAnimationFrame((()=>this.tick()))}}c.singleton=new c;class u{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,i,s){const a=2e-4*this.naturalFrequency;if(null==e||0===s)return t;if(e===t&&0===this.velocity)return t;if(i<0)return e;const o=e-t,r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,t):(this.velocity=l,t+n*h)}}const p=Math.PI/1e3,g=Math.PI/6,v=2*Math.PI;class M{constructor({experience:e,controls:t}){this.canvas=e.canvas,this.instructionsImg=e.instructionsImg,this.controls=t,this.time=e.time,this.angleAnimation=0,this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.damperImgAnimation=new u,this.idle=!1,this.active=!1,this.canvas.addEventListener("touchstart",(()=>{this.active=!1,clearTimeout(this.startTimer)})),this.canvas.addEventListener("mousedown",(()=>{this.active=!1,clearTimeout(this.startTimer)}))}play(){this.startTimer=setTimeout((()=>{this.active=!0,this.controls.requestUpdate()}),2e3)}stop(){this.active=!1}update(){this.active?(this.idle||(this.elapsedAnimation+=p*this.time.delta,this.instructionsImg.style.opacity="1"),this.elapsedAnimation>v&&(this.idle=!0,this.instructionsImg.style.opacity="0",this.elapsedAnimation=v,setTimeout((()=>{this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.idle=!1,this.controls.requestUpdate()}),2e3)),this.angleAnimation=Math.sin(this.elapsedAnimation)*g,this.elapsedImgAnimation=this.damperImgAnimation.update(this.elapsedImgAnimation,this.elapsedAnimation,this.time.delta,1),this.instructionsImg.style.transform=`translate(calc(-50% + ${-Math.sin(this.elapsedImgAnimation)}*50px), -50%)`):this.instructionsImg.style.opacity="0"}isPaused(){return this.idle}isActive(){return this.active}}const f=e=>e%(2*Math.PI)<0?2*Math.PI+e%(2*Math.PI):e%(2*Math.PI);class A extends u{constructor(e=50){super(e)}update(e,t,i,s){const a=2e-4*this.naturalFrequency;if(e=f(e),t=f(t),null==e||0===s)return t;if(e===t&&0===this.velocity)return t;if(i<0)return e;const o=((e,t)=>{const i=f(e),s=f(t),a=-(2*Math.PI-i*Math.pow(1,i)+s*Math.pow(1,s)),o=2*Math.PI-s*Math.pow(1,s)+i*Math.pow(1,i),r=i-s,n=Math.abs(a),h=Math.abs(o),l=Math.abs(r);switch(Math.min(n,h,l)){case n:return a;case h:return o;default:return r}})(e,t),r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,t):(this.velocity=l,t+n*h)}}const x=Math.PI/2.4,w=Math.PI/10;class T{constructor(e,t,i){this.ORBIT_SENSITIVITY=e.orbitSensitivity,this.MIN_CAMERA_SCROLL=2,this.MAX_CAMERA_SCROLL=10,this.DEFAULT_CAMERA_SCROLL=4,this.MAX_XZ_ANGLE=e.maxAzimuthalAngleRotation*Math.PI/180,this.MIN_XZ_ANGLE=e.minAzimuthalAngleRotation*Math.PI/180,e.maxPolarAngleRotation&&(this.MAX_Y_ANGLE=e.maxPolarAngleRotation*Math.PI/180),e.minPolarAngleRotation&&(this.MIN_Y_ANGLE=e.minPolarAngleRotation*Math.PI/180),this.MAX_X_PAN=e.maxDragX,this.MIN_X_PAN=e.minDragX,this.MAX_Y_PAN=e.maxDragY,this.MIN_Y_PAN=e.minDragY,this.MAX_Z_PAN=e.maxDragZ,this.MIN_Z_PAN=e.minDragZ,this.canvas=e.canvas,this.camera=t,this.time=e.time,this.noZoom=!!e.noZoom,this.damperRadius=new u,this.damperYAngle=new A,this.damperXZAngle=new A,this.damperXPan=new u,this.damperYPan=new u,this.damperZPan=new u,this.canvas.oncontextmenu=e=>e.preventDefault(),this.yAngleTarget=x,this.xzAngleTarget=w,this.yAngle=x,this.xzAngle=w,this.orbitCamera=!1,this.moveCamera=!1,this.panTarget=new s.Pa4,this.pan=new s.Pa4,i?(this.cameraRadius=i,this.cameraRadiusTarget=i):(this.cameraRadius=this.DEFAULT_CAMERA_SCROLL,this.cameraRadiusTarget=this.DEFAULT_CAMERA_SCROLL),this.pageMode="none",this.addDragEventListener(),this.addWheelEventListener(),this.addTouchEventListener(),this.animation=new M({experience:e,controls:this})}addDragEventListener(){let e=0,t=0;this.canvas.onmousedown=i=>{i.stopPropagation(),this.requestUpdate(),0===i.button?(this.orbitCamera=!0,this.canvas.style.cursor="grabbing"):(this.moveCamera=!0,this.canvas.style.cursor="move"),e=i.clientX,t=i.clientY},document.addEventListener("mouseup",(()=>{this.orbitCamera=!1,this.moveCamera=!1,this.canvas.style.cursor=""})),this.canvas.addEventListener("mousemove",(i=>{if(this.requestUpdate(),this.orbitCamera)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e-i.clientX)/this.canvas.width),e=i.clientX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i.clientY-t)/this.canvas.height),t=i.clientY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if(this.moveCamera){const a=.8*this.cameraRadius*(e-i.clientX)/this.canvas.width;e=i.clientX;const o=.8*this.cameraRadius*(i.clientY-t)/this.canvas.height;t=i.clientY,this.panTarget.add(new s.Pa4(a*Math.cos(this.yAngleTarget)+o*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),o*Math.cos(this.xzAngleTarget),a*Math.sin(-this.yAngleTarget)+o*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}}))}addWheelEventListener(){let e;this.canvas.onwheel=t=>{this.noZoom||(t.preventDefault(),this.requestUpdate(),t.deltaY>0?(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius,this.canvas.style.cursor="zoom-out"):(this.cameraRadiusTarget+=.003*t.deltaY*this.cameraRadius/2,this.canvas.style.cursor="zoom-in"),this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL),e&&clearTimeout(e),e=setTimeout((()=>{this.canvas.style.cursor=""}),300))}}addTouchEventListener(){let e=0,t=0;document.addEventListener("touchstart",(i=>{e=i.touches[0].clientX,t=i.touches[0].clientY})),document.addEventListener("touchmove",(i=>{"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode&&Math.abs(i.touches[0].clientY-t)>Math.abs(i.touches[0].clientX-e)&&(this.pageMode="scrolling")}));let i=0,a=0,o=0;this.canvas.ontouchstart=e=>{1===e.touches.length?(i=e.touches[0].clientX,a=e.touches[0].clientY):2===e.touches.length&&(this.pageMode="movingCamera",i=(e.touches[0].clientX+e.touches[1].clientX)/2,a=(e.touches[0].clientY+e.touches[1].clientY)/2,o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY))},document.addEventListener("touchend",(e=>{"movingCamera"===this.pageMode||"zoomingCamera"===this.pageMode?(this.pageMode="orbitingCamera",i=e.touches[0].clientX,a=e.touches[0].clientY):this.pageMode="none"})),this.canvas.addEventListener("touchmove",(e=>{if(this.requestUpdate(),"scrolling"!==this.pageMode&&e.cancelable)if(Math.abs(e.touches[0].clientY-a)<=Math.abs(e.touches[0].clientX-i)&&"none"===this.pageMode&&(this.pageMode="orbitingCamera"),"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode||e.preventDefault(),"orbitingCamera"===this.pageMode)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i-e.touches[0].pageX)/this.canvas.width),i=e.touches[0].pageX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((e.touches[0].pageY-a)/this.canvas.height),a=e.touches[0].pageY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if("movingCamera"===this.pageMode){Math.abs(Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o)>50&&(o=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY),this.pageMode="zoomingCamera");const t=(e.touches[0].clientX+e.touches[1].clientX)/2,r=(e.touches[0].clientY+e.touches[1].clientY)/2,n=1.6*this.cameraRadius*(i-t)/this.canvas.width;i=t;const h=1.6*this.cameraRadius*(r-a)/this.canvas.height;a=r,this.panTarget.add(new s.Pa4(n*Math.cos(this.yAngleTarget)+h*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),h*Math.cos(this.xzAngleTarget),n*Math.sin(-this.yAngleTarget)+h*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}else if("zoomingCamera"===this.pageMode){const t=Math.hypot(e.touches[0].pageX-e.touches[1].pageX,e.touches[0].pageY-e.touches[1].pageY)-o;this.cameraRadiusTarget-=.03*t,o+=t,this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL)}}))}setCamera({radius:e,minRadius:t,maxRadius:i,initialRadius:s,orbitSensitivity:a,azimuthalAngle:o,maxAzimuthalAngle:r,minAzimuthalAngle:n,polarAngle:h,maxPolarAngle:l,minPolarAngle:d,dragX:m,maxDragX:c,minDragX:u,dragY:p,maxDragY:g,minDragY:v,dragZ:M,maxDragZ:f,minDragZ:A,near:x,far:w}){void 0!==e&&(this.cameraRadiusTarget=0===e?.01:e),void 0!==t&&(this.MIN_CAMERA_SCROLL=0===t?.01:t),void 0!==i&&(this.MAX_CAMERA_SCROLL=0===i?.01:i),void 0!==s&&(this.DEFAULT_CAMERA_SCROLL=0===s?.01:s),void 0!==a&&(this.ORBIT_SENSITIVITY=0===a?.01:a),void 0!==r&&(this.MAX_XZ_ANGLE=0===r?.01:r*Math.PI/180),void 0!==n&&(this.MIN_XZ_ANGLE=0===n?-.01:n*Math.PI/180),void 0!==l&&(this.MAX_Y_ANGLE=0===l?.01:l*Math.PI/180),void 0!==d&&(this.MIN_Y_ANGLE=0===d?-.01:d*Math.PI/180),void 0!==c&&(this.MAX_X_PAN=0===c?.01:c),void 0!==u&&(this.MIN_X_PAN=0===u?.01:u),void 0!==g&&(this.MAX_Y_PAN=0===g?.01:g),void 0!==v&&(this.MIN_Y_PAN=0===v?.01:v),void 0!==f&&(this.MAX_Z_PAN=0===f?.01:f),void 0!==A&&(this.MIN_Z_PAN=0===A?.01:A),void 0!==x&&(this.camera.near=0===x?.01:x),void 0!==w&&(this.camera.far=0===w?.01:w),void 0!==o&&(this.xzAngleTarget=o*Math.PI/180),void 0!==h&&(this.yAngleTarget=h*Math.PI/180),void 0!==m&&(this.panTarget.x=m),void 0!==p&&(this.panTarget.y=p),void 0!==M&&(this.panTarget.z=M),this.camera.updateProjectionMatrix()}lookTo(e){const t=this.camera.position.clone().multiply(new s.Pa4(0,1,0)).divideScalar(this.cameraRadius).angleTo(e)+(e.x<0?Math.PI:0);void 0!==t&&(this.yAngleTarget=t)}getCamera(){return{radius:this.cameraRadiusTarget,orbitSensitivity:this.ORBIT_SENSITIVITY,azimuthalAngle:180*this.xzAngleTarget/Math.PI,polarAngle:180*this.yAngleTarget/Math.PI,dragX:this.panTarget.x,dragY:this.panTarget.y,dragZ:this.panTarget.z,near:this.camera.near,far:this.camera.near}}update(){this.animation.update(),this.yAngle=this.damperYAngle.update(this.yAngle,this.yAngleTarget+this.animation.angleAnimation,this.time.delta,1),this.xzAngle=this.damperXZAngle.update(this.xzAngle,this.xzAngleTarget,this.time.delta,1),this.cameraRadius=this.damperRadius.update(this.cameraRadius,this.cameraRadiusTarget,this.time.delta,1),this.pan.x=this.damperXPan.update(this.pan.x,this.panTarget.x,this.time.delta,1),this.pan.y=this.damperYPan.update(this.pan.y,this.panTarget.y,this.time.delta,1),this.pan.z=this.damperZPan.update(this.pan.z,this.panTarget.z,this.time.delta,1),this.camera.position.x=Math.cos(this.xzAngle)*Math.sin(this.yAngle)*this.cameraRadius,this.camera.position.y=Math.sin(this.xzAngle)*this.cameraRadius,this.camera.position.z=Math.cos(this.xzAngle)*Math.cos(this.yAngle)*this.cameraRadius,this.camera.position.add(this.pan),this.camera.lookAt(this.pan)}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return this.needsUpdate?(this.needsUpdate=!1,!0):this.yAngle!==this.yAngleTarget+this.animation.angleAnimation||this.xzAngle!==this.xzAngleTarget||this.cameraRadius!==this.cameraRadiusTarget||this.pan.x!==this.panTarget.x||this.pan.y!==this.panTarget.y||this.pan.z!==this.panTarget.z||!(this.animation.isPaused()||!this.animation.isActive())}}class _{constructor(e){this.instance=null,this.experience=e,this.canvas=this.experience.canvas,this.sizes=this.experience.sizes,this.scene=this.experience.scene;const t=this.experience.cameraNear?this.experience.cameraNear:.1,i=this.experience.cameraFar?this.experience.cameraFar:100;this.instance=new s.cPb(35,this.sizes.width/this.sizes.height,t,i),this.instance.position.set(1,1,4),this.scene.add(this.instance),this.controls=new T(this.experience,this.instance,this.experience.initialZoom)}resize(){this.instance&&(this.instance.aspect=this.sizes.width/this.sizes.height,this.instance.updateProjectionMatrix())}update(){this.controls.update()}shouldUpdate(){return this.controls.shouldUpdate()}}class b{constructor(e){this.instance=null,this.canvas=e.canvas,this.sizes=e.sizes,this.scene=e.scene,this.camera=e.camera,this.instance=new s.CP7({canvas:this.canvas,antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio),this.instance.setClearColor("",0),this.instance.setClearAlpha(0),this.instance.autoClear=!0,this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=s.dwk,this.instance.physicallyCorrectLights=!0,this.instance.outputEncoding=s.knz,this.instance.toneMapping=s.LY2,this.instance.toneMappingExposure=e.exposure}resize(){var e,t;null===(e=this.instance)||void 0===e||e.setSize(this.sizes.width,this.sizes.height),null===(t=this.instance)||void 0===t||t.setPixelRatio(this.sizes.pixelRatio)}update(){this.instance&&this.camera.instance&&this.instance.render(this.scene,this.camera.instance)}}var y=i(870);class P{constructor({id:e,position:t,cameraTarget:i,polarAngle:a,azimuthalAngle:o,radius:r}){this.id=e,this.position=new s.Pa4(t.x,t.y,t.z),i&&(this.cameraTarget=new s.Pa4(i.x,i.y,i.z)),a&&(this.polarAngle=a),o&&(this.azimuthalAngle=o),r&&(this.radius=r)}update(e,t,i){if(!t.instance||!i.model)return;const s=this.position.clone();s.project(t.instance),this.element=document.querySelector(`#${this.id}`),this.translateHotspot(t.sizes,s),this.updateHotspotVisibility(e,t.instance,i,s)}updateHotspotVisibility(e,t,i,s){var a,o;e.setFromCamera(s,t);const r=e.intersectObjects(i.model.children,!0);if(this.isVisible=!1,0===r.length)this.isVisible=!0;else{const e=r[0].distance;this.position.distanceTo(t.position)<e&&(this.isVisible=!0)}this.isVisible?null===(a=this.element)||void 0===a||a.classList.add("visible"):null===(o=this.element)||void 0===o||o.classList.remove("visible")}translateHotspot(e,t){const i=t.x*e.width*.5,s=t.y*e.height*-.5;this.element&&(this.element.style.transform=`translate(${i}px, ${s}px)`)}updateHotspot({position:e,cameraTarget:t,polarAngle:i,azimuthalAngle:s,radius:a}){e&&this.setPosition(e),t&&this.setCameraTarget(t),i&&this.setPolarAngle(i),s&&this.setAzimuthalAngle(s),a&&this.setRadius(a)}setPosition(e){this.position=new s.Pa4(e.x,e.y,e.z)}setCameraTarget(e){this.cameraTarget=new s.Pa4(e.x,e.y,e.z)}setPolarAngle(e){this.polarAngle=e}setAzimuthalAngle(e){this.azimuthalAngle=e}setRadius(e){this.radius=e}}var S=i(643),N=i(220),I=i(175),z=i(475),C=i(612),L=i(248),R=i(655);class E extends C.w{constructor(e,t,i,a){super(),this.strength=void 0!==t?t:1,this.radius=i,this.threshold=a,this.resolution=void 0!==e?new s.FM8(e.x,e.y):new s.FM8(256,256),this.clearColor=new s.Ilk(0,0,0);const o={minFilter:s.wem,magFilter:s.wem,format:s.wk1};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);this.renderTargetBright=new s.dd2(r,n,o),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){const t=new s.dd2(r,n,o);t.texture.name=`UnrealBloomPass.h${e}`,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);const i=new s.dd2(r,n,o);i.texture.name=`UnrealBloomPass.v${e}`,i.texture.generateMipmaps=!1,this.renderTargetsVertical.push(i),r=Math.round(r/2),n=Math.round(n/2)}void 0===R.Y&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const h=R.Y;this.highPassUniforms=s.rDY.clone(h.uniforms),this.highPassUniforms.luminosityThreshold.value=a,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new s.jyz({uniforms:this.highPassUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[e])),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(r,n),r=Math.round(r/2),n=Math.round(n/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===L.C&&console.error("THREE.UnrealBloomPass relies on CopyShader");const d=L.C;this.copyUniforms=s.rDY.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new s.jyz({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.WMw,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new s.Ilk,this.oldClearAlpha=1,this.basic=new s.vBJ,this.fsQuad=new C.T(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose()}setSize(e,t){let i=Math.round(e/2),a=Math.round(t/2);this.renderTargetBright.setSize(i,a);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(i,a),this.renderTargetsVertical[e].setSize(i,a),this.separableBlurMaterials[e].uniforms.texSize.value=new s.FM8(i,a),i=Math.round(i/2),a=Math.round(a/2)}render(e,t,i,s,a){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const o=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),a&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let r=this.renderTargetBright;for(let t=0;t<this.nMips;t++)this.fsQuad.material=this.separableBlurMaterials[t],this.separableBlurMaterials[t].uniforms.colorTexture.value=r.texture,this.separableBlurMaterials[t].uniforms.direction.value=E.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[t]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[t].uniforms.colorTexture.value=this.renderTargetsHorizontal[t].texture,this.separableBlurMaterials[t].uniforms.direction.value=E.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[t]),e.clear(),this.fsQuad.render(e),r=this.renderTargetsVertical[t];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,a&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(i),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=o}getSeperableBlurMaterial(e){return new s.jyz({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new s.FM8(.5,.5)},direction:{value:new s.FM8(.5,.5)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n }"})}getCompositeMaterial(e){return new s.jyz({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform sampler2D dirtTexture;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n float lerpBloomFactor(const in float factor) {\n float mirrorFactor = 1.2 - factor;\n return mix(factor, mirrorFactor, bloomRadius);\n }\n void main() {\n gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n }"})}}E.BlurDirectionX=new s.FM8(1,0),E.BlurDirectionY=new s.FM8(0,1);class X{constructor(e){var t,i;if(this.scene=e.scene,this.bloomModels=null===(t=e.world.model)||void 0===t?void 0:t.bloomModels,this.lightModels=null===(i=e.world.model)||void 0===i?void 0:i.lightModels,this.experience=e,this.sunLight=new s.Ox3("",0),this.sunLight.position.set(this.experience.shadowOffsetX,this.experience.shadowOffsetY,this.experience.shadowOffsetZ),this.experience.activeShadow&&(this.sunLight.castShadow=!0),this.sunLight.shadow.camera.near=.01,this.sunLight.shadow.camera.far=100,this.sunLight.shadow.bias=-1e-5,this.sunLight.shadow.mapSize.width=2048,this.sunLight.shadow.mapSize.height=2048,this.sunLight.shadow.blurSamples=20,this.sunLight.shadow.radius=this.experience.shadowRadius?this.experience.shadowRadius:1,this.scene.add(this.sunLight),this.experience.activeFog){const e=this.experience.fogColor?this.experience.fogColor:"#ffffff",t=this.experience.fogNear?this.experience.fogNear:1,i=this.experience.fogFar?this.experience.fogFar:15;this.fog=new s.ybr(e,t,i),this.scene.fog=this.fog}}initializeBloom(){var e;if(this.experience.renderer.instance){const t=new s.dd2(this.experience.sizes.width,this.experience.sizes.height,{minFilter:s.wem,magFilter:s.wem,format:s.wk1,type:s.cLu,stencilBuffer:!1});t.samples=3;const i=new I.T(z.Y);this.darkMaterial=new s.vBJ({color:"black"}),this.darkGlassMaterial=new s.vBJ({color:"black",visible:!1}),this.materials={};const a=new N.C(this.scene,this.experience.camera.instance);this.bloomPass=new E(new s.FM8(this.experience.sizes.width,this.experience.sizes.height),this.experience.bloomIntensity,this.experience.bloomRadius,this.experience.bloomThreshold),this.bloomComposer=new S.xC(this.experience.renderer.instance,t),this.bloomComposer.renderToScreen=!1,this.bloomComposer.addPass(a),this.bloomComposer.addPass(this.bloomPass),this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}));const o=new I.T(new s.jyz({uniforms:{baseTexture:{value:null},bloomTexture:{value:this.bloomComposer.renderTarget2.texture}},vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}",fragmentShader:"uniform sampler2D baseTexture;\nuniform sampler2D bloomTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n gl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );\n\n}",defines:{}}),"baseTexture");o.needsSwap=!0,this.finalComposer=new S.xC(this.experience.renderer.instance,t),this.finalComposer.addPass(a),this.finalComposer.addPass(o),this.finalComposer.addPass(i)}}update(){var e,t,i,a;this.experience.world.model&&this.bloomPass&&("bloomOn"===this.bloom?(this.bloomPass.enabled=!0,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!0})),null===(e=this.bloomModels)||void 0===e||e.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=1)}))):(this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((e=>{e.visible=!1})),null===(t=this.bloomModels)||void 0===t||t.forEach((e=>{e.material instanceof s.Wid&&(e.material.emissiveIntensity=0)}))),this.experience.camera.instance&&(null===(i=this.experience.world.model.model)||void 0===i||i.traverse((e=>this.darkenNonBloomed(e))),this.bloomComposer.render(),null===(a=this.experience.world.model.model)||void 0===a||a.traverse((e=>this.restoreMaterial(e))),this.finalComposer.render()))}resize(){this.bloomComposer.setSize(this.experience.sizes.width,this.experience.sizes.height),this.finalComposer.setSize(this.experience.sizes.width,this.experience.sizes.height)}updateShadow({opacity:e,XOffset:t,YOffset:i,ZOffset:s,radius:a,activeShadow:o}){var r;(t||0===t)&&(this.sunLight.position.x=t),(i||0===i)&&(this.sunLight.position.y=i),(s||0===s)&&(this.sunLight.position.z=s),void 0!==a&&(this.sunLight.shadow.radius=a||1),void 0!==o&&(null===(r=this.experience.world.model)||void 0===r||r.updateFloor(o)),this.experience.world.model&&(e||0===e)&&(this.experience.world.model.shadowMaterial.opacity=e)}updateBloom({intensity:e,radius:t,threshold:i}){void 0!==e&&(this.bloomPass.strength=e),void 0!==t&&(this.bloomPass.radius=t),void 0!==i&&(this.bloomPass.threshold=i)}updateFog({enable:e,color:t,near:i,far:a}){const o=/^#([0-9a-f]{3}){1,2}$/i;if(this.fog)e?this.scene.fog=this.fog:void 0!==e&&(this.scene.fog=null),t&&o.test(t)&&(this.fog.color=new s.Ilk(t)),i&&(this.fog.near=i),a&&(this.fog.far=a);else if(e){const e=t&&o.test(t)?t:"#ffffff",r=i||1,n=a||15;this.fog=new s.ybr(e,r,n),this.scene.fog=this.fog}}darkenNonBloomed(e){var t;e instanceof s.Kj0&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(this.materials[e.uuid]=e.material,Array.isArray(e.material)||0===e.material.alphaTest&&1===e.material.opacity?e.material=this.darkMaterial:e.material=this.darkGlassMaterial)}restoreMaterial(e){var t;e instanceof s.Kj0&&this.materials[e.uuid]&&!(null===(t=this.bloomModels)||void 0===t?void 0:t.find((t=>e===t)))&&(e.material=this.materials[e.uuid],delete this.materials[e.uuid])}}const O=(e,t)=>{if(t(e))for(let i=0,s=e.children.length;i<s;i++)O(e.children[i],t)},Y=O;class U extends a.EventEmitter{constructor(e,t,i){super(),this.animationActions={},this.activeAnimations={},this.defaultAnimationOptions={loop:!1,resetOnFinish:!1,timeScale:1,fadeFactor:0},(null==e?void 0:e.model)&&(this.model=e,this.defaultAnimationOptions=Object.assign(Object.assign({},this.defaultAnimationOptions),i),this.mixer=new s.Xcj(e.model),t.forEach((e=>{e.optimize(),this.animationActions[e.name]=this.mixer.clipAction(e)})),this.mixer.addEventListener("finished",(e=>{const t=e;this.animationFinished(t.action)})),0!==Object.keys(this.animationActions).length&&c.singleton.on("tick",(()=>{Object.keys(this.activeAnimations).length&&(this.mixer.update(c.singleton.delta/1e3),this.model.world.requestUpdate())})),this.emit("animatorReady"))}getAnimationIds(){return Object.keys(this.animationActions)}play(e,t={}){return e=this.getAnimationId(e),new Promise((i=>{const a=this.animationActions[e];this.activeAnimations[e]?i():(a.timeScale=t.timeScale||this.defaultAnimationOptions.timeScale,a.clampWhenFinished=!(t.resetOnFinish||this.defaultAnimationOptions.resetOnFinish),a.fadeIn(t.fadeFactor||this.defaultAnimationOptions.fadeFactor),a.setLoop(t.loop?s.YKA:s.jAl,1/0),this.activeAnimations[a.getClip().name]={action:a,resolve:i},a.stop(),a.play())}))}stop(e){e=this.getAnimationId(e);const t=this.animationActions[e];t?(t.stop(),this.activeAnimations[e]&&this.animationFinished(t)):console.error(`Coultn't find animationId "${e}" in model "${this.model.id}".`)}getAnimationId(e){return this.animationActions[e]||Object.keys(this.animationActions).forEach((t=>t.toLocaleLowerCase()!==e.toLocaleLowerCase()||(console.warn(`Coultn't find animationId "${e}" in model "${this.model.id}". Using animationId as "${t}" instead.`),e=t,!1))),e}animationFinished(e){const t=e.getClip().name;this.activeAnimations[t].resolve(),delete this.activeAnimations[t]}}class F{constructor({id:e,model:t,parentModel:i,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}){this.id=e,this.model=t,this.parentModel=i,this.modelParts=[],this.slotsModels={},this.slotsMaterials={},this.bloomModels=[],this.lightModels=[],this.world=n,this.animator=new U(this,r,o),this.model&&Y(this.model,(e=>{if(/^SLOT_/.test(e.name))return this.slotsModels[e.name.replace(/^SLOT_/,"")]={slot:e,activeModel:-1,models:[]},!1;if(e instanceof s.Kj0){if(/^SLOT_/.test(e.material.name)){const t=e.material;this.slotsMaterials[t.name.replace(/^SLOT_/,"").replace(/-(\d|\D|\|)*$/,"")]={slot:t,group:t.name.replace(/^(\d|\D)*-/,""),materials:[]}}new s.Ilk("rgb(0, 0, 0)").equals(e.material.emissive)||this.bloomModels.push(e),e.castShadow=!0,e.receiveShadow=!0,e.frustumCulled=!0}return e instanceof s._kC&&e.name.toLowerCase().startsWith("dynamic")&&this.lightModels.push(e),!0})),a.forEach((e=>{const t=e.name.replace(/^(\d|\D)*-/,"").split("|");Object.values(this.slotsMaterials).forEach((i=>{t.includes(i.group)&&i.materials.push({name:e.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,""),material:e})}))})),Object.values(this.slotsModels).forEach((e=>{const t=[];Y(e.slot,(e=>!/^MODEL-PART_/.test(e.name)||(t.push(e),!1))),t.forEach((t=>{t.removeFromParent(),e.models.push(new D({model:t,id:t.name.replace(/^MODEL-PART_/,""),parentModel:this,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}))}))}))}getAnimations(){return this.animator.getAnimationIds()}playAnimation(e,t){return this.animator.play(e,t)}stoAnimation(e){this.animator.stop(e)}removeFromParent(){var e;null===(e=this.model)||void 0===e||e.removeFromParent()}}class D extends F{constructor({model:e,id:t,parentModel:i,constraints:s,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}){var h,l,d;super({id:t,model:e,parentModel:i,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}),(null==s?void 0:s.position)&&(null===(h=this.model)||void 0===h||h.position.set(s.position[0],s.position[1],s.position[2])),(null==s?void 0:s.scale)&&(null===(l=this.model)||void 0===l||l.scale.set(s.scale[0],s.scale[1],s.scale[2])),(null==s?void 0:s.rotation)&&(null===(d=this.model)||void 0===d||d.rotation.set(s.rotation[0],s.rotation[1],s.rotation[2]))}dispose(){var e,t;this.model&&(this.model.traverse((e=>{var t;e instanceof s.Kj0&&(e.geometry.dispose(),/SLOT_/.test(e.material.name)?null===(t=e.material.aoMap)||void 0===t||t.dispose():Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose())})),Object.values(this.slotsModels).forEach((e=>e.models.forEach((e=>e.dispose())))),null===(t=null===(e=this.parentModel)||void 0===e?void 0:e.model)||void 0===t||t.remove(this.model))}}const B=Math.PI/2;class Z extends F{constructor(e,t,i,a){super({id:"root-model",model:e.resources.model,materialPalette:t,defaultAnimationOptions:a,animations:i,world:e.world}),this.experience=e,this.scene=e.scene,this.resources=e.resources,this.time=e.time,this.activeShadow=e.activeShadow,this.box=new s.ZzF;const o=(new s.Pa4).setScalar(1.7);if(this.model){this.box.setFromObject(this.model);const t=new s.Pa4;this.box.getSize(t),this.center=new s.Pa4,this.box.getCenter(this.center);const i=(new s.Pa4).copy(o).divide(t);let a=Math.min(i.x,Math.min(i.y,i.z));e.maxZoom||0===e.maxZoom?e.camera.controls.MIN_CAMERA_SCROLL=e.maxZoom+.01:e.camera.controls.MIN_CAMERA_SCROLL=a<1?a/.6:a<2?a/1.2:a<3?a/1.5:a<4?a/2.5:a<5?a/3:a/3.5,e.minZoom&&(e.camera.controls.MAX_CAMERA_SCROLL=e.minZoom),this.resources.animations!==[]&&(a/=1.2),this.model.scale.setScalar(a),this.model.position.sub(this.center.multiplyScalar(a)),this.model.rotation.y=B,this.activeShadow&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=e.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor)),this.scene.add(this.model),0!==this.resources.animations.length&&(this.mixer=new s.Xcj(this.model),this.mixer.clipAction(this.resources.animations[0]).play())}}update(){var e;null===(e=this.mixer)||void 0===e||e.update(this.time.delta/1e3)}updateFloor(e){e&&!this.floor&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=this.experience.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!0,e.receiveShadow=!0)}))),!e&&this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.scene.remove(this.floor),this.scene.traverse((e=>{e instanceof s.Kj0&&(e.castShadow=!1,e.receiveShadow=!1)})),this.floor=void 0)}dispose(){this.model&&(this.model.traverse((e=>{e instanceof s.Kj0&&(e.geometry.dispose(),e.material.dispose())})),this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),this.mixer=void 0,this.scene.remove(this.floor)),this.scene.remove(this.model))}}var k=function(e,t,i,s){return new(i||(i=Promise))((function(a,o){function r(e){try{h(s.next(e))}catch(e){o(e)}}function n(e){try{h(s.throw(e))}catch(e){o(e)}}function h(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,n)}h((s=s.apply(e,t||[])).next())}))};class j{constructor(e,t){this.scene=e.scene,this.resources=e.resources,this.camera=e.camera,this.materialPalette=[],this.hotspotRaycaster=new s.iMs,this.hotspots=[],this.resources.on("modelReady",(()=>{e.resources.model&&this.prepareCustomizationPalette(e.resources.model),this.model=new Z(e,this.materialPalette,this.resources.animations,t),this.environment||(this.environment=new X(e)),"noBloom"!==e.bloom&&e.initializeBloom(),this.requestUpdate()})),this.resources.on("modelDispose",(()=>{var e;null===(e=this.model)||void 0===e||e.dispose(),this.model=void 0,this.requestUpdate()}))}prepareCustomizationPalette(e){const t=[];e.traverse((e=>{e instanceof s.Kj0&&/MATERIAL_/.test(e.material.name)&&t.push(e)})),t.forEach((e=>{-1===this.materialPalette.findIndex((t=>t.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")===e.material.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")))?this.materialPalette.push(e.material):(Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose()),e.geometry.dispose(),e.removeFromParent()}))}forEachModel(e,t=this.model){t&&(e(t),[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))].forEach((t=>{this.forEachModel(e,t)})))}findModel(e,t){return e===t.id?t:[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))].reduce(((t,i)=>t||this.findModel(e,i)),null)}insertModelNode({url:e,id:t,parentId:i="root-model",constraints:s}){if(!this.model)return;const a=this.findModel(i,this.model);a&&this.resources.loadGlb(e).then((e=>{var i;this.prepareCustomizationPalette(e.scene);const o=new D({model:e.scene,id:t,parentModel:a,constraints:s,materialPalette:this.materialPalette,animations:e.animations,world:this});a.modelParts.push(o),null===(i=a.model)||void 0===i||i.add(o.model),this.requestUpdate()}))}insertSlotModelNode({url:e,modelId:t,slotName:i,parentId:a="root-model",constraints:o}){var r,n;return k(this,void 0,void 0,(function*(){if(!this.model)return;const h=this.findModel(a,this.model);if(h&&!(null===(r=h.slotsModels[i])||void 0===r?void 0:r.models.find((e=>e.id===t))))try{if(!h.slotsModels[i]){const e=new s.Tme;e.name=i,null===(n=h.model)||void 0===n||n.add(e),h.slotsModels[i]={slot:e,activeModel:-1,models:[]}}const a=yield this.resources.loadGlb(e);this.prepareCustomizationPalette(a.scene);const r=new D({model:a.scene,id:t,parentModel:h,constraints:o,materialPalette:this.materialPalette,animations:a.animations,world:this});h.slotsModels[i].models.push(r),this.requestUpdate()}catch(e){console.error("Error on load model resource")}}))}deleteModelNode(e){if(!this.model)return;const t=this.findModel(e,this.model);t&&(t.dispose(),t instanceof D&&t.parentModel&&(t.parentModel.modelParts=t.parentModel.modelParts.filter((t=>t.id!==e))),this.requestUpdate())}getAllSlotsMaterials(e){if(!this.model)return null;const t=e||this.model,i=[...t.modelParts,...Object.values(t.slotsModels).filter((e=>-1!==e.activeModel)).map((e=>e.models[e.activeModel]))];return{id:t.id,slots:Object.keys(t.slotsMaterials).map((e=>({name:e,materials:t.slotsMaterials[e].materials.map((e=>e.name))}))),models:i.map((e=>this.getAllSlotsMaterials(e)))}}setMaterial({modelId:e="root-model",slot:t,materialName:i}){var s,a;if(!this.model)return;const o=this.findModel(e,this.model);if(!o)return void console.error("Model with Id",e,"not found!");if(!o.slotsMaterials[t])return void console.error("Slot",t,"not found!");const r=null===(a=null===(s=o.slotsMaterials[t])||void 0===s?void 0:s.materials.find((e=>e.name===i)))||void 0===a?void 0:a.material;if(!r)return void console.error("Material name",i,"not found!");const n=["isMaterial","id","name","needsUpdate","uuid","version","isMeshStandardMaterial"],{slot:h}=o.slotsMaterials[t];Object.keys(h).forEach((e=>{n.includes(e)||(h[e]=r[e])})),o.slotsMaterials[t].slot.needsUpdate=!0,this.requestUpdate()}getAllSlotsModels(e){if(!this.model)return null;const t=e||this.model;return{id:t.id,slots:Object.keys(t.slotsModels).map((e=>({name:e,models:t.slotsModels[e].models.map((e=>this.getAllSlotsModels(e)))}))),modelParts:t.modelParts.map((e=>this.getAllSlotsModels(e)))}}setModel({modelId:e="root-model",slot:t,modelName:i}){if(!this.model)return;const s=this.findModel(e,this.model);if(!s)return void console.error("Model with Id",e,"not found!");const a=s.slotsModels[t];if(!a)return void console.error("Slot",t,"not found!");const o=a.models.findIndex((e=>e.id===i));-1!==a.activeModel&&a.models[a.activeModel].removeFromParent(),a.activeModel=o,-1!==o&&a.slot.add(a.models[o].model),this.requestUpdate()}getCustomizedModel(e=!0){var t;return k(this,void 0,void 0,(function*(){if(!(null===(t=this.model)||void 0===t?void 0:t.model))return null;this.gltfExporter||(this.gltfExporter=new y.M);const a=this.model.model.clone(!0);a.scale.setScalar(1),a.rotation.fromArray([0,0,0]),a.position.fromArray([0,0,0]),a.traverse((e=>{e.name&&(e.name=e.name.replace("MODEL-PART_",""),e.name=e.name.replace("SLOT_","")),e instanceof s.Kj0&&(e.material.name=e.material.name.replace("SLOT_",""))}));const o=yield this.gltfExporter.parseAsync(a,{binary:!0}).then((t=>e?Promise.all([i.e(27),i.e(322)]).then(i.bind(i,710)).then((({default:e})=>e(t))):t)),r=new Blob([o],{type:"application/octet-stream"});return a.traverse((e=>{e instanceof s.Kj0&&(e.geometry.dispose(),Object.values(e.material).forEach((e=>{e instanceof s.xEZ&&e.dispose()})),e.material.dispose())})),r}))}getCurrentCustomization(e=this.model){return e?{id:e.id,materialSlots:Object.keys(e.slotsMaterials).map((t=>{var i;return{slot:t,activeMaterial:null===(i=e.slotsMaterials[t].materials.find((({material:i})=>{const s=e.slotsMaterials[t].slot;return o=i,(a=s).color.getHexString()===o.color.getHexString()&&a.map===o.map&&a.alphaMap===o.alphaMap&&a.aoMap===o.aoMap&&a.roughness===o.roughness&&a.roughnessMap===o.roughnessMap&&a.metalness===o.metalness&&a.metalnessMap===o.metalnessMap&&a.normalMap===o.normalMap;var a,o})))||void 0===i?void 0:i.name}})),modelSlots:Object.keys(e.slotsModels).map((t=>({slot:t,activeModel:-1!==e.slotsModels[t].activeModel?this.getCurrentCustomization(e.slotsModels[t].models[e.slotsModels[t].activeModel]):null})))}:null}insertHotspot(e,t,i,s,a,o){const r=new P({id:e,position:t,cameraTarget:i,polarAngle:s,azimuthalAngle:a,radius:o});this.hotspots.push(r),this.requestUpdate()}lookToHotspot(e){const t=this.hotspots.find((t=>t.id===e));return t&&this.camera?this.camera.controls.lookTo(t.position):null}centerCameraAtHotspot(e){const t=this.hotspots.find((t=>t.id===e));return t&&this.camera?this.camera.controls.setCamera({dragX:t.position.x,dragY:t.position.y,dragZ:t.position.z}):null}updateHotspot(e,t,i,s,a,o){const r=this.hotspots.find((t=>t.id===e));return r?r.updateHotspot({position:t,cameraTarget:i,polarAngle:s,azimuthalAngle:a,radius:o}):null}deleteHotspot(e){this.hotspots=this.hotspots.filter((t=>t.id!==e))}getAnimationIds(e){var t;void 0===e&&(e=null===(t=this.model)||void 0===t?void 0:t.id);const i=[];return e?this.model&&i.push({modelId:this.model.id,animations:this.model.getAnimations()}):this.forEachModel((e=>{i.push({modelId:e.id,animations:e.getAnimations()})})),i}playAnimation(e,t,i){var s;if(void 0===i&&(i=null===(s=this.model)||void 0===s?void 0:s.id),!this.model||!i)return Promise.reject(new Error("No models found."));const a=this.findModel(i,this.model);return a?a.playAnimation(e,t):(console.error(`Couldn't find model with modelId "${i}".`),Promise.resolve())}stopAnimation(e,t){if(!this.model)return Promise.resolve();t||(t=this.model.id);const i=this.findModel(t,this.model);return i?i.stoAnimation(e):(console.error(`Couldn't find model with modelId "${t}".`),Promise.resolve())}update(){var e;null===(e=this.model)||void 0===e||e.update(),this.camera&&this.model&&this.hotspots.forEach((e=>e.update(this.hotspotRaycaster,this.camera,this.model)))}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return!!this.needsUpdate&&(this.needsUpdate=!1,!0)}}var q=function(e,t,i,s){return new(i||(i=Promise))((function(a,o){function r(e){try{h(s.next(e))}catch(e){o(e)}}function n(e){try{h(s.throw(e))}catch(e){o(e)}}function h(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,n)}h((s=s.apply(e,t||[])).next())}))};class H{constructor({canvas:e,glbSrc:t,exposure:i,noZoom:a,minZoom:o,maxZoom:r,initialZoom:n,sceneBackground:h,activeShadow:l,activeBakedShadow:u,shadowOffsetX:p,shadowOffsetY:g,shadowOffsetZ:v,shadowOpacity:M,shadowRadius:f,cameraOrbitSensitivity:A,minAzimuthalAngleRotation:x,maxAzimuthalAngleRotation:w,minPolarAngleRotation:T,maxPolarAngleRotation:y,maxDragX:P,minDragX:S,maxDragY:N,minDragY:I,maxDragZ:z,minDragZ:C,activeFog:L,fogColor:R,fogNear:E,fogFar:X,cameraNear:O,cameraFar:Y,hdri:U,bloomIntensity:F,bloomRadius:D,bloomThreshold:B,initialAnimation:Z,loadingDiv:k,instructionsImg:q,bloomButton:H,defaultAnimationOptions:G}){this.canvas=e,this.canvasObserver=new IntersectionObserver((([e])=>{this.isVisible=e.isIntersecting})),this.canvasObserver.observe(this.canvas),this.progress=k,this.bloomButton=H,this.glbSrc=t,this.needsUpdate=!0,this.exposure=i,this.instructionsImg=q,this.noZoom=a,this.minZoom=o,this.maxZoom=r,this.initialZoom=n,this.activeShadow=l,this.activeBakedShadow=u,this.shadowOffsetX=p,this.shadowOffsetY=g,this.shadowOffsetZ=v,this.shadowOpacity=M,this.shadowRadius=f,this.orbitSensitivity=A,this.minAzimuthalAngleRotation=x,this.maxAzimuthalAngleRotation=w,this.minPolarAngleRotation=T,this.maxPolarAngleRotation=y,this.maxDragX=P,this.minDragX=S,this.maxDragY=N,this.minDragY=I,this.maxDragZ=z,this.minDragZ=C,this.activeFog=L,this.fogColor=/^#([0-9a-f]{3}){1,2}$/i.test(R)?R:"",this.fogNear=E,this.fogFar=X,this.cameraNear=O,this.cameraFar=Y,this.bloomIntensity=F,this.bloomRadius=D,this.bloomThreshold=B,this.sizes=new m(this.canvas),this.time=c.singleton,this.scene=new s.xsS,this.camera=new _(this),this.hdri=U,this.renderer=new b(this),this.resources=new d({modelSource:this.glbSrc,environmentSource:this.hdri,progress:this.progress,bloomButton:this.bloomButton,canvas:this.canvas,renderer:this.renderer}),this.world=new j(this,G),this.sizes.on("resize",(()=>this.resize())),this.time.on("tick",(()=>this.update())),this.resources.on("ready",(()=>{0===this.resources.animations.length&&Z&&this.camera.controls.animation.play(),this.requestUpdate()})),this.resources.on("environmentReady",(()=>{this.resources.environmentTexture&&(h&&(this.scene.background=this.resources.environmentTexture),this.scene.environment=this.resources.environmentTexture,this.requestUpdate())}))}update(){var e;this.isVisible&&(this.camera.shouldUpdate()&&this.requestUpdate(),this.world.shouldUpdate()&&this.requestUpdate(),this.shouldUpdate()&&(this.world.update(),this.camera.update(),"noBloom"===this.bloom?this.renderer.update():null===(e=this.world.environment)||void 0===e||e.update(),this.hasUpdated()))}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return this.needsUpdate}hasUpdated(){this.needsUpdate=!1}updateGlb(e){this.resources.updateGlb(e),this.requestUpdate()}updateEnvironment({exposure:e,hdri:t,sceneBackground:i,initialAnimation:s}){void 0!==e&&this.renderer.instance&&(this.renderer.instance.toneMappingExposure=e),void 0!==t&&("neutral"===t?this.resources.updateEnvironment("https://sdk.r2u.io/hdri/neutral.hdr"):this.resources.updateEnvironment(t)),i&&this.resources.environmentTexture?this.scene.background=this.resources.environmentTexture:void 0!==i&&(this.scene.background=null),s?this.camera.controls.animation.play():void 0!==s&&this.camera.controls.animation.stop(),this.requestUpdate()}initializeBloom(){var e;null===(e=this.world.environment)||void 0===e||e.initializeBloom(),this.requestUpdate()}updateBloom(e){this.bloom=e,this.world.environment&&(this.world.environment.bloom=e),this.requestUpdate()}resize(){var e;this.camera.resize(),"noBloom"===this.bloom?this.renderer.resize():null===(e=this.world.environment)||void 0===e||e.resize(),this.requestUpdate()}insertModelNode(e){this.world.insertModelNode(e)}insertSlotModelNode(e){return q(this,void 0,void 0,(function*(){return this.world.insertSlotModelNode(e)}))}deleteModelNode(e){this.world.deleteModelNode(e)}getAllSlotsMaterials(){return this.world.getAllSlotsMaterials()}setMaterial(...e){this.world.setMaterial(...e)}getAllSlotsModels(){return this.world.getAllSlotsModels()}setModel(...e){this.world.setModel(...e)}getCustomizedModel(...e){return q(this,void 0,void 0,(function*(){return this.world.getCustomizedModel(...e)}))}getCurrentCustomization(){return this.world.getCurrentCustomization()}insertHotspot(...e){return this.world.insertHotspot(...e)}lookToHotspot(...e){return this.world.lookToHotspot(...e)}centerCameraAtHotspot(...e){return this.world.centerCameraAtHotspot(...e)}updateHotspot(...e){return this.world.updateHotspot(...e)}deleteHotspot(...e){return this.world.deleteHotspot(...e)}}}}]);
"use strict";(self.webpackChunk_r2u_viewer=self.webpackChunk_r2u_viewer||[]).push([[628],{999:(t,e,i)=>{i.r(e),i.d(e,{default:()=>H});var s=i(657),a=i(531),o=i.n(a),r=i(970),n=i(687),h=i(341),l=i(884);class d extends(o()){constructor({modelSource:t,environmentSource:e,progress:i,bloomButton:a,canvas:o,renderer:d}){super(),this.progress=i,this.bloomButton=a,this.loadingManager=new s.lLk((()=>{this.progress.style.transition="opacity 1s ease-in-out",this.progress.style.opacity="0",this.bloomButton.style.transition="opacity 0.5s ease-in-out",this.bloomButton.style.opacity="1",this.bloomButton.style.height="60px",o.classList.add("active")}),((t,e,i)=>{this.progress.style.transition="",this.progress.style.transform=`scaleX(${e/i})`})),this.modelSource=t,this.environmentSource=e,this.gltfLoader=new n.E(this.loadingManager),this.dracoLoader=new r._(this.loadingManager),this.dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.1/"),this.gltfLoader.setDRACOLoader(this.dracoLoader),this.ktx2Loader=new h.a(this.loadingManager),this.ktx2Loader.setTranscoderPath("https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/").detectSupport(d.instance),this.gltfLoader.setKTX2Loader(this.ktx2Loader),this.rgbeLoader=new l.x(this.loadingManager),Promise.all([new Promise((t=>{this.gltfLoader.load(this.modelSource,t)})),new Promise((t=>{this.rgbeLoader.load(this.environmentSource,t)}))]).then((([t,e])=>{this.model=t.scene,this.animations=t.animations,this.environmentTexture=e,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=this.environmentSource,this.emit("modelReady"),this.emit("environmentReady"),this.emit("ready")}))}resetLoadingBar(){this.progress.style.transform="scaleX(0)",this.progress.style.transition="none",this.progress.style.opacity=""}updateEnvironment(t){this.resetLoadingBar(),this.rgbeLoader.load(t,(e=>{const i=this.environmentTexture;this.environmentTexture=e,this.environmentTexture.mapping=s.dSO,this.environmentTexture.name=t,null==i||i.dispose(),this.emit("environmentReady")}))}updateGlb(t){this.resetLoadingBar(),this.emit("modelDispose"),this.gltfLoader.load(t,(t=>{this.model=t.scene,this.animations=t.animations,this.emit("modelReady")}))}loadGlb(t){return e=this,i=void 0,a=function*(){return this.gltfLoader.loadAsync(t)},new((s=void 0)||(s=Promise))((function(t,o){function r(t){try{h(a.next(t))}catch(t){o(t)}}function n(t){try{h(a.throw(t))}catch(t){o(t)}}function h(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(r,n)}h((a=a.apply(e,i||[])).next())}));var e,i,s,a}}class m extends(o()){constructor(t){super(),this.canvas=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateSizes())),this.resizeObserver.observe(this.canvas)),window.addEventListener("resize",(()=>this.updateSizes()))}updateSizes(){this.width=this.canvas.offsetWidth,this.height=this.canvas.offsetHeight,this.pixelRatio=Math.min(window.devicePixelRatio,2),this.emit("resize")}}class c extends(o()){constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=1,window.requestAnimationFrame((()=>this.tick()))}tick(){const t=Date.now();this.delta=t-this.current,this.current=t,this.elapsed=this.current-this.start,this.emit("tick"),window.requestAnimationFrame((()=>this.tick()))}}c.singleton=new c;class u{constructor(t=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(t)}setDecayTime(t){this.naturalFrequency=1/Math.max(.001,t)}update(t,e,i,s){const a=2e-4*this.naturalFrequency;if(null==t||0===s)return e;if(t===e&&0===this.velocity)return e;if(i<0)return t;const o=t-e,r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,e):(this.velocity=l,e+n*h)}}const p=Math.PI/1e3,g=Math.PI/6,v=2*Math.PI;class M{constructor({experience:t,controls:e}){this.canvas=t.canvas,this.instructionsImg=t.instructionsImg,this.controls=e,this.time=t.time,this.angleAnimation=0,this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.damperImgAnimation=new u,this.idle=!1,this.active=!1,this.canvas.addEventListener("touchstart",(()=>{this.active=!1,clearTimeout(this.startTimer)})),this.canvas.addEventListener("mousedown",(()=>{this.active=!1,clearTimeout(this.startTimer)}))}play(){this.startTimer=setTimeout((()=>{this.active=!0,this.controls.requestUpdate()}),2e3)}stop(){this.active=!1}update(){this.active?(this.idle||(this.elapsedAnimation+=p*this.time.delta,this.instructionsImg.style.opacity="1"),this.elapsedAnimation>v&&(this.idle=!0,this.instructionsImg.style.opacity="0",this.elapsedAnimation=v,setTimeout((()=>{this.elapsedAnimation=0,this.elapsedImgAnimation=0,this.idle=!1,this.controls.requestUpdate()}),2e3)),this.angleAnimation=Math.sin(this.elapsedAnimation)*g,this.elapsedImgAnimation=this.damperImgAnimation.update(this.elapsedImgAnimation,this.elapsedAnimation,this.time.delta,1),this.instructionsImg.style.transform=`translate(calc(-50% + ${-Math.sin(this.elapsedImgAnimation)}*50px), -50%)`):this.instructionsImg.style.opacity="0"}isPaused(){return this.idle}isActive(){return this.active}}const f=t=>t%(2*Math.PI)<0?2*Math.PI+t%(2*Math.PI):t%(2*Math.PI);class A extends u{constructor(t=50){super(t)}update(t,e,i,s){const a=2e-4*this.naturalFrequency;if(t=f(t),e=f(e),null==t||0===s)return e;if(t===e&&0===this.velocity)return e;if(i<0)return t;const o=((t,e)=>{const i=f(t),s=f(e),a=-(2*Math.PI-i*Math.pow(1,i)+s*Math.pow(1,s)),o=2*Math.PI-s*Math.pow(1,s)+i*Math.pow(1,i),r=i-s,n=Math.abs(a),h=Math.abs(o),l=Math.abs(r);switch(Math.min(n,h,l)){case n:return a;case h:return o;default:return r}})(t,e),r=this.velocity+this.naturalFrequency*o,n=o+i*r,h=Math.exp(-this.naturalFrequency*i),l=(r-this.naturalFrequency*n)*h,d=-this.naturalFrequency*(l+r*h);return Math.abs(l)<a*Math.abs(s)&&d*o>=0?(this.velocity=0,e):(this.velocity=l,e+n*h)}}const x=Math.PI/2.4,w=Math.PI/10;class T{constructor(t,e,i){this.ORBIT_SENSITIVITY=t.orbitSensitivity,this.MIN_CAMERA_SCROLL=2,this.MAX_CAMERA_SCROLL=10,this.DEFAULT_CAMERA_SCROLL=4,this.MAX_XZ_ANGLE=t.maxAzimuthalAngleRotation*Math.PI/180,this.MIN_XZ_ANGLE=t.minAzimuthalAngleRotation*Math.PI/180,t.maxPolarAngleRotation&&(this.MAX_Y_ANGLE=t.maxPolarAngleRotation*Math.PI/180),t.minPolarAngleRotation&&(this.MIN_Y_ANGLE=t.minPolarAngleRotation*Math.PI/180),this.MAX_X_PAN=t.maxDragX,this.MIN_X_PAN=t.minDragX,this.MAX_Y_PAN=t.maxDragY,this.MIN_Y_PAN=t.minDragY,this.MAX_Z_PAN=t.maxDragZ,this.MIN_Z_PAN=t.minDragZ,this.canvas=t.canvas,this.camera=e,this.time=t.time,this.noZoom=!!t.noZoom,this.damperRadius=new u,this.damperYAngle=new A,this.damperXZAngle=new A,this.damperXPan=new u,this.damperYPan=new u,this.damperZPan=new u,this.canvas.oncontextmenu=t=>t.preventDefault(),this.yAngleTarget=x,this.xzAngleTarget=w,this.yAngle=x,this.xzAngle=w,this.orbitCamera=!1,this.moveCamera=!1,this.panTarget=new s.Pa4,this.pan=new s.Pa4,i?(this.cameraRadius=i,this.cameraRadiusTarget=i):(this.cameraRadius=this.DEFAULT_CAMERA_SCROLL,this.cameraRadiusTarget=this.DEFAULT_CAMERA_SCROLL),this.pageMode="none",this.addDragEventListener(),this.addWheelEventListener(),this.addTouchEventListener(),this.animation=new M({experience:t,controls:this})}addDragEventListener(){let t=0,e=0;this.canvas.onmousedown=i=>{i.stopPropagation(),this.requestUpdate(),0===i.button?(this.orbitCamera=!0,this.canvas.style.cursor="grabbing"):(this.moveCamera=!0,this.canvas.style.cursor="move"),t=i.clientX,e=i.clientY},document.addEventListener("mouseup",(()=>{this.orbitCamera=!1,this.moveCamera=!1,this.canvas.style.cursor=""})),this.canvas.addEventListener("mousemove",(i=>{if(this.requestUpdate(),this.orbitCamera)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((t-i.clientX)/this.canvas.width),t=i.clientX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i.clientY-e)/this.canvas.height),e=i.clientY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if(this.moveCamera){const a=.8*this.cameraRadius*(t-i.clientX)/this.canvas.width;t=i.clientX;const o=.8*this.cameraRadius*(i.clientY-e)/this.canvas.height;e=i.clientY,this.panTarget.add(new s.Pa4(a*Math.cos(this.yAngleTarget)+o*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),o*Math.cos(this.xzAngleTarget),a*Math.sin(-this.yAngleTarget)+o*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}}))}addWheelEventListener(){let t;this.canvas.onwheel=e=>{this.noZoom||(e.preventDefault(),this.requestUpdate(),e.deltaY>0?(this.cameraRadiusTarget+=.003*e.deltaY*this.cameraRadius,this.canvas.style.cursor="zoom-out"):(this.cameraRadiusTarget+=.003*e.deltaY*this.cameraRadius/2,this.canvas.style.cursor="zoom-in"),this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL),t&&clearTimeout(t),t=setTimeout((()=>{this.canvas.style.cursor=""}),300))}}addTouchEventListener(){let t=0,e=0;document.addEventListener("touchstart",(i=>{t=i.touches[0].clientX,e=i.touches[0].clientY})),document.addEventListener("touchmove",(i=>{"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode&&Math.abs(i.touches[0].clientY-e)>Math.abs(i.touches[0].clientX-t)&&(this.pageMode="scrolling")}));let i=0,a=0,o=0;this.canvas.ontouchstart=t=>{1===t.touches.length?(i=t.touches[0].clientX,a=t.touches[0].clientY):2===t.touches.length&&(this.pageMode="movingCamera",i=(t.touches[0].clientX+t.touches[1].clientX)/2,a=(t.touches[0].clientY+t.touches[1].clientY)/2,o=Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY))},document.addEventListener("touchend",(t=>{"movingCamera"===this.pageMode||"zoomingCamera"===this.pageMode?(this.pageMode="orbitingCamera",i=t.touches[0].clientX,a=t.touches[0].clientY):this.pageMode="none"})),this.canvas.addEventListener("touchmove",(t=>{if(this.requestUpdate(),"scrolling"!==this.pageMode&&t.cancelable)if(Math.abs(t.touches[0].clientY-a)<=Math.abs(t.touches[0].clientX-i)&&"none"===this.pageMode&&(this.pageMode="orbitingCamera"),"movingCamera"!==this.pageMode&&"orbitingCamera"!==this.pageMode&&"zoomingCamera"!==this.pageMode||t.preventDefault(),"orbitingCamera"===this.pageMode)this.yAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((i-t.touches[0].pageX)/this.canvas.width),i=t.touches[0].pageX,this.xzAngleTarget+=this.ORBIT_SENSITIVITY*Math.PI*2*((t.touches[0].pageY-a)/this.canvas.height),a=t.touches[0].pageY,this.xzAngleTarget<this.MIN_XZ_ANGLE&&(this.xzAngleTarget=this.MIN_XZ_ANGLE),this.xzAngleTarget>this.MAX_XZ_ANGLE&&(this.xzAngleTarget=this.MAX_XZ_ANGLE),this.MIN_Y_ANGLE&&this.yAngleTarget<this.MIN_Y_ANGLE&&(this.yAngleTarget=this.MIN_Y_ANGLE),this.MAX_Y_ANGLE&&this.yAngleTarget>this.MAX_Y_ANGLE&&(this.yAngleTarget=this.MAX_Y_ANGLE);else if("movingCamera"===this.pageMode){Math.abs(Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY)-o)>50&&(o=Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY),this.pageMode="zoomingCamera");const e=(t.touches[0].clientX+t.touches[1].clientX)/2,r=(t.touches[0].clientY+t.touches[1].clientY)/2,n=1.6*this.cameraRadius*(i-e)/this.canvas.width;i=e;const h=1.6*this.cameraRadius*(r-a)/this.canvas.height;a=r,this.panTarget.add(new s.Pa4(n*Math.cos(this.yAngleTarget)+h*Math.sin(this.xzAngleTarget)*Math.sin(-this.yAngleTarget),h*Math.cos(this.xzAngleTarget),n*Math.sin(-this.yAngleTarget)+h*Math.sin(-this.xzAngleTarget)*Math.cos(this.yAngleTarget))),null!==this.MIN_X_PAN&&void 0!==this.MIN_X_PAN&&this.panTarget.x<this.MIN_X_PAN&&(this.panTarget.x=this.MIN_X_PAN),null!==this.MAX_X_PAN&&void 0!==this.MAX_X_PAN&&this.panTarget.x>this.MAX_X_PAN&&(this.panTarget.x=this.MAX_X_PAN),null!==this.MIN_Y_PAN&&void 0!==this.MIN_Y_PAN&&this.panTarget.y<this.MIN_Y_PAN&&(this.panTarget.y=this.MIN_Y_PAN),null!==this.MAX_Y_PAN&&void 0!==this.MAX_Y_PAN&&this.panTarget.y>this.MAX_Y_PAN&&(this.panTarget.y=this.MAX_Y_PAN),null!==this.MIN_Z_PAN&&void 0!==this.MIN_Z_PAN&&this.panTarget.z<this.MIN_Z_PAN&&(this.panTarget.z=this.MIN_Z_PAN),null!==this.MAX_Z_PAN&&void 0!==this.MAX_Z_PAN&&this.panTarget.z>this.MAX_Z_PAN&&(this.panTarget.z=this.MAX_Z_PAN)}else if("zoomingCamera"===this.pageMode){const e=Math.hypot(t.touches[0].pageX-t.touches[1].pageX,t.touches[0].pageY-t.touches[1].pageY)-o;this.cameraRadiusTarget-=.03*e,o+=e,this.cameraRadiusTarget>this.MAX_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MAX_CAMERA_SCROLL),this.cameraRadiusTarget<this.MIN_CAMERA_SCROLL&&(this.cameraRadiusTarget=this.MIN_CAMERA_SCROLL)}}))}setCamera({radius:t,minRadius:e,maxRadius:i,initialRadius:s,orbitSensitivity:a,azimuthalAngle:o,maxAzimuthalAngle:r,minAzimuthalAngle:n,polarAngle:h,maxPolarAngle:l,minPolarAngle:d,dragX:m,maxDragX:c,minDragX:u,dragY:p,maxDragY:g,minDragY:v,dragZ:M,maxDragZ:f,minDragZ:A,near:x,far:w}){void 0!==t&&(this.cameraRadiusTarget=0===t?.01:t),void 0!==e&&(this.MIN_CAMERA_SCROLL=0===e?.01:e),void 0!==i&&(this.MAX_CAMERA_SCROLL=0===i?.01:i),void 0!==s&&(this.DEFAULT_CAMERA_SCROLL=0===s?.01:s),void 0!==a&&(this.ORBIT_SENSITIVITY=0===a?.01:a),void 0!==r&&(this.MAX_XZ_ANGLE=0===r?.01:r*Math.PI/180),void 0!==n&&(this.MIN_XZ_ANGLE=0===n?-.01:n*Math.PI/180),void 0!==l&&(this.MAX_Y_ANGLE=0===l?.01:l*Math.PI/180),void 0!==d&&(this.MIN_Y_ANGLE=0===d?-.01:d*Math.PI/180),void 0!==c&&(this.MAX_X_PAN=0===c?.01:c),void 0!==u&&(this.MIN_X_PAN=0===u?.01:u),void 0!==g&&(this.MAX_Y_PAN=0===g?.01:g),void 0!==v&&(this.MIN_Y_PAN=0===v?.01:v),void 0!==f&&(this.MAX_Z_PAN=0===f?.01:f),void 0!==A&&(this.MIN_Z_PAN=0===A?.01:A),void 0!==x&&(this.camera.near=0===x?.01:x),void 0!==w&&(this.camera.far=0===w?.01:w),void 0!==o&&(this.xzAngleTarget=o*Math.PI/180),void 0!==h&&(this.yAngleTarget=h*Math.PI/180),void 0!==m&&(this.panTarget.x=m),void 0!==p&&(this.panTarget.y=p),void 0!==M&&(this.panTarget.z=M),this.camera.updateProjectionMatrix()}lookTo(t){const e=this.camera.position.clone().multiply(new s.Pa4(0,1,0)).divideScalar(this.cameraRadius).angleTo(t)+(t.x<0?Math.PI:0);void 0!==e&&(this.yAngleTarget=e)}getCamera(){return{radius:this.cameraRadiusTarget,orbitSensitivity:this.ORBIT_SENSITIVITY,azimuthalAngle:180*this.xzAngleTarget/Math.PI,polarAngle:180*this.yAngleTarget/Math.PI,dragX:this.panTarget.x,dragY:this.panTarget.y,dragZ:this.panTarget.z,near:this.camera.near,far:this.camera.near}}update(){this.animation.update(),this.yAngle=this.damperYAngle.update(this.yAngle,this.yAngleTarget+this.animation.angleAnimation,this.time.delta,1),this.xzAngle=this.damperXZAngle.update(this.xzAngle,this.xzAngleTarget,this.time.delta,1),this.cameraRadius=this.damperRadius.update(this.cameraRadius,this.cameraRadiusTarget,this.time.delta,1),this.pan.x=this.damperXPan.update(this.pan.x,this.panTarget.x,this.time.delta,1),this.pan.y=this.damperYPan.update(this.pan.y,this.panTarget.y,this.time.delta,1),this.pan.z=this.damperZPan.update(this.pan.z,this.panTarget.z,this.time.delta,1),this.camera.position.x=Math.cos(this.xzAngle)*Math.sin(this.yAngle)*this.cameraRadius,this.camera.position.y=Math.sin(this.xzAngle)*this.cameraRadius,this.camera.position.z=Math.cos(this.xzAngle)*Math.cos(this.yAngle)*this.cameraRadius,this.camera.position.add(this.pan),this.camera.lookAt(this.pan)}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return this.needsUpdate?(this.needsUpdate=!1,!0):this.yAngle!==this.yAngleTarget+this.animation.angleAnimation||this.xzAngle!==this.xzAngleTarget||this.cameraRadius!==this.cameraRadiusTarget||this.pan.x!==this.panTarget.x||this.pan.y!==this.panTarget.y||this.pan.z!==this.panTarget.z||!(this.animation.isPaused()||!this.animation.isActive())}}class _{constructor(t){this.instance=null,this.experience=t,this.canvas=this.experience.canvas,this.sizes=this.experience.sizes,this.scene=this.experience.scene;const e=this.experience.cameraNear?this.experience.cameraNear:.1,i=this.experience.cameraFar?this.experience.cameraFar:100;this.instance=new s.cPb(35,this.sizes.width/this.sizes.height,e,i),this.instance.position.set(1,1,4),this.scene.add(this.instance),this.controls=new T(this.experience,this.instance,this.experience.initialZoom)}resize(){this.instance&&(this.instance.aspect=this.sizes.width/this.sizes.height,this.instance.updateProjectionMatrix())}update(){this.controls.update()}shouldUpdate(){return this.controls.shouldUpdate()}}class b{constructor(t){this.instance=null,this.canvas=t.canvas,this.sizes=t.sizes,this.scene=t.scene,this.camera=t.camera,this.instance=new s.CP7({canvas:this.canvas,antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio),this.instance.setClearColor("",0),this.instance.setClearAlpha(0),this.instance.autoClear=!0,this.instance.shadowMap.enabled=!0,this.instance.shadowMap.type=s.dwk,this.instance.physicallyCorrectLights=!0,this.instance.outputEncoding=s.knz,this.instance.toneMapping=s.LY2,this.instance.toneMappingExposure=t.exposure}resize(){var t,e;null===(t=this.instance)||void 0===t||t.setSize(this.sizes.width,this.sizes.height),null===(e=this.instance)||void 0===e||e.setPixelRatio(this.sizes.pixelRatio)}update(){this.instance&&this.camera.instance&&this.instance.render(this.scene,this.camera.instance)}}var y=i(870);class P{constructor({id:t,position:e,cameraTarget:i,polarAngle:a,azimuthalAngle:o,radius:r}){this.id=t,this.position=new s.Pa4(e.x,e.y,e.z),i&&(this.cameraTarget=new s.Pa4(i.x,i.y,i.z)),a&&(this.polarAngle=a),o&&(this.azimuthalAngle=o),r&&(this.radius=r)}update(t,e,i){if(!e.instance||!i.model)return;const s=this.position.clone();s.project(e.instance),this.element=document.querySelector(`#${this.id}`),this.translateHotspot(e.sizes,s),this.shouldUpdateVisibility()&&this.updateHotspotVisibility(t,e.instance,i,s)}updateHotspotVisibility(t,e,i,s){var a,o;t.setFromCamera(s,e);const r=t.intersectObjects(i.model.children,!0);if(this.isVisible=!1,0===r.length)this.isVisible=!0;else{const t=r[0].distance;this.position.distanceTo(e.position)<t&&(this.isVisible=!0)}this.isVisible?null===(a=this.element)||void 0===a||a.classList.add("visible"):null===(o=this.element)||void 0===o||o.classList.remove("visible")}translateHotspot(t,e){const i=e.x*t.width*.5,s=e.y*t.height*-.5;this.element&&(this.element.style.transform=`translate(${i}px, ${s}px)`)}updateHotspot({position:t,cameraTarget:e,polarAngle:i,azimuthalAngle:s,radius:a}){t&&this.setPosition(t),e&&this.setCameraTarget(e),i&&this.setPolarAngle(i),s&&this.setAzimuthalAngle(s),a&&this.setRadius(a)}setPosition(t){this.position=new s.Pa4(t.x,t.y,t.z)}setCameraTarget(t){this.cameraTarget=new s.Pa4(t.x,t.y,t.z)}setPolarAngle(t){this.polarAngle=t}setAzimuthalAngle(t){this.azimuthalAngle=t}setRadius(t){this.radius=t}shouldUpdateVisibility(){return this.visibilityLastUpdate?c.singleton.current-this.visibilityLastUpdate>250&&(this.visibilityLastUpdate=c.singleton.current,!0):(this.visibilityLastUpdate=c.singleton.current,!0)}}var S=i(643),N=i(220),I=i(175),z=i(475),C=i(612),L=i(248),R=i(655);class E extends C.w{constructor(t,e,i,a){super(),this.strength=void 0!==e?e:1,this.radius=i,this.threshold=a,this.resolution=void 0!==t?new s.FM8(t.x,t.y):new s.FM8(256,256),this.clearColor=new s.Ilk(0,0,0);const o={minFilter:s.wem,magFilter:s.wem,format:s.wk1};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);this.renderTargetBright=new s.dd2(r,n,o),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let t=0;t<this.nMips;t++){const e=new s.dd2(r,n,o);e.texture.name=`UnrealBloomPass.h${t}`,e.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(e);const i=new s.dd2(r,n,o);i.texture.name=`UnrealBloomPass.v${t}`,i.texture.generateMipmaps=!1,this.renderTargetsVertical.push(i),r=Math.round(r/2),n=Math.round(n/2)}void 0===R.Y&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const h=R.Y;this.highPassUniforms=s.rDY.clone(h.uniforms),this.highPassUniforms.luminosityThreshold.value=a,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new s.jyz({uniforms:this.highPassUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];r=Math.round(this.resolution.x/2),n=Math.round(this.resolution.y/2);for(let t=0;t<this.nMips;t++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[t])),this.separableBlurMaterials[t].uniforms.texSize.value=new s.FM8(r,n),r=Math.round(r/2),n=Math.round(n/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=e,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1),new s.Pa4(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===L.C&&console.error("THREE.UnrealBloomPass relies on CopyShader");const d=L.C;this.copyUniforms=s.rDY.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new s.jyz({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:s.WMw,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new s.Ilk,this.oldClearAlpha=1,this.basic=new s.vBJ,this.fsQuad=new C.T(null)}dispose(){for(let t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(let t=0;t<this.renderTargetsVertical.length;t++)this.renderTargetsVertical[t].dispose();this.renderTargetBright.dispose()}setSize(t,e){let i=Math.round(t/2),a=Math.round(e/2);this.renderTargetBright.setSize(i,a);for(let t=0;t<this.nMips;t++)this.renderTargetsHorizontal[t].setSize(i,a),this.renderTargetsVertical[t].setSize(i,a),this.separableBlurMaterials[t].uniforms.texSize.value=new s.FM8(i,a),i=Math.round(i/2),a=Math.round(a/2)}render(t,e,i,s,a){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();const o=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),a&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);let r=this.renderTargetBright;for(let e=0;e<this.nMips;e++)this.fsQuad.material=this.separableBlurMaterials[e],this.separableBlurMaterials[e].uniforms.colorTexture.value=r.texture,this.separableBlurMaterials[e].uniforms.direction.value=E.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[e]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[e].uniforms.colorTexture.value=this.renderTargetsHorizontal[e].texture,this.separableBlurMaterials[e].uniforms.direction.value=E.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[e]),t.clear(),this.fsQuad.render(t),r=this.renderTargetsVertical[e];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,a&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(i),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=o}getSeperableBlurMaterial(t){return new s.jyz({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new s.FM8(.5,.5)},direction:{value:new s.FM8(.5,.5)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize; float fSigma = float(SIGMA); float weightSum = gaussianPdf(0.0, fSigma); float alphaSum = 0.0; vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; for( int i = 1; i < KERNEL_RADIUS; i ++ ) { float x = float(i); float w = gaussianPdf(x, fSigma); vec2 uvOffset = direction * invSize * x; vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += (sample1.rgb + sample2.rgb) * w; alphaSum += (sample1.a + sample2.a) * w; weightSum += 2.0 * w; } gl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n }"})}getCompositeMaterial(t){return new s.jyz({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D blurTexture1;\n uniform sampler2D blurTexture2;\n uniform sampler2D blurTexture3;\n uniform sampler2D blurTexture4;\n uniform sampler2D blurTexture5;\n uniform sampler2D dirtTexture;\n uniform float bloomStrength;\n uniform float bloomRadius;\n uniform float bloomFactors[NUM_MIPS];\n uniform vec3 bloomTintColors[NUM_MIPS];\n float lerpBloomFactor(const in float factor) {\n float mirrorFactor = 1.2 - factor;\n return mix(factor, mirrorFactor, bloomRadius);\n }\n void main() {\n gl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n }"})}}E.BlurDirectionX=new s.FM8(1,0),E.BlurDirectionY=new s.FM8(0,1);class X{constructor(t){var e,i;if(this.scene=t.scene,this.bloomModels=null===(e=t.world.model)||void 0===e?void 0:e.bloomModels,this.lightModels=null===(i=t.world.model)||void 0===i?void 0:i.lightModels,this.experience=t,this.sunLight=new s.Ox3("",0),this.sunLight.position.set(this.experience.shadowOffsetX,this.experience.shadowOffsetY,this.experience.shadowOffsetZ),this.experience.activeShadow&&(this.sunLight.castShadow=!0),this.sunLight.shadow.camera.near=.01,this.sunLight.shadow.camera.far=100,this.sunLight.shadow.bias=-1e-5,this.sunLight.shadow.mapSize.width=2048,this.sunLight.shadow.mapSize.height=2048,this.sunLight.shadow.blurSamples=20,this.sunLight.shadow.radius=this.experience.shadowRadius?this.experience.shadowRadius:1,this.scene.add(this.sunLight),this.experience.activeFog){const t=this.experience.fogColor?this.experience.fogColor:"#ffffff",e=this.experience.fogNear?this.experience.fogNear:1,i=this.experience.fogFar?this.experience.fogFar:15;this.fog=new s.ybr(t,e,i),this.scene.fog=this.fog}}initializeBloom(){var t;if(this.experience.renderer.instance){const e=new s.dd2(this.experience.sizes.width,this.experience.sizes.height,{minFilter:s.wem,magFilter:s.wem,format:s.wk1,type:s.cLu,stencilBuffer:!1});e.samples=3;const i=new I.T(z.Y);this.darkMaterial=new s.vBJ({color:"black"}),this.darkGlassMaterial=new s.vBJ({color:"black",visible:!1}),this.materials={};const a=new N.C(this.scene,this.experience.camera.instance);this.bloomPass=new E(new s.FM8(this.experience.sizes.width,this.experience.sizes.height),this.experience.bloomIntensity,this.experience.bloomRadius,this.experience.bloomThreshold),this.bloomComposer=new S.xC(this.experience.renderer.instance,e),this.bloomComposer.renderToScreen=!1,this.bloomComposer.addPass(a),this.bloomComposer.addPass(this.bloomPass),this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((t=>{t.visible=!1})),null===(t=this.bloomModels)||void 0===t||t.forEach((t=>{t.material instanceof s.Wid&&(t.material.emissiveIntensity=0)}));const o=new I.T(new s.jyz({uniforms:{baseTexture:{value:null},bloomTexture:{value:this.bloomComposer.renderTarget2.texture}},vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}",fragmentShader:"uniform sampler2D baseTexture;\nuniform sampler2D bloomTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n gl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );\n\n}",defines:{}}),"baseTexture");o.needsSwap=!0,this.finalComposer=new S.xC(this.experience.renderer.instance,e),this.finalComposer.addPass(a),this.finalComposer.addPass(o),this.finalComposer.addPass(i)}}update(){var t,e,i,a;this.experience.world.model&&this.bloomPass&&("bloomOn"===this.bloom?(this.bloomPass.enabled=!0,this.lightModels&&this.lightModels.forEach((t=>{t.visible=!0})),null===(t=this.bloomModels)||void 0===t||t.forEach((t=>{t.material instanceof s.Wid&&(t.material.emissiveIntensity=1)}))):(this.bloomPass.enabled=!1,this.lightModels&&this.lightModels.forEach((t=>{t.visible=!1})),null===(e=this.bloomModels)||void 0===e||e.forEach((t=>{t.material instanceof s.Wid&&(t.material.emissiveIntensity=0)}))),this.experience.camera.instance&&(null===(i=this.experience.world.model.model)||void 0===i||i.traverse((t=>this.darkenNonBloomed(t))),this.bloomComposer.render(),null===(a=this.experience.world.model.model)||void 0===a||a.traverse((t=>this.restoreMaterial(t))),this.finalComposer.render()))}resize(){this.bloomComposer.setSize(this.experience.sizes.width,this.experience.sizes.height),this.finalComposer.setSize(this.experience.sizes.width,this.experience.sizes.height)}updateShadow({opacity:t,XOffset:e,YOffset:i,ZOffset:s,radius:a,activeShadow:o}){var r;(e||0===e)&&(this.sunLight.position.x=e),(i||0===i)&&(this.sunLight.position.y=i),(s||0===s)&&(this.sunLight.position.z=s),void 0!==a&&(this.sunLight.shadow.radius=a||1),void 0!==o&&(null===(r=this.experience.world.model)||void 0===r||r.updateFloor(o)),this.experience.world.model&&(t||0===t)&&(this.experience.world.model.shadowMaterial.opacity=t)}updateBloom({intensity:t,radius:e,threshold:i}){void 0!==t&&(this.bloomPass.strength=t),void 0!==e&&(this.bloomPass.radius=e),void 0!==i&&(this.bloomPass.threshold=i)}updateFog({enable:t,color:e,near:i,far:a}){const o=/^#([0-9a-f]{3}){1,2}$/i;if(this.fog)t?this.scene.fog=this.fog:void 0!==t&&(this.scene.fog=null),e&&o.test(e)&&(this.fog.color=new s.Ilk(e)),i&&(this.fog.near=i),a&&(this.fog.far=a);else if(t){const t=e&&o.test(e)?e:"#ffffff",r=i||1,n=a||15;this.fog=new s.ybr(t,r,n),this.scene.fog=this.fog}}darkenNonBloomed(t){var e;t instanceof s.Kj0&&!(null===(e=this.bloomModels)||void 0===e?void 0:e.find((e=>t===e)))&&(this.materials[t.uuid]=t.material,Array.isArray(t.material)||0===t.material.alphaTest&&1===t.material.opacity?t.material=this.darkMaterial:t.material=this.darkGlassMaterial)}restoreMaterial(t){var e;t instanceof s.Kj0&&this.materials[t.uuid]&&!(null===(e=this.bloomModels)||void 0===e?void 0:e.find((e=>t===e)))&&(t.material=this.materials[t.uuid],delete this.materials[t.uuid])}}const O=(t,e)=>{if(e(t))for(let i=0,s=t.children.length;i<s;i++)O(t.children[i],e)},U=O;class Y extends a.EventEmitter{constructor(t,e,i){super(),this.animationActions={},this.activeAnimations={},this.defaultAnimationOptions={loop:!1,resetOnFinish:!1,timeScale:1,fadeFactor:0},(null==t?void 0:t.model)&&(this.model=t,this.defaultAnimationOptions=Object.assign(Object.assign({},this.defaultAnimationOptions),i),this.mixer=new s.Xcj(t.model),e.forEach((t=>{t.optimize(),this.animationActions[t.name]=this.mixer.clipAction(t)})),this.mixer.addEventListener("finished",(t=>{const e=t;this.animationFinished(e.action)})),0!==Object.keys(this.animationActions).length&&c.singleton.on("tick",(()=>{Object.keys(this.activeAnimations).length&&(this.mixer.update(c.singleton.delta/1e3),this.model.world.requestUpdate())})),this.emit("animatorReady"))}getAnimationIds(){return Object.keys(this.animationActions)}play(t,e={}){return t=this.getAnimationId(t),new Promise((i=>{const a=this.animationActions[t];this.activeAnimations[t]?i():(a.timeScale=e.timeScale||this.defaultAnimationOptions.timeScale,a.clampWhenFinished=!(e.resetOnFinish||this.defaultAnimationOptions.resetOnFinish),a.fadeIn(e.fadeFactor||this.defaultAnimationOptions.fadeFactor),a.setLoop(e.loop?s.YKA:s.jAl,1/0),this.activeAnimations[a.getClip().name]={action:a,resolve:i},a.stop(),a.play())}))}stop(t){t=this.getAnimationId(t);const e=this.animationActions[t];e?(e.stop(),this.activeAnimations[t]&&this.animationFinished(e)):console.error(`Coultn't find animationId "${t}" in model "${this.model.id}".`)}getAnimationId(t){return this.animationActions[t]||Object.keys(this.animationActions).forEach((e=>e.toLocaleLowerCase()!==t.toLocaleLowerCase()||(console.warn(`Coultn't find animationId "${t}" in model "${this.model.id}". Using animationId as "${e}" instead.`),t=e,!1))),t}animationFinished(t){const e=t.getClip().name;this.activeAnimations[e].resolve(),delete this.activeAnimations[e]}}class F{constructor({id:t,model:e,parentModel:i,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}){this.id=t,this.model=e,this.parentModel=i,this.modelParts=[],this.slotsModels={},this.slotsMaterials={},this.bloomModels=[],this.lightModels=[],this.world=n,this.animator=new Y(this,r,o),this.model&&U(this.model,(t=>{if(/^SLOT_/.test(t.name))return this.slotsModels[t.name.replace(/^SLOT_/,"")]={slot:t,activeModel:-1,models:[]},!1;if(t instanceof s.Kj0){if(/^SLOT_/.test(t.material.name)){const e=t.material;this.slotsMaterials[e.name.replace(/^SLOT_/,"").replace(/-(\d|\D|\|)*$/,"")]={slot:e,group:e.name.replace(/^(\d|\D)*-/,""),materials:[]}}new s.Ilk("rgb(0, 0, 0)").equals(t.material.emissive)||this.bloomModels.push(t),t.castShadow=!0,t.receiveShadow=!0,t.frustumCulled=!0}return t instanceof s._kC&&t.name.toLowerCase().startsWith("dynamic")&&this.lightModels.push(t),!0})),a.forEach((t=>{const e=t.name.replace(/^(\d|\D)*-/,"").split("|");Object.values(this.slotsMaterials).forEach((i=>{e.includes(i.group)&&i.materials.push({name:t.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,""),material:t})}))})),Object.values(this.slotsModels).forEach((t=>{const e=[];U(t.slot,(t=>!/^MODEL-PART_/.test(t.name)||(e.push(t),!1))),e.forEach((e=>{e.removeFromParent(),t.models.push(new D({model:e,id:e.name.replace(/^MODEL-PART_/,""),parentModel:this,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}))}))}))}getAnimations(){return this.animator.getAnimationIds()}playAnimation(t,e){return this.animator.play(t,e)}stoAnimation(t){this.animator.stop(t)}removeFromParent(){var t;null===(t=this.model)||void 0===t||t.removeFromParent()}}class D extends F{constructor({model:t,id:e,parentModel:i,constraints:s,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}){var h,l,d;super({id:e,model:t,parentModel:i,materialPalette:a,defaultAnimationOptions:o,animations:r,world:n}),(null==s?void 0:s.position)&&(null===(h=this.model)||void 0===h||h.position.set(s.position[0],s.position[1],s.position[2])),(null==s?void 0:s.scale)&&(null===(l=this.model)||void 0===l||l.scale.set(s.scale[0],s.scale[1],s.scale[2])),(null==s?void 0:s.rotation)&&(null===(d=this.model)||void 0===d||d.rotation.set(s.rotation[0],s.rotation[1],s.rotation[2]))}dispose(){var t,e;this.model&&(this.model.traverse((t=>{var e;t instanceof s.Kj0&&(t.geometry.dispose(),/SLOT_/.test(t.material.name)?null===(e=t.material.aoMap)||void 0===e||e.dispose():Object.values(t.material).forEach((t=>{t instanceof s.xEZ&&t.dispose()})),t.material.dispose())})),Object.values(this.slotsModels).forEach((t=>t.models.forEach((t=>t.dispose())))),null===(e=null===(t=this.parentModel)||void 0===t?void 0:t.model)||void 0===e||e.remove(this.model))}}const B=Math.PI/2;class Z extends F{constructor(t,e,i,a){super({id:"root-model",model:t.resources.model,materialPalette:e,defaultAnimationOptions:a,animations:i,world:t.world}),this.experience=t,this.scene=t.scene,this.resources=t.resources,this.time=t.time,this.activeShadow=t.activeShadow,this.box=new s.ZzF;const o=(new s.Pa4).setScalar(1.7);if(this.model){this.box.setFromObject(this.model);const e=new s.Pa4;this.box.getSize(e),this.center=new s.Pa4,this.box.getCenter(this.center);const i=(new s.Pa4).copy(o).divide(e);let a=Math.min(i.x,Math.min(i.y,i.z));t.maxZoom||0===t.maxZoom?t.camera.controls.MIN_CAMERA_SCROLL=t.maxZoom+.01:t.camera.controls.MIN_CAMERA_SCROLL=a<1?a/.6:a<2?a/1.2:a<3?a/1.5:a<4?a/2.5:a<5?a/3:a/3.5,t.minZoom&&(t.camera.controls.MAX_CAMERA_SCROLL=t.minZoom),this.resources.animations!==[]&&(a/=1.2),this.model.scale.setScalar(a),this.model.position.sub(this.center.multiplyScalar(a)),this.model.rotation.y=B,this.activeShadow&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=t.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor)),this.scene.add(this.model),0!==this.resources.animations.length&&(this.mixer=new s.Xcj(this.model),this.mixer.clipAction(this.resources.animations[0]).play())}}update(){var t;null===(t=this.mixer)||void 0===t||t.update(this.time.delta/1e3)}updateFloor(t){t&&!this.floor&&(this.shadowMaterial=new s.Tn7,this.shadowMaterial.opacity=this.experience.shadowOpacity,this.shadowMaterial.needsUpdate=!0,this.floor=new s.Kj0(new s.BKK(100,100,1),this.shadowMaterial),this.floor.rotation.x=-Math.PI/2,this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.position.sub(this.center),this.scene.add(this.floor),this.scene.traverse((t=>{t instanceof s.Kj0&&(t.castShadow=!0,t.receiveShadow=!0)}))),!t&&this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((t=>{t instanceof s.xEZ&&t.dispose()})),this.scene.remove(this.floor),this.scene.traverse((t=>{t instanceof s.Kj0&&(t.castShadow=!1,t.receiveShadow=!1)})),this.floor=void 0)}dispose(){this.model&&(this.model.traverse((t=>{t instanceof s.Kj0&&(t.geometry.dispose(),t.material.dispose())})),this.floor&&(this.floor.geometry.dispose(),this.floor.material.dispose(),Object.values(this.floor.material).forEach((t=>{t instanceof s.xEZ&&t.dispose()})),this.mixer=void 0,this.scene.remove(this.floor)),this.scene.remove(this.model))}}var k=function(t,e,i,s){return new(i||(i=Promise))((function(a,o){function r(t){try{h(s.next(t))}catch(t){o(t)}}function n(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?a(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,n)}h((s=s.apply(t,e||[])).next())}))};class j{constructor(t,e){this.scene=t.scene,this.resources=t.resources,this.camera=t.camera,this.materialPalette=[],this.hotspotRaycaster=new s.iMs,this.hotspots=[],this.resources.on("modelReady",(()=>{t.resources.model&&this.prepareCustomizationPalette(t.resources.model),this.model=new Z(t,this.materialPalette,this.resources.animations,e),this.environment||(this.environment=new X(t)),"noBloom"!==t.bloom&&t.initializeBloom(),this.requestUpdate()})),this.resources.on("modelDispose",(()=>{var t;null===(t=this.model)||void 0===t||t.dispose(),this.model=void 0,this.requestUpdate()}))}prepareCustomizationPalette(t){const e=[];t.traverse((t=>{t instanceof s.Kj0&&/MATERIAL_/.test(t.material.name)&&e.push(t)})),e.forEach((t=>{-1===this.materialPalette.findIndex((e=>e.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")===t.material.name.replace(/^MATERIAL_/,"").replace(/-(\d|\D|\|)*$/,"")))?this.materialPalette.push(t.material):(Object.values(t.material).forEach((t=>{t instanceof s.xEZ&&t.dispose()})),t.material.dispose()),t.geometry.dispose(),t.removeFromParent()}))}forEachModel(t,e=this.model){e&&(t(e),[...e.modelParts,...Object.values(e.slotsModels).filter((t=>-1!==t.activeModel)).map((t=>t.models[t.activeModel]))].forEach((e=>{this.forEachModel(t,e)})))}findModel(t,e){return t===e.id?e:[...e.modelParts,...Object.values(e.slotsModels).filter((t=>-1!==t.activeModel)).map((t=>t.models[t.activeModel]))].reduce(((e,i)=>e||this.findModel(t,i)),null)}insertModelNode({url:t,id:e,parentId:i="root-model",constraints:s}){if(!this.model)return;const a=this.findModel(i,this.model);a&&this.resources.loadGlb(t).then((t=>{var i;this.prepareCustomizationPalette(t.scene);const o=new D({model:t.scene,id:e,parentModel:a,constraints:s,materialPalette:this.materialPalette,animations:t.animations,world:this});a.modelParts.push(o),null===(i=a.model)||void 0===i||i.add(o.model),this.requestUpdate()}))}insertSlotModelNode({url:t,modelId:e,slotName:i,parentId:a="root-model",constraints:o}){var r,n;return k(this,void 0,void 0,(function*(){if(!this.model)return;const h=this.findModel(a,this.model);if(h&&!(null===(r=h.slotsModels[i])||void 0===r?void 0:r.models.find((t=>t.id===e))))try{if(!h.slotsModels[i]){const t=new s.Tme;t.name=i,null===(n=h.model)||void 0===n||n.add(t),h.slotsModels[i]={slot:t,activeModel:-1,models:[]}}const a=yield this.resources.loadGlb(t);this.prepareCustomizationPalette(a.scene);const r=new D({model:a.scene,id:e,parentModel:h,constraints:o,materialPalette:this.materialPalette,animations:a.animations,world:this});h.slotsModels[i].models.push(r),this.requestUpdate()}catch(t){console.error("Error on load model resource")}}))}deleteModelNode(t){if(!this.model)return;const e=this.findModel(t,this.model);e&&(e.dispose(),e instanceof D&&e.parentModel&&(e.parentModel.modelParts=e.parentModel.modelParts.filter((e=>e.id!==t))),this.requestUpdate())}getAllSlotsMaterials(t){if(!this.model)return null;const e=t||this.model,i=[...e.modelParts,...Object.values(e.slotsModels).filter((t=>-1!==t.activeModel)).map((t=>t.models[t.activeModel]))];return{id:e.id,slots:Object.keys(e.slotsMaterials).map((t=>({name:t,materials:e.slotsMaterials[t].materials.map((t=>t.name))}))),models:i.map((t=>this.getAllSlotsMaterials(t)))}}setMaterial({modelId:t="root-model",slot:e,materialName:i}){var s,a;if(!this.model)return;const o=this.findModel(t,this.model);if(!o)return void console.error("Model with Id",t,"not found!");if(!o.slotsMaterials[e])return void console.error("Slot",e,"not found!");const r=null===(a=null===(s=o.slotsMaterials[e])||void 0===s?void 0:s.materials.find((t=>t.name===i)))||void 0===a?void 0:a.material;if(!r)return void console.error("Material name",i,"not found!");const n=["isMaterial","id","name","needsUpdate","uuid","version","isMeshStandardMaterial"],{slot:h}=o.slotsMaterials[e];Object.keys(h).forEach((t=>{n.includes(t)||(h[t]=r[t])})),o.slotsMaterials[e].slot.needsUpdate=!0,this.requestUpdate()}getAllSlotsModels(t){if(!this.model)return null;const e=t||this.model;return{id:e.id,slots:Object.keys(e.slotsModels).map((t=>({name:t,models:e.slotsModels[t].models.map((t=>this.getAllSlotsModels(t)))}))),modelParts:e.modelParts.map((t=>this.getAllSlotsModels(t)))}}setModel({modelId:t="root-model",slot:e,modelName:i}){if(!this.model)return;const s=this.findModel(t,this.model);if(!s)return void console.error("Model with Id",t,"not found!");const a=s.slotsModels[e];if(!a)return void console.error("Slot",e,"not found!");const o=a.models.findIndex((t=>t.id===i));-1!==a.activeModel&&a.models[a.activeModel].removeFromParent(),a.activeModel=o,-1!==o&&a.slot.add(a.models[o].model),this.requestUpdate()}getCustomizedModel(t=!0){var e;return k(this,void 0,void 0,(function*(){if(!(null===(e=this.model)||void 0===e?void 0:e.model))return null;this.gltfExporter||(this.gltfExporter=new y.M);const a=this.model.model.clone(!0);a.scale.setScalar(1),a.rotation.fromArray([0,0,0]),a.position.fromArray([0,0,0]),a.traverse((t=>{t.name&&(t.name=t.name.replace("MODEL-PART_",""),t.name=t.name.replace("SLOT_","")),t instanceof s.Kj0&&(t.material.name=t.material.name.replace("SLOT_",""))}));const o=yield this.gltfExporter.parseAsync(a,{binary:!0}).then((e=>t?Promise.all([i.e(27),i.e(322)]).then(i.bind(i,710)).then((({default:t})=>t(e))):e)),r=new Blob([o],{type:"application/octet-stream"});return a.traverse((t=>{t instanceof s.Kj0&&(t.geometry.dispose(),Object.values(t.material).forEach((t=>{t instanceof s.xEZ&&t.dispose()})),t.material.dispose())})),r}))}getCurrentCustomization(t=this.model){return t?{id:t.id,materialSlots:Object.keys(t.slotsMaterials).map((e=>{var i;return{slot:e,activeMaterial:null===(i=t.slotsMaterials[e].materials.find((({material:i})=>{const s=t.slotsMaterials[e].slot;return o=i,(a=s).color.getHexString()===o.color.getHexString()&&a.map===o.map&&a.alphaMap===o.alphaMap&&a.aoMap===o.aoMap&&a.roughness===o.roughness&&a.roughnessMap===o.roughnessMap&&a.metalness===o.metalness&&a.metalnessMap===o.metalnessMap&&a.normalMap===o.normalMap;var a,o})))||void 0===i?void 0:i.name}})),modelSlots:Object.keys(t.slotsModels).map((e=>({slot:e,activeModel:-1!==t.slotsModels[e].activeModel?this.getCurrentCustomization(t.slotsModels[e].models[t.slotsModels[e].activeModel]):null})))}:null}insertHotspot(t,e,i,s,a,o){const r=new P({id:t,position:e,cameraTarget:i,polarAngle:s,azimuthalAngle:a,radius:o});this.hotspots.push(r),this.requestUpdate()}lookToHotspot(t){const e=this.hotspots.find((e=>e.id===t));return e&&this.camera?this.camera.controls.lookTo(e.position):null}centerCameraAtHotspot(t){const e=this.hotspots.find((e=>e.id===t));return e&&this.camera?this.camera.controls.setCamera({dragX:e.position.x,dragY:e.position.y,dragZ:e.position.z}):null}updateHotspot(t,e,i,s,a,o){const r=this.hotspots.find((e=>e.id===t));return r?r.updateHotspot({position:e,cameraTarget:i,polarAngle:s,azimuthalAngle:a,radius:o}):null}deleteHotspot(t){this.hotspots=this.hotspots.filter((e=>e.id!==t))}getAnimationIds(t){var e;void 0===t&&(t=null===(e=this.model)||void 0===e?void 0:e.id);const i=[];return t?this.model&&i.push({modelId:this.model.id,animations:this.model.getAnimations()}):this.forEachModel((t=>{i.push({modelId:t.id,animations:t.getAnimations()})})),i}playAnimation(t,e,i){var s;if(void 0===i&&(i=null===(s=this.model)||void 0===s?void 0:s.id),!this.model||!i)return Promise.reject(new Error("No models found."));const a=this.findModel(i,this.model);return a?a.playAnimation(t,e):(console.error(`Couldn't find model with modelId "${i}".`),Promise.resolve())}stopAnimation(t,e){if(!this.model)return Promise.resolve();e||(e=this.model.id);const i=this.findModel(e,this.model);return i?i.stoAnimation(t):(console.error(`Couldn't find model with modelId "${e}".`),Promise.resolve())}update(){var t;null===(t=this.model)||void 0===t||t.update(),this.camera&&this.model&&this.hotspots.forEach((t=>t.update(this.hotspotRaycaster,this.camera,this.model)))}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return!!this.needsUpdate&&(this.needsUpdate=!1,!0)}}var q=function(t,e,i,s){return new(i||(i=Promise))((function(a,o){function r(t){try{h(s.next(t))}catch(t){o(t)}}function n(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?a(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,n)}h((s=s.apply(t,e||[])).next())}))};class H{constructor({canvas:t,glbSrc:e,exposure:i,noZoom:a,minZoom:o,maxZoom:r,initialZoom:n,sceneBackground:h,activeShadow:l,activeBakedShadow:u,shadowOffsetX:p,shadowOffsetY:g,shadowOffsetZ:v,shadowOpacity:M,shadowRadius:f,cameraOrbitSensitivity:A,minAzimuthalAngleRotation:x,maxAzimuthalAngleRotation:w,minPolarAngleRotation:T,maxPolarAngleRotation:y,maxDragX:P,minDragX:S,maxDragY:N,minDragY:I,maxDragZ:z,minDragZ:C,activeFog:L,fogColor:R,fogNear:E,fogFar:X,cameraNear:O,cameraFar:U,hdri:Y,bloomIntensity:F,bloomRadius:D,bloomThreshold:B,initialAnimation:Z,loadingDiv:k,instructionsImg:q,bloomButton:H,defaultAnimationOptions:G}){this.canvas=t,this.canvasObserver=new IntersectionObserver((([t])=>{this.isVisible=t.isIntersecting})),this.canvasObserver.observe(this.canvas),this.progress=k,this.bloomButton=H,this.glbSrc=e,this.needsUpdate=!0,this.exposure=i,this.instructionsImg=q,this.noZoom=a,this.minZoom=o,this.maxZoom=r,this.initialZoom=n,this.activeShadow=l,this.activeBakedShadow=u,this.shadowOffsetX=p,this.shadowOffsetY=g,this.shadowOffsetZ=v,this.shadowOpacity=M,this.shadowRadius=f,this.orbitSensitivity=A,this.minAzimuthalAngleRotation=x,this.maxAzimuthalAngleRotation=w,this.minPolarAngleRotation=T,this.maxPolarAngleRotation=y,this.maxDragX=P,this.minDragX=S,this.maxDragY=N,this.minDragY=I,this.maxDragZ=z,this.minDragZ=C,this.activeFog=L,this.fogColor=/^#([0-9a-f]{3}){1,2}$/i.test(R)?R:"",this.fogNear=E,this.fogFar=X,this.cameraNear=O,this.cameraFar=U,this.bloomIntensity=F,this.bloomRadius=D,this.bloomThreshold=B,this.sizes=new m(this.canvas),this.time=c.singleton,this.scene=new s.xsS,this.camera=new _(this),this.hdri=Y,this.renderer=new b(this),this.resources=new d({modelSource:this.glbSrc,environmentSource:this.hdri,progress:this.progress,bloomButton:this.bloomButton,canvas:this.canvas,renderer:this.renderer}),this.world=new j(this,G),this.sizes.on("resize",(()=>this.resize())),this.time.on("tick",(()=>this.update())),this.resources.on("ready",(()=>{0===this.resources.animations.length&&Z&&this.camera.controls.animation.play(),this.requestUpdate()})),this.resources.on("environmentReady",(()=>{this.resources.environmentTexture&&(h&&(this.scene.background=this.resources.environmentTexture),this.scene.environment=this.resources.environmentTexture,this.requestUpdate())}))}update(){var t;this.isVisible&&(this.camera.shouldUpdate()&&this.requestUpdate(),this.world.shouldUpdate()&&this.requestUpdate(),this.shouldUpdate()&&(this.world.update(),this.camera.update(),"noBloom"===this.bloom?this.renderer.update():null===(t=this.world.environment)||void 0===t||t.update(),this.hasUpdated()))}requestUpdate(){this.needsUpdate=!0}shouldUpdate(){return this.needsUpdate}hasUpdated(){this.needsUpdate=!1}updateGlb(t){this.resources.updateGlb(t),this.requestUpdate()}updateEnvironment({exposure:t,hdri:e,sceneBackground:i,initialAnimation:s}){void 0!==t&&this.renderer.instance&&(this.renderer.instance.toneMappingExposure=t),void 0!==e&&("neutral"===e?this.resources.updateEnvironment("https://sdk.r2u.io/hdri/neutral.hdr"):this.resources.updateEnvironment(e)),i&&this.resources.environmentTexture?this.scene.background=this.resources.environmentTexture:void 0!==i&&(this.scene.background=null),s?this.camera.controls.animation.play():void 0!==s&&this.camera.controls.animation.stop(),this.requestUpdate()}initializeBloom(){var t;null===(t=this.world.environment)||void 0===t||t.initializeBloom(),this.requestUpdate()}updateBloom(t){this.bloom=t,this.world.environment&&(this.world.environment.bloom=t),this.requestUpdate()}resize(){var t;this.camera.resize(),"noBloom"===this.bloom?this.renderer.resize():null===(t=this.world.environment)||void 0===t||t.resize(),this.requestUpdate()}insertModelNode(t){this.world.insertModelNode(t)}insertSlotModelNode(t){return q(this,void 0,void 0,(function*(){return this.world.insertSlotModelNode(t)}))}deleteModelNode(t){this.world.deleteModelNode(t)}getAllSlotsMaterials(){return this.world.getAllSlotsMaterials()}setMaterial(...t){this.world.setMaterial(...t)}getAllSlotsModels(){return this.world.getAllSlotsModels()}setModel(...t){this.world.setModel(...t)}getCustomizedModel(...t){return q(this,void 0,void 0,(function*(){return this.world.getCustomizedModel(...t)}))}getCurrentCustomization(){return this.world.getCurrentCustomization()}insertHotspot(...t){return this.world.insertHotspot(...t)}lookToHotspot(...t){return this.world.lookToHotspot(...t)}centerCameraAtHotspot(...t){return this.world.centerCameraAtHotspot(...t)}updateHotspot(...t){return this.world.updateHotspot(...t)}deleteHotspot(...t){return this.world.deleteHotspot(...t)}}}}]);
{
"name": "@r2u/viewer",
"version": "1.5.5",
"version": "1.5.6",
"files": [

@@ -5,0 +5,0 @@ "dist"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc