1103 lines
824 KiB
JavaScript
1103 lines
824 KiB
JavaScript
|
/**
|
||
|
* @license
|
||
|
* Copyright 2017 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/
|
||
|
const t=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function e(e){return(i,n)=>void 0!==n?((t,e,i)=>{e.constructor.createProperty(i,t)})(e,i,n):t(e,i)
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2021 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/}var i;null===(i=window.HTMLSlotElement)||void 0===i||i.prototype.assignedElements;
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2010-2023 Three.js Authors
|
||
|
* SPDX-License-Identifier: MIT
|
||
|
*/
|
||
|
const n="149",s=0,r=1,a=2,o=1,l=2,h=3,c=0,u=1,d=2,A=0,p=1,m=2,g=3,f=4,v=5,y=100,x=101,_=102,E=103,w=104,C=200,b=201,I=202,S=203,M=204,B=205,T=206,R=207,D=208,L=209,Q=210,P=0,F=1,N=2,U=3,k=4,O=5,G=6,z=7,H=0,V=1,W=2,q=0,j=1,Y=2,J=3,X=4,K=5,$=301,Z=302,tt=303,et=304,it=306,nt=1e3,st=1001,rt=1002,at=1003,ot=1004,lt=1005,ht=1006,ct=1007,ut=1008,dt=1009,At=1010,pt=1011,mt=1012,gt=1013,ft=1014,vt=1015,yt=1016,xt=1017,_t=1018,Et=1020,wt=1021,Ct=1023,bt=1024,It=1025,St=1026,Mt=1027,Bt=1028,Tt=1029,Rt=1030,Dt=1031,Lt=1033,Qt=33776,Pt=33777,Ft=33778,Nt=33779,Ut=35840,kt=35841,Ot=35842,Gt=35843,zt=36196,Ht=37492,Vt=37496,Wt=37808,qt=37809,jt=37810,Yt=37811,Jt=37812,Xt=37813,Kt=37814,$t=37815,Zt=37816,te=37817,ee=37818,ie=37819,ne=37820,se=37821,re=36492,ae=36283,oe=36284,le=36285,he=36286,ce=2201,ue=2202,de=2300,Ae=2301,pe=2302,me=2400,ge=2401,fe=2402,ve=2500,ye=0,xe=1,_e=2,Ee=3e3,we=3001,Ce=3201,be=0,Ie=1,Se="srgb",Me="srgb-linear",Be=7680,Te=35044,Re="300 es",De=1035;class Le{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=null}}}const Qe=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Pe=1234567;const Fe=Math.PI/180,Ne=180/Math.PI;function Ue(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Qe[255&t]+Qe[t>>8&255]+Qe[t>>16&255]+Qe[t>>24&255]+"-"+Qe[255&e]+Qe[e>>8&255]+"-"+Qe[e>>16&15|64]+Qe[e>>24&255]+"-"+Qe[63&i|128]+Qe[i>>8&255]+"-"+Qe[i>>16&255]+Qe[i>>24&255]+Qe[255&n]+Qe[n>>8&255]+Qe[n>>16&255]+Qe[n>>24&255]).toLowerCase()}function ke(t,e,i){return Math.max(e,Math.min(i,t))}function Oe(t,e){return(t%e+e)%e}function Ge(t,e,i){return(1-i)*t+i*e}function ze(t){return 0==(t&t-1)&&0!==t}function He(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Ve(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function We(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function qe(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2019 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/;const vh=window,yh=vh.ShadowRoot&&(void 0===vh.ShadyCSS||vh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xh=Symbol(),_h=new WeakMap;class Eh{constructor(t,e,i){if(this._$cssResult$=!0,i!==xh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(yh&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=_h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&_h.set(e,t))}return t}toString(){return this.cssText}}const wh=yh?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new Eh("string"==typeof t?t:t+"",void 0,xh))(e)})(t):t
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2017 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/;var Ch;const bh=window,Ih=bh.trustedTypes,Sh=Ih?Ih.emptyScript:"",Mh=bh.reactiveElementPolyfillSupport,Bh={toAttribute(t,e){switch(e){case Boolean:t=t?Sh:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},Th=(t,e)=>e!==t&&(e==e||t==t),Rh={attribute:!0,type:String,converter:Bh,reflect:!1,hasChanged:Th};class Dh extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=Rh){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const s=this[t];this[e]=n,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||Rh}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(wh(t))}else void 0!==t&&e.push(wh(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{yh?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),n=vh.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=Rh){var n;const s=this.constructor._$Ep(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:Bh).toAttribute(e,i.type);this._$El=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,s=n._$Ev.get(t);if(void 0!==s&&this._$El!==s){const t=n.getPropertyOptions(s),r="function"==typeof t.converter?{from
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2017 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/
|
||
|
var Lh;Dh.finalized=!0,Dh.elementProperties=new Map,Dh.elementStyles=[],Dh.shadowRootOptions={mode:"open"},null==Mh||Mh({ReactiveElement:Dh}),(null!==(Ch=bh.reactiveElementVersions)&&void 0!==Ch?Ch:bh.reactiveElementVersions=[]).push("1.6.1");const Qh=window,Ph=Qh.trustedTypes,Fh=Ph?Ph.createPolicy("lit-html",{createHTML:t=>t}):void 0,Nh=`lit$${(Math.random()+"").slice(9)}$`,Uh="?"+Nh,kh=`<${Uh}>`,Oh=document,Gh=(t="")=>Oh.createComment(t),zh=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Hh=Array.isArray,Vh=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wh=/-->/g,qh=/>/g,jh=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Yh=/'/g,Jh=/"/g,Xh=/^(?:script|style|textarea|title)$/i,Kh=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),$h=Symbol.for("lit-noChange"),Zh=Symbol.for("lit-nothing"),tc=new WeakMap,ec=Oh.createTreeWalker(Oh,129,null,!1),ic=(t,e)=>{const i=t.length-1,n=[];let s,r=2===e?"<svg>":"",a=Vh;for(let e=0;e<i;e++){const i=t[e];let o,l,h=-1,c=0;for(;c<i.length&&(a.lastIndex=c,l=a.exec(i),null!==l);)c=a.lastIndex,a===Vh?"!--"===l[1]?a=Wh:void 0!==l[1]?a=qh:void 0!==l[2]?(Xh.test(l[2])&&(s=RegExp("</"+l[2],"g")),a=jh):void 0!==l[3]&&(a=jh):a===jh?">"===l[0]?(a=null!=s?s:Vh,h=-1):void 0===l[1]?h=-2:(h=a.lastIndex-l[2].length,o=l[1],a=void 0===l[3]?jh:'"'===l[3]?Jh:Yh):a===Jh||a===Yh?a=jh:a===Wh||a===qh?a=Vh:(a=jh,s=void 0);const u=a===jh&&t[e+1].startsWith("/>")?" ":"";r+=a===Vh?i+kh:h>=0?(n.push(o),i.slice(0,h)+"$lit$"+i.slice(h)+Nh+u):i+Nh+(-2===h?(n.push(void 0),e):u)}const o=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Fh?Fh.createHTML(o):o,n]};class nc{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let s=0,r=0;const a=t.length-1,o=this.parts,[l,h]=ic(t,e);if(this.el=nc.createElement(l,i),ec.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=ec.nextNode())&&o.length<a;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Nh)){const i=h[r++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(Nh),e=/([.?@])?(.*)/.exec(i);o.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?lc:"?"===e[1]?cc:"@"===e[1]?uc:oc})}else o.push({type:6,index:s})}for(const e of t)n.removeAttribute(e)}if(Xh.test(n.tagName)){const t=n.textContent.split(Nh),e=t.length-1;if(e>0){n.textContent=Ph?Ph.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],Gh()),ec.nextNode(),o.push({type:2,index:++s});n.append(t[e],Gh())}}}else if(8===n.nodeType)if(n.data===Uh)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=n.data.indexOf(Nh,t+1));)o.push({type:7,index:s}),t+=Nh.length-1}s++}}static createElement(t,e){const i=Oh.createElement("template");return i.innerHTML=t,i}}function sc(t,e,i=t,n){var s,r,a,o;if(e===$h)return e;let l=void 0!==n?null===(s=i._$Co)||void 0===s?void 0:s[n]:i._$Cl;const h=zh(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,n)),void 0!==n?(null!==(a=(o=i)._$Co)&&void 0!==a?a:o._$Co=[])[n]=l:i._$Cl=l),void 0!==l&&(e=sc(t,l._$AS(t,e.values),l,n)),e}class rc{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Oh).importNode(i,!0);ec.currentNode=s;let r=ec.nextNode(),a=0,o=0,l=n[0];for(;void 0!==l;){if(a===l.index){let e;2===l.type?e=new ac(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new dc(r,this,t)),this.u.push(e),l=n[++o]}a!==(null==l?void 0:l.index)&&(r=ec.nextNode(),a++)}return s}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e+
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright 2017 Google LLC
|
||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||
|
*/};var mc,gc;class fc extends Dh{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=pc(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return $h}}fc.finalized=!0,fc._$litElement$=!0,null===(mc=globalThis.litElementHydrateSupport)||void 0===mc||mc.call(globalThis,{LitElement:fc});const vc=globalThis.litElementPolyfillSupport;null==vc||vc({LitElement:fc}),(null!==(gc=globalThis.litElementVersions)&&void 0!==gc?gc:globalThis.litElementVersions=[]).push("3.2.2");
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const yc=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,xc=yc&&null!=self.XRSession.prototype.requestHitTestSource,_c=null!=self.ResizeObserver,Ec=null!=self.IntersectionObserver,wc=xc;(()=>{const t=navigator.userAgent||navigator.vendor||self.opera;let e=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const Cc=/android/i.test(navigator.userAgent),bc=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);const Ic=/firefox/i.test(navigator.userAgent),Sc=/OculusBrowser/.test(navigator.userAgent);bc&&/CriOS\//.test(navigator.userAgent);const Mc=Cc&&!Ic&&!Sc,Bc=Boolean(window.webkit&&window.webkit.messageHandlers),Tc=(()=>{if(bc){if(Bc)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{const t=document.createElement("a");return Boolean(t.relList&&t.relList.supports&&t.relList.supports("ar"))}}return!1})(),Rc=t=>t&&"null"!==t?Lc(t):null,Dc=()=>{if(wc)return;const t=[];throw yc||t.push("WebXR Device API"),xc||t.push("WebXR Hit Test API"),new Error(`The following APIs are required for AR, but are missing in this browser: ${t.join(", ")}`)},Lc=t=>new URL(t,window.location.toString()).toString(),Qc=(t,e)=>{let i=null;return(...n)=>{null!=i&&self.clearTimeout(i),i=self.setTimeout((()=>{i=null,t(...n)}),e)}},Pc=(t,e,i)=>Math.max(e,Math.min(i,t)),Fc=(()=>{const t=(()=>{var t;if(null===(t=document.documentElement.getAttribute("itemtype"))||void 0===t?void 0:t.includes("schema.org/SearchResultsPage"))return!0;const e=null!=document.head?Array.from(document.head.querySelectorAll("meta")):[];for(const t of e)if("viewport"===t.name)return!0;return!1})();return t||console.warn('No <meta name="viewport"> detected; <model-viewer> will cap pixel density at 1.'),()=>t?window.devicePixelRatio:1})(),Nc=(()=>{const t=new RegExp("[?&]model-viewer-debug-mode(&|$)");return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(t)})();
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var Uc=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const kc=Symbol("currentEnvironmentMap"),Oc=Symbol("currentBackground"),Gc=Symbol("updateEnvironment"),zc=Symbol("cancelEnvironmentUpdate");
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const Hc=Kh`
|
||
|
<style>
|
||
|
:host {
|
||
|
display: block;
|
||
|
position: relative;
|
||
|
contain: strict;
|
||
|
width: 300px;
|
||
|
height: 150px;
|
||
|
}
|
||
|
|
||
|
/* NOTE: This rule set is our integration surface area with the
|
||
|
* :focus-visible polyfill.
|
||
|
*
|
||
|
* @see https://github.com/WICG/focus-visible/pull/196 */
|
||
|
:host([data-js-focus-visible]:focus:not(.focus-visible)),
|
||
|
:host([data-js-focus-visible]) :focus:not(.focus-visible) {
|
||
|
outline: none;
|
||
|
}
|
||
|
|
||
|
.container {
|
||
|
position: relative;
|
||
|
overflow: hidden;
|
||
|
}
|
||
|
|
||
|
.userInput {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
display: none;
|
||
|
position: relative;
|
||
|
}
|
||
|
|
||
|
canvas {
|
||
|
position: absolute;
|
||
|
display: none;
|
||
|
pointer-events: none;
|
||
|
/* NOTE(cdata): Chrome 76 and below apparently have a bug
|
||
|
* that causes our canvas not to display pixels unless it is
|
||
|
* on its own render layer
|
||
|
* @see https://github.com/google/model-viewer/pull/755#issuecomment-536597893
|
||
|
*/
|
||
|
transform: translateZ(0);
|
||
|
}
|
||
|
|
||
|
.show {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
/* Adapted from HTML5 Boilerplate
|
||
|
*
|
||
|
* @see https://github.com/h5bp/html5-boilerplate/blob/ceb4620c78fc82e13534fc44202a3f168754873f/dist/css/main.css#L122-L133 */
|
||
|
.screen-reader-only {
|
||
|
border: 0;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
clip: rect(0, 0, 0, 0);
|
||
|
height: 1px;
|
||
|
margin: -1px;
|
||
|
overflow: hidden;
|
||
|
padding: 0;
|
||
|
position: absolute;
|
||
|
white-space: nowrap;
|
||
|
width: 1px;
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot {
|
||
|
position: absolute;
|
||
|
pointer-events: none;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
}
|
||
|
|
||
|
.slot > * {
|
||
|
pointer-events: initial;
|
||
|
}
|
||
|
|
||
|
.annotation-wrapper ::slotted(*) {
|
||
|
opacity: var(--max-hotspot-opacity, 1);
|
||
|
transition: opacity 0.3s;
|
||
|
}
|
||
|
|
||
|
.pointer-tumbling .annotation-wrapper ::slotted(*) {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.annotation-wrapper ::slotted(*) {
|
||
|
pointer-events: initial;
|
||
|
}
|
||
|
|
||
|
.annotation-wrapper.hide ::slotted(*) {
|
||
|
opacity: var(--min-hotspot-opacity, 0.25);
|
||
|
}
|
||
|
|
||
|
.slot.poster {
|
||
|
display: none;
|
||
|
background-color: inherit;
|
||
|
}
|
||
|
|
||
|
.slot.poster.show {
|
||
|
display: inherit;
|
||
|
}
|
||
|
|
||
|
.slot.poster > * {
|
||
|
pointer-events: initial;
|
||
|
}
|
||
|
|
||
|
.slot.poster:not(.show) > * {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
#default-poster {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
/* The default poster is a <button> so we need to set display
|
||
|
* to prevent it from being affected by text-align: */
|
||
|
display: block;
|
||
|
position: absolute;
|
||
|
border: none;
|
||
|
padding: 0;
|
||
|
background-size: contain;
|
||
|
background-repeat: no-repeat;
|
||
|
background-position: center;
|
||
|
background-color: #fff0;
|
||
|
}
|
||
|
|
||
|
#default-progress-bar {
|
||
|
display: block;
|
||
|
position: relative;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
pointer-events: none;
|
||
|
overflow: hidden;
|
||
|
}
|
||
|
|
||
|
#default-progress-bar > .bar {
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
width: 100%;
|
||
|
height: var(--progress-bar-height, 5px);
|
||
|
background-color: var(--progress-bar-color, rgba(0, 0, 0, 0.4));
|
||
|
transition: transform 0.09s;
|
||
|
transform-origin: top left;
|
||
|
transform: scaleX(0);
|
||
|
overflow: hidden;
|
||
|
}
|
||
|
|
||
|
#default-progress-bar > .bar.hide {
|
||
|
transition: opacity 0.3s 1s;
|
||
|
opacity: 0;
|
||
|
}
|
||
|
|
||
|
.centered {
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
}
|
||
|
|
||
|
.cover {
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot.interaction-prompt {
|
||
|
display: var(--interaction-prompt-display, flex);
|
||
|
overflow: hidden;
|
||
|
opacity: 0;
|
||
|
will-change: opacity;
|
||
|
transition: opacity 0.3s;
|
||
|
}
|
||
|
|
||
|
.slot.interaction-prompt.visible {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
|
||
|
.animated-container {
|
||
|
will-change: transform, opacity;
|
||
|
opacity: 0;
|
||
|
transition: opacity 0.3s;
|
||
|
}
|
||
|
|
||
|
.slot.interaction-prompt > * {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot.ar-button {
|
||
|
-moz-user-select: none;
|
||
|
-webkit-tap-highlight-color: transparent;
|
||
|
user-select: none;
|
||
|
|
||
|
display: var(--ar-button-display, block);
|
||
|
}
|
||
|
|
||
|
.slot.ar-button:not(.enabled) {
|
||
|
display: none;
|
||
|
}
|
||
|
|
||
|
.fab {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
box-sizing: border-box;
|
||
|
width: 40px;
|
||
|
height: 40px;
|
||
|
cursor: pointer;
|
||
|
background-color: #fff;
|
||
|
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15);
|
||
|
border-radius: 100px;
|
||
|
}
|
||
|
|
||
|
.fab > * {
|
||
|
opacity: 0.87;
|
||
|
}
|
||
|
|
||
|
#default-ar-button {
|
||
|
position: absolute;
|
||
|
bottom: 16px;
|
||
|
right: 16px;
|
||
|
transform: scale(var(--ar-button-scale, 1));
|
||
|
transform-origin: bottom right;
|
||
|
}
|
||
|
|
||
|
.slot.pan-target {
|
||
|
display: block;
|
||
|
position: absolute;
|
||
|
width: 0;
|
||
|
height: 0;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
transform: translate3d(-50%, -50%, 0);
|
||
|
background-color: transparent;
|
||
|
opacity: 0;
|
||
|
transition: opacity 0.3s;
|
||
|
}
|
||
|
|
||
|
#default-pan-target {
|
||
|
width: 6px;
|
||
|
height: 6px;
|
||
|
border-radius: 6px;
|
||
|
border: 1px solid white;
|
||
|
box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.8);
|
||
|
}
|
||
|
|
||
|
.slot.default {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot.progress-bar {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot.exit-webxr-ar-button {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
|
||
|
.slot.exit-webxr-ar-button:not(.enabled) {
|
||
|
display: none;
|
||
|
}
|
||
|
|
||
|
#default-exit-webxr-ar-button {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
position: absolute;
|
||
|
top: env(safe-area-inset-top, 16px);
|
||
|
right: 16px;
|
||
|
width: 40px;
|
||
|
height: 40px;
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
|
||
|
#default-exit-webxr-ar-button > svg {
|
||
|
fill: #fff;
|
||
|
}
|
||
|
</style>
|
||
|
<div class="container">
|
||
|
<div class="userInput" tabindex="0" role="img"
|
||
|
aria-label="3D model">
|
||
|
<div class="slot canvas">
|
||
|
<slot name="canvas">
|
||
|
<canvas></canvas>
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<!-- NOTE(cdata): We need to wrap slots because browsers without ShadowDOM
|
||
|
will have their <slot> elements removed by ShadyCSS -->
|
||
|
<div class="slot poster">
|
||
|
<slot name="poster">
|
||
|
<button type="button" id="default-poster" aria-hidden="true" aria-label="Loading 3D model"></button>
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
<div class="slot ar-button">
|
||
|
<slot name="ar-button">
|
||
|
<a id="default-ar-button" part="default-ar-button" class="fab"
|
||
|
tabindex="2"
|
||
|
aria-label="View in your space">
|
||
|
${Kh`
|
||
|
<svg version="1.1" id="view_x5F_in_x5F_AR_x5F_icon"
|
||
|
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px"
|
||
|
viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
|
||
|
<rect id="Bounding_Box" x="0" y="0" fill="none" width="24" height="24"/>
|
||
|
<g id="Art_layer">
|
||
|
<path d="M3,4c0-0.55,0.45-1,1-1h2V1H4C2.35,1,1,2.35,1,4v2h2V4z"/>
|
||
|
<path d="M20,3c0.55,0,1,0.45,1,1v2h2V4c0-1.65-1.35-3-3-3h-2v2H20z"/>
|
||
|
<path d="M4,21c-0.55,0-1-0.45-1-1v-2H1v2c0,1.65,1.35,3,3,3h2v-2H4z"/>
|
||
|
<path d="M20,21c0.55,0,1-0.45,1-1v-2h2v2c0,1.65-1.35,3-3,3h-2v-2H20z"/>
|
||
|
<g>
|
||
|
<path d="M18.25,7.6l-5.5-3.18c-0.46-0.27-1.04-0.27-1.5,0L5.75,7.6C5.29,7.87,5,8.36,5,8.9v6.35c0,0.54,0.29,1.03,0.75,1.3
|
||
|
l5.5,3.18c0.46,0.27,1.04,0.27,1.5,0l5.5-3.18c0.46-0.27,0.75-0.76,0.75-1.3V8.9C19,8.36,18.71,7.87,18.25,7.6z M7,14.96v-4.62
|
||
|
l4,2.32v4.61L7,14.96z M12,10.93L8,8.61l4-2.31l4,2.31L12,10.93z M13,17.27v-4.61l4-2.32v4.62L13,17.27z"/>
|
||
|
</g>
|
||
|
</g>
|
||
|
</svg>`}
|
||
|
</a>
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
<div class="slot pan-target">
|
||
|
<slot name="pan-target">
|
||
|
<div id="default-pan-target">
|
||
|
</div>
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
<div class="slot interaction-prompt cover centered">
|
||
|
<div id="prompt" class="animated-container">
|
||
|
<slot name="interaction-prompt" aria-hidden="true">
|
||
|
${Kh`
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="36">
|
||
|
<defs>
|
||
|
<path id="A" d="M.001.232h24.997V36H.001z" />
|
||
|
</defs>
|
||
|
<g transform="translate(-11 -4)" fill="none" fill-rule="evenodd">
|
||
|
<path fill-opacity="0" fill="#fff" d="M0 0h44v44H0z" />
|
||
|
<g transform="translate(11 3)">
|
||
|
<path d="M8.733 11.165c.04-1.108.766-2.027 1.743-2.307a2.54 2.54 0 0 1 .628-.089c.16 0 .314.017.463.044 1.088.2 1.9 1.092 1.9 2.16v8.88h1.26c2.943-1.39 5-4.45 5-8.025a9.01 9.01 0 0 0-1.9-5.56l-.43-.5c-.765-.838-1.683-1.522-2.712-2-1.057-.49-2.226-.77-3.46-.77s-2.4.278-3.46.77c-1.03.478-1.947 1.162-2.71 2l-.43.5a9.01 9.01 0 0 0-1.9 5.56 9.04 9.04 0 0 0 .094 1.305c.03.21.088.41.13.617l.136.624c.083.286.196.56.305.832l.124.333a8.78 8.78 0 0 0 .509.953l.065.122a8.69 8.69 0 0 0 3.521 3.191l1.11.537v-9.178z" fill-opacity=".5" fill="#e4e4e4" />
|
||
|
<path d="M22.94 26.218l-2.76 7.74c-.172.485-.676.8-1.253.8H12.24c-1.606 0-3.092-.68-3.98-1.82-1.592-2.048-3.647-3.822-6.11-5.27-.095-.055-.15-.137-.152-.23-.004-.1.046-.196.193-.297.56-.393 1.234-.6 1.926-.6a3.43 3.43 0 0 1 .691.069l4.922.994V10.972c0-.663.615-1.203 1.37-1.203s1.373.54 1.373 1.203v9.882h2.953c.273 0 .533.073.757.21l6.257 3.874c.027.017.045.042.07.06.41.296.586.77.426 1.22M4.1 16.614c-.024-.04-.042-.083-.065-.122a8.69 8.69 0 0 1-.509-.953c-.048-.107-.08-.223-.124-.333l-.305-.832c-.058-.202-.09-.416-.136-.624l-.13-.617a9.03 9.03 0 0 1-.094-1.305c0-2.107.714-4.04 1.9-5.56l.43-.5c.764-.84 1.682-1.523 2.71-2 1.058-.49 2.226-.77 3.46-.77s2.402.28 3.46.77c1.03.477 1.947 1.16 2.712 2l.428.5a9 9 0 0 1 1.901 5.559c0 3.577-2.056 6.636-5 8.026h-1.26v-8.882c0-1.067-.822-1.96-1.9-2.16-.15-.028-.304-.044-.463-.044-.22 0-.427.037-.628.09-.977.28-1.703 1.198-1.743 2.306v9.178l-1.11-.537C6.18 19.098 4.96 18 4.1 16.614M22.97 24.09l-6.256-3.874c-.102-.063-.218-.098-.33-.144 2.683-1.8 4.354-4.855 4.354-8.243 0-.486-.037-.964-.104-1.43a9.97 9.97 0 0 0-1.57-4.128l-.295-.408-.066-.092a10.05 10.05 0 0 0-.949-1.078c-.342-.334-.708-.643-1.094-.922-1.155-.834-2.492-1.412-3.94-1.65l-.732-.088-.748-.03a9.29 9.29 0 0 0-1.482.119c-1.447.238-2.786.816-3.94 1.65a9.33 9.33 0 0 0-.813.686 9.59 9.59 0 0 0-.845.877l-.385.437-.36.5-.288.468-.418.778-.04.09c-.593 1.28-.93 2.71-.93 4.222 0 3.832 2.182 7.342 5.56 8.938l1.437.68v4.946L5 25.64a4.44 4.44 0 0 0-.888-.086c-.017 0-.034.003-.05.003-.252.004-.503.033-.75.08a5.08 5.08 0 0 0-.237.056c-.193.046-.382.107-.568.18-.075.03-.15.057-.225.1-.25.114-.494.244-.723.405a1.31 1.31 0 0 0-.566 1.122 1.28 1.28 0 0 0 .645 1.051C4 29.925 5.96 31.614 7.473 33.563a5.06 5.06 0 0 0 .434.491c1.086 1.082 2.656 1.713 4.326 1.715h6.697c.748-.001 1.43-.333 1.858-.872.142-.18.256-.38.336-.602l2.757-7.74c.094-.26.13-.53.112-.794s-.088-.52-.203-.76a2.19 2.19 0 0 0-.821-.91" fill-opacity=".6" fill="#000" />
|
||
|
<path d="M22.444 24.94l-6.257-3.874a1.45 1.45 0 0 0-.757-.211h-2.953v-9.88c0-.663-.616-1.203-1.373-1.203s-1.37.54-1.37 1.203v16.643l-4.922-.994a3.44 3.44 0 0 0-.692-.069 3.35 3.35 0 0 0-1.925.598c-.147.102-.198.198-.194.298.004.094.058.176.153.23 2.462 1.448 4.517 3.22 6.11 5.27.887 1.14 2.373 1.82 3.98 1.82h6.686c.577 0 1.08-.326 1.253-.8l2.76-7.74c.16-.448-.017-.923-.426-1.22-.025-.02-.043-.043-.07-.06z" fill="#fff" />
|
||
|
<g transform="translate(0 .769)">
|
||
|
<mask id="B" fill="#fff">
|
||
|
<use xlink:href="#A" />
|
||
|
</mask>
|
||
|
<path d="M23.993 24.992a1.96 1.96 0 0 1-.111.794l-2.758 7.74c-.08.22-.194.423-.336.602-.427.54-1.11.87-1.857.872h-6.698c-1.67-.002-3.24-.633-4.326-1.715-.154-.154-.3-.318-.434-.49C5.96 30.846 4 29.157 1.646 27.773c-.385-.225-.626-.618-.645-1.05a1.31 1.31 0 0 1 .566-1.122 4.56 4.56 0 0 1 .723-.405l.225-.1a4.3 4.3 0 0 1 .568-.18l.237-.056c.248-.046.5-.075.75-.08.018 0 .034-.003.05-.003.303-.001.597.027.89.086l3.722.752V20.68l-1.436-.68c-3.377-1.596-5.56-5.106-5.56-8.938 0-1.51.336-2.94.93-4.222.015-.03.025-.06.04-.09.127-.267.268-.525.418-.778.093-.16.186-.316.288-.468.063-.095.133-.186.2-.277L3.773 5c.118-.155.26-.29.385-.437.266-.3.544-.604.845-.877a9.33 9.33 0 0 1 .813-.686C6.97 2.167 8.31 1.59 9.757 1.35a9.27 9.27 0 0 1 1.481-.119 8.82 8.82 0 0 1 .748.031c.247.02.49.05.733.088 1.448.238 2.786.816 3.94 1.65.387.28.752.588 1.094.922a9.94 9.94 0 0 1 .949 1.078l.066.092c.102.133.203.268.295.408a9.97 9.97 0 0 1 1.571 4.128c.066.467.103.945.103 1.43 0 3.388-1.67 6.453-4.353 8.243.11.046.227.08.33.144l6.256 3.874c.37.23.645.55.82.9.115.24.185.498.203.76m.697-1.195c-.265-.55-.677-1.007-1.194-1.326l-5.323-3.297c2.255-2.037 3.564-4.97 3.564-8.114 0-2.19-.637-4.304-1.84-6.114-.126-.188-.26-.37-.4-.552-.645-.848-1.402-1.6-2.252-2.204C15.472.91 13.393.232 11.238.232A10.21 10.21 0 0 0 5.23 2.19c-.848.614-1.606 1.356-2.253 2.205-.136.18-.272.363-.398.55C1.374 6.756.737 8.87.737 11.06c0 4.218 2.407 8.08 6.133 9.842l.863.41v3.092l-2.525-.51c-.356-.07-.717-.106-1.076-.106a5.45 5.45 0 0 0-3.14.996c-.653.46-1.022 1.202-.99 1.983a2.28 2.28 0 0 0 1.138 1.872c2.24 1.318 4.106 2.923 5.543 4.772 1.26 1.62 3.333 2.59 5.55 2.592h6.698c1.42-.001 2.68-.86 3.134-2.138l2.76-7.74c.272-.757.224-1.584-.134-2.325" fill-opacity=".05" fill="#000" mask="url(#B)" />
|
||
|
</g>
|
||
|
</g>
|
||
|
</g>
|
||
|
</svg>`
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/}
|
||
|
</slot>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div id="finger0" class="animated-container cover">
|
||
|
<slot name="finger0" aria-hidden="true">
|
||
|
</slot>
|
||
|
</div>
|
||
|
<div id="finger1" class="animated-container cover">
|
||
|
<slot name="finger1" aria-hidden="true">
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
<div class="slot default">
|
||
|
<slot></slot>
|
||
|
|
||
|
<div class="slot progress-bar">
|
||
|
<slot name="progress-bar">
|
||
|
<div id="default-progress-bar" aria-hidden="true">
|
||
|
<div class="bar" part="default-progress-bar"></div>
|
||
|
</div>
|
||
|
</slot>
|
||
|
</div>
|
||
|
|
||
|
<div class="slot exit-webxr-ar-button">
|
||
|
<slot name="exit-webxr-ar-button">
|
||
|
<a id="default-exit-webxr-ar-button" part="default-exit-webxr-ar-button"
|
||
|
tabindex="3"
|
||
|
aria-label="Exit AR"
|
||
|
aria-hidden="true">
|
||
|
${Kh`
|
||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000">
|
||
|
<!-- NOTE(cdata): This SVG filter is a stop-gap until we can implement
|
||
|
support for dynamic re-coloring of UI components -->
|
||
|
<defs>
|
||
|
<filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%">
|
||
|
<feGaussianBlur in="SourceAlpha" stdDeviation="1"/>
|
||
|
<feOffset dx="0" dy="0" result="offsetblur"/>
|
||
|
<feFlood flood-color="#000000"/>
|
||
|
<feComposite in2="offsetblur" operator="in"/>
|
||
|
<feMerge>
|
||
|
<feMergeNode/>
|
||
|
<feMergeNode in="SourceGraphic"/>
|
||
|
</feMerge>
|
||
|
</filter>
|
||
|
</defs>
|
||
|
<path filter="url(#drop-shadow)" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
||
|
<path d="M0 0h24v24H0z" fill="none"/>
|
||
|
</svg>`
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/}
|
||
|
</a>
|
||
|
</slot>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="screen-reader-only" role="region" aria-label="Live announcements">
|
||
|
<span id="status" role="status"></span>
|
||
|
</div>`,Vc=new WeakMap;function Wc(){let t,e;function i(t,e,i,n,s,r){const a=r.num_components(),o=i.num_points()*a,l=o*s.BYTES_PER_ELEMENT,h=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32}}(t,s),c=t._malloc(l);e.GetAttributeDataArrayForAllPoints(i,r,h,l,c);const u=new s(t.HEAPF32.buffer,c,o).slice();return t._free(c),{name:n,array:u,itemSize:a}}onmessage=function(n){const s=n.data;switch(s.type){case"init":t=s.decoderConfig,e=new Promise((function(e){t.onModuleLoaded=function(t){e({draco:t})},DracoDecoderModule(t)}));break;case"decode":const n=s.buffer,r=s.taskConfig;e.then((t=>{const e=t.draco,a=new e.Decoder,o=new e.DecoderBuffer;o.Init(new Int8Array(n),n.byteLength);try{const t=function(t,e,n,s){const r=s.attributeIDs,a=s.attributeTypes;let o,l;const h=e.GetEncodedGeometryType(n);if(h===t.TRIANGULAR_MESH)o=new t.Mesh,l=e.DecodeBufferToMesh(n,o);else{if(h!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new t.PointCloud,l=e.DecodeBufferToPointCloud(n,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const c={index:null,attributes:[]};for(const n in r){const l=self[a[n]];let h,u;if(s.useUniqueIDs)u=r[n],h=e.GetAttributeByUniqueId(o,u);else{if(u=e.GetAttributeId(o,t[r[n]]),-1===u)continue;h=e.GetAttribute(o,u)}c.attributes.push(i(t,e,o,n,l,h))}h===t.TRIANGULAR_MESH&&(c.index=function(t,e,i){const n=i.num_faces(),s=3*n,r=4*s,a=t._malloc(r);e.GetTrianglesUInt32Array(i,r,a);const o=new Uint32Array(t.HEAPF32.buffer,a,s).slice();return t._free(a),{array:o,itemSize:1}}(t,e,o));return t.destroy(o),c}(e,a,o,r),n=t.attributes.map((t=>t.array.buffer));t.index&&n.push(t.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:t},n)}catch(t){console.error(t),self.postMessage({type:"error",id:s.id,error:t.message})}finally{e.destroy(o),e.destroy(a)}}))}}}function qc(t,e){if(e===ye)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===_e||e===xe){let i=t.getIndex();if(null===i){const e=[],n=t.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<n.count;t++)e.push(t);t.setIndex(e),i=t.getIndex()}const n=i.count-2,s=[];if(e===_e)for(let t=1;t<=n;t++)s.push(i.getX(0)),s.push(i.getX(t)),s.push(i.getX(t+1));else for(let t=0;t<n;t++)t%2==0?(s.push(i.getX(t)),s.push(i.getX(t+1)),s.push(i.getX(t+2))):(s.push(i.getX(t+2)),s.push(i.getX(t+1)),s.push(i.getX(t)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=t.clone();return r.setIndex(s),r.clearGroups(),r}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}class jc extends Tl{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new Zc(t)})),this.register((function(t){return new au(t)})),this.register((function(t){return new ou(t)})),this.register((function(t){return new eu(t)})),this.register((function(t){return new iu(t)})),this.register((function(t){return new nu(t)})),this.register((function(t){return new su(t)})),this.register((function(t){return new $c(t)})),this.register((function(t){return new ru(t)})),this.register((function(t){return new tu(t)})),this.register((function(t){return new Xc(t)})),this.register((function(t){return new lu(t)})),this.register((function(t){return new hu(t)}))}load(t,e,i,n){const s=this;let r;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:Zl.extractUrlBase(t),this.manager.itemStart(t);const a=function(e){n?n(e):console.error(e),s.manager.itemError(t),s.manager.itemEnd(t)},o=new Ll(this.manager);o.setPath(this.path)
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/(i);const n=e,s=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:n},[t]))).then((t=>this._createTextureFrom(t.data,i)));return td.set(t,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),id--,this}}nd.BasisFormat={ETC1S:0,UASTC_4x4:1},nd.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},nd.EngineFormat={RGBAFormat:Ct,RGBA_ASTC_4x4_Format:Wt,RGBA_BPTC_Format:re,RGBA_ETC2_EAC_Format:Vt,RGBA_PVRTC_4BPPV1_Format:Ot,RGBA_S3TC_DXT5_Format:Nt,RGB_ETC1_Format:zt,RGB_ETC2_Format:Ht,RGB_PVRTC_4BPPV1_Format:Ut,RGB_S3TC_DXT1_Format:Qt},nd.BasisWorker=function(){let t,e,i;const n=_EngineFormat,s=_TranscoderFormat,r=_BasisFormat;self.addEventListener("message",(function(a){const u=a.data;switch(u.type){case"init":t=u.config,d=u.transcoderBinary,e=new Promise((t=>{i={wasmBinary:d,onRuntimeInitialized:t},BASIS(i)})).then((()=>{i.initializeBasis(),void 0===i.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{width:e,height:a,hasAlpha:d,mipmaps:A,format:p,dfdTransferFn:m,dfdFlags:g}=function(e){const a=new i.KTX2File(new Uint8Array(e));function u(){a.close(),a.delete()}if(!a.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=a.isUASTC()?r.UASTC_4x4:r.ETC1S,A=a.getWidth(),p=a.getHeight(),m=a.getLayers()||1,g=a.getLevels(),f=a.getHasAlpha(),v=a.getDFDTransferFunc(),y=a.getDFDFlags(),{transcoderFormat:x,engineFormat:_}=function(e,i,a,c){let u,d;const A=e===r.ETC1S?o:l;for(let n=0;n<A.length;n++){const s=A[n];if(t[s.if]&&(s.basisFormat.includes(e)&&!(c&&s.transcoderFormat.length<2)&&(!s.needsPowerOfTwo||h(i)&&h(a))))return u=s.transcoderFormat[c?1:0],d=s.engineFormat[c?1:0],{transcoderFormat:u,engineFormat:d}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),u=s.RGBA32,d=n.RGBAFormat,{transcoderFormat:u,engineFormat:d}}(d,A,p,f);if(!A||!p||!g)throw u(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!a.startTranscoding())throw u(),new Error("THREE.KTX2Loader: .startTranscoding failed");const E=[];for(let t=0;t<g;t++){const e=[];let i,n;for(let s=0;s<m;s++){const r=a.getImageLevelInfo(t,s,0);i=r.origWidth,n=r.origHeight;const o=new Uint8Array(a.getImageTranscodedSizeInBytes(t,s,0,x));if(!a.transcodeImage(o,t,s,0,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");e.push(o)}E.push({data:c(e),width:i,height:n})}return u(),{width:A,height:p,hasAlpha:f,mipmaps:E,format:_,dfdTransferFn:v,dfdFlags:y}}(u.buffer),f=[];for(let t=0;t<A.length;++t)f.push(A[t].data.buffer);self.postMessage({type:"transcode",id:u.id,width:e,height:a,hasAlpha:d,mipmaps:A,format:p,dfdTransferFn:m,dfdFlags:g},f)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const a=[{if:"astcSupported",basisFormat:[r.UASTC_4x4],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.BC1,s.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[r.ETC1S,r.UA
|
||
|
/* @license
|
||
|
* Copyright 2021 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const md=t=>{const e=new Map;for(const i of t.mappings)for(const t of i.variants)e.set(t,{material:null,gltfMaterialIndex:i.material});return e};class gd{constructor(t){this.parser=t,this.name="KHR_materials_variants"}afterRoot(t){const e=this.parser,i=e.json;if(void 0===i.extensions||void 0===i.extensions[this.name])return null;const n=(t=>{const e=[],i=new Set;for(const n of t){let t=n,s=0;for(;i.has(t);)t=n+"."+ ++s;i.add(t),e.push(t)}return e})((i.extensions[this.name].variants||[]).map((t=>t.name)));for(const n of t.scenes)n.traverse((t=>{const n=t;if(!n.isMesh)return;const s=e.associations.get(n);if(null==s||null==s.meshes||null==s.primitives)return;const r=i.meshes[s.meshes].primitives[s.primitives].extensions;r&&r[this.name]&&(n.userData.variantMaterials=md(r[this.name]))}));return t.userData.variants=n,Promise.resolve()}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var fd,vd;mi.DEFAULT_ANISOTROPY=4;const yd=new Map,xd=new Map;let _d;const Ed=new class extends Tl{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,i,n){const s=new Ll(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(t=>{this.decodeDracoFile(t,e).catch(n)}),i,n)}decodeDracoFile(t,e,i,n){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!i};return this.decodeGeometry(t,s).then(e)}decodeGeometry(t,e){const i=JSON.stringify(e);if(Vc.has(t)){const e=Vc.get(t);if(e.key===i)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const s=this.workerNextTaskID++,r=t.byteLength,a=this._getWorker(s,r).then((i=>(n=i,new Promise(((i,r)=>{n._callbacks[s]={resolve:i,reject:r},n.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return a.catch((()=>!0)).then((()=>{n&&s&&this._releaseTask(n,s)})),Vc.set(t,{key:i,promise:a}),a}_createGeometry(t){const e=new Kn;t.index&&e.setIndex(new On(t.index.array,1));for(let i=0;i<t.attributes.length;i++){const n=t.attributes[i],s=n.name,r=n.array,a=n.itemSize;e.setAttribute(s,new On(r,a))}return e}_loadLibrary(t,e){const i=new Ll(this.manager);return i.setPath(this.decoderPath),i.setResponseType(e),i.setWithCredentials(this.withCredentials),new Promise(((e,n)=>{i.load(t,e,void 0,n)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const i=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const n=Wc.toString(),s=["/* draco decoder */",i,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const t=new Worker(this.workerSourceURL);t._callbacks={},t._taskCosts={},t._taskLoad=0,t.postMessage({type:"init",decoderConfig:this.decoderConfig}),t.onmessage=function(e){const i=e.data;switch(i.type){case"decode":t._callbacks[i.id].resolve(i);break;case"error":t._callbacks[i.id].reject(i);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+i.type+'"')}},this.workerPool.push(t)}else this.workerPool.sort((function(t,e){return t._taskLoad>e._taskLoad?-1:1}));const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[t]=e,i._taskLoad+=e,i}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}};let wd;const Cd=new nd;let bd,Id;const Sd=Symbol("loader"),Md=Symbol("evictionPolicy"),Bd=Symbol("GLTFInstance");class Td extends Le{constructor(t){super(),this[vd]=(new jc).register((t=>new gd(t))),this[Bd]=t,this[Sd].setDRACOLoader(Ed),this[Sd].setKTX2Loader(Cd)}static setDRACODecoderLocation(t){_d=
|
||
|
/* @license
|
||
|
* Copyright 2021 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const wA=t=>void 0!==t.material&&t.userData&&t.userData.variantMaterials&&!!Array.from(t.userData.variantMaterials.values()).filter((t=>CA(t.material))),CA=t=>t&&t.isMaterial&&!Array.isArray(t);class bA{constructor(t){this.writer=t,this.name="KHR_materials_variants",this.variantNames=[]}beforeParse(t){const e=new Set;for(const i of t)i.traverse((t=>{if(!wA(t))return;const i=t.userData.variantMaterials,n=t.userData.variantData;for(const[t,s]of n){const n=i.get(s.index);n&&CA(n.material)&&e.add(t)}}));e.forEach((t=>this.variantNames.push(t)))}writeMesh(t,e){if(!wA(t))return;const i=t.userData,n=i.variantMaterials,s=i.variantData,r=new Map,a=new Map,o=Array.from(s.values()).sort(((t,e)=>t.index-e.index));for(const[t,e]of o.entries())a.set(e.index,t);for(const t of s.values()){const e=n.get(t.index);if(!e||!CA(e.material))continue;const i=this.writer.processMaterial(e.material);r.has(i)||r.set(i,{material:i,variants:[]}),r.get(i).variants.push(a.get(t.index))}const l=Array.from(r.values()).map((t=>t.variants.sort(((t,e)=>t-e))&&t)).sort(((t,e)=>t.material-e.material));if(0===l.length)return;const h=CA(i.originalMaterial)?this.writer.processMaterial(i.originalMaterial):-1;for(const t of e.primitives)h>=0&&(t.material=h),t.extensions=t.extensions||{},t.extensions[this.name]={mappings:l}}afterParse(){if(0===this.variantNames.length)return;const t=this.writer.json;t.extensions=t.extensions||{};const e=this.variantNames.map((t=>({name:t})));t.extensions[this.name]={variants:e},this.writer.extensionsUsed[this.name]=!0}}class IA{constructor(t,e,i,n,s){this.xrLight=t,this.renderer=e,this.lightProbe=i,this.xrWebGLBinding=null,this.estimationStartCallback=s,this.frameCallback=this.onXRFrame.bind(this);const r=e.xr.getSession();if(n&&"XRWebGLBinding"in window){const i=new Cs(16);t.environment=i.texture;const n=e.getContext();switch(r.preferredReflectionFormat){case"srgba8":n.getExtension("EXT_sRGB");break;case"rgba16f":n.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(r,n),this.lightProbe.addEventListener("reflectionchange",(()=>{this.updateReflection()}))}r.requestAnimationFrame(this.frameCallback)}updateReflection(){const t=this.renderer.properties.get(this.xrLight.environment);if(t){const e=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);e&&(t.__webglTexture=e,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(t,e){if(!this.xrLight)return;e.session.requestAnimationFrame(this.frameCallback);const i=e.getLightEstimate(this.lightProbe);if(i){this.xrLight.lightProbe.sh.fromArray(i.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const t=Math.max(1,Math.max(i.primaryLightIntensity.x,Math.max(i.primaryLightIntensity.y,i.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(i.primaryLightIntensity.x/t,i.primaryLightIntensity.y/t,i.primaryLightIntensity.z/t),this.xrLight.directionalLight.intensity=t,this.xrLight.directionalLight.position.copy(i.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class SA extends ao{constructor(t,e=!0){super(),this.lightProbe=new $l,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new Xl,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let i=null,n=!1;t.xr.addEventListener("sessionstart",(()=>{const s=t.xr.getSession();"requestLightProbe"in s&&s.requestLightProbe({reflectionFormat:s.preferredReflectionFormat}).then((s=>{i=new IA(this,t,s,e,(()=>{n=!0,this.dispatchEvent({type:"estimationstart"})}))}))})),t.xr.addEventListener("sessionend",(()=>{i&&(i.dispose(),i=null),n&&this.dispatchEvent({type:"estimationend"})})),this.dispose=()=>{i&&(i.dispose(),i=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/class MA{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,n){const s=2e-4*this.naturalFrequency;if(null==t||0===n)return e;if(t===e&&0===this.velocity)return e;if(i<0)return t;const r=t-e,a=this.velocity+this.naturalFrequency*r,o=r+i*a,l=Math.exp(-this.naturalFrequency*i),h=(a-this.naturalFrequency*o)*l,c=-this.naturalFrequency*(h+a*l);return Math.abs(h)<s*Math.abs(n)&&c*r>=0?(this.velocity=0,e):(this.velocity=h,e+o*l)}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const BA=.2,TA=Math.PI/24,RA=new Ye,DA=(t,e,i)=>{let n=e>0?i>0?0:-Math.PI/2:i>0?Math.PI/2:Math.PI;for(let s=0;s<=12;++s)t.push(e+.17*Math.cos(n),i+.17*Math.sin(n),0,e+BA*Math.cos(n),i+BA*Math.sin(n),0),n+=TA};class LA extends us{constructor(t,e){const i=new Kn,n=[],s=[],{size:r,boundingBox:a}=t,o=r.x/2,l=("back"===e?r.y:r.z)/2;DA(s,o,l),DA(s,-o,l),DA(s,-o,-l),DA(s,o,-l);const h=s.length/3;for(let t=0;t<h-2;t+=2)n.push(t,t+1,t+3,t,t+3,t+2);const c=h-2;n.push(c,c+1,1,c,1,0),i.setAttribute("position",new Hn(s,3)),i.setIndex(n),super(i),this.side=e;const u=this.material;switch(u.side=d,u.transparent=!0,u.opacity=0,this.goalOpacity=0,this.opacityDamper=new MA,this.hitPlane=new us(new Qs(2*(o+BA),2*(l+BA))),this.hitPlane.visible=!1,this.hitPlane.material.side=d,this.add(this.hitPlane),a.getCenter(this.position),e){case"bottom":this.rotateX(-Math.PI/2),this.shadowHeight=a.min.y,this.position.y=this.shadowHeight;break;case"back":this.shadowHeight=a.min.z,this.position.z=this.shadowHeight}t.target.add(this),this.offsetHeight=0}getHit(t,e,i){RA.set(e,-i),this.hitPlane.visible=!0;const n=t.positionAndNormalFromPoint(RA,this.hitPlane);return this.hitPlane.visible=!1,null==n?null:n.position}getExpandedHit(t,e,i){this.hitPlane.scale.set(1e3,1e3,1e3),this.hitPlane.updateMatrixWorld();const n=this.getHit(t,e,i);return this.hitPlane.scale.set(1,1,1),n}set offsetHeight(t){t-=.001,"back"===this.side?this.position.z=this.shadowHeight+t:this.position.y=this.shadowHeight+t}get offsetHeight(){return"back"===this.side?this.position.z-this.shadowHeight:this.position.y-this.shadowHeight}set show(t){this.goalOpacity=t?.75:0}updateOpacity(t){const e=this.material;e.opacity=this.opacityDamper.update(e.opacity,this.goalOpacity,t,1),this.visible=e.opacity>0}dispose(){var t;const{geometry:e,material:i}=this.hitPlane;e.dispose(),i.dispose(),this.geometry.dispose(),this.material.dispose(),null===(t=this.parent)||void 0===t||t.remove(this)}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const QA=(t,e)=>({type:"number",number:t,unit:e}),PA=(()=>{const t={};return e=>{const i=e;if(i in t)return t[i];const n=[];let s=0;for(;e;){if(++s>1e3){e="";break}const t=FA(e),i=t.nodes[0];if(null==i||0===i.terms.length)break;n.push(i),e=t.remainingInput}return t[i]=n}})(),FA=(()=>{const t=/^(\-\-|[a-z\u0240-\uffff])/i,e=/^([\*\+\/]|[\-]\s)/i,i=/^[\),]/;return n=>{const s=[];for(;n.length&&(n=n.trim(),!i.test(n));)if("("===n[0]){const{nodes:t,remainingInput:e}=OA(n);n=e,s.push({type:"function",name:{type:"ident",value:"calc"},arguments:t})}else if(t.test(n)){const t=NA(n),e=t.nodes[0];if("("===(n=t.remainingInput)[0]){const{nodes:t,remainingInput:i}=OA(n);s.push({type:"function",name:e,arguments:t}),n=i}else s.push(e)}else if(e.test(n))s.push({type:"operator",value:n[0]}),n=n.slice(1);else{const{nodes:t,remainingInput:e}="#"===n[0]?kA(n):UA(n);if(0===t.length)break;s.push(t[0]),n=e}return{nodes:[{type:"expression",terms:s}],remainingInput:n}}})(),NA=(()=>{const t=/[^a-z0-9_\-\u0240-\uffff]/i;return e=>{const i=e.match(t);return{nodes:[{type:"ident",value:null==i?e:e.substr(0,i.index)}],remainingInput:null==i?"":e.substr(i.index)}}})(),UA=(()=>{const t=/[\+\-]?(\d+[\.]\d+|\d+|[\.]\d+)([eE][\+\-]?\d+)?/,e=/^[a-z%]+/i,i=/^(m|mm|cm|rad|deg|[%])$/;return n=>{const s=n.match(t),r=null==s?"0":s[0],a=(n=null==r?n:n.slice(r.length)).match(e);let o=null!=a&&""!==a[0]?a[0]:null;const l=null==a?n:n.slice(o.length);return null==o||i.test(o)||(o=null),{nodes:[{type:"number",number:parseFloat(r)||0,unit:o}],remainingInput:l}}})(),kA=(()=>{const t=/^[a-f0-9]*/i;return e=>{const i=(e=e.slice(1).trim()).match(t);return{nodes:null==i?[]:[{type:"hex",value:i[0]}],remainingInput:null==i?e:e.slice(i[0].length)}}})(),OA=t=>{const e=[];for(t=t.slice(1).trim();t.length;){const i=FA(t);if(e.push(i.nodes[0]),","===(t=i.remainingInput.trim())[0])t=t.slice(1).trim();else if(")"===t[0]){t=t.slice(1);break}}return{nodes:e,remainingInput:t}},GA=Symbol("visitedTypes");class zA{constructor(t){this[GA]=t}walk(t,e){const i=t.slice();for(;i.length;){const t=i.shift();switch(this[GA].indexOf(t.type)>-1&&e(t),t.type){case"expression":i.unshift(...t.terms);break;case"function":i.unshift(t.name,...t.arguments)}}}}const HA=Object.freeze({type:"number",number:0,unit:null}),VA=(t,e=0)=>{let{number:i,unit:n}=t;if(isFinite(i)){if("rad"===t.unit||null==t.unit)return t}else i=e,n="rad";return{type:"number",number:("deg"===n&&null!=i?i:0)*Math.PI/180,unit:"rad"}},WA=(t,e=0)=>{let i,{number:n,unit:s}=t;if(isFinite(n)){if("m"===t.unit)return t}else n=e,s="m";switch(s){default:i=1;break;case"cm":i=.01;break;case"mm":i=.001}return{type:"number",number:i*n,unit:"m"}},qA=(()=>{const t=t=>t,e={rad:t,deg:VA,m:t,mm:WA,cm:WA};return(t,i=HA)=>{isFinite(t.number)||(t.number=i.number,t.unit=i.unit);const{unit:n}=t;if(null==n)return t;const s=e[n];return null==s?i:s(t)}})();
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var jA,YA,JA;const XA=Symbol("evaluate"),KA=Symbol("lastValue");class $A{constructor(){this[jA]=null}static evaluatableFor(t,e=HA){if(t instanceof $A)return t;if("number"===t.type)return"%"===t.unit?new ep(t,e):t;switch(t.name.value){case"calc":return new ap(t,e);case"env":return new np(t)}return HA}static evaluate(t){return t instanceof $A?t.evaluate():t}static isConstant(t){return!(t instanceof $A)||t.isConstant}static applyIntrinsics(t,e){const{basis:i,keywords:n}=e,{auto:s}=n;return i.map(((e,i)=>{const r=null==s[i]?e:s[i];let a=t[i]?t[i]:r;if("ident"===a.type){const t=a.value;t in n&&(a=n[t][i])}return null!=a&&"ident"!==a.type||(a=r),"%"===a.unit?QA(a.number/100*e.number,e.unit):(a=qA(a,e),a.unit!==e.unit?e:a)}))}get isConstant(){return!1}evaluate(){return this.isConstant&&null!=this[KA]||(this[KA]=this[XA]()),this[KA]}}jA=KA;const ZA=Symbol("percentage"),tp=Symbol("basis");class ep extends $A{constructor(t,e){super(),this[ZA]=t,this[tp]=e}get isConstant(){return!0}[XA](){return QA(this[ZA].number/100*this[tp].number,this[tp].unit)}}const ip=Symbol("identNode");class np extends $A{constructor(t){super(),this[YA]=null;const e=t.arguments.length?t.arguments[0].terms[0]:null;null!=e&&"ident"===e.type&&(this[ip]=e)}get isConstant(){return!1}[(YA=ip,XA)](){if(null!=this[ip]&&"window-scroll-y"===this[ip].value){return{type:"number",number:window.pageYOffset/(Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)-window.innerHeight)||0,unit:null}}return HA}}const sp=/[\*\/]/,rp=Symbol("evaluator");class ap extends $A{constructor(t,e=HA){if(super(),this[JA]=null,1!==t.arguments.length)return;const i=t.arguments[0].terms.slice(),n=[];for(;i.length;){const t=i.shift();if(n.length>0){const i=n[n.length-1];if("operator"===i.type&&sp.test(i.value)){const i=n.pop(),s=n.pop();if(null==s)return;n.push(new cp(i,$A.evaluatableFor(s,e),$A.evaluatableFor(t,e)));continue}}n.push("operator"===t.type?t:$A.evaluatableFor(t,e))}for(;n.length>2;){const[t,i,s]=n.splice(0,3);if("operator"!==i.type)return;n.unshift(new cp(i,$A.evaluatableFor(t,e),$A.evaluatableFor(s,e)))}1===n.length&&(this[rp]=n[0])}get isConstant(){return null==this[rp]||$A.isConstant(this[rp])}[(JA=rp,XA)](){return null!=this[rp]?$A.evaluate(this[rp]):HA}}const op=Symbol("operator"),lp=Symbol("left"),hp=Symbol("right");class cp extends $A{constructor(t,e,i){super(),this[op]=t,this[lp]=e,this[hp]=i}get isConstant(){return $A.isConstant(this[lp])&&$A.isConstant(this[hp])}[XA](){const t=qA($A.evaluate(this[lp])),e=qA($A.evaluate(this[hp])),{number:i,unit:n}=t,{number:s,unit:r}=e;if(null!=r&&null!=n&&r!=n)return HA;const a=n||r;let o;switch(this[op].value){case"+":o=i+s;break;case"-":o=i-s;break;case"/":o=i/s;break;case"*":o=i*s;break;default:return HA}return{type:"number",number:o,unit:a}}}const up=Symbol("evaluatables"),dp=Symbol("intrinsics");class Ap extends $A{constructor(t,e){super(),this[dp]=e;const i=t[0],n=null!=i?i.terms:[];this[up]=e.basis.map(((t,e)=>{const i=n[e];return null==i?{type:"ident",value:"auto"}:"ident"===i.type?i:$A.evaluatableFor(i,t)}))}get isConstant(){for(const t of this[up])if(!$A.isConstant(t))return!1;return!0}[XA](){const t=this[up].map((t=>$A.evaluate(t)));return $A.applyIntrinsics(t,this[dp]).map((t=>t.number))}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var pp,mp,gp,fp;const vp=Symbol("instances"),yp=Symbol("activateListener"),xp=Symbol("deactivateListener"),_p=Symbol("notifyInstances"),Ep=Symbol("notify"),wp=Symbol("callback");class Cp{constructor(t){this[wp]=t}static[_p](){for(const t of Cp[vp])t[Ep]()}static[(pp=vp,yp)](){window.addEventListener("scroll",this[_p],{passive:!0})}static[xp](){window.removeEventListener("scroll",this[_p])}observe(){0===Cp[vp].size&&Cp[yp](),Cp[vp].add(this)}disconnect(){Cp[vp].delete(this),0===Cp[vp].size&&Cp[xp]()}[Ep](){this[wp]()}}Cp[pp]=new Set;const bp=Symbol("computeStyleCallback"),Ip=Symbol("astWalker"),Sp=Symbol("dependencies"),Mp=Symbol("onScroll");class Bp{constructor(t){this[mp]={},this[gp]=new zA(["function"]),this[fp]=()=>{this[bp]({relatedState:"window-scroll"})},this[bp]=t}observeEffectsFor(t){const e={},i=this[Sp];this[Ip].walk(t,(t=>{const{name:n}=t,s=t.arguments[0].terms[0];if("env"===n.value&&null!=s&&"ident"===s.type&&"window-scroll-y"===s.value)if(null==e["window-scroll"]){const t="window-scroll"in i?i["window-scroll"]:new Cp(this[Mp]);t.observe(),delete i["window-scroll"],e["window-scroll"]=t}}));for(const t in i){i[t].disconnect()}this[Sp]=e}dispose(){for(const t in this[Sp]){this[Sp][t].disconnect()}}}mp=Sp,gp=Ip,fp=Mp;
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const Tp=t=>{const e=t.observeEffects||!1,i=t.intrinsics instanceof Function?t.intrinsics:()=>t.intrinsics;return(n,s)=>{const r=n.updated,a=n.connectedCallback,o=n.disconnectedCallback,l=Symbol(`${s}StyleEffector`),h=Symbol(`${s}StyleEvaluator`),c=Symbol(`${s}UpdateEvaluator`),u=Symbol(`${s}EvaluateAndSync`);Object.defineProperties(n,{[l]:{value:null,writable:!0},[h]:{value:null,writable:!0},[c]:{value:function(){const t=PA(this[s]);this[h]=new Ap(t,i(this)),null==this[l]&&e&&(this[l]=new Bp((()=>this[u]()))),null!=this[l]&&this[l].observeEffectsFor(t)}},[u]:{value:function(){if(null==this[h])return;const e=this[h].evaluate();this[t.updateHandler](e)}},updated:{value:function(t){t.has(s)&&(this[c](),this[u]()),r.call(this,t)}},connectedCallback:{value:function(){a.call(this),this.requestUpdate(s,this[s])}},disconnectedCallback:{value:function(){o.call(this),null!=this[l]&&(this[l].dispose(),this[l]=null)}}})}},Rp=t=>t<.5?2*t*t:(4-2*t)*t-1,Dp=(t,e,i=Rp)=>n=>t+(e-t)*i(n),Lp=t=>{const e=[],i=[];let n=t.initialValue;for(let s=0;s<t.keyframes.length;++s){const r=t.keyframes[s],{value:a,frames:o}=r,l=r.ease||Rp,h=Dp(n,a,l);e.push(h),i.push(o),n=a}return((t,e)=>{const i=e.map((n=0,t=>n+=t));var n;return e=>{e=Pc(e,0,1),e*=i[i.length-1];const n=i.findIndex((t=>t>=e)),s=n<1?0:i[n-1],r=i[n];return t[n]((e-s)/(r-s))}})(e,i)};
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var Qp=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Pp=Lp({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),Fp=Lp({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),Np="0deg 75deg 105%",Up=["front","right","back","left"],kp=["upper-","","lower-"],Op="auto",Gp="basic",zp="wiggle",Hp="none",Vp=()=>({basis:[VA(QA(30,"deg"))],keywords:{auto:[null]}}),Wp=()=>({basis:[VA(QA(12,"deg"))],keywords:{auto:[null]}}),qp=(()=>{const t=PA(Np)[0].terms,e=qA(t[0]),i=qA(t[1]);return t=>{const n=t[ty].idealCameraDistance();return{basis:[e,i,QA(n,"m")],keywords:{auto:[null,null,QA(105,"%")]}}}})(),jp=t=>{const e=2.2*t[ty].boundingSphere.radius;return{basis:[QA(-1/0,"rad"),QA(Math.PI/8,"rad"),QA(e,"m")],keywords:{auto:[null,null,null]}}},Yp=t=>{const e=qp(t),i=new Ap([],e).evaluate()[2];return{basis:[QA(1/0,"rad"),QA(Math.PI-Math.PI/8,"rad"),QA(i,"m")],keywords:{auto:[null,null,null]}}},Jp=t=>{const e=t[ty].boundingBox.getCenter(new _i);return{basis:[QA(e.x,"m"),QA(e.y,"m"),QA(e.z,"m")],keywords:{auto:[null,null,null]}}},Xp=Math.PI/2,Kp=Math.PI/3,$p=Xp/2,Zp=2*Math.PI,tm=Symbol("controls"),em=Symbol("panElement"),im=Symbol("promptElement"),nm=Symbol("promptAnimatedContainer"),sm=Symbol("fingerAnimatedContainers"),rm=Symbol("deferInteractionPrompt"),am=Symbol("updateAria"),om=Symbol("updateCameraForRadius"),lm=Symbol("cancelPrompts"),hm=Symbol("onChange"),cm=Symbol("onPointerChange"),um=Symbol("waitingToPromptUser"),dm=Symbol("userHasInteracted"),Am=Symbol("promptElementVisibleTime"),pm=Symbol("lastPromptOffset"),mm=Symbol("cancellationSource"),gm=Symbol("lastSpherical"),fm=Symbol("jumpCamera"),vm=Symbol("initialized"),ym=Symbol("maintainThetaPhi"),xm=Symbol("syncCameraOrbit"),_m=Symbol("syncFieldOfView"),Em=Symbol("syncCameraTarget"),wm=Symbol("syncMinCameraOrbit"),Cm=Symbol("syncMaxCameraOrbit"),bm=Symbol("syncMinFieldOfView"),Im=Symbol("syncMaxFieldOfView"),Sm=new Ye,Mm=new _i,Bm=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:Math.PI/8,maximumPolarAngle:Math.PI-Math.PI/8,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),Tm=Math.PI/8,Rm=.04,Dm={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class Lm extends Le{constructor(t,e,i){super(),this.camera=t,this.element=e,this.scene=i,this.orbitSensitivity=1,this.inputSensitivity=1,this.changeSource=Dm.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new Je,this.panPerPixel=0,this.spherical=new ph,this.goalSpherical=new ph,this.thetaDamper=new MA,this.phiDamper=new MA,this.radiusDamper=new MA,this.logFov=Math.log(Bm.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new MA,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=t=>{if(this.enablePan)t.preventDefault();else for(const t of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:t.id})))},this.touchModeZoom=(t,e)=>{if(!this._disableZoom){const t=this.twoTouchDistance(this.pointers[0],this.pointers[1]),e=Rm*(this.lastSeparation-t)*50/this.scene.height;this.lastSeparation=t,this.userAdjustOrbit(0,0,e)}this.panPerPixel>0&&this.movePan(t,e)},this.disableScroll=t=>{t.preventDefault()},this.touchModeRotate=(t,e)=>{const{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;const n=Math.abs(t),s=Math.abs(e);if(this.changeSource===Dm.USER_INTERACTION&&("pan-y"===i&&s>n||"pan-x"===i&&n>s))return void(this.touchMode=null);this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.han
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const Qm="not-presenting",Pm="session-started",Fm="object-placed",Nm="failed",Um="tracking",km="not-tracking",Om=new _i,Gm=new Ki,zm=new _i,Hm=new xs(45,1,.1,100);class Vm extends Le{constructor(t){super(),this.renderer=t,this.currentSession=null,this.placeOnWall=!1,this.placementBox=null,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.initialHitSource=null,this.transientHitTestSource=null,this.inputSource=null,this._presentedScene=null,this.resolveCleanup=null,this.exitWebXRButtonContainer=null,this.overlay=null,this.xrLight=null,this.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new _i,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.lastDragPosition=new _i,this.firstRatio=0,this.lastAngle=0,this.goalPosition=new _i,this.goalYaw=0,this.goalScale=1,this.xDamper=new MA,this.yDamper=new MA,this.zDamper=new MA,this.yawDamper=new MA,this.scaleDamper=new MA,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.dispose(),this.placementBox=new LA(this.presentedScene,this.placeOnWall?"back":"bottom"))},this.onSelectStart=t=>{const e=this.transientHitTestSource;if(null==e)return;const i=this.frame.getHitTestResultsForTransientInput(e),n=this.presentedScene,s=this.placementBox;if(1===i.length){this.inputSource=t.inputSource;const{axes:e}=this.inputSource.gamepad,i=s.getHit(this.presentedScene,e[0],e[1]);s.show=!0,null!=i?(this.isTranslating=!0,this.lastDragPosition.copy(i)):!1===this.placeOnWall&&(this.isRotating=!0,this.lastAngle=1.5*e[0])}else if(2===i.length){s.show=!0,this.isTwoFingering=!0;const{separation:t}=this.fingerPolar(i);this.firstRatio=t/n.scale.x}},this.onSelectEnd=()=>{this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.inputSource=null,this.goalPosition.y+=this.placementBox.offsetHeight*this.presentedScene.scale.x,this.placementBox.show=!1},this.threeRenderer=t.threeRenderer,this.threeRenderer.xr.enabled=!0}async resolveARSession(){Dc();const t=await navigator.xr.requestSession("immersive-ar",{requiredFeatures:["hit-test"],optionalFeatures:["dom-overlay","light-estimation"],domOverlay:this.overlay?{root:this.overlay}:void 0});return this.threeRenderer.xr.setReferenceSpaceType("local"),await this.threeRenderer.xr.setSession(t),this.threeRenderer.xr.cameraAutoUpdate=!1,t}get presentedScene(){return this._presentedScene}async supportsPresentation(){try{return Dc(),await navigator.xr.isSessionSupported("immersive-ar")}catch(t){return console.warn("Request to present in WebXR denied:"),console.warn(t),console.warn("Falling back to next ar-mode"),!1}}async present(t,e=!1){this.isPresenting&&console.warn("Cannot present while a model is already presenting");let i=new Promise(((t,e)=>{requestAnimationFrame((()=>t()))}));t.setHotspotsVisibility(!1),t.queueRender(),await i,this._presentedScene=t,this.overlay=t.element.shadowRoot.querySelector("div.default"),!0===e&&(this.xrLight=new SA(this.threeRenderer),this.xrLight.addEventListener("estimationstart",(()=>{if(!this.isPresenting||null==this.xrLight)return;const t=this.presentedScene;t.add(this.xrLight),t.environment=this.xrLight.environment})));const n=await this.resolveARSession();n.addEventListener("end",(()=>{this.postSessionCleanup()}),{once:!0});const s=t.element.shadowRoot.querySelector(".slot.exit-webxr-ar-button");s.classList.add("enabled"),s.addEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=s;const r=await n.requestReferenceSpace("viewer");this.tracking=!0,this.frames=0,this.initialized=!1,this.turntableRotation=t.yaw,this.goalYaw=t.yaw,this.goalScale=1,t.background=null,this.oldShadowIntensity=t.shadowIntensity,t.setShadowIntensity(.01),this.oldTarget.copy(t.getTarget()),t.element.addEventListener("load",this.onUpdateScene);const a=20*Math.PI/180,o=!0===this.placeOnWall?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(a),z:-Math.cos(a)});n.requestHitTestSource({space:r,offsetRay:o}).then((t=>
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/class Wm{constructor(t){t.threeRenderer.debug={checkShaderErrors:!0},Promise.resolve().then((()=>{self.dispatchEvent(new CustomEvent("model-viewer-renderer-debug",{detail:{renderer:t,THREE:{ShaderMaterial:vs,Texture:mi,Mesh:us,Scene:mo,PlaneGeometry:Qs,OrthographicCamera:Ws,WebGLRenderTarget:fi}}}))}))}addScene(t){self.dispatchEvent(new CustomEvent("model-viewer-scene-added-debug",{detail:{scene:t}}))}removeScene(t){self.dispatchEvent(new CustomEvent("model-viewer-scene-removed-debug",{detail:{scene:t}}))}}function qm(t){const e=new Map,i=new Map,n=t.clone();return jm(t,n,(function(t,n){e.set(n,t),i.set(t,n)})),n.traverse((function(t){if(!t.isSkinnedMesh)return;const n=t,s=e.get(t),r=s.skeleton.bones;n.skeleton=s.skeleton.clone(),n.bindMatrix.copy(s.bindMatrix),n.skeleton.bones=r.map((function(t){return i.get(t)})),n.bind(n.skeleton,n.bindMatrix)})),n}function jm(t,e,i){i(t,e);for(let n=0;n<t.children.length;n++)jm(t.children[n],e.children[n],i)}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const Ym=Symbol("prepared"),Jm=Symbol("prepare"),Xm=Symbol("preparedGLTF"),Km=Symbol("clone");class $m{constructor(t){this[Xm]=t}static prepare(t){if(null==t.scene)throw new Error("Model does not have a scene");if(t[Ym])return t;const e=this[Jm](t);return e[Ym]=!0,e}static[Jm](t){const{scene:e}=t,i=[e];return Object.assign(Object.assign({},t),{scene:e,scenes:i})}get parser(){return this[Xm].parser}get animations(){return this[Xm].animations}get scene(){return this[Xm].scene}get scenes(){return this[Xm].scenes}get cameras(){return this[Xm].cameras}get asset(){return this[Xm].asset}get userData(){return this[Xm].userData}clone(){return new(0,this.constructor)(this[Km]())}dispose(){this.scenes.forEach((t=>{t.traverse((t=>{if(!t.isMesh)return;const e=t;(Array.isArray(e.material)?e.material:[e.material]).forEach((t=>{for(const e in t){const i=t[e];if(i instanceof mi){const t=i.source.data;null!=t.close&&t.close(),i.dispose()}}t.dispose()})),e.geometry.dispose()}))}))}[Km](){const t=this[Xm],e=qm(this.scene);Zm(e,this.scene);const i=[e],n=t.userData?Object.assign({},t.userData):{};return Object.assign(Object.assign({},t),{scene:e,scenes:i,userData:n})}}const Zm=(t,e)=>{tg(t,e,((t,e)=>{void 0!==e.userData.variantMaterials&&(t.userData.variantMaterials=new Map(e.userData.variantMaterials)),void 0!==e.userData.variantData&&(t.userData.variantData=e.userData.variantData),void 0!==e.userData.originalMaterial&&(t.userData.originalMaterial=e.userData.originalMaterial)}))},tg=(t,e,i)=>{i(t,e);for(let n=0;n<t.children.length;n++)tg(t.children[n],e.children[n],i)},eg=Symbol("threeGLTF"),ig=Symbol("gltf"),ng=Symbol("gltfElementMap"),sg=Symbol("threeObjectMap"),rg=Symbol("parallelTraverseThreeScene"),ag=Symbol("correlateOriginalThreeGLTF"),og=Symbol("correlateCloneThreeGLTF");class lg{constructor(t,e,i,n){this[eg]=t,this[ig]=e,this[ng]=n,this[sg]=i}static from(t,e){return null!=e?this[og](t,e):this[ag](t)}static[ag](t){const e=t.parser.json,i=t.parser.associations,n=new Map,s={name:"Default"},r={type:"materials",index:-1};for(const t of i.keys())t instanceof Fn&&null==i.get(t)&&(r.index<0&&(null==e.materials&&(e.materials=[]),r.index=e.materials.length,e.materials.push(s)),t.name=s.name,i.set(t,{materials:r.index}));for(const[t,s]of i){if(s){const e=t;e.userData=e.userData||{},e.userData.associations=s}for(const i in s)if(null!=i&&"primitives"!==i){const r=i,a=(e[r]||[])[s[r]];if(null==a)continue;let o=n.get(a);null==o&&(o=new Set,n.set(a,o)),o.add(t)}}return new lg(t,e,i,n)}static[og](t,e){const i=e.threeGLTF,n=e.gltf,s=JSON.parse(JSON.stringify(n)),r=new Map,a=new Map;for(let n=0;n<i.scenes.length;n++)this[rg](i.scenes[n],t.scenes[n],((t,i)=>{const n=e.threeObjectMap.get(t);if(null!=n)for(const t in n)if(null!=t&&"primitives"!==t){const e=t,o=n[e],l=s[e][o],h=r.get(i)||{};h[e]=o,r.set(i,h);const c=a.get(l)||new Set;c.add(i),a.set(l,c)}}));return new lg(t,s,r,a)}static[rg](t,e,i){const n=(t,e)=>{if(i(t,e),t.isObject3D){if(t.isMesh)if(Array.isArray(t.material))for(let i=0;i<t.material.length;++i)n(t.material[i],e.material[i]);else n(t.material,e.material);for(let i=0;i<t.children.length;++i)n(t.children[i],e.children[i])}};n(t,e)}get threeGLTF(){return this[eg]}get gltf(){return this[ig]}get gltfElementMap(){return this[ng]}get threeObjectMap(){return this[sg]}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const hg=Symbol("correlatedSceneGraph");class cg extends $m{static[Jm](t){const e=super[Jm](t);null==e[hg]&&(e[hg]=lg.from(e));const{scene:i}=e,n=new zi(void 0,1/0);return i.traverse((t=>{t.renderOrder=1e3,t.frustumCulled=!1,t.name||(t.name=t.uuid);const i=t;if(i.isMesh){const{geometry:t}=i;i.castShadow=!0,i.isSkinnedMesh&&(t.boundingSphere=n,t.boundingBox=null);const s=i.material;if(!0===s.isMeshBasicMaterial&&(s.toneMapped=!1),s.shadowSide=c,s.aoMap){const{gltf:i,threeObjectMap:n}=e[hg],r=n.get(s);if(null!=i.materials&&null!=r&&null!=r.materials){const e=i.materials[r.materials];e.occlusionTexture&&0===e.occlusionTexture.texCoord&&null!=t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv)}}}})),e}get correlatedSceneGraph(){return this[Xm][hg]}[Km](){const t=super[Km](),e=new Map;return t.scene.traverse((t=>{if(t.isMesh){const i=t,n=i.material;if(null!=n){if(e.has(n.uuid))return void(i.material=e.get(n.uuid));i.material=n.clone(),e.set(n.uuid,i.material)}}})),t[hg]=lg.from(t,this.correlatedSceneGraph),t}}class ug extends Pl{constructor(t){super(t),this.type=yt}parse(t){const e=function(t,e){switch(t){case 1:console.error("THREE.RGBELoader Read Error: "+(e||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(e||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(e||""));break;default:console.error("THREE.RGBELoader: Error: "+(e||""))}return-1},i=function(t,e,i){e=e||1024;let n=t.pos,s=-1,r=0,a="",o=String.fromCharCode.apply(null,new Uint16Array(t.subarray(n,n+128)));for(;0>(s=o.indexOf("\n"))&&r<e&&n<t.byteLength;)a+=o,r+=o.length,n+=128,o+=String.fromCharCode.apply(null,new Uint16Array(t.subarray(n,n+128)));return-1<s&&(!1!==i&&(t.pos+=r+s+1),a+o.slice(0,s))},n=function(t,e,i,n){const s=t[e+3],r=Math.pow(2,s-128)/255;i[n+0]=t[e+0]*r,i[n+1]=t[e+1]*r,i[n+2]=t[e+2]*r,i[n+3]=1},s=function(t,e,i,n){const s=t[e+3],r=Math.pow(2,s-128)/255;i[n+0]=fh.toHalfFloat(Math.min(t[e+0]*r,65504)),i[n+1]=fh.toHalfFloat(Math.min(t[e+1]*r,65504)),i[n+2]=fh.toHalfFloat(Math.min(t[e+2]*r,65504)),i[n+3]=fh.toHalfFloat(1)},r=new Uint8Array(t);r.pos=0;const a=function(t){const n=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,r=/^\s*FORMAT=(\S+)\s*$/,a=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,h;if(t.pos>=t.byteLength||!(l=i(t)))return e(1,"no header found");if(!(h=l.match(/^#\?(\S+)/)))return e(3,"bad initial token");for(o.valid|=1,o.programtype=h[1],o.string+=l+"\n";l=i(t),!1!==l;)if(o.string+=l+"\n","#"!==l.charAt(0)){if((h=l.match(n))&&(o.gamma=parseFloat(h[1])),(h=l.match(s))&&(o.exposure=parseFloat(h[1])),(h=l.match(r))&&(o.valid|=2,o.format=h[1]),(h=l.match(a))&&(o.valid|=4,o.height=parseInt(h[1],10),o.width=parseInt(h[2],10)),2&o.valid&&4&o.valid)break}else o.comments+=l+"\n";return 2&o.valid?4&o.valid?o:e(3,"missing image size specifier"):e(3,"missing format specifier")}(r);if(-1!==a){const t=a.width,i=a.height,o=function(t,i,n){const s=i;if(s<8||s>32767||2!==t[0]||2!==t[1]||128&t[2])return new Uint8Array(t);if(s!==(t[2]<<8|t[3]))return e(3,"wrong scanline width");const r=new Uint8Array(4*i*n);if(!r.length)return e(4,"unable to allocate buffer space");let a=0,o=0;const l=4*s,h=new Uint8Array(4),c=new Uint8Array(l);let u=n;for(;u>0&&o<t.byteLength;){if(o+4>t.byteLength)return e(1);if(h[0]=t[o++],h[1]=t[o++],h[2]=t[o++],h[3]=t[o++],2!=h[0]||2!=h[1]||(h[2]<<8|h[3])!=s)return e(3,"bad rgbe scanline format");let i,n=0;for(;n<l&&o<t.byteLength;){i=t[o++];const s=i>128;if(s&&(i-=128),0===i||n+i>l)return e(3,"bad scanline data");if(s){const e=t[o++];for(let t=0;t<i;t++)c[n++]=e}else c.set(t.subarray(o,o+i),n),n+=i,o+=i}const d=s;for(let t=0;t<d;t++){let e=0;r[a]=c[t+e],e+=s,r[a+1]=c[t+e],e+=s,r[a+2]=c[t+e],e+=s,r[a+3]=c[t+e],a+=4}u--}return r}(r.subarray(r.pos),t,i);if(-1!==o){let e,r,l;switch(this.type){case vt:l=o.length/4;const t=new Float32Array(4*l);for(let e=0;e<l;e++)n(o,4*e,t,4*e);e=t,r=vt;break;case yt:l=o.length/4;const i=new Uint16Array(4*l);for(let t=0;t<l;t++)s(o,4*t,i
|
||
|
/* @license
|
||
|
* Copyright 2021 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/class dg extends mo{constructor(){super(),this.position.y=-3.5;const t=new As;t.deleteAttribute("uv");const e=new rl({metalness:0,side:u}),i=new rl({metalness:0}),n=new Yl(16777215,500,28,2);n.position.set(.418,16.199,.3),this.add(n);const s=new us(t,e);s.position.set(-.757,13.219,.717),s.scale.set(31.713,28.305,28.591),this.add(s);const r=new us(t,i);r.position.set(-10.906,2.009,1.846),r.rotation.set(0,-.195,0),r.scale.set(2.328,7.905,4.651),this.add(r);const a=new us(t,i);a.position.set(-5.607,-.754,-.758),a.rotation.set(0,.994,0),a.scale.set(1.97,1.534,3.955),this.add(a);const o=new us(t,i);o.position.set(6.167,.857,7.803),o.rotation.set(0,.561,0),o.scale.set(3.927,6.285,3.687),this.add(o);const l=new us(t,i);l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),this.add(l);const h=new us(t,i);h.position.set(2.291,-.756,-2.621),h.rotation.set(0,-.286,0),h.scale.set(1.546,1.552,1.496),this.add(h);const c=new us(t,i);c.position.set(-2.193,-.369,-5.547),c.rotation.set(0,.516,0),c.scale.set(3.875,3.487,2.986),this.add(c);const d=new us(t,this.createAreaLightMaterial(50));d.position.set(-16.116,14.37,8.208),d.scale.set(.1,2.428,2.739),this.add(d);const A=new us(t,this.createAreaLightMaterial(50));A.position.set(-16.109,18.021,-8.207),A.scale.set(.1,2.425,2.751),this.add(A);const p=new us(t,this.createAreaLightMaterial(17));p.position.set(14.904,12.198,-1.832),p.scale.set(.15,4.265,6.331),this.add(p);const m=new us(t,this.createAreaLightMaterial(43));m.position.set(-.462,8.89,14.52),m.scale.set(4.38,5.441,.088),this.add(m);const g=new us(t,this.createAreaLightMaterial(20));g.position.set(3.235,11.486,-12.541),g.scale.set(2.5,2,.1),this.add(g);const f=new us(t,this.createAreaLightMaterial(100));f.position.set(0,20,0),f.scale.set(1,.1,1),this.add(f)}createAreaLightMaterial(t){const e=new Nn;return e.color.setScalar(t),e}}
|
||
|
/* @license
|
||
|
* Copyright 2021 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/class Ag extends mo{constructor(){super(),this.position.y=-3.5;const t=new As;t.deleteAttribute("uv");const e=new rl({metalness:0,side:u}),i=new rl({metalness:0}),n=new Yl(16777215,400,28,2);n.position.set(.5,14,.5),this.add(n);const s=new us(t,e);s.position.set(0,13.2,0),s.scale.set(31.5,28.5,31.5),this.add(s);const r=new us(t,i);r.position.set(-10.906,-1,1.846),r.rotation.set(0,-.195,0),r.scale.set(2.328,7.905,4.651),this.add(r);const a=new us(t,i);a.position.set(-5.607,-.754,-.758),a.rotation.set(0,.994,0),a.scale.set(1.97,1.534,3.955),this.add(a);const o=new us(t,i);o.position.set(6.167,-.16,7.803),o.rotation.set(0,.561,0),o.scale.set(3.927,6.285,3.687),this.add(o);const l=new us(t,i);l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),this.add(l);const h=new us(t,i);h.position.set(2.291,-.756,-2.621),h.rotation.set(0,-.286,0),h.scale.set(1.546,1.552,1.496),this.add(h);const c=new us(t,i);c.position.set(-2.193,-.369,-5.547),c.rotation.set(0,.516,0),c.scale.set(3.875,3.487,2.986),this.add(c);const d=new us(t,this.createAreaLightMaterial(80));d.position.set(-14,10,8),d.scale.set(.1,2.5,2.5),this.add(d);const A=new us(t,this.createAreaLightMaterial(80));A.position.set(-14,14,-4),A.scale.set(.1,2.5,2.5),this.add(A);const p=new us(t,this.createAreaLightMaterial(23));p.position.set(14,12,0),p.scale.set(.1,5,5),this.add(p);const m=new us(t,this.createAreaLightMaterial(16));m.position.set(0,9,14),m.scale.set(5,5,.1),this.add(m);const g=new us(t,this.createAreaLightMaterial(80));g.position.set(7,8,-14),g.scale.set(2.5,2.5,.1),this.add(g);const f=new us(t,this.createAreaLightMaterial(80));f.position.set(-7,16,-14),f.scale.set(2.5,2.5,.1),this.add(f);const v=new us(t,this.createAreaLightMaterial(1));v.position.set(0,20,0),v.scale.set(.1,.1,.1),this.add(v)}createAreaLightMaterial(t){const e=new Nn;return e.color.setScalar(t),e}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const pg=20,mg=/\.hdr(\.js)?$/;class gg extends Le{constructor(t){super(),this.threeRenderer=t,this.lottieLoaderUrl="",this.withCredentials=!1,this._ldrLoader=null,this._hdrLoader=null,this._lottieLoader=null,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}get ldrLoader(){return null==this._ldrLoader&&(this._ldrLoader=new Fl),this._ldrLoader.setWithCredentials(this.withCredentials),this._ldrLoader}get hdrLoader(){return null==this._hdrLoader&&(this._hdrLoader=new ug,this._hdrLoader.setDataType(yt)),this._hdrLoader.setWithCredentials(this.withCredentials),this._hdrLoader}async getLottieLoader(){if(null==this._lottieLoader){const{LottieLoader:t}=await import(this.lottieLoaderUrl);this._lottieLoader=new t}return this._lottieLoader.setWithCredentials(this.withCredentials),this._lottieLoader}async loadImage(t){const e=await new Promise(((e,i)=>this.ldrLoader.load(t,e,(()=>{}),i)));return e.name=t,e.flipY=!1,e}async loadLottie(t,e){const i=await this.getLottieLoader();i.setQuality(e);const n=await new Promise(((e,n)=>i.load(t,e,(()=>{}),n)));return n.name=t,n}async loadEquirect(t,e=(()=>{})){try{const i=mg.test(t),n=i?this.hdrLoader:this.ldrLoader,s=await new Promise(((i,s)=>n.load(t,i,(t=>{e(t.loaded/t.total*.9)}),s)));return e(1),s.name=t,s.mapping=tt,i||(s.encoding=we),s}finally{e&&e(1)}}async generateEnvironmentMapAndSkybox(t=null,e=null,i=(()=>{})){const n="legacy"!==e;"legacy"!==e&&"neutral"!==e||(e=null),e=Rc(e);let s,r=Promise.resolve(null);t&&(r=this.loadEquirectFromUrl(t,i)),s=e?this.loadEquirectFromUrl(e,i):t?this.loadEquirectFromUrl(t,i):n?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();const[a,o]=await Promise.all([s,r]);if(null==a)throw new Error("Failed to load environment map.");return{environmentMap:a,skybox:o}}async loadEquirectFromUrl(t,e){if(!this.skyboxCache.has(t)){const i=this.loadEquirect(t,e);this.skyboxCache.set(t,i)}return this.skyboxCache.get(t)}async GenerateEnvironmentMap(t,e){await((t=0)=>new Promise((e=>setTimeout(e,t))))();const i=this.threeRenderer,n=new Cs(256,{generateMipmaps:!1,type:yt,format:Ct,encoding:Ee,depthBuffer:!0}),s=new Es(.1,100,n),r=s.renderTarget.texture;r.name=e;const a=i.outputEncoding,o=i.toneMapping;return i.toneMapping=q,i.outputEncoding=Ee,s.update(i,t),this.blurCubemap(n,.04),i.toneMapping=o,i.outputEncoding=a,r}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new dg,"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new Ag,"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(t,e){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(pg);const t=new As,e=new us(t,this.blurMaterial);this.blurScene=new mo,this.blurScene.add(e)}const i=t.clone();this.halfblur(t,i,e,"latitudinal"),this.halfblur(i,t,e,"longitudinal")}halfblur(t,e,i,n){const s=t.width,r=isFinite(i)?Math.PI/(2*s):2*Math.PI/39,a=i/r,o=isFinite(i)?1+Math.floor(3*a):pg;o>pg&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${o} samples when the maximum is set to 20`);const l=[];let h=0;for(let t=0;t<pg;++t){const e=t/a,i=Math.exp(-e*e/2);l.push(i),0==t?h+=i:t<o&&(h+=2*i)}for(let t=0;t<l.length;t++)l[t]=l[t]/h;const c=this.blurMaterial.uniforms;c.envMap.value=t.texture,c.samples.value=o,c.weights.value=l,c.latitudinal.value="latitudinal"===n,c.dTheta.value=r;new Es(.1,100,e).update(this.threeRenderer,this.blurScene)}getBlurShader(t){const e=new Float32Array(t),i=new _i(0,1,0);return new vs({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:i}},vertexShader:"\n \n varying vec3 vOutputDirection;\n \n void main() {\n \n vOutputDirection = vec3( position );\n gl_Position = projectionMatrix * model
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const fg=[1,.79,.62,.5,.4,.31,.25],vg="high-performance";class yg extends Le{constructor(t){super(),this.loader=new Td(cg),this.width=0,this.height=0,this.dpr=1,this.debugger=null,this.scenes=new Set,this.multipleScenesVisible=!1,this.lastTick=performance.now(),this.renderedLastFrame=!1,this.scaleStep=0,this.lastStep=3,this.avgFrameDuration=50,this.onWebGLContextLost=t=>{this.dispatchEvent({type:"contextlost",sourceEvent:t})},this.onWebGLContextRestored=()=>{var t;null===(t=this.textureUtils)||void 0===t||t.dispose(),this.textureUtils=new gg(this.threeRenderer);for(const t of this.scenes)t.element[Gc]()},this.dpr=Fc(),this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new po({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:t.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.outputEncoding=we,this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(1),this.debugger=t.debug?new Wm(this):null,this.threeRenderer.debug={checkShaderErrors:!!this.debugger},this.threeRenderer.toneMapping=X}catch(t){console.warn(t)}this.arRenderer=new Vm(this),this.textureUtils=this.canRender?new gg(this.threeRenderer):null,Td.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}static get singleton(){return this._singleton}static resetSingleton(){const t=this._singleton.dispose();for(const e of t)e.disconnectedCallback();this._singleton=new yg({powerPreference:(self.ModelViewerElement||{}).powerPreference||vg,debug:Nc()});for(const e of t)e.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return fg[this.scaleStep]}set minScale(t){let e=1;for(;e<fg.length&&!(fg[e]<t);)++e;this.lastStep=e-1}registerScene(t){this.scenes.add(t),t.forceRescale();const e=new Ye;this.threeRenderer.getSize(e),t.canvas.width=e.x,t.canvas.height=e.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop(((t,e)=>this.render(t,e))),null!=this.debugger&&this.debugger.addScene(t)}unregisterScene(t){this.scenes.delete(t),this.canvas3D.parentElement===t.canvas.parentElement&&t.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&0===this.scenes.size&&this.threeRenderer.setAnimationLoop(null),null!=this.debugger&&this.debugger.removeScene(t)}displayCanvas(t){return this.multipleScenesVisible?t.element[Zv]:this.canvas3D}countVisibleScenes(){const{canvas3D:t}=this;let e=0,i=null;for(const n of this.scenes){const{element:s}=n;s.modelIsVisible&&null==n.externalRenderer&&++e,t.parentElement===n.canvas.parentElement&&(i=n)}const n=e>1;if(null!=i){const e=n&&!this.multipleScenesVisible,s=!i.element.modelIsVisible;if(e||s){const{width:e,height:n}=this.sceneSize(i);this.copyPixels(i,e,n),t.parentElement.removeChild(t)}}this.multipleScenesVisible=n}updateRendererSize(){const t=Fc();if(t!==this.dpr)for(const t of this.scenes){const{element:e}=t;e[Ov](e.getBoundingClientRect())}let e=0,i=0;for(const t of this.scenes)e=Math.max(e,t.width),i=Math.max(i,t.height);if(e!==this.width||i!==this.height||t!==this.dpr){this.width=e,this.height=i,this.dpr=t,e=Math.ceil(e*t),i=Math.ceil(i*t),this.canRender&&this.threeRenderer.setSize(e,i,!1);for(const t of this.scenes){const{canvas:n}=t;n.width=e,n.height=i,t.forceRescale()}}}updateRendererScale(t){const e=this.scaleStep;this.avgFrameDuration+=Pc(.2*(t-this.avgFrameDuration),-5,5),this.avgFrameDuration>60?++this.scaleStep:this.avgFrameDuration<40&&this.scaleStep>0&&--this.scaleStep,this.scaleStep=Math.min(this.scaleStep,this.lastStep),e!==this.scaleStep&&(this.avgFrameDuration=50)}shouldRender(t){if(t.shouldRender())t.scaleStep!=this.scaleStep&&(t.scaleStep=this.scaleStep,this.rescaleCanvas(t));else{if(0==t.scaleStep)return!1;t.scaleStep=0,this.rescaleCanvas(t)}return!0}rescaleCanvas(t){const e=fg[t.scaleStep],i=Math.ceil(this.width/e),n=Math.ceil(this.he
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const xg=Symbol("correlatedObjects"),_g=Symbol("sourceObject"),Eg=Symbol("onUpdate");class wg{constructor(t,e,i=null){this[Eg]=t,this[_g]=e,this[xg]=i}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const Cg=new Nn,bg=new Qs(2,2);let Ig=0;const Sg=Symbol("threeTexture");class Mg extends wg{get[Sg](){var t;return console.assert(null!=this[xg]&&this[xg].size>0,"Image correlated object is undefined"),null===(t=this[xg])||void 0===t?void 0:t.values().next().value}constructor(t,e,i){super(t,i=null!=i?i:{name:e&&e.image&&e.image.src?e.image.src.split("/").pop():"adhoc_image",uri:e&&e.image&&e.image.src?e.image.src:"adhoc_image"+Ig++},new Set(e?[e]:[]))}get name(){return this[_g].name||""}get uri(){return this[_g].uri}get bufferView(){return this[_g].bufferView}get element(){const t=this[Sg];if(t&&(t.isCanvasTexture||t.isVideoTexture))return t.image}get animation(){const t=this[Sg];if(t&&t.isCanvasTexture&&t.animation)return t.animation}get type(){return null!=this.uri?"external":"embedded"}set name(t){this[_g].name=t}update(){const t=this[Sg];t&&t.isCanvasTexture&&!t.animation&&(this[Sg].needsUpdate=!0,this[Eg]())}async createThumbnail(t,e){const i=new mo;Cg.map=this[Sg];const n=new us(bg,Cg);i.add(n);const s=new Ws(-1,1,1,-1,0,1),{threeRenderer:r}=yg.singleton,a=new fi(t,e);r.setRenderTarget(a),r.render(i,s),r.setRenderTarget(null);const o=new Uint8Array(t*e*4);r.readRenderTargetPixels(a,0,0,t,e,o),Tv.width=t,Tv.height=e;const l=Tv.getContext("2d"),h=l.createImageData(t,e);return h.data.set(o),l.putImageData(h,0,0),new Promise((async(t,e)=>{Tv.toBlob((i=>{if(!i)return e("Failed to capture thumbnail.");t(URL.createObjectURL(i))}),"image/png")}))}}var Bg,Tg;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.NearestMipmapNearest=9984]="NearestMipmapNearest",t[t.LinearMipmapNearest=9985]="LinearMipmapNearest",t[t.NearestMipmapLinear=9986]="NearestMipmapLinear",t[t.LinearMipmapLinear=9987]="LinearMipmapLinear"}(Bg||(Bg={})),function(t){t[t.ClampToEdge=33071]="ClampToEdge",t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.Repeat=10497]="Repeat"}(Tg||(Tg={}));
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const Rg=(()=>{const t=[Bg.Nearest,Bg.Linear,Bg.NearestMipmapNearest,Bg.LinearMipmapLinear,Bg.NearestMipmapLinear,Bg.LinearMipmapLinear];return e=>t.indexOf(e)>-1})(),Dg=(()=>{const t=[Bg.Nearest,Bg.Linear];return e=>t.indexOf(e)>-1})(),Lg=(()=>{const t=[Tg.ClampToEdge,Tg.MirroredRepeat,Tg.Repeat];return e=>t.indexOf(e)>-1})(),Qg=Symbol("threeTextures"),Pg=Symbol("setProperty"),Fg=Symbol("sourceSampler");class Ng extends wg{get[Qg](){return console.assert(null!=this[xg]&&this[xg].size>0,"Sampler correlated object is undefined"),this[xg]}get[Fg](){return console.assert(null!=this[_g],"Sampler source is undefined"),this[_g]}constructor(t,e,i){null==(i=null!=i?i:{}).minFilter&&(i.minFilter=e?e.minFilter:Bg.LinearMipmapLinear),null==i.magFilter&&(i.magFilter=e?e.magFilter:Bg.Linear),null==i.wrapS&&(i.wrapS=e?e.wrapS:Tg.Repeat),null==i.wrapT&&(i.wrapT=e?e.wrapT:Tg.Repeat),super(t,i,new Set(e?[e]:[]))}get name(){return this[_g].name||""}get minFilter(){return this[Fg].minFilter}get magFilter(){return this[Fg].magFilter}get wrapS(){return this[Fg].wrapS}get wrapT(){return this[Fg].wrapT}setMinFilter(t){this[Pg]("minFilter",t)}setMagFilter(t){this[Pg]("magFilter",t)}setWrapS(t){this[Pg]("wrapS",t)}setWrapT(t){this[Pg]("wrapT",t)}[Pg](t,e){const i=this[Fg];if(null!=i){if(((t,e)=>{switch(t){case"minFilter":return Rg(e);case"magFilter":return Dg(e);case"wrapS":case"wrapT":return Lg(e);default:throw new Error(`Cannot configure property "${t}" on Sampler`)}})(t,e)){i[t]=e;for(const i of this[Qg])i[t]=e,i.needsUpdate=!0}this[Eg]()}}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const Ug=Symbol("image"),kg=Symbol("sampler");class Og extends wg{constructor(t,e,i=null,n=null,s=null){super(t,i||{},new Set(e?[e]:[])),this[kg]=new Ng(t,e,n),this[Ug]=new Mg(t,e,s)}get name(){return this[_g].name||""}set name(t){this[_g].name=t}get sampler(){return this[kg]}get source(){return this[Ug]}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var Gg,zg,Hg;const Vg=Symbol("texture"),Wg=Symbol("transform"),qg=Symbol("materials"),jg=Symbol("usage"),Yg=Symbol("onUpdate"),Jg=Symbol("activeVideo");var Xg;!function(t){t[t.Base=0]="Base",t[t.MetallicRoughness=1]="MetallicRoughness",t[t.Normal=2]="Normal",t[t.Occlusion=3]="Occlusion",t[t.Emissive=4]="Emissive"}(Xg||(Xg={}));class Kg{constructor(t,e,i,n,s,r){if(this[Gg]=null,this[zg]={rotation:0,scale:new Ye(1,1),offset:new Ye(0,0)},this[Hg]=!1,r&&i){const e=s.textures?s.textures[r.index]:null,n=e&&s.samplers?s.samplers[e.sampler]:null,a=e&&s.images?s.images[e.source]:null;this[Wg].rotation=i.rotation,this[Wg].scale.copy(i.repeat),this[Wg].offset.copy(i.offset),this[Vg]=new Og(t,i,e,n,a)}this[Yg]=t,this[qg]=n,this[jg]=e}get texture(){return this[Vg]}setTexture(t){var e,i;const n=null!=t?t.source[Sg]:null,s=null===(e=this[Vg])||void 0===e?void 0:e.source[Sg];if(null!=s&&s.isVideoTexture?this[Jg]=!1:(null===(i=this[Vg])||void 0===i?void 0:i.source.animation)&&this[Vg].source.animation.removeEventListener("enterFrame",this[Yg]),this[Vg]=t,null!=n&&n.isVideoTexture){const t=n.image;if(this[Jg]=!0,null!=t.requestVideoFrameCallback){const e=()=>{this[Jg]&&(this[Yg](),t.requestVideoFrameCallback(e))};t.requestVideoFrameCallback(e)}else{const t=()=>{this[Jg]&&(this[Yg](),requestAnimationFrame(t))};requestAnimationFrame(t)}}else null!=(null==t?void 0:t.source.animation)&&t.source.animation.addEventListener("enterFrame",this[Yg]);let r=we;if(this[qg])for(const t of this[qg]){switch(this[jg]){case Xg.Base:t.map=n;break;case Xg.MetallicRoughness:r=Ee,t.metalnessMap=n,t.roughnessMap=n;break;case Xg.Normal:r=Ee,t.normalMap=n;break;case Xg.Occlusion:r=Ee,t.aoMap=n;break;case Xg.Emissive:t.emissiveMap=n}t.needsUpdate=!0}n&&(n.encoding=r,n.rotation=this[Wg].rotation,n.repeat=this[Wg].scale,n.offset=this[Wg].offset),this[Yg]()}}Gg=Vg,zg=Wg,Hg=Jg;
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
const $g=Symbol("threeMaterials"),Zg=Symbol("baseColorTexture"),tf=Symbol("metallicRoughnessTexture");class ef extends wg{constructor(t,e,i,n){super(t,i,n),null==i.baseColorFactor&&(i.baseColorFactor=[1,1,1,1]),null==i.roughnessFactor&&(i.roughnessFactor=1),null==i.metallicFactor&&(i.metallicFactor=1);const{baseColorTexture:s,metallicRoughnessTexture:r}=i,{map:a,metalnessMap:o}=n.values().next().value;this[Zg]=new Kg(t,Xg.Base,a,n,e,s||null),this[tf]=new Kg(t,Xg.MetallicRoughness,o,n,e,r||null)}get[$g](){return this[xg]}get baseColorFactor(){return this[_g].baseColorFactor}get metallicFactor(){return this[_g].metallicFactor}get roughnessFactor(){return this[_g].roughnessFactor}get baseColorTexture(){return this[Zg]}get metallicRoughnessTexture(){return this[tf]}setBaseColorFactor(t){const e=new hi;t instanceof Array?e.fromArray(t):e.set(t).convertSRGBToLinear();for(const i of this[$g])i.color.set(e),t instanceof Array?i.opacity=t[3]:(t=[0,0,0,i.opacity],e.toArray(t));this[_g].baseColorFactor=t,this[Eg]()}setMetallicFactor(t){for(const e of this[$g])e.metalness=t;this[_g].metallicFactor=t,this[Eg]()}setRoughnessFactor(t){for(const e of this[$g])e.roughness=t;this[_g].roughnessFactor=t,this[Eg]()}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var nf;const sf=Symbol("pbrMetallicRoughness"),rf=Symbol("normalTexture"),af=Symbol("occlusionTexture"),of=Symbol("emissiveTexture"),lf=Symbol("backingThreeMaterial"),hf=Symbol("applyAlphaCutoff"),cf=Symbol("lazyLoadGLTFInfo"),uf=Symbol("initialize"),df=Symbol("getLoadedMaterial"),Af=Symbol("ensureMaterialIsLoaded"),pf=Symbol("gltfIndex"),mf=Symbol("setActive"),gf=Symbol("variantIndices"),ff=Symbol("isActive"),vf=Symbol("variantSet"),yf=Symbol("modelVariants");class xf extends wg{constructor(t,e,i,n,s,r,a,o){super(t,i,a),this[nf]=new Set,this[pf]=n,this[ff]=s,this[yf]=r,null==o?this[uf](e):this[cf]=o}get[(nf=vf,lf)](){return this[xg].values().next().value}[uf](t){const e=this[Eg],i=this[_g],n=this[xg];i.extensions&&i.extensions.KHR_materials_pbrSpecularGlossiness&&console.warn(`Material ${i.name} uses a deprecated extension\n "KHR_materials_pbrSpecularGlossiness", please use\n "pbrMetallicRoughness" instead. Specular Glossiness materials are\n no longer supported; to convert to metal-rough, see \n https://www.donmccurdy.com/2022/11/28/converting-gltf-pbr-materials-from-specgloss-to-metalrough/.`),null==i.pbrMetallicRoughness&&(i.pbrMetallicRoughness={}),this[sf]=new ef(e,t,i.pbrMetallicRoughness,n),null==i.emissiveFactor&&(i.emissiveFactor=[0,0,0]),null==i.doubleSided&&(i.doubleSided=!1),null==i.alphaMode&&(i.alphaMode="OPAQUE"),null==i.alphaCutoff&&(i.alphaCutoff=.5);const{normalTexture:s,occlusionTexture:r,emissiveTexture:a}=i,{normalMap:o,aoMap:l,emissiveMap:h}=n.values().next().value;this[rf]=new Kg(e,Xg.Normal,o,n,t,s||null),this[af]=new Kg(e,Xg.Occlusion,l,n,t,r||null),this[of]=new Kg(e,Xg.Emissive,h,n,t,a||null)}async[df](){if(null!=this[cf]){const{set:t,material:e}=await this[cf].doLazyLoad();return this[xg]=t,this[uf](this[cf].gltf),this[cf]=void 0,this.ensureLoaded=async()=>{},e}return this[xg].values().next().value}[Af](){if(null!=this[cf])throw new Error(`Material "${this.name}" has not been loaded, call 'await\n myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[df]()}get isLoaded(){return null==this[cf]}get isActive(){return this[ff]}[mf](t){this[ff]=t}get name(){return this[_g].name}set name(t){const e=this[_g];if(null!=e&&(e.name=t),null!=this[xg])for(const e of this[xg])e.name=t}get pbrMetallicRoughness(){return this[Af](),this[sf]}get normalTexture(){return this[Af](),this[rf]}get occlusionTexture(){return this[Af](),this[af]}get emissiveTexture(){return this[Af](),this[of]}get emissiveFactor(){return this[Af](),this[_g].emissiveFactor}get index(){return this[pf]}[gf](){return this[vf]}hasVariant(t){const e=this[yf].get(t);return null!=e&&this[vf].has(e.index)}setEmissiveFactor(t){this[Af]();const e=new hi;t instanceof Array?e.fromArray(t):e.set(t).convertSRGBToLinear();for(const t of this[xg])t.emissive.set(e);this[_g].emissiveFactor=e.toArray(),this[Eg]()}[hf](){this[Af]();const t=this[_g];for(const e of this[xg])"MASK"===this[_g].alphaMode?e.alphaTest=t.alphaCutoff:e.alphaTest=void 0,e.needsUpdate=!0}setAlphaCutoff(t){this[Af](),this[_g].alphaCutoff=t,this[hf](),this[Eg]()}getAlphaCutoff(){return this[Af](),this[_g].alphaCutoff}setDoubleSided(t){this[Af]();for(const e of this[xg])e.side=t?d:c,e.needsUpdate=!0;this[_g].doubleSided=t,this[Eg]()}getDoubleSided(){return this[Af](),this[_g].doubleSided}setAlphaMode(t){this[Af]();const e=(t,e)=>{t.transparent=e,t.depthWrite=!e};this[_g].alphaMode=t;for(const i of this[xg])e(i,"BLEND"===t),this[hf](),i.needsUpdate=!0;this[Eg]()}getAlphaMode(){return this[Af](),this[_g].alphaMode}}class _f{constructor(t){this.name="",this.children=new Array,this.name=t}}class Ef extends _f{constructor(t,e,i,n){super(t.name),this.materials=new Map,this.variantToMaterialMap=new Map,this.initialMaterialIdx=0,this.activeMaterialIdx=0,this.mesh=t;const{gltf:s,threeGLTF:r,threeObjectMap:a}=n;this.modelVariants=i,this.mesh.userData.variantData=i;const o=a.get(t.material);null!=o.materials?this.initialMaterialIdx=this.activeMaterialIdx=o.materials:console.error(`Primitive (${t.name}) missing init
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var wf,Cf,bf,If,Sf,Mf;const Bf=Symbol("materials"),Tf=Symbol("hierarchy"),Rf=Symbol("roots"),Df=Symbol("primitives"),Lf=Symbol("correlatedSceneGraph"),Qf=Symbol("prepareVariantsForExport"),Pf=Symbol("switchVariant"),Ff=Symbol("materialFromPoint"),Nf=Symbol("nodeFromPoint"),Uf=Symbol("nodeFromIndex"),kf=Symbol("variantData"),Of=Symbol("availableVariants"),Gf=Symbol("modelOnUpdate"),zf=Symbol("cloneMaterial");class Hf{constructor(t,e,i,n){this.gltf=t,this.gltfElementMap=e,this.mapKey=i,this.doLazyLoad=n}}class Vf{constructor(t,e=(()=>{})){this[wf]=new Array,this[Cf]=new Array,this[bf]=new Array,this[If]=new Array,this[Sf]=()=>{},this[Mf]=new Map,this[Gf]=e,this[Lf]=t;const{gltf:i,threeGLTF:n,gltfElementMap:s}=t;for(const[t,r]of i.materials.entries()){const a=s.get(r);if(null!=a)this[Bf].push(new xf(e,i,r,t,!0,this[kf],a));else{const r=(i.materials||[])[t],o=t,l=async()=>{const t=await n.parser.getDependency("material",o),e=new Set;return s.set(r,e),e.add(t),{set:e,material:t}};this[Bf].push(new xf(e,i,r,t,!1,this[kf],a,new Hf(i,s,r,l)))}}const r=new Map,a=new Array;for(const t of n.scene.children)a.push(t);for(;a.length>0;){const e=a.pop();let i=null;e instanceof us?(i=new Ef(e,this.materials,this[kf],t),this[Df].push(i)):i=new _f(e.name);const n=r.get(e);null!=n?n.children.push(i):this[Rf].push(i),this[Tf].push(i);for(const t of e.children)a.push(t),r.set(e,i)}}get materials(){return this[Bf]}[(wf=Bf,Cf=Tf,bf=Rf,If=Df,Sf=Gf,Mf=kf,Of)](){const t=Array.from(this[kf].values());return t.sort(((t,e)=>t.index-e.index)),t.map((t=>t.name))}getMaterialByName(t){const e=this[Bf].filter((e=>e.name===t));return e.length>0?e[0]:null}[Uf](t,e){const i=this[Tf].find((i=>{if(i instanceof Ef){const{meshes:n,primitives:s}=i.mesh.userData.associations;if(n==t&&s==e)return!0}return!1}));return null==i?null:i}[Nf](t){return this[Tf].find((e=>{if(e instanceof Ef){if(e.mesh===t.object)return!0}return!1}))}[Ff](t){return this[Nf](t).getActiveMaterial()}async[Pf](t){for(const e of this[Df])await e.enableVariant(t);for(const t of this.materials)t[mf](!1);for(const t of this[Df])this.materials[t.getActiveMaterial().index][mf](!0)}async[Qf](){const t=new Array;for(const e of this[Df])t.push(e.instantiateVariants());await Promise.all(t)}[zf](t,e){const i=this.materials[t];i.isLoaded||console.error("Cloning an unloaded material,\n call 'material.ensureLoaded() before cloning the material.");const n=i[xg],s=JSON.parse(JSON.stringify(i[_g]));s.name=e;this[Lf].gltf.materials.push(s);const r=new Set;for(const[t,i]of n.entries()){const s=i.clone();s.name=e+(n.size>1?"_inst"+t:""),r.add(s)}const a=new xf(this[Gf],this[Lf].gltf,s,this[Bf].length,!1,this[kf],r);return this[Bf].push(a),a}createMaterialInstanceForVariant(t,e,i,n=!0){let s=null;for(const n of this[Df]){const r=this[kf].get(i);null!=r&&n.variantInfo.has(r.index)||null!=n.getMaterial(t)&&(this.hasVariant(i)||this.createVariant(i),null==s&&(s=this[zf](t,e)),n.addVariant(s,i))}if(n&&null!=s){s[mf](!0),this.materials[t][mf](!1);for(const t of this[Df])t.enableVariant(i)}return s}createVariant(t){this[kf].has(t)?console.warn(`Variant '${t}'' already exists`):this[kf].set(t,{name:t,index:this[kf].size})}hasVariant(t){return this[kf].has(t)}setMaterialToVariant(t,e){if(null!=this[Of]().find((t=>t===e)))if(t<0||t>=this.materials.length)console.error("setMaterialToVariant(): materialIndex is out of bounds.");else for(const i of this[Df]){const n=i.getMaterial(t);null!=n&&i.addVariant(n,e)}else console.warn(`Can't add material to '${e}', the variant does not exist.'`)}updateVariantName(t,e){const i=this[kf].get(t);null!=i&&(i.name=e,this[kf].set(e,i),this[kf].delete(t))}deleteVariant(t){const e=this[kf].get(t);if(null!=e){for(const i of this.materials)i.hasVariant(t)&&i[vf].delete(e.index);for(const t of this[Df])t.deleteVariant(e.index);this[kf].delete(t)}}}
|
||
|
/* @license
|
||
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var Wf=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const qf=Symbol("currentGLTF"),jf=Symbol("originalGltfJson"),Yf=Symbol("model"),Jf=Symbol("getOnUpdateMethod"),Xf=Symbol("buildTexture"),Kf=new _i,$f=new _i,Zf=new _i,tv=new Je,ev=new Qn,iv=new xi;class nv extends Rd{constructor(t){super(document.createElement("div")),this.normal=new _i(0,1,0),this.initialized=!1,this.referenceCount=1,this.pivot=document.createElement("div"),this.slot=document.createElement("slot"),this.element.classList.add("annotation-wrapper"),this.slot.name=t.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(t.position),this.updateNormal(t.normal),this.surface=t.surface}get facingCamera(){return!this.element.classList.contains("hide")}show(){this.facingCamera&&this.initialized||this.updateVisibility(!0)}hide(){!this.facingCamera&&this.initialized||this.updateVisibility(!1)}increment(){this.referenceCount++}decrement(){return this.referenceCount>0&&--this.referenceCount,0===this.referenceCount}updatePosition(t){if(null==t)return;const e=PA(t)[0].terms;for(let t=0;t<3;++t)this.position.setComponent(t,qA(e[t]).number);this.updateMatrixWorld()}updateNormal(t){if(null==t)return;const e=PA(t)[0].terms;for(let t=0;t<3;++t)this.normal.setComponent(t,e[t].number)}updateSurface(t){if(!t&&this.initialized)return;const{mesh:e,tri:i,bary:n}=this;if(null==e||null==i||null==n)return;e.getVertexPosition(i.x,Kf),e.getVertexPosition(i.y,$f),e.getVertexPosition(i.z,Zf),Kf.toArray(tv.elements,0),$f.toArray(tv.elements,3),Zf.toArray(tv.elements,6),this.position.copy(n).applyMatrix3(tv);const s=this.parent;s.worldToLocal(e.localToWorld(this.position)),ev.set(Kf,$f,Zf),ev.getNormal(this.normal).transformDirection(e.matrixWorld);const r=s.parent;iv.setFromAxisAngle(Kf.set(0,1,0),-r.yaw),this.normal.applyQuaternion(iv)}orient(t){this.pivot.style.transform=`rotate(${t}rad)`}updateVisibility(t){t?this.element.classList.remove("hide"):this.element.classList.add("hide"),this.slot.assignedNodes().forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const i=e,n=i.dataset.visibilityAttribute;if(null!=n){const e=`data-${n}`;t?i.setAttribute(e,""):i.removeAttribute(e)}i.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:t}}))})),this.initialized=!0}}const sv={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float h;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}"},rv={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float v;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv
|
||
|
/* @license
|
||
|
* Copyright 2022 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/class ov extends wn{constructor(t,e,i){super(),this.camera=new Ws,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new Ka,this.horizontalBlurMaterial=new vs(sv),this.verticalBlurMaterial=new vs(rv),this.intensity=0,this.softness=1,this.boundingBox=new Ci,this.size=new _i,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;const{camera:n}=this;n.rotation.x=Math.PI/2,n.left=-.5,n.right=.5,n.bottom=-.5,n.top=.5,this.add(n);const s=new Qs,r=new Nn({opacity:1,transparent:!0,side:u});this.floor=new us(s,r),this.floor.userData.shadow=!0,n.add(this.floor),this.blurPlane=new us(s),this.blurPlane.visible=!1,n.add(this.blurPlane),t.target.add(this),this.depthMaterial.onBeforeCompile=function(t){t.fragmentShader=t.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * opacity );")},this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(t,e,i)}setScene(t,e,i){const{boundingBox:n,size:s,rotation:r,position:a}=this;if(this.isAnimated=t.animationNames.length>0,this.boundingBox.copy(t.boundingBox),this.size.copy(t.size),this.maxDimension=Math.max(s.x,s.y,s.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(a),"back"===i){const{min:t,max:e}=n;[t.y,t.z]=[t.z,t.y],[e.y,e.z]=[e.z,e.y],[s.y,s.z]=[s.z,s.y],r.x=Math.PI/2,r.y=Math.PI}else r.x=0,r.y=0;if(this.isAnimated){const t=n.min.y,e=n.max.y;s.y=this.maxDimension,n.expandByVector(s.subScalar(this.maxDimension).multiplyScalar(-.5)),n.min.y=t,n.max.y=e,s.set(this.maxDimension,e-t,this.maxDimension)}"bottom"===i?a.y=n.min.y:a.z=n.min.y,this.setSoftness(e)}setSoftness(t){this.softness=t;const{size:e,camera:i}=this,n=this.isAnimated?2:1,s=n*Math.pow(2,9-3*t);this.setMapSize(s);const r=e.y/2,a=e.y*n;i.near=0,i.far=av(a,r,t),this.depthMaterial.opacity=1/t,i.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(t){const{size:e}=this;this.isAnimated&&(t*=2);const i=Math.floor(e.x>e.z?t:t*e.x/e.z),n=Math.floor(e.x>e.z?t*e.z/e.x:t),s=10+i,r=10+n;if(null==this.renderTarget||this.renderTarget.width===s&&this.renderTarget.height===r||(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){const t={format:Ct};this.renderTarget=new fi(s,r,t),this.renderTargetBlur=new fi(s,r,t),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(e.x*(1+10/i),e.z*(1+10/n),1),this.needsUpdate=!0}setIntensity(t){this.intensity=t,t>0?(this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=t*av(.3,1,this.softness*this.softness)):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.intensity}setOffset(t){this.floor.position.z=-t+.001*this.maxDimension}render(t,e){e.overrideMaterial=this.depthMaterial;const i=t.getClearAlpha();t.setClearAlpha(0),this.floor.visible=!1;const n=t.xr.enabled;t.xr.enabled=!1;const s=t.getRenderTarget();t.setRenderTarget(this.renderTarget),t.render(e,this.camera),e.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(t),t.xr.enabled=n,t.setRenderTarget(s),t.setClearAlpha(i)}blurShadow(t){const{camera:e,horizontalBlurMaterial:i,verticalBlurMaterial:n,renderTarget:s,renderTargetBlur:r,blurPlane:a}=this;a.visible=!0,a.material=i,i.uniforms.h.value=1/this.renderTarget.width,i.uniforms.tDiffuse.value=this.renderTarget.texture,t.setRenderTarget(r),t.render(a,e),a.material=n,n.uniforms.v.value=1/this.renderTarget.height,n.uniforms.tDiffuse.value=this.renderTargetBlur.texture,t.setRenderTarget(s),t.render(a,e),a.visible=!1}dispose(){null!=this.renderTarget&&this.renderTarget.dispose(),null!=this.renderTargetBlur&&this.renderTargetBlur.dispose(),this.depthMaterial.dispose(),this.horizontalBlurMaterial.dispose(),this.verticalBlurMaterial.dispose(),this.floor.material.dispose(),this.floor.geometry.dispose(),this.blurPlane.geometry.dispose(),this.removeFromParent()}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/const lv=new _i,hv=new _i,cv=new _i,uv=new class{constructor(t,e,i=0,n=1/0){this.ray=new Xi(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new hn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!0,i=[]){return Ah(t,this,i,e),i.sort(dh),i}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)Ah(t[n],this,i,e);return i.sort(dh),i}},dv=new _i,Av=new Ye;class pv extends mo{constructor({canvas:t,element:e,width:i,height:n}){super(),this.annotationRenderer=new Nd,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.camera=new xs(45,1,.1,100),this.xrCamera=null,this.url=null,this.target=new wn,this.animationNames=[],this.boundingBox=new Ci,this.boundingSphere=new zi,this.size=new _i,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.canScale=!0,this.isDirty=!1,this.goalTarget=new _i,this.targetDamperX=new MA,this.targetDamperY=new MA,this.targetDamperZ=new MA,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.name="ModelScene",this.element=e,this.canvas=t,this.camera=new xs(45,1,.1,100),this.camera.name="MainCamera",this.add(this.target),this.setSize(i,n),this.target.name="Target",this.mixer=new uh(this.target);const{domElement:s}=this.annotationRenderer,{style:r}=s;r.display="none",r.pointerEvents="none",r.position="absolute",r.top="0",this.element.shadowRoot.querySelector(".default").appendChild(s),this.schemaElement.setAttribute("type","application/ld+json")}get context(){return this.canvas.getContext("2d")}getCamera(){return null!=this.xrCamera?this.xrCamera:this.camera}queueRender(){this.isDirty=!0}shouldRender(){return this.isDirty}hasRendered(){this.isDirty=!1}forceRescale(){this.scaleStep=-1,this.queueRender()}async setObject(t){this.reset(),this._model=t,this.target.add(t),await this.setupScene()}async setSource(t,e=(()=>{})){if(!t||t===this.url)return void e(1);if(this.reset(),this.url=t,null!=this.externalRenderer){const t=await this.externalRenderer.load(e);return this.boundingSphere.radius=t.framedRadius,void(this.idealAspect=t.fieldOfViewAspect)}let i;null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{i=await new Promise((async(i,n)=>{this.cancelPendingSourceChange=()=>n();try{i(await this.element[ry].loader.load(t,this.element,e))}catch(t){n(t)}}))}catch(t){if(null==t)return;throw t}this.cancelPendingSourceChange=null,this.reset(),this.url=t,this._currentGLTF=i,null!=i&&(this._model=i.scene,this.target.add(i.scene));const{animations:n}=i,s=new Map,r=[];for(const t of n)s.set(t.name,t),r.push(t.name);this.animations=n,this.animationsByName=s,this.animationNames=r,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity)}reset(){this.url=null,this.renderCount=0,this.queueRender(),null!=this.shadow&&this.shadow.setIntensity(0),this.bakedShadows.clear();const{_model:t}=this;null!=t&&(t.removeFromParent(),this._model=null);const e=this._currentGLTF;null!=e&&(e.dispose(),this._currentGLTF=null),null!=this.currentAnimationAction&&(this.currentAnimationAction.stop(),this.currentAnimationAction=null),this.mixer.stopAllAction(),this.mixer.uncacheRoot(this)}dispose(){this.reset(),null!=this.shadow&&(this.shadow.dispose(),this
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
class mv extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(){const t={progress:0,completed:!1};return this.ongoingActivities.add(t),1===this.ongoingActivityCount&&this.announceTotalProgress(t,0),e=>{let i;return i=Math.max(Pc(e,0,1),t.progress),i!==t.progress&&this.announceTotalProgress(t,i),t.progress}}announceTotalProgress(t,e){let i=0,n=0;1==e&&(t.completed=!0);for(const t of this.ongoingActivities){const{progress:e}=t;i+=1-e,!0===t.completed&&n++}const s=t.progress;t.progress=e,this.totalProgress+=(e-s)*(1-this.totalProgress)/i;const r=n===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:r}})),n===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/var gv,fv,vv,yv,xv,_v,Ev,wv,Cv,bv,Iv,Sv,Mv,Bv=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Tv=document.createElement("canvas"),Rv=Symbol("fallbackResizeHandler"),Dv=Symbol("defaultAriaLabel"),Lv=Symbol("resizeObserver"),Qv=Symbol("clearModelTimeout"),Pv=Symbol("onContextLost"),Fv=Symbol("loaded"),Nv=Symbol("status"),Uv=Symbol("onFocus"),kv=Symbol("onBlur"),Ov=Symbol("updateSize"),Gv=Symbol("intersectionObserver"),zv=Symbol("isElementInViewport"),Hv=Symbol("announceModelVisibility"),Vv=Symbol("ariaLabel"),Wv=Symbol("altDefaulted"),qv=Symbol("statusElement"),jv=Symbol("updateStatus"),Yv=Symbol("loadedTime"),Jv=Symbol("updateSource"),Xv=Symbol("markLoaded"),Kv=Symbol("container"),$v=Symbol("input"),Zv=Symbol("canvas"),ty=Symbol("scene"),ey=Symbol("needsRender"),iy=Symbol("tick"),ny=Symbol("onModelLoad"),sy=Symbol("onResize"),ry=Symbol("renderer"),ay=Symbol("progressTracker"),oy=Symbol("getLoaded"),ly=Symbol("getModelIsVisible"),hy=Symbol("shouldAttemptPreload"),cy=t=>({x:t.x,y:t.y,z:t.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),uy=t=>({u:t.x,v:t.y,toString(){return`${this.u} ${this.v}`}});class dy extends Dh{constructor(){super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[gv]=!1,this[fv]=!1,this[vv]=0,this[yv]="",this[xv]=null,this[_v]=Qc((()=>{const t=this.getBoundingClientRect();this[Ov](t)}),50),this[Ev]=Qc((t=>{const e=this.modelIsVisible;e!==t&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:e}}))}),0),this[wv]=null,this[Cv]=null,this[bv]=new mv,this[Iv]=()=>{this[qv].textContent=this[Nv]},this[Sv]=()=>{this[qv].textContent=""},this[Mv]=t=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:t.sourceEvent}}))},this.attachShadow({mode:"open"});const t=this.shadowRoot;let e,i;if((t=>{pc(Hc,t)})(t),this[Kv]=t.querySelector(".container"),this[$v]=t.querySelector(".userInput"),this[Zv]=t.querySelector("canvas"),this[qv]=t.querySelector("#status"),this[Dv]=this[$v].getAttribute("aria-label"),this.isConnected){const t=this.getBoundingClientRect();e=t.width,i=t.height}else e=300,i=150;this[ty]=new pv({canvas:this[Zv],element:this,width:e,height:i}),Promise.resolve().then((()=>{this[Ov](this.getBoundingClientRect())})),_c&&(this[Lv]=new ResizeObserver((t=>{if(!this[ry].isPresenting)for(let e of t)e.target===this&&this[Ov](e.contentRect)}))),Ec?this[Gv]=new IntersectionObserver((t=>{for(let e of t)if(e.target===this){const t=this.modelIsVisible;this[zv]=e.isIntersecting,this[Hv](t),this[zv]&&!this.loaded&&this[Jv]()}}),{root:null,rootMargin:"0px",threshold:1e-5}):this[zv]=!0}static get is(){return"model-viewer"}static set modelCacheSize(t){Td[Md].evictionThreshold=t}static get modelCacheSize(){return Td[Md].evictionThreshold}static set minimumRenderScale(t){t>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),t<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),yg.singleton.minScale=t}static get minimumRenderScale(){return yg.singleton.minScale}get loaded(){return this[oy]()}get[(gv=zv,fv=Fv,vv=Yv,yv=Nv,xv=Qv,_v=Rv,Ev=Hv,wv=Lv,Cv=Gv,bv=ay,ry)](){return yg.singleton}get modelIsVisible(){return this[ly]()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),_c?this[Lv].observe(this):self.addEventListener("resize",this[Rv]),Ec&&this[Gv].observe(this),this.addEventListener("focus",this[Uv]),this.addEventListener("blur",this[kv]);const t=this[ry];t.addEventListener("contextlost",this[Pv]),t.registerScene(this[ty]),null!=this[Qv]&&(self.clearTimeout(this[Qv]),this[Qv]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),_c?this[Lv].unobserve(this):self.removeEventListener("resize",this[Rv]),Ec&&this[Gv].unobserve(this),this.removeEventListener("focus",this[Uv]),this.removeE
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var Ay=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const py=Symbol("changeAnimation"),my=Symbol("paused"),gy={repetitions:1/0,pingpong:!1},fy=Symbol("hotspotMap"),vy=Symbol("mutationCallback"),yy=Symbol("observer"),xy=Symbol("addHotspot"),_y=Symbol("removeHotspot"),Ey=new Ki;
|
||
|
/*!
|
||
|
fflate - fast JavaScript compression/decompression
|
||
|
<https://101arrowz.github.io/fflate>
|
||
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
||
|
version 0.6.9
|
||
|
*/
|
||
|
var wy=function(t){return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};try{URL.revokeObjectURL(wy(""))}catch(Fh){wy=function(t){return"data:application/javascript;charset=UTF-8,"+encodeURI(t)}}var Cy=Uint8Array,by=Uint16Array,Iy=Uint32Array,Sy=new Cy([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),My=new Cy([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),By=new Cy([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ty=function(t,e){for(var i=new by(31),n=0;n<31;++n)i[n]=e+=1<<t[n-1];var s=new Iy(i[30]);for(n=1;n<30;++n)for(var r=i[n];r<i[n+1];++r)s[r]=r-i[n]<<5|n;return[i,s]},Ry=Ty(Sy,2),Dy=Ry[0],Ly=Ry[1];Dy[28]=258,Ly[258]=28;for(var Qy=Ty(My,0)[1],Py=new by(32768),Fy=0;Fy<32768;++Fy){var Ny=(43690&Fy)>>>1|(21845&Fy)<<1;Ny=(61680&(Ny=(52428&Ny)>>>2|(13107&Ny)<<2))>>>4|(3855&Ny)<<4,Py[Fy]=((65280&Ny)>>>8|(255&Ny)<<8)>>>1}var Uy=function(t,e,i){for(var n=t.length,s=0,r=new by(e);s<n;++s)++r[t[s]-1];var a,o=new by(e);for(s=0;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;if(i){a=new by(1<<e);var l=15-e;for(s=0;s<n;++s)if(t[s])for(var h=s<<4|t[s],c=e-t[s],u=o[t[s]-1]++<<c,d=u|(1<<c)-1;u<=d;++u)a[Py[u]>>>l]=h}else for(a=new by(n),s=0;s<n;++s)t[s]&&(a[s]=Py[o[t[s]-1]++]>>>15-t[s]);return a},ky=new Cy(288);for(Fy=0;Fy<144;++Fy)ky[Fy]=8;for(Fy=144;Fy<256;++Fy)ky[Fy]=9;for(Fy=256;Fy<280;++Fy)ky[Fy]=7;for(Fy=280;Fy<288;++Fy)ky[Fy]=8;var Oy=new Cy(32);for(Fy=0;Fy<32;++Fy)Oy[Fy]=5;var Gy=Uy(ky,9,0),zy=Uy(Oy,5,0),Hy=function(t){return(t/8|0)+(7&t&&1)},Vy=function(t,e,i){(null==e||e<0)&&(e=0),(null==i||i>t.length)&&(i=t.length);var n=new(t instanceof by?by:t instanceof Iy?Iy:Cy)(i-e);return n.set(t.subarray(e,i)),n},Wy=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>>8},qy=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>>8,t[n+2]|=i>>>16},jy=function(t,e){for(var i=[],n=0;n<t.length;++n)t[n]&&i.push({s:n,f:t[n]});var s=i.length,r=i.slice();if(!s)return[tx,0];if(1==s){var a=new Cy(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],h=0,c=1,u=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=i[i[h].f<i[u].f?h++:u++],l=i[h!=c&&i[h].f<i[u].f?h++:u++],i[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=r[0].s;for(n=1;n<s;++n)r[n].s>d&&(d=r[n].s);var A=new by(d+1),p=Yy(i[c-1],A,0);if(p>e){n=0;var m=0,g=p-e,f=1<<g;for(r.sort((function(t,e){return A[e.s]-A[t.s]||t.f-e.f}));n<s;++n){var v=r[n].s;if(!(A[v]>e))break;m+=f-(1<<p-A[v]),A[v]=e}for(m>>>=g;m>0;){var y=r[n].s;A[y]<e?m-=1<<e-A[y]++-1:++n}for(;n>=0&&m;--n){var x=r[n].s;A[x]==e&&(--A[x],++m)}p=e}return[new Cy(A),p]},Yy=function(t,e,i){return-1==t.s?Math.max(Yy(t.l,e,i+1),Yy(t.r,e,i+1)):e[t.s]=i},Jy=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new by(++e),n=0,s=t[0],r=1,a=function(t){i[n++]=t},o=1;o<=e;++o)if(t[o]==s&&o!=e)++r;else{if(!s&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(s),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(s);r=1,s=t[o]}return[i.subarray(0,n),e]},Xy=function(t,e){for(var i=0,n=0;n<e.length;++n)i+=t[n]*e[n];return i},Ky=function(t,e,i){var n=i.length,s=Hy(e+2);t[s]=255&n,t[s+1]=n>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var r=0;r<n;++r)t[s+r+4]=i[r];return 8*(s+4+n)},$y=function(t,e,i,n,s,r,a,o,l,h,c){Wy(e,c++,i),++s[256];for(var u=jy(s,15),d=u[0],A=u[1],p=jy(r,15),m=p[0],g=p[1],f=Jy(d),v=f[0],y=f[1],x=Jy(m),_=x[0],E=x[1],w=new by(19),C=0;C<v.length;++C)w[31&v[C]]++;for(C=0;C<_.length;++C)w[31&_[C]]++;for(var b=jy(w,7),I=b[0],S=b[1],M=19;M>4&&!I[By[M-1]];--M);var B,T,R,D,L=h+5<<3,Q=Xy(s,ky)+Xy(r,Oy)+a,P=Xy(s,d)+Xy(r,m)+a+14+3*M+Xy(w,I)+(2*w[16]+3*w[17]+7*w[18]);if(L<=Q&&L<=P)return Ky(e,c,t.subarray(l,l+h));if(Wy(e,c,1+(P<Q)),c+=2,P<Q){B=Uy(d,A,0),T=d,R=Uy(m,g,0),D=m;var F=Uy(I,S,0);Wy(e,c,y-257),Wy(e,c+5,E-1),Wy(e,c+10,M-4),c+=14;for(C=0;C<M;++C)Wy(e,c+3*C,I[By[C]]);c+=3*M;for(var N=[v,_],U=0;U<2;++U){var k=N[U];for(C=0;C<k.length;++C){var O=31&k[C];Wy(e,c,F[O]),c+=I[O],O>15&&(Wy(e,c,k[C]>>>5&127),c+=k[C]>>>12)}}}else B=Gy,T=ky,R=zy,D=Oy;for(C=0;C<o;++C)if(n[C]>255){O=n[C]>>>18&31;qy(e,c,
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/(t))})),s+="\n }\n }\n}\n\n",s+=function(t,e){const i=[];for(const n in t){const s=t[n];i.push(_x(s,e))}return`def "Materials"\n{\n${i.join("")}\n}\n\n`}(r,a),i[n]=cx(s),s=null;for(const t in a){const e=a[t],n=t.split("_")[1],s=1023===e.format,r=mx(e.image,n),o=await new Promise((t=>r.toBlob(t,s?"image/png":"image/jpeg",1)));i[`textures/Texture_${t}.${s?"png":"jpg"}`]=new Uint8Array(await o.arrayBuffer())}let o=0;for(const t in i){const e=i[t];o+=34+t.length;const n=63&o;if(4!==n){const s=new Uint8Array(64-n);i[t]=[e,{extra:{12345:s}}]}o=e.length}return function(t,e){e||(e={});var i={},n=[];ox(t,"",i,e);var s=0,r=0;for(var a in i){var o=i[a],l=o[0],h=o[1],c=0==h.level?0:8,u=(w=cx(a)).length,d=h.comment,A=d&&cx(d),p=A&&A.length,m=ux(h.extra);if(u>65535)throw"filename too long";var g=c?ax(l,h):l,f=g.length,v=ix();v.p(l),n.push(sx(h,{size:l.length,crc:v.d(),c:g,f:w,m:A,u:u!=a.length||A&&d.length!=p,o:s,compression:c})),s+=30+u+m+f,r+=76+2*(u+m)+(p||0)+f}for(var y=new Cy(r+22),x=s,_=r-s,E=0;E<n.length;++E){var w=n[E];dx(y,w.o,w,w.f,w.u,w.c.length);var C=30+w.f.length+ux(w.extra);y.set(w.c,w.o+C),dx(y,s,w,w.f,w.u,w.c.length,w.o,w.m),s+=16+C+(w.m?w.m.length:0)}return Ax(y,s,n.length,_,x),y}(i,{level:0})}}function mx(t,e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=1024/Math.max(t.width,t.height),n=document.createElement("canvas");n.width=t.width*Math.min(1,i),n.height=t.height*Math.min(1,i);const s=n.getContext("2d");if(s.drawImage(t,0,0,n.width,n.height),void 0!==e){const t=parseInt(e,16),i=(t>>16&255)/255,r=(t>>8&255)/255,a=(255&t)/255,o=s.getImageData(0,0,n.width,n.height),l=o.data;for(let t=0;t<l.length;t+=4)l[t+0]=l[t+0]*i,l[t+1]=l[t+1]*r,l[t+2]=l[t+2]*a;s.putImageData(o,0,0)}return n}throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}const gx=7;function fx(){return'#usda 1.0\n(\n customLayerData = {\n string creator = "Three.js USDZExporter"\n }\n metersPerUnit = 1\n upAxis = "Y"\n)\n\n'}function vx(t){const e=t.elements;return`( ${yx(e,0)}, ${yx(e,4)}, ${yx(e,8)}, ${yx(e,12)} )`}function yx(t,e){return`(${t[e+0]}, ${t[e+1]}, ${t[e+2]}, ${t[e+3]})`}function xx(t,e){if(void 0===t)return console.warn("USDZExporter: Normals missing."),Array(e).fill("(0, 0, 0)").join(", ");const i=[];for(let e=0;e<t.count;e++){const n=t.getX(e),s=t.getY(e),r=t.getZ(e);i.push(`(${n.toPrecision(gx)}, ${s.toPrecision(gx)}, ${r.toPrecision(gx)})`)}return i.join(", ")}function _x(t,e){const i=" ",n=[],s=[];function r(i,n,s){const r=i.id+(s?"_"+s.getHexString():""),a=1023===i.format;return e[r]=i,`\n def Shader "Transform2d_${n}" (\n sdrMetadata = {\n string role = "math"\n }\n )\n {\n uniform token info:id = "UsdTransform2d"\n float2 inputs:in.connect = </Materials/Material_${t.id}/uvReader_st.outputs:result>\n float2 inputs:scale = ${wx(i.repeat)}\n float2 inputs:translation = ${wx(i.offset)}\n float2 outputs:result\n }\n\n def Shader "Texture_${i.id}_${n}"\n {\n uniform token info:id = "UsdUVTexture"\n asset inputs:file = @textures/Texture_${r}.${a?"png":"jpg"}@\n float2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${n}.outputs:result>\n token inputs:wrapS = "repeat"\n token inputs:wrapT = "repeat"\n float outputs:r\n float outputs:g\n float outputs:b\n float3 outputs:rgb\n ${t.transparent||t.alphaTest>0?"float outputs:a":""}\n }`}return t.side===d&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",t),null!==t.map?(n.push(`${i}color3f inputs:diffuseColor.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:rgb>`),t.tra
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var Cx=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let bx=!1,Ix=!1;const Sx="#model-viewer-no-ar-fallback",Mx=(Bx=["quick-look","scene-viewer","webxr","none"],t=>{try{const e=PA(t),i=(e.length?e[0].terms:[]).filter((t=>t&&"ident"===t.type)).map((t=>t.value)).filter((t=>Bx.indexOf(t)>-1)),n=new Set;for(const t of i)n.add(t);return n}catch(t){}return new Set});var Bx;const Tx="quick-look",Rx="scene-viewer",Dx="webxr",Lx="none",Qx=Symbol("arButtonContainer"),Px=Symbol("enterARWithWebXR"),Fx=Symbol("openSceneViewer"),Nx=Symbol("openIOSARQuickLook"),Ux=Symbol("canActivateAR"),kx=Symbol("arMode"),Ox=Symbol("arModes"),Gx=Symbol("arAnchor"),zx=Symbol("preload"),Hx=Symbol("onARButtonContainerClick"),Vx=Symbol("onARStatus"),Wx=Symbol("onARTracking"),qx=Symbol("onARTap"),jx=Symbol("selectARMode"),Yx=Symbol("triggerLoad");
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var Jx=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Xx="auto",Kx="auto",$x="eager",Zx=Symbol("defaultProgressBarElement"),t_=Symbol("posterContainerElement"),e_=Symbol("defaultPosterElement"),i_=Symbol("shouldDismissPoster"),n_=Symbol("hidePoster"),s_=Symbol("modelIsRevealed"),r_=Symbol("updateProgressBar"),a_=Symbol("ariaLabelCallToAction"),o_=Symbol("onProgress");
|
||
|
/* @license
|
||
|
* Copyright 2019 Google LLC. All Rights Reserved.
|
||
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an 'AS IS' BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
var l_=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const h_=Math.PI/32,c_={basis:[VA(QA(h_,"rad"))],keywords:{auto:[null]}},u_=Symbol("autoRotateStartTime"),d_=Symbol("radiansPerSecond"),A_=Symbol("syncRotationRate"),p_=Symbol("onCameraChange"),m_=(t=>{var e,i,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[i]=t=>{t.forEach((t=>{t instanceof MutationRecord&&"childList"!==t.type||(t.addedNodes.forEach((t=>{this[xy](t)})),t.removedNodes.forEach((t=>{this[_y](t)})),this[ey]())}))},this[n]=new MutationObserver(this[vy])}connectedCallback(){super.connectedCallback();for(let t=0;t<this.children.length;++t)this[xy](this.children[t]);const{ShadyDOM:t}=self;null==t?this[yy].observe(this,{childList:!0}):this[yy]=t.observeChildren(this,this[vy])}disconnectedCallback(){super.disconnectedCallback();const{ShadyDOM:t}=self;null==t?this[yy].disconnect():t.unobserveChildren(this[yy])}[(e=fy,i=vy,n=yy,iy)](t,e){super[iy](t,e);const i=this[ty],{annotationRenderer:n}=i,s=i.getCamera();i.shouldRender()&&(i.updateSurfaceHotspots(),i.updateHotspotsVisibility(s.position),n.domElement.style.display="",n.render(i,s))}updateHotspot(t){const e=this[fy].get(t.name);null!=e&&(e.updatePosition(t.position),e.updateNormal(t.normal),e.surface=t.surface,this[ey]())}queryHotspot(t){const e=this[fy].get(t);if(null==e)return null;const i=cy(e.position),n=cy(e.normal),s=e.facingCamera,r=this[ty],a=r.getCamera(),o=new _i;o.setFromMatrixPosition(e.matrixWorld),o.project(a);const l=r.width/2,h=r.height/2;o.x=o.x*l+l,o.y=-o.y*h+h;const c=cy(new _i(o.x,o.y,o.z));return Number.isFinite(c.x)&&Number.isFinite(c.y)?{position:i,normal:n,canvasPosition:c,facingCamera:s}:null}positionAndNormalFromPoint(t,e){const i=this[ty],n=i.getNDC(t,e),s=i.positionAndNormalFromPoint(n);if(null==s)return null;Ey.copy(i.target.matrixWorld).invert();const r=cy(s.position.applyMatrix4(Ey)),a=cy(s.normal.transformDirection(Ey));let o=null;return null!=s.uv&&(o=uy(s.uv)),{position:r,normal:a,uv:o}}surfaceFromPoint(t,e){const i=this[ty],n=i.getNDC(t,e);return i.surfaceFromPoint(n)}[xy](t){if(!(t instanceof HTMLElement&&0===t.slot.indexOf("hotspot")))return;let e=this[fy].get(t.slot);null!=e?e.increment():(e=new nv({name:t.slot,position:t.dataset.position,normal:t.dataset.normal,surface:t.dataset.surface}),this[fy].set(t.slot,e),this[ty].addHotspot(e)),this[ty].queueRender()}[_y](t){if(!(t instanceof HTMLElement))return;const e=this[fy].get(t.slot);e&&(e.decrement()&&(this[ty].removeHotspot(e),this[fy].delete(t.slot)),this[ty].queueRender())}}return s})((t=>{var i,n,s;class r extends t{constructor(){super(...arguments),this[i]=void 0,this[n]=null,this[s]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[Yf]}get availableVariants(){return this.model?this.model[Of]():[]}get originalGltfJson(){return this[jf]}[(i=Yf,n=qf,s=jf,Jf)](){return()=>{this[ey]()}}[Xf](t){return t.encoding=we,t.wrapS=nt,t.wrapT=nt,new Og(this[Jf](),t)}async createTexture(t,e="image/png"){const{textureUtils:i}=this[ry],n=await i.loadImage(t);return n.userData.mimeType=e,this[Xf](n)}async createLottieTexture(t,e=1){const{textureUtils:i}=this[ry],n=await i.loadLottie(t,e);return this[Xf](n)}createVideoTexture(t){const e=document.createElement("video");e.src=t,e.muted=!0,e.play(),e.loop=!0;const i=new el(e);return this[Xf](i)}createCanvasTexture(){const t=document.createElement("canvas"),e=new sl(t);return this[Xf](e)}async updated(t){if(super.updated(t),t.has("variantName")){const t=this[ay].beginActivity();t(.1);const e=this[Yf],{variantName:i}=this;null!=e&&(await e[Pf](i),this[ey](),this.dispatchEvent(new CustomEvent("variant-applied"))),t(1)}if(t.has("orientation")||t.has("scale")){if(!this.loaded)return;const t=this[ty];t.applyTransform(),t.updateBoundingBox(),t.updateShadow(),this[ry].arRenderer.onUpdateScene(),this[ey]()}}[ny](){super[ny]();const{currentGLTF:t}=this[ty]
|
||
|
//# sourceMappingURL=model-viewer.min.js.map
|