1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5541],{5541:function(e,t,i){let s,r,a,n,A,o,l,h;i.r(t),i.d(t,{ModelViewer:function(){return op},default:function(){return op}});var c,g,u,d,p,m,I,f,E,C,B,Q,y,w,v,b,S,x,M,R,D,T,L,F,k,U,N,G,_,P,O,H,q,K,J,V,Y,j,z,W,X,Z,$,ee,et,ei=i(63976),es=i(76375),er=i(37686);/* @license 2 * Copyright 2019 Google LLC. All Rights Reserved. 3 * Licensed under the Apache License, Version 2.0 (the 'License'); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an 'AS IS' BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */let ea=null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported,en=ea&&null!=self.XRSession.prototype.requestHitTestSource,eA=null!=self.ResizeObserver,eo=null!=self.IntersectionObserver;(()=>{let e=navigator.userAgent||navigator.vendor||self.opera;/(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(e)||/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(e.substr(0,4))})(),/\bCrOS\b/.test(navigator.userAgent);let el=/android/i.test(navigator.userAgent),eh=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;/Safari\//.test(navigator.userAgent);let ec=/firefox/i.test(navigator.userAgent),eg=/OculusBrowser/.test(navigator.userAgent);eh&&/CriOS\//.test(navigator.userAgent);let eu=el&&!ec&&!eg,ed=!!(window.webkit&&window.webkit.messageHandlers),ep=(()=>
14{if(!eh)return!1;if(ed)return!!/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent);{let e=document.createElement("a");return!!(e.relList&&e.relList.supports&&e.relList.supports("ar"))}})(),em=e=>e&&"null"!==e?ef(e):null,eI=()=>{if(en)return;let e=[];throw ea||e.push("WebXR Device API"),en||e.push("WebXR Hit Test API"),Error(`The following APIs are required for AR, but are missing in this browser: ${e.join(", ")}`)},ef=e=>{let t=new URL(e,window.location.toString());return t.toString()},eE=(e,t)=>{let i=null,s=(...s)=>{null==i&&(e(...s),i=self.setTimeout(()=>i=null,t))};return s.flush=()=>{null!=i&&(self.clearTimeout(i),i=null)},s},eC=(e,t)=>{let i=null;return(...s)=>{null!=i&&self.clearTimeout(i),i=self.setTimeout(()=>{i=null,e(...s)},t)}},eB=(e,t,i)=>Math.max(t,Math.min(i,e)),eQ=(()=>{let e=(()=>{var e;if(null===(e=document.documentElement.getAttribute("itemtype"))||void 0===e?void 0:e.includes("schema.org/SearchResultsPage"))return!0;let t=null!=document.head?Array.from(document.head.querySelectorAll("meta")):[];for(let e of t)if("viewport"===e.name)return!0;return!1})();return e||console.warn('No <meta name="viewport"> detected; <model-viewer> will cap pixel density at 1.'),()=>e?window.devicePixelRatio:1})(),ey=(()=>{let e=RegExp("[?&]model-viewer-debug-mode(&|$)");return()=>self.ModelViewerElement&&self.ModelViewerElement.debugMode||self.location&&self.location.search&&self.location.search.match(e)})(),ew=(e=0)=>new Promise(t=>setTimeout(t,e)),ev=(e,t,i=null)=>new Promise(s=>{e.addEventListener(t,function r(a){(!i||i(a))&&(s(a),e.removeEventListener(t,r))})});/* @license 15 * Copyright 2019 Google LLC. All Rights Reserved. 16 * Licensed under the Apache License, Version 2.0 (the 'License'); 17 * you may not use this file except in compliance with the License. 18 * You may obtain a copy of the License at 19 * 20 * http://www.apache.org/licenses/LICENSE-2.0 21 * 22 * Unless required by applicable law or agreed to in writing, software 23 * distributed under the License is distributed on an 'AS IS' BASIS, 24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 * See the License for the specific language governing permissions and 26 * limitations under the License. 27 */var eb=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let eS=Symbol("currentEnvironmentMap"),ex=Symbol("currentBackground"),eM=Symbol("updateEnvironment"),eR=Symbol("cancelEnvironmentUpdate");/* @license 28 * Copyright 2019 Google LLC. All Rights Reserved. 29 * Licensed under the Apache License, Version 2.0 (the 'License'); 30 * you may not use this file except in compliance with the License. 31 * You may obtain a copy of the License at 32 * 33 * http://www.apache.org/licenses/LICENSE-2.0 34 * 35 * Unless required by applicable law or agreed to in writing, software 36 * distributed under the License is distributed on an 'AS IS' BASIS, 37 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 * See the License for the specific language governing permissions and 39 * limitations under the License. 40 */var eD=er.dy` 41<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000"> 42 <!-- NOTE(cdata): This SVG filter is a stop-gap until we can implement 43 support for dynamic re-coloring of UI components --> 44 <defs> 45 <filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%"> 46 <feGaussianBlur in="SourceAlpha" stdDeviation="1"/> 47 <feOffset dx="0" dy="0" result="offsetblur"/> 48 <feFlood flood-color="#000000"/> 49 <feComposite in2="offsetblur" operator="in"/> 50 <feMerge> 51 <feMergeNode/> 52 <feMergeNode in="SourceGraphic"/> 53 </feMerge> 54 </filter> 55 </defs>
56 <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"/> 57 <path d="M0 0h24v24H0z" fill="none"/> 58</svg>`,eT=er.dy` 59<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="36"> 60 <defs> 61 <path id="A" d="M.001.232h24.997V36H.001z" /> 62 </defs> 63 <g transform="translate(-11 -4)" fill="none" fill-rule="evenodd"> 64 <path fill-opacity="0" fill="#fff" d="M0 0h44v44H0z" /> 65 <g transform="translate(11 3)"> 66 <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" /> 67 <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" /> 68 <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" /> 69 <g transform="translate(0 .769)"> 70 <mask id="B" fill="#fff"> 71 <use xlink:href="#A" /> 72 </mask> 73 <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.
7304-.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)" /> 74 </g> 75 </g> 76 </g> 77</svg>`,eL=er.dy` 78<svg version="1.1" id="view_x5F_in_x5F_AR_x5F_icon" 79 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" 80 viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> 81<rect id="Bounding_Box" x="0" y="0" fill="none" width="24" height="24"/> 82<g id="Art_layer"> 83 <path d="M3,4c0-0.55,0.45-1,1-1h2V1H4C2.35,1,1,2.35,1,4v2h2V4z"/> 84 <path d="M20,3c0.55,0,1,0.45,1,1v2h2V4c0-1.65-1.35-3-3-3h-2v2H20z"/> 85 <path d="M4,21c-0.55,0-1-0.45-1-1v-2H1v2c0,1.65,1.35,3,3,3h2v-2H4z"/> 86 <path d="M20,21c0.55,0,1-0.45,1-1v-2h2v2c0,1.65-1.35,3-3,3h-2v-2H20z"/> 87 <g> 88 <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 89 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 90 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"/> 91 </g> 92</g> 93</svg>`;/* @license 94 * Copyright 2019 Google LLC. All Rights Reserved. 95 * Licensed under the Apache License, Version 2.0 (the 'License'); 96 * you may not use this file except in compliance with the License. 97 * You may obtain a copy of the License at 98 * 99 * http://www.apache.org/licenses/LICENSE-2.0 100 * 101 * Unless required by applicable law or agreed to in writing, software 102 * distributed under the License is distributed on an 'AS IS' BASIS, 103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 104 * See the License for the specific language governing permissions and 105 * limitations under the License. 106 */let eF=er.dy` 107<style> 108:host { 109 display: block; 110 position: relative; 111 contain: strict; 112 width: 300px; 113 height: 150px; 114} 115 116/* NOTE: This rule set is our integration surface area with the 117 * :focus-visible polyfill. 118 * 119 * @see https://github.com/WICG/focus-visible/pull/196 */ 120:host([data-js-focus-visible]:focus:not(.focus-visible)), 121:host([data-js-focus-visible]) :focus:not(.focus-visible) { 122 outline: none; 123} 124 125.container { 126 position: relative; 127 overflow: hidden; 128} 129 130.userInput { 131 width: 100%; 132 height: 100%; 133 display: none; 134 position: relative; 135} 136 137canvas { 138 position: absolute; 139 display: none; 140 pointer-events: none; 141 /* NOTE(cdata): Chrome 76 and below apparently have a bug 142 * that causes our canvas not to display pixels unless it is 143 * on its own render layer 144 * @see https://github.com/google/model-viewer/pull/755#issuecomment-536597893 145 */ 146 transform: translateZ(0); 147} 148 149.show { 150 display: block; 151} 152 153/* Adapted from HTML5 Boilerplate 154 * 155 * @see https://github.com/h5bp/html5-boilerplate/blob/ceb4620c78fc82e13534fc44202a3f168754873f/dist/css/main.css#L122-L133 */ 156.screen-reader-only { 157 border: 0; 158 left: 0; 159 top: 0; 160 clip: rect(0, 0, 0, 0); 161 height: 1px; 162 margin: -1px; 163 overflow: hidden; 164 padding: 0; 165 position: absolute; 166 white-space: nowrap; 167 width: 1px; 168 pointer-events: none; 169} 170 171.slot { 172 position: absolute; 173 pointer-events: none; 174 top: 0; 175 left: 0; 176 width: 100%; 177 height: 100%; 178} 179 180.slot > * { 181 pointer-events: initial; 182} 183 184.annotation-wrapper ::slotted(*) { 185 opacity: var(--max-hotspot-opacity, 1); 186 transition: opacity 0.3s; 187} 188 189.pointer-tumbling .annotation-wrapper ::slotted(*) { 190 pointer-events: none; 191} 192 193.annotation-wrapper ::slotted(*) { 194 pointer-events: initial; 195} 196 197.annotation-wrapper.hide ::slotted(*) { 198 opacity: var(--min-hotspot-opacity, 0.25); 199} 200 201.slot.poster { 202 display: none; 203 background-color: inherit; 204} 205 206.slot.poster.show { 207 display: inherit; 208} 209 210.slot.poster > * { 211 pointer-events: initial; 212} 213 214.slot.poster:not(.show) > * { 215 pointer-events: none; 216} 217 218#default-poster { 219 width: 100%; 220 height: 100%; 221 /* The default poster is a <button> so we need to set display 222 * to prevent it from being affected by text-align: */ 223 display: block; 224 position: absolute; 225 border: none; 226 padding: 0; 227 background-size: contain; 228 background-repeat: no-repeat; 229 background-position: center; 230 background-color: #fff0; 231} 232 233#default-progress-bar { 234 display: block; 235 position: relative; 236 width: 100%; 237 height: 100%; 238 pointer-events: none; 239 overflow: hidden; 240} 241 242#default-progress-bar > .bar { 243 position: absolute; 244 top: 0; 245 left: 0; 246 width: 100%; 247 height: var(--progress-bar-height, 5px); 248 background-color: var(--progress-bar-color, rgba(0, 0, 0, 0.4)); 249 transition: transform 0.09s; 250 transform-origin: top left; 251 transform: scaleX(0); 252 overflow: hidden; 253} 254 255#default-progress-bar > .bar.hide { 256 transition: opacity 0.3s 1s; 257 opacity: 0; 258} 259 260.centered { 261 align-items: center; 262 justify-content: center; 263} 264 265.cover { 266 position: absolute; 267 top: 0; 268 left: 0; 269 width: 100%; 270 height: 100%; 271 pointer-events: none; 272} 273 274.slot.interaction-prompt { 275 display: var(--interaction-prompt-display, flex); 276 overflow: hidden; 277 opacity: 0; 278 will-change: opacity; 279 transition: opacity 0.3s; 280} 281 282.slot.interaction-prompt.visible { 283 opacity: 1; 284} 285 286.animated-container { 287 will-change: transform, opacity; 288 opacity: 0; 289 transition: opacity 0.3s; 290} 291 292.slot.interaction-prompt > * { 293 pointer-events: none; 294} 295 296.slot.ar-button { 297 -moz-user-select: none; 298 -webkit-tap-highlight-color: transparent; 299 user-select: none; 300 301 display: var(--ar-button-display, block); 302} 303 304.slot.ar-button:not(.enabled) { 305 display: none; 306} 307 308.fab { 309 display: flex; 310 align-items: center; 311 justify-content: center; 312 box-sizing: border-box; 313 width: 40px; 314 height: 40px; 315 cursor: pointer; 316 background-color: #fff; 317 box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15); 318 border-radius: 100px; 319} 320 321.fab > * { 322 opacity: 0.87; 323} 324 325#default-ar-button { 326 position: absolute; 327 bottom: 16px; 328 right: 16px; 329 transform: scale(var(--ar-button-scale, 1)); 330 transform-origin: bottom right; 331} 332 333.slot.pan-target { 334 display: block; 335 position: absolute; 336 width: 0; 337 height: 0; 338 left: 50%; 339 top: 50%; 340 transform: translate3d(-50%, -50%, 0); 341 background-color: transparent; 342 opacity: 0; 343 transition: opacity 0.3s; 344} 345 346#default-pan-target { 347 width: 6px; 348 height: 6px; 349 border-radius: 6px; 350 border: 1px solid white; 351 box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.8); 352} 353 354.slot.default { 355 pointer-events: none; 356} 357 358.slot.progress-bar { 359 pointer-events: none; 360} 361 362.slot.exit-webxr-ar-button { 363 pointer-events: none; 364} 365 366.slot.exit-webxr-ar-button:not(.enabled) { 367 display: none; 368} 369 370#default-exit-webxr-ar-button { 371 display: flex; 372 align-items: center; 373 justify-content: center; 374 position: absolute; 375 top: env(safe-area-inset-top, 16px); 376 right: 16px; 377 width: 40px; 378 height: 40px; 379 box-sizing: border-box; 380} 381 382#default-exit-webxr-ar-button > svg { 383 fill: #fff; 384} 385</style> 386<div class="container"> 387 <div class="userInput" tabindex="0" role="img" 388 aria-label="3D model"> 389 <div class="slot canvas"> 390 <slot name="canvas"> 391 <canvas></canvas> 392 </slot> 393 </div> 394 395 </div> 396 397 <!-- NOTE(cdata): We need to wrap slots because browsers without ShadowDOM 398 will have their <slot> elements removed by ShadyCSS --> 399 <div class="slot poster"> 400 <slot name="poster"> 401 <button type="button" id="default-poster" aria-hidden="true" aria-label="Loading 3D model"></button> 402 </slot> 403 </div> 404 405 <div class="slot ar-button"> 406 <slot name="ar-button"> 407 <a id="default-ar-button" part="default-ar-button" class="fab" 408 tabindex="2" 409 aria-label="View in your space"> 410 ${eL} 411 </a> 412 </slot> 413 </div> 414 415 <div class="slot pan-target"> 416 <slot name="pan-target"> 417 <div id="default-pan-target"> 418 </div> 419 </slot> 420 </div> 421 422 <div class="slot interaction-prompt cover centered"> 423 <div id="prompt" class="animated-container"> 424 <slot name="interaction-prompt" aria-hidden="true"> 425 ${eT} 426 </slot> 427 </div> 428 </div> 429 430 <div id="finger0" class="animated-container cover"> 431 <slot name="finger0" aria-hidden="true"> 432 </slot> 433 </div> 434 <div id="finger1" class="animated-container cover"> 435 <slot name="finger1" aria-hidden="true"> 436 </slot> 437 </div> 438 439 <div class="slot default"> 440 <slot></slot> 441 442 <div class="slot progress-bar"> 443 <slot name="progress-bar"> 444 <div id="default-progress-bar" aria-hidden="true"> 445 <div class="bar" part="default-progress-bar"></div> 446 </div> 447 </slot> 448 </div> 449 450 <div class="slot exit-webxr-ar-button"> 451 <slot name="exit-webxr-ar-button"> 452 <a id="default-exit-webxr-ar-button" part="default-exit-webxr-ar-button" 453 tabindex="3" 454 aria-label="Exit AR" 455 aria-hidden="true"> 456 ${eD} 457 </a> 458 </slot> 459 </div> 460 </div> 461</div> 462<div class="screen-reader-only" role="region" aria-label="Live announcements"> 463 <span id="status" role="status"></span> 464</div>`,ek=e=>{(0,er.sY)(eF,e)},eU=new WeakMap;class eN extends es.aNw{constructor(e){super(e),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(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,s){let r=new es.hH6(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,e=>{this.decodeDracoFile(e,t).catch(s)},i,s)}decodeDracoFile(e,t,i,s){let r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){let i;let s=JSON.stringify(t);if(eU.has(e)){let t=eU.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r=this.workerNextTaskID++,a=e.byteLength,n=this._getWorker(r,a).then(s=>(i=s,new Promise((s,a)=>
464{i._callbacks[r]={resolve:s,reject:a},i.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return n.catch(()=>!0).then(()=>{i&&r&&this._releaseTask(i,r)}),eU.set(e,{key:s,promise:n}),n}_createGeometry(e){let t=new es.u9r;e.index&&t.setIndex(new es.TlE(e.index.array,1));for(let i=0;i<e.attributes.length;i++){let s=e.attributes[i],r=s.name,a=s.array,n=s.itemSize;t.setAttribute(r,new es.TlE(a,n))}return t}_loadLibrary(e,t){let i=new es.hH6(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((t,s)=>{i.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let i=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=eG.toString(),r=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let i=t.data;switch(i.type){case"decode":e._callbacks[i.id].resolve(i);break;case"error":e._callbacks[i.id].reject(i);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+i.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function eG(){let e,t;onmessage=function(i){let s=i.data;switch(s.type){case"init":e=s.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let r=s.buffer,a=s.taskConfig;t.then(e=>{let t=e.draco,i=new t.Decoder,n=new t.DecoderBuffer;n.Init(new Int8Array(r),r.byteLength);try{let e=function(e,t,i,s){let r,a;let n=s.attributeIDs,A=s.attributeTypes,o=t.GetEncodedGeometryType(i);if(o===e.TRIANGULAR_MESH)r=new e.Mesh,a=t.DecodeBufferToMesh(i,r);else if(o===e.POINT_CLOUD)r=new e.PointCloud,a=t.DecodeBufferToPointCloud(i,r);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!a.ok()||0===r.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());let l={index:null,attributes:[]};for(let i in n){let a,o;let h=self[A[i]];if(s.useUniqueIDs)o=n[i],a=t.GetAttributeByUniqueId(r,o);else{if(-1===(o=t.GetAttributeId(r,e[n[i]])))continue;a=t.GetAttribute(r,o)}l.attributes.push(function(e,t,i,s,r,a){let n=a.num_components(),A=i.num_points(),o=A*n,l=o*r.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,r),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(i,a,h,l,c);let g=new r(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:s,array:g,itemSize:n}}(e,t,r,i,h,a))}return o===e.TRIANGULAR_MESH&&(l.index=function(e,t,i){let s=i.num_faces(),r=3*s,a=4*r,n=e._malloc(a);t.GetTrianglesUInt32Array(i,a,n);let A=new Uint32Array(e.HEAPF32.buffer,n,r).slice();return e._free(n),{array:A,itemSize:1}}(e,t,r)),e.destroy(r),l}(t,i,n,a),r=e.attributes.map(e=>e.array.buffer);e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(n),t.destroy(i)}})}}}class e_ extends es.aNw{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new eJ(e)}
464),this.register(function(e){return new eZ(e)}),this.register(function(e){return new e$(e)}),this.register(function(e){return new eY(e)}),this.register(function(e){return new ej(e)}),this.register(function(e){return new ez(e)}),this.register(function(e){return new eW(e)}),this.register(function(e){return new eK(e)}),this.register(function(e){return new eX(e)}),this.register(function(e){return new eV(e)}),this.register(function(e){return new eH(e)}),this.register(function(e){return new e0(e)}),this.register(function(e){return new e1(e)})}load(e,t,i,s){let r;let a=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:es.Zp0.extractUrlBase(e),this.manager.itemStart(e);let n=function(t){s?s(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},A=new es.hH6(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(i){try{a.parse(i,r,function(i){t(i),a.manager.itemEnd(e)},n)}catch(e){n(e)}},i,n)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let r;let a={},n={};if("string"==typeof e)r=JSON.parse(e);else if(e instanceof ArrayBuffer){let t=es.Zp0.decodeText(new Uint8Array(e,0,4));if(t===e2){try{a[eO.KHR_BINARY_GLTF]=new e4(e)}catch(e){s&&s(e);return}r=JSON.parse(a[eO.KHR_BINARY_GLTF].content)}else r=JSON.parse(es.Zp0.decodeText(new Uint8Array(e)))}else r=e;if(void 0===r.asset||r.asset.version[0]<2){s&&s(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let A=new tm(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});A.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](A);n[t.name]=t,a[t.name]=!0}if(r.extensionsUsed)for(let e=0;e<r.extensionsUsed.length;++e){let t=r.extensionsUsed[e],i=r.extensionsRequired||[];switch(t){case eO.KHR_MATERIALS_UNLIT:a[t]=new eq;break;case eO.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[t]=new e9;break;case eO.KHR_DRACO_MESH_COMPRESSION:a[t]=new e8(r,this.dracoLoader);break;case eO.KHR_TEXTURE_TRANSFORM:a[t]=new e5;break;case eO.KHR_MESH_QUANTIZATION:a[t]=new e7;break;default:i.indexOf(t)>=0&&void 0===n[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}A.setExtensions(a),A.setPlugins(n),A.parse(i,s)}parseAsync(e,t){let i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function eP(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let eO={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class eH{constructor(e){this.parser=e,this.name=eO.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i<s;i++){let s=t[i];s.extensions&&s.extensions[this.name]&&void 0!==s.extensions[this.name].light&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){let t;let i=this.parser,s="light:"+e,r=i.cache.get(s);if(r)return r;let a=i.json,n=a.extensions&&a.extensions[this.name]||{},A=n.lights||[],o=A[e],l=new es.Ilk(16777215);void 0!==o.color&&l.fromArray(o.color);let h=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new es.Ox3(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new es.cek(l)).distance=h;break;case"spot":(t=new es.PMe(l)).distance=h,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),t.decay=2,void 0!==o.intensity&&(t.intensity=o.intensity),t.name=i.createUniqueName(o.name||"light_"+e),r=Promise.resolve(t),i.cache.add(s,r),r}createNodeAttachment(e){let t=this,i=this.parser,s=i.json,r=s.nodes[e],a=r.extensions&&r.extensions[this.name]||{},n=a.light;return void 0===n?null:this._loadLight(n).then(function(e){return i._getNodeRef(t.cache,n,e)})}}class eq{constructor(){this.name=eO.KHR_MATERIALS_UNLIT}getMaterialType(){return es.vBJ}extendParams(e,t,i){let s=[];e.color=new es.Ilk(1,1,1),e.opacity=1;let r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let t=r.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==r.baseColorTexture&&s.push(i.assignTexture(e,"map",r.baseColorTexture,es.knz))}return Promise.all(s)}}class eK{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class eJ{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],a=s.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&r.push(i.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&r.push(i.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(r.push(i.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new es.FM8(e,e)}return Promise.all(r)}}class eV{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],a=s.extensions[this.name];return void 0!==a.iridescenceFactor&&(t.iridescence=a.iridescenceFactor),void 0!==a.iridescenceTexture&&r.push(i.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),void 0!==a.iridescenceIor&&(t.iridescenceIOR=a.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==a.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),void 0!==a.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),void 0!==a.iridescenceThicknessTexture&&r.push(i.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(r)}}class eY{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[];t.sheenColor=new es.Ilk(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=s.extensions[this.name];return void 0!==a.sheenColorFactor&&t.sheenColor.fromArray(a.sheenColorFactor),void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&r.push(i.assignTexture(t,"sheenColorMap",a.sheenColorTexture,es.knz)),void 0!==a.sheenRoughnessTexture&&r.push(i.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(r)}}class ej{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],a=s.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&r.push(i.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(r)}}class ez{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],a=s.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&r.push(i.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let n=a.attenuationColor||[1,1,1];return t.attenuationColor=new es.Ilk(n[0],n[1],n[2]),Promise.all(r)}}class eW{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=s.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class eX{constructor(e){this.parser=e,this.name=eO.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser,i=t.json.materials[e];return i.extensions&&i.extensions[this.name]?es.EJi:null}extendMaterialParams(e,t){let i=this.parser,s=i.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();let r=[],a=s.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&r.push(i.assignTexture(t,"specularIntensityMap",a.specularTexture));let n=a.specularColorFactor||[1,1,1];return t.specularColor=new es.Ilk(n[0],n[1],n[2]),void 0!==a.specularColorTexture&&r.push(i.assignTexture(t,"specularColorMap",a.specularColorTexture,es.knz)),Promise.all(r)}}class eZ{constructor(e){this.parser=e,this.name=eO.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;let r=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(!(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures")}return t.loadTextureImage(e,r.source,a)}}class e${constructor(e){this.parser=e,this.name=eO.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;let a=r.extensions[t],n=s.images[a.source],A=i.textureLoader;if(n.uri){let e=i.options.manager.getHandler(n.uri);null!==e&&(A=e)}return this.detectSupport().then(function(r){if(r)return i.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class e0{constructor(e){this.name=eO.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(!i.extensions||!i.extensions[this.name])return null;{let e=i.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files")}return s.then(function(t){let i=e.byteOffset||0,s=e.byteLength||0,a=e.count,n=e.byteStride,A=new Uint8Array(t,i,s);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(a,n,A,e.mode,e.filter).then(function(e){return e.buffer}):r.ready.then(function(){let t=new ArrayBuffer(a*n);return r.decodeGltfBuffer(new Uint8Array(t),a,n,A,e.mode,e.filter),t})})}}}class e1{constructor(e){this.name=eO.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||void 0===i.mesh)return null;let s=t.meshes[i.mesh];for(let e of s.primitives)if(e.mode!==ts.TRIANGLES&&e.mode!==ts.TRIANGLE_STRIP&&e.mode!==ts.TRIANGLE_FAN&&void 0!==e.mode)return null;let r=i.extensions[this.name],a=r.attributes,n=[],A={};for(let e in a)n.push(this.parser.getDependency("accessor",a[e]).then(t=>(A[e]=t,A[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),i=t.isGroup?t.children:[t],s=e[0].count,r=[];for(let e of i){let t=new es.yGw,i=new es.Pa4,a=new es._fP,n=new es.Pa4(1,1,1),o=new es.SPe(e.geometry,e.material,s);for(let e=0;e<s;e++)A.TRANSLATION&&i.fromBufferAttribute(A.TRANSLATION,e),A.ROTATION&&a.fromBufferAttribute(A.ROTATION,e),A.SCALE&&n.fromBufferAttribute(A.SCALE,e),o.setMatrixAt(e,t.compose(i,a,n));for(let t in A)"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,A[t]);es.Tme.prototype.copy.call(o,e),o.frustumCulled=!1,this.parser.assignFinalMaterial(o),r.push(o)}return t.isGroup?(t.clear(),t.add(...r),t):r[0]}))}}let e2="glTF",e3={JSON:1313821514,BIN:5130562};class e4{constructor(e){this.name=eO.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12);if(this.header={magic:es.Zp0.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==e2)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let i=this.header.length-12,s=new DataView(e,12),r=0;for(;r<i;){let t=s.getUint32(r,!0);r+=4;let i=s.getUint32(r,!0);if(r+=4,i===e3.JSON){let i=new Uint8Array(e,12+r,t);this.content=es.Zp0.decodeText(i)}
464else if(i===e3.BIN){let i=12+r;this.body=e.slice(i,i+t)}r+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class e8{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=eO.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let i=this.json,s=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,n={},A={},o={};for(let e in a){let t=to[e]||e.toLowerCase();n[t]=a[e]}for(let t in e.attributes){let s=to[t]||t.toLowerCase();if(void 0!==a[t]){let r=i.accessors[e.attributes[t]],a=tr[r.componentType];o[s]=a.name,A[s]=!0===r.normalized}}return t.getDependency("bufferView",r).then(function(e){return new Promise(function(t){s.decodeDracoFile(e,function(e){for(let t in e.attributes){let i=e.attributes[t],s=A[t];void 0!==s&&(i.normalized=s)}t(e)},n,o)})})}}class e5{constructor(){this.name=eO.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class e6 extends es.Wid{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;let t={specular:{value:new es.Ilk().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=t,this.onBeforeCompile=function(e){for(let i in t)e.uniforms[i]=t[i];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>","#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif").replace("#include <metalnessmap_pars_fragment>","#ifdef USE_GLOSSINESSMAP\n uniform sampler2D glossinessMap;\n#endif").replace("#include <roughnessmap_fragment>","vec3 specularFactor = specular;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture\n specularFactor *= texelSpecular.rgb;\n#endif").replace("#include <metalnessmap_fragment>","float glossinessFactor = glossiness;\n#ifdef USE_GLOSSINESSMAP\n vec4 texelGlossiness = texture2D( glossinessMap, vUv );\n // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture\n glossinessFactor *= texelGlossiness.a;\n#endif").replace("#include <lights_physical_fragment>","PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\nmaterial.specularColor = specularFactor;")},Object.defineProperties(this,{specular:{get:function(){return t.specular.value},set:function(e){t.specular.value=e}},specularMap:{get:function(){return t.specularMap.value},set:function(e){t.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return t.glossiness.value},set:function(e){t.glossiness.value=e}},glossinessMap:{get:function(){return t.glossinessMap.value},set:function(e){t.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class e9{constructor(){this.name=eO.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return e6}extendParams(e,t,i){let s=t.extensions[this.name];e.color=new es.Ilk(1,1,1),e.opacity=1;let r=[];if(Array.isArray(s.diffuseFactor)){let t=s.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==s.diffuseTexture&&r.push(i.assignTexture(e,"map",s.diffuseTexture,es.knz)),e.emissive=new es.Ilk(0,0,0),e.glossiness=void 0!==s.glossinessFactor?s.glossinessFactor:1,e.specular=new es.Ilk(1,1,1),Array.isArray(s.specularFactor)&&e.specular.fromArray(s.specularFactor),void 0!==s.specularGlossinessTexture){let t=s.specularGlossinessTexture;r.push(i.assignTexture(e,"glossinessMap",t)),r.push(i.assignTexture(e,"specularMap",t,es.knz))}return Promise.all(r)}createMaterial(e){let t=new e6(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=es.IOt,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class e7{constructor(){this.name=eO.KHR_MESH_QUANTIZATION}}class te extends es._C8{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=e*s*3+s;for(let e=0;e!==s;e++)t[e]=i[r+e];return t}interpolate_(e,t,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,A=2*n,o=3*n,l=s-t,h=(i-t)/l,c=h*h,g=c*h,u=e*o,d=u-o,p=-2*g+3*c,m=g-c,I=1-p,f=m-c+h;for(let e=0;e!==n;e++){let t=a[d+e+n],i=a[d+e+A]*l,s=a[u+e+n],o=a[u+e]*l;r[e]=I*t+f*i+p*s+m*o}return r}}let tt=new es._fP;class ti extends te{interpolate_(e,t,i,s){let r=super.interpolate_(e,t,i,s);return tt.fromArray(r).normalize().toArray(r),r}}let ts={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},tr={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ta={9728:es.TyD,9729:es.wem,9984:es.YLQ,9985:es.qyh,9986:es.aH4,9987:e
464s.D1R},tn={33071:es.uWy,33648:es.OoA,10497:es.rpg},tA={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},to={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},tl={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},th={CUBICSPLINE:void 0,LINEAR:es.NMF,STEP:es.Syv},tc={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function tg(e,t,i){for(let s in i.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=i.extensions[s])}function tu(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function td(e){let t="",i=Object.keys(e).sort();for(let s=0,r=i.length;s<r;s++)t+=i[s]+":"+e[i[s]]+";";return t}function tp(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class tm{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new eP,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||s&&r<98?this.textureLoader=new es.dpR(this.options.manager):this.textureLoader=new es.QRU(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new es.hH6(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let i=this,s=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(t){let a={scene:t[0][s.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:s.asset,parser:i,userData:{}};tg(r,a,s),tu(a,s),Promise.all(i._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){let s=t[i].joints;for(let t=0,i=s.length;t<i;t++)e[s[t]].isBone=!0}for(let t=0,s=e.length;t<s;t++){let s=e[t];void 0!==s.mesh&&(this._addNodeRef(this.meshCache,s.mesh),void 0!==s.skin&&(i[s.mesh].isSkinnedMesh=!0)),void 0!==s.camera&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;let s=i.clone(),r=(e,t)=>{let i=this.associations.get(e);for(let[s,a]of(null!=i&&this.associations.set(t,i),e.children.entries()))r(a,t.children[s])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let s=e(t[i]);if(s)return s}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let s=0;s<t.length;s++){let r=e(t[s]);r&&i.push(r)}return i}getDependency(e,t){let i=e+":"+t,s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this.loadNode(t);break;case"mesh":s=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:throw Error("Unknown type: "+e)}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this,s=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(s.map(function(t,s){return i.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");
464if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[eO.KHR_BINARY_GLTF].body);let s=this.options;return new Promise(function(e,r){i.load(es.Zp0.resolveURL(t.uri,s.path),e,void 0,function(){r(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let i=t.byteLength||0,s=t.byteOffset||0;return e.slice(s,s+i)})}loadAccessor(e){let t=this,i=this.json,s=this.json.accessors[e];if(void 0===s.bufferView&&void 0===s.sparse)return Promise.resolve(null);let r=[];return void 0!==s.bufferView?r.push(this.getDependency("bufferView",s.bufferView)):r.push(null),void 0!==s.sparse&&(r.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(r).then(function(e){let r,a;let n=e[0],A=tA[s.type],o=tr[s.componentType],l=o.BYTES_PER_ELEMENT,h=l*A,c=s.byteOffset||0,g=void 0!==s.bufferView?i.bufferViews[s.bufferView].byteStride:void 0,u=!0===s.normalized;if(g&&g!==h){let e=Math.floor(c/g),i="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+e+":"+s.count,h=t.cache.get(i);h||(r=new o(n,e*g,s.count*g/l),h=new es.vpT(r,g/l),t.cache.add(i,h)),a=new es.kB5(h,A,c%g/l,u)}else r=null===n?new o(s.count*A):new o(n,c,s.count*A),a=new es.TlE(r,A,u);if(void 0!==s.sparse){let t=tA.SCALAR,i=tr[s.sparse.indices.componentType],r=s.sparse.indices.byteOffset||0,l=s.sparse.values.byteOffset||0,h=new i(e[1],r,s.sparse.count*t),c=new o(e[2],l,s.sparse.count*A);null!==n&&(a=new es.TlE(a.array.slice(),a.itemSize,a.normalized));for(let e=0,t=h.length;e<t;e++){let t=h[e];if(a.setX(t,c[e*A]),A>=2&&a.setY(t,c[e*A+1]),A>=3&&a.setZ(t,c[e*A+2]),A>=4&&a.setW(t,c[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})}loadTexture(e){let t=this.json,i=this.options,s=t.textures[e],r=s.source,a=t.images[r],n=this.textureLoader;if(a.uri){let e=i.manager.getHandler(a.uri);null!==e&&(n=e)}return this.loadTextureImage(e,r,n)}loadTextureImage(e,t,i){let s=this,r=this.json,a=r.textures[e],n=r.images[t],A=(n.uri||n.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];let o=this.loadImageSource(t,i).then(function(t){t.flipY=!1,t.name=a.name||n.name||"";let i=r.samplers||{},A=i[a.sampler]||{};return t.magFilter=ta[A.magFilter]||es.wem,t.minFilter=ta[A.minFilter]||es.D1R,t.wrapS=tn[A.wrapS]||es.rpg,t.wrapT=tn[A.wrapT]||es.rpg,
464s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=o,o}loadImageSource(e,t){let i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let r=i.images[e],URL=self.URL||self.webkitURL,a=r.uri||"",n=!1;if(void 0!==r.bufferView)a=this.getDependency("bufferView",r.bufferView).then(function(e){n=!0;let t=new Blob([e],{type:r.mimeType});return a=URL.createObjectURL(t)});else if(void 0===r.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let A=Promise.resolve(a).then(function(e){return new Promise(function(i,r){let a=i;!0===t.isImageBitmapLoader&&(a=function(e){let t=new es.xEZ(e);t.needsUpdate=!0,i(t)}),t.load(es.Zp0.resolveURL(e,s.path),a,void 0,r)})}).then(function(e){var t;return!0===n&&URL.revokeObjectURL(a),e.userData.mimeType=r.mimeType||((t=r.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=A,A}assignTexture(e,t,i,s){let r=this;return this.getDependency("texture",i.index).then(function(a){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[eO.KHR_TEXTURE_TRANSFORM]){let e=void 0!==i.extensions?i.extensions[eO.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=r.associations.get(a);a=r.extensions[eO.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),r.associations.set(a,t)}}return void 0!==s&&(a.encoding=s),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,i=e.material,s=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new es.UY4,es.F5T.prototype.copy.call(t,i),t.color.copy(i.color),t.map=i.map,t.sizeAttenuation=!1,this.cache.add(e,t)),i=t}else if(e.isLine){let e="LineBasicMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new es.nls,es.F5T.prototype.copy.call(t,i),t.color.copy(i.color),this.cache.add(e,t)),i=t}if(s||r||a){let e="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),s&&(e+="derivative-tangents:"),r&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=i.clone(),r&&(t.vertexColors=!0),a&&(t.flatShading=!0),s&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(i))),i=t}i.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return es.Wid}loadMaterial(e){let t;let i=this,s=this.json,r=this.extensions,a=s.materials[e],n={},A=a.extensions||{},o=[];if(A[eO.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let e=r[eO.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=e.getMaterialType(),o.push(e.extendParams(n,a,i))}else if(A[eO.KHR_MATERIALS_UNLIT]){let e=r[eO.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),o.push(e.extendParams(n,a,i))}else{let s=a.pbrMetallicRoughness||{};if(n.color=new es.Ilk(1,1,1),n.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;n.color.fromArray(e),n.opacity=e[3]}void 0!==s.baseColorTexture&&o.push(i.assignTexture(n,"map",s.baseColorTexture,es.knz)),n.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,n.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(o.push(i.assignTexture(n,"metalnessMap",s.metallicRoughnessTexture)),o.push(i.assignTexture(n,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),o.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,n)})))}!0===a.doubleSided&&(n.side=es.ehD);let l=a.alphaMode||tc.OPAQUE;if(l===tc.BLEND?(n.transparent=!0,n.depthWrite=!1):(n.transparent=!1,l===tc.MASK&&(n.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==es.vBJ&&(o.push(i.assignTexture(n,"normalMap",a.normalTexture)),n.normalScale=new es.FM8(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;n.normalScale.set(e,e)}return void 0!==a.occlusionTexture&&t!==es.vBJ&&(o.push(i.assignTexture(n,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(n.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==es.vBJ&&(n.emissive=new es.Ilk().fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==es.vBJ&&o.push(i.assignTexture(n,"emissiveMap",a.emissiveTexture,es.knz)),Promise.all(o).then(function(){let s;return s=t===e6?r[eO.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(n):new t(n),a.name&&(s.name=a.name),tu(s,a),i.associations.set(s,{materials:e}),a.extensions&&tg(r,s,a),s})}createUniqueName(e){let t=es.iUV.sanitizeNodeName(e||""),i=t;for(let e=1;this.nodeNamesUsed[i];++e)i=t+"_"+e;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){let t=this,i=this.extensions,s=this.primitiveCache,r=[];for(let a=0,n=e.length;a<n;a++){let n=e[a],A=function(e){let t=e.extensions&&e.extensions[eO.KHR_DRACO_MESH_COMPRESSION];return t?"draco:"+t.bufferView+":"+t.indices+":"+td(t.attributes):e.indices+":"+td(e.attributes)+":"+e.mode}(n),o=s[A];if(o)r.push(o.promise);else{let e;e=n.extensions&&n.extensions[eO.KHR_DRACO_MESH_COMPRESSION]?function(e){return i[eO.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(i){return tI(i,e,t)})}(n):tI(new es.u9r,n,t),s[A]={primitive:n,promise:e},r.push(e)}}return Promise.all(r)}loadMesh(e){let t=this,i=this.json,s=this.extensions,r=i.meshes[e],a=r.primitives,n=[];for(let e=0,t=a.length;e<t;e++){var A;let t=void 0===a[e].material?(void 0===(A=this.cache).DefaultMaterial&&(A.DefaultMaterial=new es.Wid({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:es.Wl3})),A.DefaultMaterial):this.getDependency("material",a[e].material);n.push(t)}return n.push(t.loadGeometries(a)),Promise.all(n).then(function(i){let n=i.slice(0,i.length-1),A=i[i.length-1],o=[];for(let i=0,l=A.length;i<l;i++){let l;let h=A[i],c=a[i],g=n[i];if(c.mode===ts.TRIANGLES||c.mode===ts.TRIANGLE_STRIP||c.mode===ts.TRIANGLE_FAN||void 0===c.mode)!0!==(l=!0===r.isSkinnedMesh?new es.TUv(h,g):new es.Kj0(h,g)).isSkinnedMesh||l.geometry.attributes.skinWeight.normalized||l.normalizeSkinWeights(),c.mode===ts.TRIANGLE_STRIP?l.geometry=tf(l.geometry,es.UlW):c.mode===ts.TRIANGLE_FAN&&(l.geometry=tf(l.geometry,es.z$h));
464else if(c.mode===ts.LINES)l=new es.ejS(h,g);else if(c.mode===ts.LINE_STRIP)l=new es.x12(h,g);else if(c.mode===ts.LINE_LOOP)l=new es.blk(h,g);else if(c.mode===ts.POINTS)l=new es.woe(h,g);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);Object.keys(l.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let i=0,s=t.weights.length;i<s;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(let t=0,s=i.length;t<s;t++)e.morphTargetDictionary[i[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(l,r),l.name=t.createUniqueName(r.name||"mesh_"+e),tu(l,r),c.extensions&&tg(s,l,c),t.assignFinalMaterial(l),o.push(l)}for(let i=0,s=o.length;i<s;i++)t.associations.set(o[i],{meshes:e,primitives:i});if(1===o.length)return o[0];let l=new es.ZAu;t.associations.set(l,{meshes:e});for(let e=0,t=o.length;e<t;e++)l.add(o[e]);return l})}loadCamera(e){let t;let i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return"perspective"===i.type?t=new es.cPb(es.M8C.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):"orthographic"===i.type&&(t=new es.iKG(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),tu(t,i),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],i={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return i.inverseBindMatrices=e,i})}loadAnimation(e){let t=this.json,i=t.animations[e],s=[],r=[],a=[],n=[],A=[];for(let e=0,t=i.channels.length;e<t;e++){let t=i.channels[e],o=i.samplers[t.sampler],l=t.target,h=l.node,c=void 0!==i.parameters?i.parameters[o.input]:o.input,g=void 0!==i.parameters?i.parameters[o.output]:o.output;s.push(this.getDependency("node",h)),r.push(this.getDependency("accessor",c)),a.push(this.getDependency("accessor",g)),n.push(o),A.push(l)}return Promise.all([Promise.all(s),Promise.all(r),Promise.all(a),Promise.all(n),Promise.all(A)]).then(function(t){let s=t[0],r=t[1],a=t[2],n=t[3],A=t[4],o=[];for(let e=0,t=s.length;e<t;e++){let t;let i=s[e],l=r[e],h=a[e],c=n[e],g=A[e];if(void 0===i)continue;switch(i.updateMatrix(),tl[g.path]){case tl.weights:t=es.dUE;break;case tl.rotation:t=es.iLg;break;case tl.position:case tl.scale:default:t=es.yC1}let u=i.name?i.name:i.uuid,d=void 0!==c.interpolation?th[c.interpolation]:es.NMF,p=[];tl[g.path]===tl.weights?i.traverse(function(e){e.morphTargetInfluences&&p.push(e.name?e.name:e.uuid)}):p.push(u);let m=h.array;if(h.normalized){let e=tp(m.constructor),t=new Float32Array(m.length);for(let i=0,s=m.length;i<s;i++)t[i]=m[i]*e;m=t}for(let e=0,i=p.length;e<i;e++){let i=new t(p[e]+"."+tl[g.path],l.array,m,d);"CUBICSPLINE"===c.interpolation&&(i.createInterpolant=function(e){let t=this instanceof es.iLg?ti:te;return new t(this.times,this.values,this.getValueSize()/3,e)},i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),o.push(i)}}let l=i.name?i.name:"animation_"+e;return new es.m7l(l,void 0,o)})}createNodeMesh(e){let t=this.json,i=this,s=t.nodes[e];return void 0===s.mesh?null:i.getDependency("mesh",s.mesh).then(function(e){let t=i._getNodeRef(i.meshCache,s.mesh,e);return void 0!==s.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,i=s.weights.length;t<i;t++)e.morphTargetInfluences[t]=s.weights[t]}),t})}loadNode(e){let t=this.json,i=this.extensions,s=this,r=t.nodes[e],a=r.name?s.createUniqueName(r.name):"";return(function(){let t=[],i=s._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return i&&t.push(i),void 0!==r.camera&&t.push(s.getDependency("camera",r.camera).then(function(e){return s._getNodeRef(s.cameraCache,r.camera,e)})),s._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){t.push(e)}),Promise.all(t)})().then(function(t){let n;if((n=!0===r.isBone?new es.N$j:t.length>1?new es.ZAu:1===t.length?t[0]:new es.Tme)!==t[0])for(let e=0,i=t.length;e<i;e++)n.add(t[e]);if(r.name&&(n.userData.name=r.name,n.name=a),tu(n,r),r.extensions&&tg(i,n,r),void 0!==r.matrix){let e=new es.yGw;e.fromArray(r.matrix),n.applyMatrix4(e)}else void 0!==r.translation&&n.position.fromArray(r.translation),void 0!==r.rotation&&n.quaternion.fromArray(r.rotation),void 0!==r.scale&&n.scale.fromArray(r.scale);return s.associations.has(n)||s.associations.set(n,{}),s.associations.get(n).nodes=e,n})}loadScene(e){let t=this.json,i=this.extensions,s=this.json.scenes[e],r=this,a=new es.ZAu;s.name&&(a.name=r.createUniqueName(s.name)),tu(a,s),s.extensions&&tg(i,a,s);let n=s.nodes||[],A=[];for(let e=0,i=n.length;e<i;e++)A.push(function e(t,i,s,r){let a=s.nodes[t];return r.getDependency("node",t).then(function(e){let t;return void 0===a.skin?e:r.getDependency("skin",a.skin).then(function(e){t=e;let i=[];for(let e=0,s=t.joints.length;e<s;e++)i.push(r.getDependency("node",t.joints[e]));return Promise.all(i)}).then(function(i){return e.traverse(function(e){if(!e.isMesh)return;let s=[],r=[];for(let e=0,a=i.length;e<a;e++){let a=i[e];if(a){s.push(a);let i=new es.yGw;void 0!==t.inverseBindMatrices&&i.fromArray(t.inverseBindMatrices.array,16*e),r.push(i)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new es.OdW(s,r),e.matrixWorld)}),e})}).then(function(t){i.add(t);let n=[];if(a.children){let i=a.children;for(let a=0,A=i.length;a<A;a++){let A=i[a];n.push(e(A,t,s,r))}}return Promise.all(n)})}(n[e],a,t,r));return Promise.all(A).then(function(){return r.associations=(e=>{let t=new Map;for(let[e,i]of r.associations)(e instanceof es.F5T||e instanceof es.xEZ)&&t.set(e,i);return e.traverse(e=>{let i=r.associations.get(e);null!=i&&t.set(e,i)}),t})(a),a})}}function tI(e,t,i){let s=t.attributes,r=[];for(let t in s){let a=to[t]||t.toLowerCase();a in e.attributes||r.push(function(t,s){return i.getDependency("accessor",t).then(function(t){e.setAttribute(s,t)})}(s[t],a))}if(void 0!==t.indices&&!e.index){let s=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});r.push(s)}return tu(e,t),!function(e,t,i){let s=t.attributes,r=new es.ZzF;
464if(void 0===s.POSITION)return;{let e=i.json.accessors[s.POSITION],t=e.min,a=e.max;if(void 0!==t&&void 0!==a){if(r.set(new es.Pa4(t[0],t[1],t[2]),new es.Pa4(a[0],a[1],a[2])),e.normalized){let t=tp(tr[e.componentType]);r.min.multiplyScalar(t),r.max.multiplyScalar(t)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}let a=t.targets;if(void 0!==a){let e=new es.Pa4,t=new es.Pa4;for(let s=0,r=a.length;s<r;s++){let r=a[s];if(void 0!==r.POSITION){let s=i.json.accessors[r.POSITION],a=s.min,n=s.max;if(void 0!==a&&void 0!==n){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(n[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(n[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(n[2]))),s.normalized){let e=tp(tr[s.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(e)}e.boundingBox=r;let n=new es.aLr;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=n}(e,t,i),Promise.all(r).then(function(){return void 0!==t.targets?function(e,t,i){let s=!1,r=!1,a=!1;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(void 0!==i.POSITION&&(s=!0),void 0!==i.NORMAL&&(r=!0),void 0!==i.COLOR_0&&(a=!0),s&&r&&a)break}if(!s&&!r&&!a)return Promise.resolve(e);let n=[],A=[],o=[];for(let l=0,h=t.length;l<h;l++){let h=t[l];if(s){let t=void 0!==h.POSITION?i.getDependency("accessor",h.POSITION):e.attributes.position;n.push(t)}if(r){let t=void 0!==h.NORMAL?i.getDependency("accessor",h.NORMAL):e.attributes.normal;A.push(t)}if(a){let t=void 0!==h.COLOR_0?i.getDependency("accessor",h.COLOR_0):e.attributes.color;o.push(t)}}return Promise.all([Promise.all(n),Promise.all(A),Promise.all(o)]).then(function(t){let i=t[0],n=t[1],A=t[2];return s&&(e.morphAttributes.position=i),r&&(e.morphAttributes.normal=n),a&&(e.morphAttributes.color=A),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}function tf(e,t){let i=e.getIndex();if(null===i){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<s.count;e++)t.push(e);e.setIndex(t),i=e.getIndex()}let s=i.count-2,r=[];if(t===es.z$h)for(let e=1;e<=s;e++)r.push(i.getX(0)),r.push(i.getX(e)),r.push(i.getX(e+1));else for(let e=0;e<s;e++)e%2==0?(r.push(i.getX(e)),r.push(i.getX(e+1)),r.push(i.getX(e+2))):(r.push(i.getX(e+2)),r.push(i.getX(e+1)),r.push(i.getX(e)));r.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(r),a}class tE{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){let t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return -1}_onMessage(e,t){let i=this.workersResolve[e];if(i&&i(t),this.queue.length){let{resolve:t,msg:i,transfer:s}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(i,s)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{let s=this._getIdleWorker();-1!==s?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}var tC=i(67133).Buffer;class tB{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class tQ{constructor(e,t,i,s){this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=s,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}
464_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){let i=this._offset,s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,s)}}new Uint8Array([0]);let ty=[171,75,84,88,32,50,48,187,13,10,26,10];function tw(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):tC.from(e).toString("utf8")}var tv=i(67133).Buffer;let tb={env:{emscripten_notify_memory_growth:function(e){a=new Uint8Array(r.exports.memory.buffer)}}};class tS{init(){return s||(s="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+tx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,tb)).then(this._init):WebAssembly.instantiate(tv.from(tx,"base64"),tb).then(this._init))}_init(e){r=e.instance,tb.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!r)throw Error("ZSTDDecoder: Await .init() before decoding.");let i=e.byteLength,s=r.exports.malloc(i);a.set(e,s),t=t||Number(r.exports.ZSTD_findDecompressedSize(s,i));let n=r.exports.malloc(t),A=r.exports.ZSTD_decompress(n,t,s,i),o=a.slice(n,n+A);return r.exports.free(s),r.exports.free(n),o}}let tx
vendor: 38,980 bytes, line 464
464="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2Cwg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AItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0B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AIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQA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QMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAA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AAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",
464tM=new WeakMap,tR=0;class tD extends es.aNw{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new tE,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){let e=new es.hH6(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);let t=e.loadAsync("basis_transcoder.js"),i=new es.hH6(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);let s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([e,t])=>{let i=tD.BasisWorker.toString(),s=["/* constants */","let _EngineFormat = "+JSON.stringify(tD.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(tD.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(tD.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s])),this.transcoderBinary=t,this.workerPool.setWorkerCreator(()=>{let e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e})}),tR>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),tR++}return this.transcoderPending}load(e,t,i,s){if(null===this.workerConfig)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let r=new es.hH6(this.manager);r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials),r.load(e,e=>{if(tM.has(e)){let i=tM.get(e);
464return i.promise.then(t).catch(s)}this._createTexture(e).then(e=>t?t(e):null).catch(s)},i,s)}_createTextureFrom(e,t){let{mipmaps:i,width:s,height:r,format:a,type:n,error:A,dfdTransferFn:o,dfdFlags:l}=e;if("error"===n)return Promise.reject(A);let h=t.layerCount>1?new es.Z_g(i,s,r,t.layerCount,a,es.ywz):new es.EB7(i,s,r,a,es.ywz);return h.minFilter=1===i.length?es.wem:es.D1R,h.magFilter=es.wem,h.generateMipmaps=!1,h.needsUpdate=!0,h.encoding=2===o?es.knz:es.rnI,h.premultiplyAlpha=!!(1&l),h}async _createTexture(e,t={}){let i=function(e){let t=new Uint8Array(e.buffer,e.byteOffset,ty.length);if(t[0]!==ty[0]||t[1]!==ty[1]||t[2]!==ty[2]||t[3]!==ty[3]||t[4]!==ty[4]||t[5]!==ty[5]||t[6]!==ty[6]||t[7]!==ty[7]||t[8]!==ty[8]||t[9]!==ty[9]||t[10]!==ty[10]||t[11]!==ty[11])throw Error("Missing KTX 2.0 identifier.");let i=new tB,s=17*Uint32Array.BYTES_PER_ELEMENT,r=new tQ(e,ty.length,s,!0);i.vkFormat=r._nextUint32(),i.typeSize=r._nextUint32(),i.pixelWidth=r._nextUint32(),i.pixelHeight=r._nextUint32(),i.pixelDepth=r._nextUint32(),i.layerCount=r._nextUint32(),i.faceCount=r._nextUint32();let a=r._nextUint32();i.supercompressionScheme=r._nextUint32();let n=r._nextUint32(),A=r._nextUint32(),o=r._nextUint32(),l=r._nextUint32(),h=r._nextUint64(),c=r._nextUint64(),g=new tQ(e,ty.length+s,3*a*8,!0);for(let t=0;t<a;t++)i.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});let u=new tQ(e,n,A,!0),d={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},p=(d.descriptorBlockSize/4-6)/4;for(let e=0;e<p;e++){let t={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&t.channelType?(t.sampleLower=u._nextInt32(),t.sampleUpper=u._nextInt32()):(t.sampleLower=u._nextUint32(),t.sampleUpper=u._nextUint32()),d.samples[e]=t}i.dataFormatDescriptor.length=0,i.dataFormatDescriptor.push(d);let m=new tQ(e,o,l,!0);for(;m._offset<l;){let e=m._nextUint32(),t=m._scan(e),s=tw(t),r=m._scan(e-t.byteLength);i.keyValue[s]=s.match(/^ktx/i)?tw(r):r,m._offset%4&&m._skip(4-m._offset%4)}if(c<=0)return i;let I=new tQ(e,h,c,!0),f=I._nextUint16(),E=I._nextUint16(),C=I._nextUint32(),B=I._nextUint32(),Q=I._nextUint32(),y=I._nextUint32(),w=[];for(let e=0;e<a;e++)w.push({imageFlags:I._nextUint32(),rgbSliceByteOffset:I._nextUint32(),rgbSliceByteLength:I._nextUint32(),alphaSliceByteOffset:I._nextUint32(),alphaSliceByteLength:I._nextUint32()});let v=h+I._offset,b=v+C,S=b+B,x=S+Q,M=new Uint8Array(e.buffer,e.byteOffset+v,C),R=new Uint8Array(e.buffer,e.byteOffset+b,B),D=new Uint8Array(e.buffer,e.byteOffset+S,Q),T=new Uint8Array(e.buffer,e.byteOffset+x,y);return i.globalData={endpointCount:f,selectorCount:E,imageDescs:w,endpointsData:M,selectorsData:R,tablesData:D,extendedData:T},i}(new Uint8Array(e));if(0!==i.vkFormat)return tk(i);let s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:t},[e])).then(e=>this._createTextureFrom(e.data,i));return tM.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),tR--,this}}tD.BasisFormat={ETC1S:0,UASTC_4x4:1},tD.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},tD.EngineFormat={RGBAFormat:es.wk1,RGBA_ASTC_4x4_Format:es.ptH,RGBA_BPTC_Format:es.bsb,RGBA_ETC2_EAC_Format:es.ekQ,RGBA_PVRTC_4BPPV1_Format:es.eaV,RGBA_S3TC_DXT5_Format:es.ILR,RGB_ETC1_Format:es.fto,RGB_ETC2_Format:es.l0P,RGB_PVRTC_4BPPV1_Format:es._AM,RGB_S3TC_DXT1_Format:es.wuA},tD.BasisWorker=function(){let e,t,i;let s=_EngineFormat,r=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(n){let h=n.data;switch(h.type){case"init":var c;e=h.config,c=h.transcoderBinary,t=new Promise(e=>{i={wasmBinary:c,onRuntimeInitialized:e},BASIS(i)}).then(()=>{i.initializeBasis(),void 0===i.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")});break;case"transcode":t.then(()=>{try{let{width:t,height:n,hasAlpha:c,mipmaps:g,format:u,dfdTransferFn:d,dfdFlags:p}
464=function(t){let n=new i.KTX2File(new Uint8Array(t));function h(){n.close(),n.delete()}if(!n.isValid())throw h(),Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let c=n.isUASTC()?a.UASTC_4x4:a.ETC1S,g=n.getWidth(),u=n.getHeight(),d=n.getLayers()||1,p=n.getLevels(),m=n.getHasAlpha(),I=n.getDFDTransferFunc(),f=n.getDFDFlags(),{transcoderFormat:E,engineFormat:C}=function(t,i,n,h){let c;let g=t===a.ETC1S?A:o;for(let s=0;s<g.length;s++){let r=g[s];if(e[r.if]&&r.basisFormat.includes(t)&&(!h||!(r.transcoderFormat.length<2))&&(!r.needsPowerOfTwo||l(i)&&l(n)))return{transcoderFormat:r.transcoderFormat[h?1:0],engineFormat:r.engineFormat[h?1:0]}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),{transcoderFormat:r.RGBA32,engineFormat:s.RGBAFormat}}(c,g,u,m);if(!g||!u||!p)throw h(),Error("THREE.KTX2Loader: Invalid texture");if(!n.startTranscoding())throw h(),Error("THREE.KTX2Loader: .startTranscoding failed");let B=[];for(let e=0;e<p;e++){let t,i;let s=[];for(let r=0;r<d;r++){let a=n.getImageLevelInfo(e,r,0);t=a.origWidth,i=a.origHeight;let A=new Uint8Array(n.getImageTranscodedSizeInBytes(e,r,0,E)),o=n.transcodeImage(A,e,r,0,E,0,-1,-1);if(!o)throw h(),Error("THREE.KTX2Loader: .transcodeImage failed.");s.push(A)}B.push({data:function(e){let t=0;for(let i of e)t+=i.byteLength;let i=new Uint8Array(t),s=0;for(let t of e)i.set(t,s),s+=t.byteLength;return i}(s),width:t,height:i})}return h(),{width:g,height:u,hasAlpha:m,mipmaps:B,format:C,dfdTransferFn:I,dfdFlags:f}}(h.buffer),m=[];for(let e=0;e<g.length;++e)m.push(g[e].data.buffer);self.postMessage({type:"transcode",id:h.id,width:t,height:n,hasAlpha:c,mipmaps:g,format:u,dfdTransferFn:d,dfdFlags:p},m)}catch(e){console.error(e),self.postMessage({type:"error",id:h.id,error:e.message})}})}});let n=[{if:"astcSupported",basisFormat:[a.UASTC_4x4],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.BC1,r.BC3],engineFormat:[s.RGB_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.ETC1],engineFormat:[s.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],A=n.sort(function(e,t){return e.priorityETC1S-t.priorityETC1S}),o=n.sort(function(e,t){return e.priorityUASTC-t.priorityUASTC});function l(e){return e<=2||(e&e-1)==0&&0!==e}};let tT={109:es.wk1,97:es.wk1,37:es.wk1,43:es.wk1,103:es.av9,83:es.av9,16:es.av9,22:es.av9,100:es.hEm,76:es.hEm,15:es.hEm,9:es.hEm},tL={109:es.VzW,97:es.cLu,37:es.ywz,43:es.ywz,103:es.VzW,83:es.cLu,16:es.ywz,22:es.ywz,100:es.VzW,76:es.cLu,15:es.ywz,9:es.ywz},tF={43:es.knz,22:es.knz,15:es.knz};async function tk(e){let t,i;let{vkFormat:s,pixelWidth:r,pixelHeight:a,pixelDepth:A}=e;if(void 0===tT[s])throw Error("THREE.KTX2Loader: Unsupported vkFormat.");let o=e.levels[0];if(0===e.supercompressionScheme)t=o.levelData;else if(2===e.supercompressionScheme)n||(n=new Promise(async e=>{let t=new tS;await t.init(),e(t)})),t=(await n).decode(o.levelData,o.uncompressedByteLength);else throw Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");i=tL[s]===es.VzW?new Float32Array(t.buffer,t.byteOffset,t.byteLength/Float32Array.BYTES_PER_ELEMENT):tL[s]===es.cLu?new Uint16Array(t.buffer,t.byteOffset,t.byteLength/Uint16Array.BYTES_PER_ELEMENT):t;let l=0===A?new es.IEO(i,r,a):new es.JUT(i,r,a,A);return l.type=tL[s],l.format=tT[s],l.encoding=tF[s]||es.rnI,l.needsUpdate=!0,Promise.resolve(l)}let tU=Symbol("retainerCount"),tN=Symbol("recentlyUsed"),tG=Symbol("evict"),t_=Symbol("evictionThreshold"),tP=Symbol("cache");class tO{constructor(e,t=5){this[p]=new Map,this[m]=[],this[tP]=e,this[t_]=t}set evictionThreshold(e){this[t_]=e,this[tG]()}get evictionThreshold(){return this[t_]}get cache(){return this[tP]}retainerCount(e){return this[tU].get(e)||0}reset(){this[tU].clear(),this[tN]=[]}retain(e){this[tU].has(e)||this[tU].set(e,0),this[tU].set(e,this[tU].get(e)+1);let t=this[tN].indexOf(e);-1!==t&&this[tN].splice(t,1),this[tN].unshift(e),this[tG]()}release(e){this[tU].has(e)&&this[tU].set(e,Math.max(this[tU].get(e)-1,0)),this[tG]()}[(p=tU,m=tN,tG)](){if(!(this[tN].length<this[t_]))for(let e=this[tN].length-1;e>=this[t_];--e){let t=this[tN][e],i=this[tU].get(t);0===i&&(this[tP].delete(t),this[tN].splice(e,1))}}}/* @license 465 * Copyright 2021 Google LLC. All Rights Reserved. 466 * Licensed under the Apache License, Version 2.0 (the 'License');
467 * you may not use this file except in compliance with the License. 468 * You may obtain a copy of the License at 469 * 470 * http://www.apache.org/licenses/LICENSE-2.0 471 * 472 * Unless required by applicable law or agreed to in writing, software 473 * distributed under the License is distributed on an 'AS IS' BASIS, 474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 475 * See the License for the specific language governing permissions and 476 * limitations under the License. 477 */let tH=e=>{let t=[],i=new Set;for(let s of e){let e=s,r=0;for(;i.has(e);)e=s+"."+ ++r;i.add(e),t.push(e)}return t},tq=e=>{let t=new Map;for(let i of e.mappings)for(let e of i.variants)t.set(e,{material:null,gltfMaterialIndex:i.material});return t};class tK{constructor(e){this.parser=e,this.name="KHR_materials_variants"}afterRoot(e){let t=this.parser,i=t.json;if(void 0===i.extensions||void 0===i.extensions[this.name])return null;let s=i.extensions[this.name],r=s.variants||[],a=tH(r.map(e=>e.name));for(let s of e.scenes)s.traverse(e=>{if(!e.isMesh)return;let s=t.associations.get(e);if(null==s||null==s.meshes||null==s.primitives)return;let r=i.meshes[s.meshes],a=r.primitives,n=a[s.primitives],A=n.extensions;A&&A[this.name]&&(e.userData.variantMaterials=tq(A[this.name]))});return e.userData.variants=a,Promise.resolve()}}let tJ=(e,t,i=()=>{})=>{let s=e=>{let t=e.loaded/e.total;i(Math.max(0,Math.min(1,isFinite(t)?t:1)))};return new Promise((i,r)=>{t.load(e,i,s,r)})},tV=e=>new Promise((t,i)=>{let s=document.createElement("script");document.body.appendChild(s),s.onload=t,s.onerror=i,s.async=!0,s.src=e}),tY=new Map,tj=new Map,tz=new eN,tW=new tD,tX=Symbol("loader"),tZ=Symbol("evictionPolicy"),t$=Symbol("GLTFInstance");class t0 extends es.pBf{constructor(e){super(),this[f]=new e_().register(e=>new tK(e)),this[t$]=e,this[tX].setDRACOLoader(tz),this[tX].setKTX2Loader(tW)}static setDRACODecoderLocation(e){A=e,tz.setDecoderPath(e)}static getDRACODecoderLocation(){return A}static setKTX2TranscoderLocation(e){o=e,tW.setTranscoderPath(e)}static getKTX2TranscoderLocation(){return o}static setMeshoptDecoderLocation(e){l!==e&&(l=e,h=tV(e).then(()=>MeshoptDecoder.ready).then(()=>MeshoptDecoder))}static getMeshoptDecoderLocation(){return l}static initializeKTX2Loader(e){tW.detectSupport(e)}static get cache(){return tY}static clearCache(){tY.forEach((e,t)=>{this.delete(t)}),this[tZ].reset()}static has(e){return tY.has(e)}static async delete(e){if(!this.has(e))return;let t=tY.get(e);tj.delete(e),tY.delete(e);let i=await t;i.dispose()}static hasFinishedLoading(e){return!!tj.get(e)}get[(I=tZ,f=tX,tZ)](){return this.constructor[tZ]}async preload(e,t,i=()=>{}){if(this[tX].setWithCredentials(t0.withCredentials),this.dispatchEvent({type:"preload",element:t,src:e}),!tY.has(e)){null!=h&&this[tX].setMeshoptDecoder(await h);let t=tJ(e,this[tX],e=>{i(.8*e)}),s=this[t$],r=t.then(e=>s.prepare(e)).then(e=>(i(.9),new s(e))).catch(e=>(console.error(e),new s));tY.set(e,r)}await tY.get(e),tj.set(e,!0),i&&i(1)}async load(e,t,i=()=>{}){await this.preload(e,t,i);let s=await tY.get(e),r=await s.clone();return this[tZ].retain(e),r.dispose=()=>{this[tZ].release(e)},r}}t0[I]=new tO(t0);class t1 extends es.Tme{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof Element&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}let t2=new es.Pa4,t3=new es.yGw,t4=new es.yGw,t8=new es.Pa4,t5=new es.Pa4;class t6{constructor(e={}){let t,i,s,r;let a=this,n={objects:new WeakMap},A=void 0!==e.element?e.element:document.createElement("div");A.style.overflow="hidden",this.domElement=A,this.getSize=function(){return{width:t,height:i}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),t3.copy(t.matrixWorldInverse),t4.multiplyMatrices(t.projectionMatrix,t3),function e(t,i,o){if(t.isCSS2DObject){t2.setFromMatrixPosition(t.matrixWorld),t2.applyM
477atrix4(t4);let e=!0===t.visible&&t2.z>=-1&&t2.z<=1&&!0===t.layers.test(o.layers);if(t.element.style.display=!0===e?"":"none",!0===e){t.onBeforeRender(a,i,o);let e=t.element;e.style.transform="translate(-50%,-50%) translate("+(t2.x*s+s)+"px,"+(-t2.y*r+r)+"px)",e.parentNode!==A&&A.appendChild(e),t.onAfterRender(a,i,o)}let l={distanceToCameraSquared:(t8.setFromMatrixPosition(o.matrixWorld),t5.setFromMatrixPosition(t.matrixWorld),t8.distanceToSquared(t5))};n.objects.set(t,l)}for(let s=0,r=t.children.length;s<r;s++)e(t.children[s],i,o)}(e,e,t),function(e){let t=(function(e){let t=[];return e.traverse(function(e){e.isCSS2DObject&&t.push(e)}),t})(e).sort(function(e,t){if(e.renderOrder!==t.renderOrder)return t.renderOrder-e.renderOrder;let i=n.objects.get(e).distanceToCameraSquared,s=n.objects.get(t).distanceToCameraSquared;return i-s}),i=t.length;for(let e=0,s=t.length;e<s;e++)t[e].element.style.zIndex=i-e}(e)},this.setSize=function(e,a){t=e,i=a,s=t/2,r=i/2,A.style.width=e+"px",A.style.height=a+"px"}}}class t9{constructor(){this.pluginCallbacks=[],this.register(function(e){return new il(e)}),this.register(function(e){return new ih(e)}),this.register(function(e){return new ic(e)}),this.register(function(e){return new id(e)}),this.register(function(e){return new ip(e)}),this.register(function(e){return new ig(e)}),this.register(function(e){return new iu(e)})}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let r=new io,a=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)a.push(this.pluginCallbacks[e](r));r.setPlugins(a),r.write(e,t,s).catch(i)}parseAsync(e,t){let i=this;return new Promise(function(s,r){i.parse(e,s,r,t)})}}let t7={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},ie={};ie[es.TyD]=t7.NEAREST,ie[es.YLQ]=t7.NEAREST_MIPMAP_NEAREST,ie[es.aH4]=t7.NEAREST_MIPMAP_LINEAR,ie[es.wem]=t7.LINEAR,ie[es.qyh]=t7.LINEAR_MIPMAP_NEAREST,ie[es.D1R]=t7.LINEAR_MIPMAP_LINEAR,ie[es.uWy]=t7.CLAMP_TO_EDGE,ie[es.rpg]=t7.REPEAT,ie[es.OoA]=t7.MIRRORED_REPEAT;let it={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"};function ii(e,t){return e.length===t.length&&e.every(function(e,i){return e===t[i]})}function is(e){return 4*Math.ceil(e/4)}function ir(e,t=0){let i=is(e.byteLength);if(i!==e.byteLength){let s=new Uint8Array(i);if(s.set(new Uint8Array(e)),0!==t)for(let r=e.byteLength;r<i;r++)s[r]=t;return s.buffer}return e}function ia(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function iA(e,t){let i;return void 0!==e.toBlob?new Promise(i=>e.toBlob(i,t)):("image/jpeg"===t?i=.92:"image/webp"===t&&(i=.8),e.convertToBlob({type:t,quality:i}))}class io{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,i){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let s=this.buffers,r=this.json;i=this.options;let a=this.extensionsUsed,n=new Blob(s,{type:"application/octet-stream"}),A=Object.keys(a);if(A.length>0&&(r.extensionsUsed=A),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=n.size),!0===i.binary){let e=new FileReader;e.readAsArrayBuffer(n),e.onloadend=function(){var i;let s=ir(e.result),a=new DataView(new ArrayBuffer(8));a.setUint32(0,s.byteLength,!0),a.setUint32(4,5130562,!0);let n=ir((i=JSON.stringify(r),new TextEncoder().encode(i).buffer),32),A=new DataView(new ArrayBuffer(8));A.setUint32(0,n.byteLength,!0),A.setUint32(4,1313821514,!0);let o=new ArrayBuffer(12),l=new DataView(o);l.setUint32(0,1179937895,!0),l.setUint32(4,2,!0);let h=12+A.byteLength+n.byteLength+a.byteLength+s.byteLength;l.setUint32(8,h,!0);let c=new Blob([o,A,n,a,s],{type:"application/octet-stream"}),g=new FileReader;g.readAsArrayBuffer(c),g.onloadend=function(){t(g.result)}}}else if(r.buffers&&r.buffers.length>0){let e=new FileReader;
477e.readAsDataURL(n),e.onloadend=function(){let i=e.result;r.buffers[0].uri=i,t(r)}}else t(r)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let i=this.options,s=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&r.gltfExtensions){for(let e in void 0===t.extensions&&(t.extensions={}),r.gltfExtensions)t.extensions[e]=r.gltfExtensions[e],s[e]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(t.extras=r)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e,t=!1){if(!1===this.uids.has(e)){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}let i=this.uids.get(e);return i.get(t)}isNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return!1;let i=new es.Pa4;for(let t=0,s=e.count;t<s;t++)if(Math.abs(i.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let i=e.clone(),s=new es.Pa4;for(let e=0,t=i.count;e<t;e++)s.fromBufferAttribute(i,e),0===s.x&&0===s.y&&0===s.z?s.setX(1):s.normalize(),i.setXYZ(e,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1,s={};(0!==t.offset.x||0!==t.offset.y)&&(s.offset=t.offset.toArray(),i=!0),0!==t.rotation&&(s.rotation=t.rotation,i=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(s.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function i(e){return e.encoding===es.knz?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");let s=e?.image,r=t?.image,a=Math.max(s?.width||0,r?.width||0),n=Math.max(s?.height||0,r?.height||0),A=ia();A.width=a,A.height=n;let o=A.getContext("2d");o.fillStyle="#00ffff",o.fillRect(0,0,a,n);let l=o.getImageData(0,0,a,n);if(s){o.drawImage(s,0,0,a,n);let t=i(e),r=o.getImageData(0,0,a,n).data;for(let e=2;e<r.length;e+=4)l.data[e]=256*t(r[e]/256)}if(r){o.drawImage(r,0,0,a,n);let e=i(t),s=o.getImageData(0,0,a,n).data;for(let t=1;t<s.length;t+=4)l.data[t]=256*e(s[t]/256)}o.putImageData(l,0,0);let h=e||t,c=h.clone();return c.source=new es.Hw6(A),c.encoding=es.rnI,c}processBuffer(e){let t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,r){let a;let n=this.json;n.bufferViews||(n.bufferViews=[]),a=t===t7.UNSIGNED_BYTE?1:t===t7.UNSIGNED_SHORT?2:4;let A=is(s*e.itemSize*a),o=new DataView(new ArrayBuffer(A)),l=0;for(let r=i;r<i+s;r++)for(let i=0;i<e.itemSize;i++){let s;e.itemSize>4?s=e.array[r*e.itemSize+i]:0===i?s=e.getX(r):1===i?s=e.getY(r):2===i?s=e.getZ(r):3===i&&(s=e.getW(r)),t===t7.FLOAT?o.setFloat32(l,s,!0):t===t7.UNSIGNED_INT?o.setUint32(l,s,!0):t===t7.UNSIGNED_SHORT?o.setUint16(l,s,!0):t===t7.UNSIGNED_BYTE&&o.setUint8(l,s),l+=a}let h={buffer:this.processBuffer(o.buffer),byteOffset:this.byteOffset,byteLength:A};void 0!==r&&(h.target=r),r===t7.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=A,n.bufferViews.push(h);let c={id:n.bufferViews.length-1,byteLength:0};return c}processBufferViewImage(e){let t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let e=ir(r.result),a={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,s(i.bufferViews.push(a)-1)}})}processAccessor(e,t,i,s){let r,a;let n=this.json;if(e.array.constructor===Float32Array)r=t7.FLOAT;else if(e.array.constructor===Uint32Array)r=t7.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)r=t7.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)r=t7.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(void 0===i&&(i=0),void 0===s&&(s=e.count),0===s)return null;let A=function(e,t,i){let s={min:Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let r=t;r<t+i;r++)for(let t=0;t<e.itemSize;t++){let i;e.itemSize>4?i=e.array[r*e.itemSize+t]:0===t?i=e.getX(r):1===t?i=e.getY(r):2===t?i=e.getZ(r):3===t&&(i=e.getW(r)),s.min[t]=Math.min(s.min[t],i),s.max[t]=Math.max(s.max[t],i)}return s}(e,i,s);void 0!==t&&(a=e===t.index?t7.ELEMENT_ARRAY_BUFFER:t7.ARRAY_BUFFER);let o=this.processBufferView(e,r,i,s,a),l={bufferView:o.id,byteOffset:o.byteOffset,componentType:r,count:s,max:A.max,min:A.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(l.normalized=!0),n.accessors||(n.accessors=[]),n.accessors.push(l)-1}processImage(e,t,i,s="image/png"){let r=this,a=r.cache,n=r.json,A=r.options,o=r.pending;a.images.has(e)||a.images.set(e,{});let l=a.images.get(e),h=s+":flipY/"+i.toString();if(void 0!==l[h])return l[h];n.images||(n.images=[]);let c={mimeType:s},g=ia();g.width=Math.min(e.width,A.maxTextureSize),g.height=Math.min(e.height,A.maxTextureSize);let u=g.getContext("2d");if(!0===i&&(u.translate(0,g.height),u.scale(1,-1)),void 0!==e.data){t!==es.wk1&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>A.maxTextureSize||e.height>
477A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let i=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<i.length;t+=4)i[t+0]=e.data[t+0],i[t+1]=e.data[t+1],i[t+2]=e.data[t+2],i[t+3]=e.data[t+3];u.putImageData(new ImageData(i,e.width,e.height),0,0)}else u.drawImage(e,0,0,g.width,g.height);!0===A.binary?o.push(iA(g,s).then(e=>r.processBufferViewImage(e)).then(e=>{c.bufferView=e})):void 0!==g.toDataURL?c.uri=g.toDataURL(s):o.push(iA(g,s).then(e=>new FileReader().readAsDataURL(e)).then(e=>{c.uri=e}));let d=n.images.push(c)-1;return l[h]=d,d}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let i={magFilter:ie[e.magFilter],minFilter:ie[e.minFilter],wrapS:ie[e.wrapS],wrapT:ie[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){let t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]);let s=e.userData.mimeType;"image/webp"===s&&(s="image/png");let r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,s)};e.name&&(r.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,r)});let a=i.textures.push(r)-1;return t.textures.set(e,a),a}processMaterial(e){let t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);let s={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let r=e.color.toArray().concat([e.opacity]);if(ii(r,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=r),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=.5,s.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),i={index:this.processTexture(t)};this.applyTextureTransform(i,t),s.pbrMetallicRoughness.metallicRoughnessTexture=i}if(e.map){let t={index:this.processTexture(e.map)};this.applyTextureTransform(t,e.map),s.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),i=Math.max(t.r,t.g,t.b);if(i>1&&(t.multiplyScalar(1/i),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),i>0&&(s.emissiveFactor=t.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),s.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),s.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),s.occlusionTexture=t}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===es.ehD&&(s.doubleSided=!0),""!==e.name&&(s.name=e.name),this.serializeUserData(e,s),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,s)});let a=i.materials.push(s)-1;return t.materials.set(e,a),a}processMesh(e){let t;let i=this.cache,s=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,i=e.material.length;t<i;t++)r.push(e.material[t].uuid);else r.push(e.material.uuid);let a=r.join(":");if(i.meshes.has(a))return i.meshes.get(a);let n=e.geometry;t=e.isLineSegments?t7.LINES:e.isLineLoop?t7.LINE_LOOP:e.isLine?t7.LINE_STRIP:e.isPoints?t7.POINTS:e.material.wireframe?t7.LINES:t7.TRIANGLES;let A={},o={},l=[],h=[],c={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},g=n.getAttribute("normal");void 0===g||this.isNormalizedNormalAttribute(g)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),n.setAttribute("normal",this.createNormalizedNormalAttribute(g)));let u=null;
477for(let e in n.attributes){if("morph"===e.slice(0,5))continue;let t=n.attributes[e];e=c[e]||e.toUpperCase();let s=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(s.test(e)||(e="_"+e),i.attributes.has(this.getUID(t))){o[e]=i.attributes.get(this.getUID(t));continue}u=null;let r=t.array;"JOINTS_0"!==e||r instanceof Uint16Array||r instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),u=new es.TlE(new Uint16Array(r),t.itemSize,t.normalized));let a=this.processAccessor(u||t,n);null!==a&&(o[e]=a,i.attributes.set(this.getUID(t),a))}if(void 0!==g&&n.setAttribute("normal",g),0===Object.keys(o).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let t=[],s=[],r={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)r[e.morphTargetDictionary[t]]=t;for(let a=0;a<e.morphTargetInfluences.length;++a){let A={},o=!1;for(let e in n.morphAttributes){if("position"!==e&&"normal"!==e){o||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),o=!0);continue}let t=n.morphAttributes[e][a],s=e.toUpperCase(),r=n.attributes[e];if(i.attributes.has(this.getUID(t,!0))){A[s]=i.attributes.get(this.getUID(t,!0));continue}let l=t.clone();if(!n.morphTargetsRelative)for(let e=0,i=t.count;e<i;e++)l.setXYZ(e,t.getX(e)-r.getX(e),t.getY(e)-r.getY(e),t.getZ(e)-r.getZ(e));A[s]=this.processAccessor(l,n),i.attributes.set(this.getUID(r,!0),A[s])}h.push(A),t.push(e.morphTargetInfluences[a]),void 0!==e.morphTargetDictionary&&s.push(r[a])}A.weights=t,s.length>0&&(A.extras={},A.extras.targetNames=s)}let d=Array.isArray(e.material);if(d&&0===n.groups.length)return null;let p=d?e.material:[e.material],m=d?n.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,s=m.length;e<s;e++){let s={mode:t,attributes:o};if(this.serializeUserData(n,s),h.length>0&&(s.targets=h),null!==n.index){let t=this.getUID(n.index);(void 0!==m[e].start||void 0!==m[e].count)&&(t+=":"+m[e].start+":"+m[e].count),i.attributes.has(t)?s.indices=i.attributes.get(t):(s.indices=this.processAccessor(n.index,n,m[e].start,m[e].count),i.attributes.set(t,s.indices)),null===s.indices&&delete s.indices}let r=this.processMaterial(p[m[e].materialIndex]);null!==r&&(s.material=r),l.push(s)}A.primitives=l,s.meshes||(s.meshes=[]),this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,A)});let I=s.meshes.push(A)-1;return i.meshes.set(a,I),I}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?s.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:es.M8C.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){let i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=t9.Utils.mergeMorphTargetTracks(e.clone(),t);let r=e.tracks,a=[],n=[];for(let e=0;e<r.length;++e){let i;let A=r[e],o=es.iUV.parseTrackName(A.name),l=es.iUV.findNode(t,o.nodeName),h=it[o.propertyName];if("bones"===o.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(o.objectIndex):void 0),!l||!h)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',A.name),null;let c=A.values.length/A.times.length;h===it.morphTargetInfluences&&(c/=l.morphTargetInfluences.length),!0===A.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(i="CUBICSPLINE",c/=3):i=A.getInterpolation()===es.Syv?"STEP":"LINEAR",n.push({input:this.processAccessor(new es.TlE(A.times,1)),output:this.processAccessor(new es.TlE(A.values,c)),interpolation:i}),a.push({sampler:n.length-1,target:{node:s.get(l),path:h}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:n,channels:a}),i.animations.length-1}processSkin(e){let t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],r=e.skeleton;if(void 0===r)return null;let a=e.skeleton.bones[0];if(void 0===a)return null;let n=[],A=new Float32Array(16*r.bones.length),o=new es.yGw;for(let t=0;t<r.bones.length;++t)n.push(i.get(r.bones[t])),o.copy(r.boneInverses[t]),o.multiply(e.bindMatrix).toArray(A,16*t);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new es.TlE(A,16)),joints:n,skeleton:i.get(a)});let l=s.skin=t.skins.length-1;return l}processNode(e){let t=this.json,i=this.options,s=this.nodeMap;
477t.nodes||(t.nodes=[]);let r={};if(i.trs){let t=e.quaternion.toArray(),i=e.position.toArray(),s=e.scale.toArray();ii(t,[0,0,0,1])||(r.rotation=t),ii(i,[0,0,0])||(r.translation=i),ii(s,[1,1,1])||(r.scale=s)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===ii(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(r.matrix=e.matrix.elements);if(""!==e.name&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let t=this.processMesh(e);null!==t&&(r.mesh=t)}else e.isCamera&&(r.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let t=[];for(let s=0,r=e.children.length;s<r;s++){let r=e.children[s];if(r.visible||!1===i.onlyVisible){let e=this.processNode(r);null!==e&&t.push(e)}}t.length>0&&(r.children=t)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,r)});let a=t.nodes.push(r)-1;return s.set(e,a),a}processScene(e){let t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);let s={};""!==e.name&&(s.name=e.name),t.scenes.push(s);let r=[];for(let t=0,s=e.children.length;t<s;t++){let s=e.children[t];if(s.visible||!1===i.onlyVisible){let e=this.processNode(s);null!==e&&r.push(e)}}r.length>0&&(s.nodes=r),this.serializeUserData(e,s)}processObjects(e){let t=new es.xsS;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);this.processScene(t)}processInput(e){let t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let i=[];for(let t=0;t<e.length;t++)e[t]instanceof es.xsS?this.processScene(e[t]):i.push(e[t]);i.length>0&&this.processObjects(i);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let i=0;i<t.animations.length;++i)this.processAnimation(t.animations[i],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let t=0,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class il{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let i=this.writer,s=i.json,r=i.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=-((e.penumbra-1)*e.angle*1),a.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||-1!==e.target.position.z)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),r[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},r[this.name]=!0);let n=s.extensions[this.name].lights;n.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:n.length-1}}}class ih{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer,s=i.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class ic{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};t.pbrMetallicRoughness.baseColorFactor&&(r.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let a=[1,1,1];if(e.specular.toArray(a,0),r.specularFactor=a,r.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(r.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let t={index:i.processTexture(e.specularMap)};i.applyTextureTransform(t,e.specularMap),r.specularGlossinessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class ig{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:i.processTexture(e.clearcoatMap)};i.applyTextureTransform(t,e.clearcoatMap),r.clearcoatTexture=t}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:i.processTexture(e.clearcoatRoughnessMap)};i.applyTextureTransform(t,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:i.processTexture(e.clearcoatNormalMap)};i.applyTextureTransform(t,e.clearcoatNormalMap),r.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class iu{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:i.processTexture(e.iridescenceMap)};i.applyTextureTransform(t,e.iridescenceMap),r.iridescenceTexture=t}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:i.processTexture(e.iridescenceThicknessMap)};i.applyTextureTransform(t,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}
477class id{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let t={index:i.processTexture(e.transmissionMap)};i.applyTextureTransform(t,e.transmissionMap),r.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}class ip{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,s=i.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let t={index:i.processTexture(e.thicknessMap)};i.applyTextureTransform(t,e.thicknessMap),r.thicknessTexture=t}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,s[this.name]=!0}}t9.Utils={insertKeyframe:function(e,t){let i;let s=e.getValueSize(),r=new e.TimeBufferType(e.times.length+1),a=new e.ValueBufferType(e.values.length+s),n=e.createInterpolant(new e.ValueBufferType(s));if(0===e.times.length){r[0]=t;for(let e=0;e<s;e++)a[e]=0;i=0}else if(t<e.times[0]){if(.001>Math.abs(e.times[0]-t))return 0;r[0]=t,r.set(e.times,1),a.set(n.evaluate(t),0),a.set(e.values,s),i=0}else if(t>e.times[e.times.length-1]){if(.001>Math.abs(e.times[e.times.length-1]-t))return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),a.set(e.values,0),a.set(n.evaluate(t),e.values.length),i=r.length-1}else for(let A=0;A<e.times.length;A++){if(.001>Math.abs(e.times[A]-t))return A;if(e.times[A]<t&&e.times[A+1]>t){r.set(e.times.slice(0,A+1),0),r[A+1]=t,r.set(e.times.slice(A+1),A+2),a.set(e.values.slice(0,(A+1)*s),0),a.set(n.evaluate(t),(A+1)*s),a.set(e.values.slice((A+1)*s),(A+2)*s),i=A+1;break}}return e.times=r,e.values=a,i},mergeMorphTargetTracks:function(e,t){let i=[],s={},r=e.tracks;for(let e=0;e<r.length;++e){let a,n=r[e],A=es.iUV.parseTrackName(n.name),o=es.iUV.findNode(t,A.nodeName);if("morphTargetInfluences"!==A.propertyName||void 0===A.propertyIndex){i.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),(n=n.clone()).setInterpolation(es.NMF)}let l=o.morphTargetInfluences.length,h=o.morphTargetDictionary[A.propertyIndex];if(void 0===h)throw Error("THREE.GLTFExporter: Morph target name not found: "+A.propertyIndex);if(void 0===s[o.uuid]){a=n.clone();let e=new a.ValueBufferType(l*a.times.length);for(let t=0;t<a.times.length;t++)e[t*l+h]=a.values[t];a.name=(A.nodeName||"")+".morphTargetInfluences",a.values=e,s[o.uuid]=a,i.push(a);continue}let c=n.createInterpolant(new n.ValueBufferType(1));a=s[o.uuid];for(let e=0;e<a.times.length;e++)a.values[e*l+h]=c.evaluate(a.times[e]);for(let e=0;e<n.times.length;e++){let t=this.insertKeyframe(a,n.times[e]);a.values[t*l+h]=n.values[e]}}return e.tracks=i,e}};/* @license 478 * Copyright 2021 Google LLC. All Rights Reserved. 479 * Licensed under the Apache License, Version 2.0 (the 'License'); 480 * you may not use this file except in compliance with the License. 481 * You may obtain a copy of the License at 482 * 483 * http://www.apache.org/licenses/LICENSE-2.0 484 * 485 * Unless required by applicable law or agreed to in writing, software 486 * distributed under the License is distributed on an 'AS IS' BASIS, 487 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 488 * See the License for the specific language governing permissions and 489 * limitations under the License. 490 */let im=e=>void 0!==e.material&&e.userData&&e.userData.variantMaterials&&!!Array.from(e.userData.variantMaterials.values()).filter(e=>iI(e.material)),iI=e=>e&&e.isMaterial&&!Array.isArray(e);class iE{constructor(e){this.writer=e,this.name="KHR_materials_variants",this.variantNames=[]}beforeParse(e){let t=new Set;for(let i of e)i.traverse(e=>{if(!im(e))return;let i=e.userData.variantMaterials,s=e.userData.variantData;for(let[e,r]of s){let s=i.get(r.index);s&&iI(s.material)&&t.add(e)}});
490t.forEach(e=>this.variantNames.push(e))}writeMesh(e,t){if(!im(e))return;let i=e.userData,s=i.variantMaterials,r=i.variantData,a=new Map,n=new Map,A=Array.from(r.values()).sort((e,t)=>e.index-t.index);for(let[e,t]of A.entries())n.set(t.index,e);for(let e of r.values()){let t=s.get(e.index);if(!t||!iI(t.material))continue;let i=this.writer.processMaterial(t.material);a.has(i)||a.set(i,{material:i,variants:[]}),a.get(i).variants.push(n.get(e.index))}let o=Array.from(a.values()).map(e=>e.variants.sort((e,t)=>e-t)&&e).sort((e,t)=>e.material-t.material);if(0===o.length)return;let l=iI(i.originalMaterial)?this.writer.processMaterial(i.originalMaterial):-1;for(let e of t.primitives)l>=0&&(e.material=l),e.extensions=e.extensions||{},e.extensions[this.name]={mappings:o}}afterParse(){if(0===this.variantNames.length)return;let e=this.writer.json;e.extensions=e.extensions||{};let t=this.variantNames.map(e=>({name:e}));e.extensions[this.name]={variants:t},this.writer.extensionsUsed[this.name]=!0}}class iC{constructor(e,t,i,s,r){this.xrLight=e,this.renderer=t,this.lightProbe=i,this.xrWebGLBinding=null,this.estimationStartCallback=r,this.frameCallback=this.onXRFrame.bind(this);let a=t.xr.getSession();if(s&&"XRWebGLBinding"in window){let i=new es.oAp(16);e.environment=i.texture;let s=t.getContext();switch(a.preferredReflectionFormat){case"srgba8":s.getExtension("EXT_sRGB");break;case"rgba16f":s.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(a,s),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}a.requestAnimationFrame(this.frameCallback)}updateReflection(){let e=this.renderer.properties.get(this.xrLight.environment);if(e){let t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;let i=t.session;i.requestAnimationFrame(this.frameCallback);let s=t.getLightEstimate(this.lightProbe);if(s){this.xrLight.lightProbe.sh.fromArray(s.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;let e=Math.max(1,Math.max(s.primaryLightIntensity.x,Math.max(s.primaryLightIntensity.y,s.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(s.primaryLightIntensity.x/e,s.primaryLightIntensity.y/e,s.primaryLightIntensity.z/e),this.xrLight.directionalLight.intensity=e,this.xrLight.directionalLight.position.copy(s.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class iB extends es.ZAu{constructor(e,t=!0){super(),this.lightProbe=new es.lk7,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new es.Ox3,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let i=null,s=!1;e.xr.addEventListener("sessionstart",()=>{let r=e.xr.getSession();"requestLightProbe"in r&&r.requestLightProbe({reflectionFormat:r.preferredReflectionFormat}).then(r=>{i=new iC(this,e,r,t,()=>{s=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{i&&(i.dispose(),i=null),s&&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}}}class iQ{constructor(e=50){this.velocity=0,this.naturalFrequency=0,this.setDecayTime(e)}setDecayTime(e){this.naturalFrequency=1/Math.max(.001,e)}update(e,t,i,s){let r=2e-4*this.naturalFrequency;if(null==e||0===s||e===t&&0===this.velocity)return t;if(i<0)return e;let a=e-t,n=this.velocity+this.naturalFrequency*a,A=a+i*n,o=Math.exp(-this.naturalFrequency*i),l=(n-this.naturalFrequency*A)*o,h=-this.naturalFrequency*(l+n*o);return Math.abs(l)<r*Math.abs(s)&&h*a>=0?(this.velocity=0,t):(this.velocity=l,t+A*o)}}let iy=Math.PI/24,iw=new es.FM8,iv=(e,t,i)=>{let s=t>0?i>0?0:-Math.PI/2:i>0?Math.PI/2:Math.PI;for(let r=0;r<=12;++r)e.push(t+.17*Math.cos(s),i+.17*Math.sin(s),0,t+.2*Math.cos(s),i+.2*Math.sin(s),0),s+=iy};class ib extends es.Kj0{constructor(e,t){let i=new es.u9r,s=[],r=[],{size:a,boundingBox:n}=e,A=a.x/2,o=("back"===t?a.y:a.z)/2;iv(r,A,o),iv(r,-A,o),iv(r,-A,-o),iv(r,A,-o);let l=r.length/3;for(let e=0;e<l-2;e+=2)s.push(e,e+1,e+3,e,e+3,e+2);let h=l-2;s.push(h,h+1,1,h,1,0),i.setAttribute("position",new es.a$l(r,3)),i.setIndex(s),super(i),this.side=t;let c=this.material;switch(c.side=es.ehD,c.transparent=!0,c.opacity=0,this.goalOpacity=0,this.opacityDamper=new iQ,this.hitPlane=new es.Kj0(new es._12(2*(A+.2),2*(o+.2))),this.hitPlane.visible=!1,this.hitPlane.material.side=es.ehD,this.add(this.hitPlane),n.getCenter(this.position),t){case"bottom":this.rotateX(-Math.PI/2),this.shadowHeight=n.min.y,this.position.y=this.shadowHeight;break;case"back":this.shadowHeight=n.min.z,this.position.z=this.shadowHeight}e.target.add(this),this.offsetHeight=0}getHit(e,t,i){iw.set(t,-i),this.hitPlane.visible=!0;let s=e.positionAndNormalFromPoint(iw,this.hitPlane);return this.hitPlane.visible=!1,null==s?null:s.position}getExpandedHit(e,t,i){this.hitPlane.scale.set(1e3,1e3,1e3),this.hitPlane.updateMatrixWorld();let s=this.getHit(e,t,i);return this.hitPlane.scale.set(1,1,1),s}set offsetHeight(e){e-=.001,"back"===this.side?this.position.z=this.shadowHeight+e:this.position.y=this.shadowHeight+e}get offsetHeight(){return"back"===this.side?this.position.z-this.shadowHeight:this.position.y-this.shadowHeight}set show(e){this.goalOpacity=e?.75:0}updateOpacity(e){let t=this.material;t.opacity=this.opacityDamper.update(t.opacity,this.goalOpacity,e,1),this.visible=t.opacity>0}dispose(){var e;let{geometry:t,material:i}
490=this.hitPlane;t.dispose(),i.dispose(),this.geometry.dispose(),this.material.dispose(),null===(e=this.parent)||void 0===e||e.remove(this)}}let iS={NOT_PRESENTING:"not-presenting",SESSION_STARTED:"session-started",OBJECT_PLACED:"object-placed",FAILED:"failed"},ix={TRACKING:"tracking",NOT_TRACKING:"not-tracking"},iM=new es.Pa4,iR=new es.yGw,iD=new es.Pa4,iT=new es.cPb(45,1,.1,100);class iL extends es.pBf{constructor(e){super(),this.renderer=e,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 es.Pa4,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!1,this.lastDragPosition=new es.Pa4,this.firstRatio=0,this.lastAngle=0,this.goalPosition=new es.Pa4,this.goalYaw=0,this.goalScale=1,this.xDamper=new iQ,this.yDamper=new iQ,this.zDamper=new iQ,this.yawDamper=new iQ,this.scaleDamper=new iQ,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.dispose(),this.placementBox=new ib(this.presentedScene,this.placeOnWall?"back":"bottom"))},this.onSelectStart=e=>{let t=this.transientHitTestSource;if(null==t)return;let i=this.frame.getHitTestResultsForTransientInput(t),s=this.presentedScene,r=this.placementBox;if(1===i.length){this.inputSource=e.inputSource;let{axes:t}=this.inputSource.gamepad,i=r.getHit(this.presentedScene,t[0],t[1]);r.show=!0,null!=i?(this.isTranslating=!0,this.lastDragPosition.copy(i)):!1===this.placeOnWall&&(this.isRotating=!0,this.lastAngle=1.5*t[0])}else if(2===i.length){r.show=!0,this.isTwoFingering=!0;let{separation:e}=this.fingerPolar(i);this.firstRatio=e/s.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=e.threeRenderer,this.threeRenderer.xr.enabled=!0}async resolveARSession(){eI();let e=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(e),this.threeRenderer.xr.cameraAutoUpdate=!1,e}get presentedScene(){return this._presentedScene}async supportsPresentation(){try{return eI(),await navigator.xr.isSessionSupported("immersive-ar")}catch(e){return console.warn("Request to present in WebXR denied:"),console.warn(e),console.warn("Falling back to next ar-mode"),!1}}async present(e,t=!1){this.isPresenting&&console.warn("Cannot present while a model is already presenting");let i=new Promise((e,t)=>{requestAnimationFrame(()=>e())});e.setHotspotsVisibility(!1),e.queueRender(),await i,this._presentedScene=e,this.overlay=e.element.shadowRoot.querySelector("div.default"),!0===t&&(this.xrLight=new iB(this.threeRenderer),this.xrLight.addEventListener("estimationstart",()=>{if(!this.isPresenting||null==this.xrLight)return;let e=this.presentedScene;e.add(this.xrLight),e.environment=this.xrLight.environment}));let s=await this.resolveARSession();s.addEventListener("end",()=>{this.postSessionCleanup()},{once:!0});let r=e.element.shadowRoot.querySelector(".slot.exit-webxr-ar-button");r.classList.add("enabled"),r.addEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=r;let a=await s.requestReferenceSpace("viewer");this.tracking=!0,this.frames=0,this.initialized=!1,this.turntableRotation=e.yaw,this.goalYaw=e.yaw,this.goalScale=1,e.background=null,this.oldShadowIntensity=e.shadowIntensity,e.setShadowIntensity(.01),this.oldTarget.copy(e.getTarget()),e.element.addEventListener("load",this.onUpdateScene);let n=20*Math.PI/180,A=!0===this.placeOnWall?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(n),z:-Math.cos(n)});s.requestHitTestSource({space:a,offsetRay:A}).then(e=>{this.initialHitSource=e}),this.currentSession=s,this.placementBox=new ib(e,this.placeOnWall?"back":"bottom"),this.placementComplete=!1,this.lastTick=performance.now(),this.dispatchEvent({type:"status",status:iS.SESSION_STARTED})}async stopPresenting(){if(!this.isPresenting)return;let e=new Promise(e=>{this.resolveCleanup=e});try{await this.currentSession.end(),await e}catch(e){console.warn("Error while trying to end WebXR AR session"),console.warn(e),this.postSessionCleanup()}}get isPresenting(){return null!=this.presentedScene}get target(){return this.oldTarget}updateTarget(){let e=this.presentedScene;if(null!=e){let t=e.getTarget();this.oldTarget.copy(t),this.placeOnWall?t.z=e.boundingBox.min.z:t.y=e.boundingBox.min.y,e.setTarget(t.x,t.y,t.z)}}postSessionCleanup(){let e=this.currentSession;null!=e&&(e.removeEventListener("selectstart",this.onSelectStart),e.removeEventListener("selectend",this.onSelectEnd),this.currentSession=null);let t=this.presentedScene;if(this._presentedScene=null,null!=t){let{element:e}=t;null!=this.xrLight&&(t.remove(this.xrLight),this.xrLight.dispose(),this.xrLight=null),t.position.set(0,0,0),t.scale.set(1,1,1),t.setShadowOffset(0);let i=this.turntableRotation;null!=i&&(t.yaw=i);
490let s=this.oldShadowIntensity;null!=s&&t.setShadowIntensity(s),t.setEnvironmentAndSkybox(e[eS],e[ex]);let r=this.oldTarget;t.setTarget(r.x,r.y,r.z),t.xrCamera=null,t.element.removeEventListener("load",this.onUpdateScene),t.orientHotspots(0),e.requestUpdate("cameraTarget"),e.requestUpdate("maxCameraOrbit"),e[as](e.getBoundingClientRect())}this.renderer.height=0;let i=this.exitWebXRButtonContainer;null!=i&&(i.classList.remove("enabled"),i.removeEventListener("click",this.onExitWebXRButtonContainerClick),this.exitWebXRButtonContainer=null);let s=this.transientHitTestSource;null!=s&&(s.cancel(),this.transientHitTestSource=null);let r=this.initialHitSource;null!=r&&(r.cancel(),this.initialHitSource=null),null!=this.placementBox&&(this.placementBox.dispose(),this.placementBox=null),this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.inputSource=null,this.overlay=null,null!=this.resolveCleanup&&this.resolveCleanup(),this.dispatchEvent({type:"status",status:iS.NOT_PRESENTING})}updateView(e){let t=this.presentedScene,i=this.threeRenderer.xr;i.updateCamera(iT),t.xrCamera=i.getCamera();let{elements:s}=t.getCamera().matrixWorld;if(t.orientHotspots(Math.atan2(s[1],s[5])),this.initialized||(this.placeInitially(),this.initialized=!0),e.requestViewportScale&&e.recommendedViewportScale){let t=e.recommendedViewportScale;e.requestViewportScale(Math.max(t,.25))}let r=this.currentSession.renderState.baseLayer,a=r.getViewport(e);this.threeRenderer.setViewport(a.x,a.y,a.width,a.height)}placeInitially(){let e=this.presentedScene,{position:t,element:i}=e,s=e.getCamera(),{width:r,height:a}=this.overlay.getBoundingClientRect();e.setSize(r,a),s.projectionMatrixInverse.copy(s.projectionMatrix).invert();let{theta:n,radius:A}=i.getCameraOrbit(),o=s.getWorldDirection(iM);e.yaw=Math.atan2(-o.x,-o.z)-n,this.goalYaw=e.yaw,t.copy(s.position).add(o.multiplyScalar(A)),this.updateTarget();let l=e.getTarget();t.add(l).sub(this.oldTarget),this.goalPosition.copy(t),e.setHotspotsVisibility(!0);let{session:h}=this.frame;h.addEventListener("selectstart",this.onSelectStart),h.addEventListener("selectend",this.onSelectEnd),h.requestHitTestSourceForTransientInput({profile:"generic-touchscreen"}).then(e=>{this.transientHitTestSource=e})}getTouchLocation(){let{axes:e}=this.inputSource.gamepad,t=this.placementBox.getExpandedHit(this.presentedScene,e[0],e[1]);return null!=t&&(iM.copy(t).sub(this.presentedScene.getCamera().position),iM.length()>10)?null:t}getHitPoint(e){let t=this.threeRenderer.xr.getReferenceSpace(),i=e.getPose(t);if(null==i)return null;let s=iR.fromArray(i.transform.matrix);return!0===this.placeOnWall&&(this.goalYaw=Math.atan2(s.elements[4],s.elements[6])),s.elements[5]>.75!==this.placeOnWall?iD.setFromMatrixPosition(s):null}moveToFloor(e){let t=this.initialHitSource;if(null==t)return;let i=e.getHitTestResults(t);if(0==i.length)return;let s=i[0],r=this.getHitPoint(s);null!=r&&(this.placementBox.show=!0,this.isTranslating||(this.placeOnWall?this.goalPosition.copy(r):this.goalPosition.y=r.y),t.cancel(),this.initialHitSource=null,this.dispatchEvent({type:"status",status:iS.OBJECT_PLACED}))}fingerPolar(e){let t=e[0].inputSource.gamepad.axes,i=e[1].inputSource.gamepad.axes,s=i[0]-t[0],r=i[1]-t[1],a=Math.atan2(r,s),n=this.lastAngle-a;return n>Math.PI?n-=2*Math.PI:n<-Math.PI&&(n+=2*Math.PI),this.lastAngle=a,{separation:Math.sqrt(s*s+r*r),deltaYaw:n}}processInput(e){let t=this.transientHitTestSource;if(null==t||!this.isTranslating&&!this.isTwoFingering&&!this.isRotating)return;let i=e.getHitTestResultsForTransientInput(t),s=this.presentedScene,r=s.scale.x;if(this.isTwoFingering){if(i.length<2)this.isTwoFingering=!1;else{let{separation:e,deltaYaw:t}=this.fingerPolar(i);if(!1===this.placeOnWall&&(this.goalYaw+=t),s.canScale){let t=e/this.firstRatio;this.goalScale=t<1.3&&t>.7692307692307692?1:t}}return}if(2===i.length){this.isTranslating=!1,this.isRotating=!1,this.isTwoFingering=!0;let{separation:e}=this.fingerPolar(i);this.firstRatio=e/r;return}if(this.isRotating){let e=1.5*this.inputSource.gamepad.axes[0];this.goalYaw+=e-this.lastAngle,this.lastAngle=e}
490else this.isTranslating&&i.forEach(e=>{if(e.inputSource!==this.inputSource)return;let t=null;if(e.results.length>0&&(t=this.getHitPoint(e.results[0])),null==t&&(t=this.getTouchLocation()),null!=t){if(this.goalPosition.sub(this.lastDragPosition),!1===this.placeOnWall){let e=t.y-this.lastDragPosition.y;if(e<0){this.placementBox.offsetHeight=e/r,this.presentedScene.setShadowOffset(e);let i=iM.copy(s.getCamera().position),a=-e/(i.y-t.y);i.multiplyScalar(a),t.multiplyScalar(1-a).add(i)}}this.goalPosition.add(t),this.lastDragPosition.copy(t)}})}moveScene(e){let t=this.presentedScene,{position:i,yaw:s}=t,r=t.boundingSphere.radius,a=this.goalPosition,n=t.scale.x,A=this.placementBox;if(!a.equals(i)||this.goalScale!==n){let{x:s,y:o,z:l}=i;s=this.xDamper.update(s,a.x,e,r),o=this.yDamper.update(o,a.y,e,r),l=this.zDamper.update(l,a.z,e,r),i.set(s,o,l);let h=this.scaleDamper.update(n,this.goalScale,e,1);if(t.scale.set(h,h,h),!this.isTranslating){let e=a.y-o;this.placementComplete&&!1===this.placeOnWall?(A.offsetHeight=e/h,t.setShadowOffset(e)):0===e&&(this.placementComplete=!0,A.show=!1,t.setShadowIntensity(.8))}}A.updateOpacity(e),t.updateTarget(e),t.yaw=this.yawDamper.update(s,this.goalYaw,e,Math.PI)}onWebXRFrame(e,t){this.frame=t,++this.frames;let i=this.threeRenderer.xr.getReferenceSpace(),s=t.getViewerPose(i);null==s&&!0===this.tracking&&this.frames>30&&(this.tracking=!1,this.dispatchEvent({type:"tracking",status:ix.NOT_TRACKING}));let r=this.presentedScene;if(null==s||null==r||!r.element.loaded){this.threeRenderer.clear();return}!1===this.tracking&&(this.tracking=!0,this.dispatchEvent({type:"tracking",status:ix.TRACKING}));let a=!0;for(let i of s.views){if(this.updateView(i),a){this.moveToFloor(t),this.processInput(t);let i=e-this.lastTick;this.moveScene(i),this.renderer.preRender(r,e,i),this.lastTick=e,r.renderShadow(this.threeRenderer)}this.threeRenderer.render(r,r.getCamera()),a=!1}}}/* @license 491 * Copyright 2019 Google LLC. All Rights Reserved. 492 * Licensed under the Apache License, Version 2.0 (the 'License'); 493 * you may not use this file except in compliance with the License. 494 * You may obtain a copy of the License at 495 * 496 * http://www.apache.org/licenses/LICENSE-2.0 497 * 498 * Unless required by applicable law or agreed to in writing, software 499 * distributed under the License is distributed on an 'AS IS' BASIS, 500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 501 * See the License for the specific language governing permissions and 502 * limitations under the License. 503 */class iF{constructor(e){e.threeRenderer.debug={checkShaderErrors:!0},Promise.resolve().then(()=>{self.dispatchEvent(new CustomEvent("model-viewer-renderer-debug",{detail:{renderer:e,THREE:{ShaderMaterial:es.jyz,Texture:es.xEZ,Mesh:es.Kj0,Scene:es.xsS,PlaneGeometry:es._12,OrthographicCamera:es.iKG,WebGLRenderTarget:es.dd2}}}))})}addScene(e){self.dispatchEvent(new CustomEvent("model-viewer-scene-added-debug",{detail:{scene:e}}))}removeScene(e){self.dispatchEvent(new CustomEvent("model-viewer-scene-removed-debug",{detail:{scene:e}}))}}/* @license 504 * Copyright 2020 Google LLC. All Rights Reserved. 505 * Licensed under the Apache License, Version 2.0 (the 'License'); 506 * you may not use this file except in compliance with the License. 507 * You may obtain a copy of the License at 508 * 509 * http://www.apache.org/licenses/LICENSE-2.0 510 * 511 * Unless required by applicable law or agreed to in writing, software 512 * distributed under the License is distributed on an 'AS IS' BASIS, 513 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 514 * See the License for the specific language governing permissions and 515 * limitations under the License. 516 */let ik=Symbol("prepared"),iU=Symbol("prepare"),iN=Symbol("preparedGLTF"),iG=Symbol("clone");class i_{constructor(e){this[iN]=e}static prepare(e){if(null==e.scene)throw Error("Model does not have a scene");if(e[ik])return e;let t=this[iU](e);return t[ik]=!0,t}static[iU](e){let{scene:t}=e,i=[t];return Object.assign(Object.assign({},e),{scene:t,scenes:i})}get parser(){return this[iN].parser}get animations(){return this[iN].animations}get scene(){return this[iN].scene}get scenes(){return this[iN].scenes}get cameras(){return this[iN].cameras}get asset(){return this[iN].asset}get userData(){return this[iN].userData}clone(){let e=this.constructor,t=this[iG]();return new e(t)}
516dispose(){this.scenes.forEach(e=>{e.traverse(e=>{if(!e.isMesh)return;let t=Array.isArray(e.material)?e.material:[e.material];t.forEach(e=>{for(let t in e){let i=e[t];if(i instanceof es.xEZ){let e=i.source.data;null!=e.close&&e.close(),i.dispose()}}e.dispose()}),e.geometry.dispose()})})}[iG](){let e=this[iN],t=function(e){let t=new Map,i=new Map,s=e.clone();return function e(t,i,s){s(t,i);for(let r=0;r<t.children.length;r++)e(t.children[r],i.children[r],s)}(e,s,function(e,s){t.set(s,e),i.set(e,s)}),s.traverse(function(e){if(!e.isSkinnedMesh)return;let s=t.get(e),r=s.skeleton.bones;e.skeleton=s.skeleton.clone(),e.bindMatrix.copy(s.bindMatrix),e.skeleton.bones=r.map(function(e){return i.get(e)}),e.bind(e.skeleton,e.bindMatrix)}),s}(this.scene);iP(t,this.scene);let i=[t],s=e.userData?Object.assign({},e.userData):{};return Object.assign(Object.assign({},e),{scene:t,scenes:i,userData:s})}}let iP=(e,t)=>{iO(e,t,(e,t)=>{void 0!==t.userData.variantMaterials&&(e.userData.variantMaterials=new Map(t.userData.variantMaterials)),void 0!==t.userData.variantData&&(e.userData.variantData=t.userData.variantData),void 0!==t.userData.originalMaterial&&(e.userData.originalMaterial=t.userData.originalMaterial)})},iO=(e,t,i)=>{i(e,t);for(let s=0;s<e.children.length;s++)iO(e.children[s],t.children[s],i)},iH=Symbol("threeGLTF"),iq=Symbol("gltf"),iK=Symbol("gltfElementMap"),iJ=Symbol("threeObjectMap"),iV=Symbol("parallelTraverseThreeScene"),iY=Symbol("correlateOriginalThreeGLTF"),ij=Symbol("correlateCloneThreeGLTF");class iz{constructor(e,t,i,s){this[iH]=e,this[iq]=t,this[iK]=s,this[iJ]=i}static from(e,t){return null!=t?this[ij](e,t):this[iY](e)}static[iY](e){let t=e.parser.json,i=e.parser.associations,s=new Map,r={name:"Default"},a={index:-1};for(let e of i.keys())e instanceof es.F5T&&null==i.get(e)&&(a.index<0&&(null==t.materials&&(t.materials=[]),a.index=t.materials.length,t.materials.push(r)),e.name=r.name,i.set(e,{materials:a.index}));for(let[e,r]of i)for(let i in r&&(e.userData=e.userData||{},e.userData.associations=r),r)if(null!=i&&"primitives"!==i){let a=t[i]||[],n=a[r[i]];if(null==n)continue;let A=s.get(n);null==A&&(A=new Set,s.set(n,A)),A.add(e)}return new iz(e,t,i,s)}static[ij](e,t){let i=t.threeGLTF,s=t.gltf,r=JSON.parse(JSON.stringify(s)),a=new Map,n=new Map;for(let s=0;s<i.scenes.length;s++)this[iV](i.scenes[s],e.scenes[s],(e,i)=>{let s=t.threeObjectMap.get(e);if(null!=s){for(let e in s)if(null!=e&&"primitives"!==e){let t=s[e],A=r[e][t],o=a.get(i)||{};o[e]=t,a.set(i,o);let l=n.get(A)||new Set;l.add(i),n.set(A,l)}}});return new iz(e,r,a,n)}static[iV](e,t,i){let s=e=>e.isMesh,r=(e,t)=>{if(i(e,t),e.isObject3D){if(s(e)){if(Array.isArray(e.material))for(let i=0;i<e.material.length;++i)r(e.material[i],t.material[i]);else r(e.material,t.material)}for(let i=0;i<e.children.length;++i)r(e.children[i],t.children[i])}};r(e,t)}get threeGLTF(){return this[iH]}get gltf(){return this[iq]}get gltfElementMap(){return this[iK]}get threeObjectMap(){return this[iJ]}}/* @license 517 * Copyright 2020 Google LLC. All Rights Reserved. 518 * Licensed under the Apache License, Version 2.0 (the 'License'); 519 * you may not use this file except in compliance with the License. 520 * You may obtain a copy of the License at 521 * 522 * http://www.apache.org/licenses/LICENSE-2.0 523 * 524 * Unless required by applicable law or agreed to in writing, software 525 * distributed under the License is distributed on an 'AS IS' BASIS, 526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 527 * See the License for the specific language governing permissions and 528 * limitations under the License. 529 */let iW=Symbol("correlatedSceneGraph");class iX extends i_{static[iU](e){let t=super[iU](e);null==t[iW]&&(t[iW]=iz.from(t));let{scene:i}=t,s=new es.aLr(void 0,1/0);return i.traverse(e=>{if(e.renderOrder=1e3,e.frustumCulled=!1,e.name||(e.name=e.uuid),e.isMesh){let{geometry:i}=e;e.castShadow=!0,e.isSkinnedMesh&&(i.boundingSphere=s,i.boundingBox=null);let r=e.material;if(!0===r.isMeshBasicMaterial&&(r.toneMapped=!1),r.shadowSide=es.Wl3,r.aoMap){let{gltf:e,threeObjectMap:s}=t[iW],a=s.get(r);if(null!=e.materials&&null!=a&&null!=a.materials){let t=e.materials[a.materials];t.occlusionTexture&&0===t.occlusionTexture.texCoord&&null!=i.attributes.uv&&i.setAttribute("uv2",i.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[iN][iW]}[iG](){let e=super[iG](),t=new Map;
529return e.scene.traverse(e=>{if(e.isMesh){let i=e.material;if(null!=i){if(t.has(i.uuid)){e.material=t.get(i.uuid);return}e.material=i.clone(),t.set(i.uuid,e.material)}}}),e[iW]=iz.from(e,this.correlatedSceneGraph),e}}class iZ extends es.yxD{constructor(e){super(e),this.type=es.cLu}parse(e){let t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return -1},i=function(e,t,i){t=t||1024;let s=e.pos,r=-1,a=0,n="",A=String.fromCharCode.apply(null,new Uint16Array(e.subarray(s,s+128)));for(;0>(r=A.indexOf("\n"))&&a<t&&s<e.byteLength;)n+=A,a+=A.length,s+=128,A+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(s,s+128)));return -1<r&&(!1!==i&&(e.pos+=a+r+1),n+A.slice(0,r))},s=new Uint8Array(e);s.pos=0;let r=function(e){let s,r;let a=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,n=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,A=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,l={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};if(e.pos>=e.byteLength||!(s=i(e)))return t(1,"no header found");if(!(r=s.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(l.valid|=1,l.programtype=r[1],l.string+=s+"\n";!1!==(s=i(e));){if(l.string+=s+"\n","#"===s.charAt(0)){l.comments+=s+"\n";continue}if((r=s.match(a))&&(l.gamma=parseFloat(r[1])),(r=s.match(n))&&(l.exposure=parseFloat(r[1])),(r=s.match(A))&&(l.valid|=2,l.format=r[1]),(r=s.match(o))&&(l.valid|=4,l.height=parseInt(r[1],10),l.width=parseInt(r[2],10)),2&l.valid&&4&l.valid)break}return 2&l.valid?4&l.valid?l:t(3,"missing image size specifier"):t(3,"missing format specifier")}(s);if(-1!==r){let e=r.width,i=r.height,a=function(e,i,s){if(i<8||i>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(i!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");let r=new Uint8Array(4*i*s);if(!r.length)return t(4,"unable to allocate buffer space");let a=0,n=0,A=4*i,o=new Uint8Array(4),l=new Uint8Array(A),h=s;for(;h>0&&n<e.byteLength;){if(n+4>e.byteLength)return t(1);if(o[0]=e[n++],o[1]=e[n++],o[2]=e[n++],o[3]=e[n++],2!=o[0]||2!=o[1]||(o[2]<<8|o[3])!=i)return t(3,"bad rgbe scanline format");let s=0,c;for(;s<A&&n<e.byteLength;){c=e[n++];let i=c>128;if(i&&(c-=128),0===c||s+c>A)return t(3,"bad scanline data");if(i){let t=e[n++];for(let e=0;e<c;e++)l[s++]=t}else l.set(e.subarray(n,n+c),s),s+=c,n+=c}for(let e=0;e<i;e++){let t=0;r[a]=l[e+t],t+=i,r[a+1]=l[e+t],t+=i,r[a+2]=l[e+t],t+=i,r[a+3]=l[e+t],a+=4}h--}return r}(s.subarray(s.pos),e,i);if(-1!==a){let t,s,n;switch(this.type){case es.VzW:n=a.length/4;let A=new Float32Array(4*n);for(let e=0;e<n;e++)!function(e,t,i,s){let r=e[t+3],a=Math.pow(2,r-128)/255;i[s+0]=e[t+0]*a,i[s+1]=e[t+1]*a,i[s+2]=e[t+2]*a,i[s+3]=1}(a,4*e,A,4*e);t=A,s=es.VzW;break;case es.cLu:n=a.length/4;let o=new Uint16Array(4*n);for(let e=0;e<n;e++)!function(e,t,i,s){let r=e[t+3],a=Math.pow(2,r-128)/255;i[s+0]=es.A5E.toHalfFloat(Math.min(e[t+0]*a,65504)),i[s+1]=es.A5E.toHalfFloat(Math.min(e[t+1]*a,65504)),i[s+2]=es.A5E.toHalfFloat(Math.min(e[t+2]*a,65504)),i[s+3]=es.A5E.toHalfFloat(1)}(a,4*e,o,4*e);t=o,s=es.cLu;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:e,height:i,data:t,header:r.string,gamma:r.gamma,exposure:r.exposure,type:s}}}return null}setDataType(e){return this.type=e,this}load(e,t,i,s){return super.load(e,function(e,i){switch(e.type){case es.VzW:case es.cLu:e.encoding=es.rnI,e.minFilter=es.wem,e.magFilter=es.wem,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,i)},i,s)}}/* @license 530 * Copyright 2021 Google LLC. All Rights Reserved. 531 * Licensed under the Apache License, Version 2.0 (the 'License'); 532 * you may not use this file except in compliance with the License. 533 * You may obtain a copy of the License at 534 * 535 * http://www.apache.org/licenses/LICENSE-2.0 536 * 537 * Unless required by applicable law or agreed to in writing, software 538 * distributed under the License is distributed on an 'AS IS' BASIS, 539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 540 * See the License for the specific language governing permissions and 541 * limitations under the License. 542 */class i$ extends es.xsS{constructor(){super(),this.position.y=-3.5;let e=new es.DvJ;e.deleteAttribute("uv");let t=new es.Wid({metalness:0,side:es._Li}),i=new es.Wid({metalness:0}),s=new es.cek(16777215,500,28,2);s.position.set(.418,16.199,.3),this.add(s);let r=new es.Kj0(e,t);r.position.set(-.757,13.219,.717),r.scale.set(31.713,28.305,28.591),this.add(r);let a=new es.Kj0(e,i);a.position.set(-10.906,2.009,1.846),a.rotation.set(0,-.195,0),a.scale.set(2.328,7.905,4.651),this.add(a);let n=new es.Kj0(e,i);n.position.set(-5.607,-.754,-.758),n.rotation.set(0,.994,0),n.scale.set(1.97,1.534,3.955),this.add(n);let A=new es.Kj0(e,i);A.position.set(6.167,.857,7.803),A.rotation.set(0,.561,0),A.scale.set(3.927,6.285,3.687),this.add(A);let o=new es.Kj0(e,i);o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),this.add(o);let l=new es.Kj0(e,i);l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),this.add(l);let h=new es.Kj0(e,i);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);let c=new es.Kj0(e,this.createAreaLightMaterial(50));c.position.set(-16.116,14.37,8.208),c.scale.set(.1,2.428,2.739),this.add(c);let g=new es.Kj0(e,this.createAreaLightMaterial(50));g.position.set(-16.109,18.021,-8.207),g.scale.set(.1,2.425,2.751),this.add(g);let u=new es.Kj0(e,this.createAreaLightMaterial(17));u.position.set(14.904,12.198,-1.832),u.scale.set(.15,4.265,6.331),this.add(u);let d=new es.Kj0(e,this.createAreaLightMaterial(43));d.position.set(-.462,8.89,14.52),d.scale.set(4.38,5.441,.088),this.add(d);let p=new es.Kj0(e,this.createAreaLightMaterial(20));p.position.set(3.235,11.486,-12.541),p.scale.set(2.5,2,.1),this.add(p);let m=new es.Kj0(e,this.createAreaLightMaterial(100));m.position.set(0,20,0),m.scale.set(1,.1,1),this.add(m)}createAreaLightMaterial(e){let t=new es.vBJ;return t.color.setScalar(e),t}}/* @license 543 * Copyright 2021 Google LLC. All Rights Reserved. 544 * Licensed under the Apache License, Version 2.0 (the 'License');
545 * you may not use this file except in compliance with the License. 546 * You may obtain a copy of the License at 547 * 548 * http://www.apache.org/licenses/LICENSE-2.0 549 * 550 * Unless required by applicable law or agreed to in writing, software 551 * distributed under the License is distributed on an 'AS IS' BASIS, 552 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 553 * See the License for the specific language governing permissions and 554 * limitations under the License. 555 */class i0 extends es.xsS{constructor(){super(),this.position.y=-3.5;let e=new es.DvJ;e.deleteAttribute("uv");let t=new es.Wid({metalness:0,side:es._Li}),i=new es.Wid({metalness:0}),s=new es.cek(16777215,400,28,2);s.position.set(.5,14,.5),this.add(s);let r=new es.Kj0(e,t);r.position.set(0,13.2,0),r.scale.set(31.5,28.5,31.5),this.add(r);let a=new es.Kj0(e,i);a.position.set(-10.906,-1,1.846),a.rotation.set(0,-.195,0),a.scale.set(2.328,7.905,4.651),this.add(a);let n=new es.Kj0(e,i);n.position.set(-5.607,-.754,-.758),n.rotation.set(0,.994,0),n.scale.set(1.97,1.534,3.955),this.add(n);let A=new es.Kj0(e,i);A.position.set(6.167,-.16,7.803),A.rotation.set(0,.561,0),A.scale.set(3.927,6.285,3.687),this.add(A);let o=new es.Kj0(e,i);o.position.set(-2.017,.018,6.124),o.rotation.set(0,.333,0),o.scale.set(2.002,4.566,2.064),this.add(o);let l=new es.Kj0(e,i);l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),this.add(l);let h=new es.Kj0(e,i);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);let c=new es.Kj0(e,this.createAreaLightMaterial(80));c.position.set(-14,10,8),c.scale.set(.1,2.5,2.5),this.add(c);let g=new es.Kj0(e,this.createAreaLightMaterial(80));g.position.set(-14,14,-4),g.scale.set(.1,2.5,2.5),this.add(g);let u=new es.Kj0(e,this.createAreaLightMaterial(23));u.position.set(14,12,0),u.scale.set(.1,5,5),this.add(u);let d=new es.Kj0(e,this.createAreaLightMaterial(16));d.position.set(0,9,14),d.scale.set(5,5,.1),this.add(d);let p=new es.Kj0(e,this.createAreaLightMaterial(80));p.position.set(7,8,-14),p.scale.set(2.5,2.5,.1),this.add(p);let m=new es.Kj0(e,this.createAreaLightMaterial(80));m.position.set(-7,16,-14),m.scale.set(2.5,2.5,.1),this.add(m);let I=new es.Kj0(e,this.createAreaLightMaterial(1));I.position.set(0,20,0),I.scale.set(.1,.1,.1),this.add(I)}createAreaLightMaterial(e){let t=new es.vBJ;return t.color.setScalar(e),t}}let i1=/\.hdr(\.js)?$/,i2=new es.dpR,i3=new iZ;i3.setDataType(es.cLu);class i4 extends es.pBf{constructor(e){super(),this.threeRenderer=e,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}async load(e,t=()=>{}){try{let i=i1.test(e),s=i?i3:i2,r=await new Promise((i,r)=>s.load(e,i,e=>{t(e.loaded/e.total*.9)},r));return t(1),r.name=e,r.mapping=es.dSO,i||(r.encoding=es.knz),r}finally{t&&t(1)}}async generateEnvironmentMapAndSkybox(e=null,t=null,i=()=>{}){let s;let r="legacy"!==t;("legacy"===t||"neutral"===t)&&(t=null),t=em(t);let a=Promise.resolve(null);e&&(a=this.loadEquirectFromUrl(e,i)),s=t?this.loadEquirectFromUrl(t,i):e?this.loadEquirectFromUrl(e,i):r?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();let[n,A]=await Promise.all([s,a]);if(null==n)throw Error("Failed to load environment map.");return{environmentMap:n,skybox:A}}async loadEquirectFromUrl(e,t){if(!this.skyboxCache.has(e)){let i=this.load(e,t);this.skyboxCache.set(e,i)}return this.skyboxCache.get(e)}async GenerateEnvironmentMap(e,t){await ew();let i=this.threeRenderer,s=new es.oAp(256,{generateMipmaps:!1,type:es.cLu,format:es.wk1,encoding:es.rnI,depthBuffer:!0}),r=new es._am(.1,100,s),a=r.renderTarget.texture;a.name=t;let n=i.outputEncoding,A=i.toneMapping;return i.toneMapping=es.uL9,i.outputEncoding=es.rnI,r.update(i,e),this.blurCubemap(s,.04),i.toneMapping=A,i.outputEncoding=n,a}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new i$,"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new i0,"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(e,t){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(20);let e=new es.DvJ,t=new es.Kj0(e,this.blurMaterial);this.blurScene=new es.xsS,this.blurScene.add(t)}let i=e.clone();this.halfblur(e,i,t,"latitudinal"),this.halfblur(i,e,t,"longitudinal")}halfblur(e,t,i,s){let r=e.width,a=isFinite(i)?Math.PI/(2*r):2*Math.PI/39,n=i/a,A=isFinite(i)?1+Math.floor(3*n):20;A>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${A} samples when the maximum is set to 20`);let o=[],l=0;for(let e=0;e<20;++e){let t=e/n,i=Math.exp(-t*t/2);o.push(i),0==e?l+=i:e<A&&(l+=2*i)}for(let e=0;e<o.length;e++)o[e]=o[e]/l;let h=this.blurMaterial.uniforms;h.envMap.value=e.texture,h.samples.value=A,h.weights.value=o,h.latitudinal.value="latitudinal"===s,h.dTheta.value=a;let c=new es._am(.1,100,t);c.update(this.threeRenderer,this.blurScene)}getBlurShader(e){let t=new Float32Array(e),i=new es.Pa4(0,1,0),s=new es.jyz({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:i}},vertexShader:` 556 557 varying vec3 vOutputDirection; 558 559 void main() { 560 561 vOutputDirection = vec3( position ); 562 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 563 564 } 565 `,fragmentShader:` 566 varying vec3 vOutputDirection; 567 568 uniform samplerCube envMap; 569 uniform int samples; 570 uniform float weights[ n ]; 571 uniform bool latitudinal; 572 uniform float dTheta; 573 uniform vec3 poleAxis; 574 575 vec3 getSample( float theta, vec3 axis ) { 576 577 float cosTheta = cos( theta ); 578 // Rodrigues' axis-angle rotation 579 vec3 sampleDirection = vOutputDirection * cosTheta 580 + cross( axis, vOutputDirection ) * sin( theta ) 581 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 582 583 return vec3( textureCube( envMap, sampleDirection ) ); 584 585 } 586 587 void main() { 588 589 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 590 591 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 592 593 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 594 595 } 596 597 axis = normalize( axis ); 598 599 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 600 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 601 602 for ( int i = 1; i < n; i++ ) { 603 604 if ( i >= samples ) { 605 606 break; 607 608 } 609 610 float theta = dTheta * float( i ); 611 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 612 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 613 614 } 615 } 616 `,blending:es.jFi,depthTest:!1,depthWrite:!1,side:es._Li});return s}async dispose(){for(let[,e]of this.skyboxCache){let t=await e;t.dispose()}null!=this.generatedEnvironmentMap&&((await this.generatedEnvironmentMap).dispose(),this.generatedEnvironmentMap=null),null!=this.generatedEnvironmentMapAlt&&((await this.generatedEnvironmentMapAlt).dispose(),this.generatedEnvironmentMapAlt=null),null!=this.blurMaterial&&this.blurMaterial.dispose()}}let i8=[1,.79,.62,.5,.4,.31,.25],i5="high-performance";class i6 extends es.pBf{constructor(e){super(),this.loader=new t0(iX),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=e=>{this.dispatchEvent({type:"contextlost",sourceEvent:e})},this.onWebGLContextRestored=()=>{var e;
616for(let t of(null===(e=this.textureUtils)||void 0===e||e.dispose(),this.textureUtils=new i4(this.threeRenderer),this.scenes))t.element[eM]()},this.dpr=eQ(),this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new es.CP7({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:e.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.outputEncoding=es.knz,this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(1),this.debugger=e.debug?new iF(this):null,this.threeRenderer.debug={checkShaderErrors:!!this.debugger},this.threeRenderer.toneMapping=es.LY2}catch(e){console.warn(e)}this.arRenderer=new iL(this),this.textureUtils=this.canRender?new i4(this.threeRenderer):null,t0.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(){let e=this._singleton.dispose();for(let t of e)t.disconnectedCallback();for(let t of(this._singleton=new i6({powerPreference:(self.ModelViewerElement||{}).powerPreference||i5,debug:ey()}),e))t.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return i8[this.scaleStep]}set minScale(e){let t=1;for(;t<i8.length&&!(i8[t]<e);)++t;this.lastStep=t-1}registerScene(e){this.scenes.add(e),e.forceRescale();let t=new es.FM8;this.threeRenderer.getSize(t),e.canvas.width=t.x,e.canvas.height=t.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop((e,t)=>this.render(e,t)),null!=this.debugger&&this.debugger.addScene(e)}unregisterScene(e){this.scenes.delete(e),this.canvas3D.parentElement===e.canvas.parentElement&&e.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&0===this.scenes.size&&this.threeRenderer.setAnimationLoop(null),null!=this.debugger&&this.debugger.removeScene(e)}displayCanvas(e){return this.multipleScenesVisible?e.element[r9]:this.canvas3D}countVisibleScenes(){let{canvas3D:e}=this,t=0,i=null;for(let s of this.scenes){let{element:r}=s;r.modelIsVisible&&null==s.externalRenderer&&++t,e.parentElement===s.canvas.parentElement&&(i=s)}let s=t>1;if(null!=i){let t=s&&!this.multipleScenesVisible,r=!i.element.modelIsVisible;if(t||r){let{width:t,height:s}=this.sceneSize(i);this.copyPixels(i,t,s),e.parentElement.removeChild(e)}}this.multipleScenesVisible=s}updateRendererSize(){let e=eQ();if(e!==this.dpr)for(let e of this.scenes){let{element:t}=e;t[rz](t.getBoundingClientRect())}let t=0,i=0;for(let e of this.scenes)t=Math.max(t,e.width),i=Math.max(i,e.height);if(t!==this.width||i!==this.height||e!==this.dpr)for(let s of(this.width=t,this.height=i,this.dpr=e,t=Math.ceil(t*e),i=Math.ceil(i*e),this.canRender&&this.threeRenderer.setSize(t,i,!1),this.scenes)){let{canvas:e}=s;e.width=t,e.height=i,s.forceRescale()}}updateRendererScale(e){let t=this.scaleStep;this.avgFrameDuration+=eB(.2*(e-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),t!==this.scaleStep&&(this.avgFrameDuration=50)}shouldRender(e){if(e.shouldRender())e.scaleStep!=this.scaleStep&&(e.scaleStep=this.scaleStep,this.rescaleCanvas(e));else{if(0==e.scaleStep)return!1;e.scaleStep=0,this.rescaleCanvas(e)}return!0}rescaleCanvas(e){let t=i8[e.scaleStep],i=Math.ceil(this.width/t),s=Math.ceil(this.height/t),{style:r}=e.canvas;r.width=`${i}px`,r.height=`${s}px`,this.canvas3D.style.width=`${i}px`,this.canvas3D.style.height=`${s}px`;let a=this.dpr*t,n=t<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";e.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:a,minimumDpr:this.dpr*i8[this.lastStep],pixelWidth:Math.ceil(e.width*a),pixelHeight:Math.ceil(e.height*a),reason:n}}))}sceneSize(e){let{dpr:t}=this,i=i8[e.scaleStep],s=Math.min(Math.ceil(e.width*i*t),this.canvas3D.width),r=Math.min(Math.ceil(e.height*i*t),this.canvas3D.height);return{width:s,height:r}}copyPixels(e,t,i){let s=e.context;if(null==s){console.log("could not acquire 2d context");return}s.clearRect(0,0,t,i),s.drawImage(this.canvas3D,0,0,t,i,0,0,t,i),e.canvas.classList.add("show")}orderedScenes(){let e=[];for(let t of[!1,!0])for(let i of this.scenes)i.element.modelIsVisible===t&&e.push(i);return e}get isPresenting(){return this.arRenderer.isPresenting}preRender(e,t,i){let{element:s,exposure:r}=e;s[at](t,i);let a="number"==typeof r&&!Number.isNaN(r);this.threeRenderer.toneMappingExposure=a?r:1}render(e,t){if(null!=t){this.arRenderer.onWebXRFrame(e,t);return}let i=e-this.lastTick;if(this.lastTick=e,!this.canRender||this.isPresenting)return;this.countVisibleScenes(),this.updateRendererSize(),this.renderedLastFrame&&(this.updateRendererScale(i),this.renderedLastFrame=!1);let{canvas3D:s}=this;for(let t of this.orderedScenes()){let{element:r}=t;if(!r.loaded||!r.modelIsVisible&&t.renderCount>0||(this.preRender(t,e,i),!this.shouldRender(t)))continue;if(null!=t.externalRenderer){let e=t.getCamera();e.updateMatrix();let{matrix:i,projectionMatrix:s}=e,r=i.elements.slice(),a=t.getTarget();r[12]+=a.x,r[13]+=a.y,r[14]+=a.z,t.externalRenderer.render({viewMatrix:r,projectionMatrix:s.elements});continue}if(!r.modelIsVisible&&!this.multipleScenesVisible)for(let e of this.scenes)e.element.modelIsVisible&&e.queueRender();let{width:a,height:n}=this.sceneSize(t);t.renderShadow(this.threeRenderer),this.threeRenderer.setRenderTarget(null),this.threeRenderer.setViewport(0,Math.ceil(this.height*this.dpr)-n,a,n),this.threeRenderer.render(t,t.camera),this.multipleScenesVisible||0===t.renderCount?this.copyPixels(t,a,n):s.parentElement!==t.canvas.parentElement&&(t.canvas.parentElement.appendChild(s),t.canvas.classList.remove("show")),t.hasRendered(),++t.renderCount,this.renderedLastFrame=!0}}dispose(){null!=this.textureUtils&&this.textureUtils.dispose(),null!=this.threeRenderer&&this.threeRenderer.dispose(),this.textureUtils=null,this.threeRenderer=null;let e=[];for(let t of this.scenes)e.push(t.element);return this.canvas3D.removeEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.removeEventListener("webglcontextrestored",this.onWebGLContextRestored),e}}i6._singleton=new i6({powerPreference:(self.ModelViewerElement||{}).powerPreference||i5,debug:ey()});/* @license 617 * Copyright 2020 Google LLC. All Rights Reserved. 618 * Licensed under the Apache License, Version 2.0 (the 'License');
619 * you may not use this file except in compliance with the License. 620 * You may obtain a copy of the License at 621 * 622 * http://www.apache.org/licenses/LICENSE-2.0 623 * 624 * Unless required by applicable law or agreed to in writing, software 625 * distributed under the License is distributed on an 'AS IS' BASIS, 626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 627 * See the License for the specific language governing permissions and 628 * limitations under the License. 629 */let i9=Symbol("correlatedObjects"),i7=Symbol("sourceObject"),se=Symbol("onUpdate");class st{constructor(e,t,i=null){this[se]=e,this[i7]=t,this[i9]=i}}/* @license 630 * Copyright 2020 Google LLC. All Rights Reserved. 631 * Licensed under the Apache License, Version 2.0 (the 'License'); 632 * you may not use this file except in compliance with the License. 633 * You may obtain a copy of the License at 634 * 635 * http://www.apache.org/licenses/LICENSE-2.0 636 * 637 * Unless required by applicable law or agreed to in writing, software 638 * distributed under the License is distributed on an 'AS IS' BASIS, 639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 640 * See the License for the specific language governing permissions and 641 * limitations under the License. 642 */let si=new es.vBJ,ss=new es._12(2,2),sr=0,sa=Symbol("threeTexture");Symbol("applyTexture");class sn extends st{get[sa](){var e;return console.assert(null!=this[i9]&&this[i9].size>0,"Image correlated object is undefined"),null===(e=this[i9])||void 0===e?void 0:e.values().next().value}constructor(e,t,i){super(e,i=null!=i?i:{name:t&&t.image&&t.image.src?t.image.src.split("/").pop():"adhoc_image",uri:t&&t.image&&t.image.src?t.image.src:"adhoc_image"+sr++},new Set(t?[t]:[]))}get name(){return this[i7].name||""}get uri(){return this[i7].uri}get bufferView(){return this[i7].bufferView}get type(){return null!=this.uri?"external":"embedded"}set name(e){this[i7].name=e}async createThumbnail(e,t){let i=new es.xsS;si.map=this[sa];let s=new es.Kj0(ss,si);i.add(s);let r=new es.iKG(-1,1,1,-1,0,1),{threeRenderer:a}=i6.singleton,n=new es.dd2(e,t);a.setRenderTarget(n),a.render(i,r),a.setRenderTarget(null);let A=new Uint8Array(e*t*4);a.readRenderTargetPixels(n,0,0,e,t,A),r_.width=e,r_.height=t;let o=r_.getContext("2d"),l=o.createImageData(e,t);return l.data.set(A),o.putImageData(l,0,0),new Promise(async(e,t)=>{r_.toBlob(i=>{if(!i)return t("Failed to capture thumbnail.");e(URL.createObjectURL(i))},"image/png")})}}(c=E||(E={}))[c.Nearest=9728]="Nearest",c[c.Linear=9729]="Linear",c[c.NearestMipmapNearest=9984]="NearestMipmapNearest",c[c.LinearMipmapNearest=9985]="LinearMipmapNearest",c[c.NearestMipmapLinear=9986]="NearestMipmapLinear",c[c.LinearMipmapLinear=9987]="LinearMipmapLinear",(g=C||(C={}))[g.ClampToEdge=33071]="ClampToEdge",g[g.MirroredRepeat=33648]="MirroredRepeat",g[g.Repeat=10497]="Repeat";/* @license 643 * Copyright 2020 Google LLC. All Rights Reserved. 644 * Licensed under the Apache License, Version 2.0 (the 'License'); 645 * you may not use this file except in compliance with the License. 646 * You may obtain a copy of the License at 647 * 648 * http://www.apache.org/licenses/LICENSE-2.0 649 * 650 * Unless required by applicable law or agreed to in writing, software 651 * distributed under the License is distributed on an 'AS IS' BASIS, 652 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 653 * See the License for the specific language governing permissions and 654 * limitations under the License. 655 */let sA=(()=>{let e=[E.Nearest,E.Linear,E.NearestMipmapNearest,E.LinearMipmapLinear,E.NearestMipmapLinear,E.LinearMipmapLinear];return t=>e.indexOf(t)>-1})(),so=(()=>{let e=[E.Nearest,E.Linear];return t=>e.indexOf(t)>-1})(),sl=(()=>{let e=[C.ClampToEdge,C.MirroredRepeat,C.Repeat];return t=>e.indexOf(t)>-1})(),sh=(e,t)=>{switch(e){case"minFilter":return sA(t);case"magFilter":return so(t);case"wrapS":case"wrapT":return sl(t);default:throw Error(`Cannot configure property "${e}" on Sampler`)}},sc=Symbol("threeTextures"),sg=Symbol("setProperty"),su=Symbol("sourceSampler");class sd extends st{get[sc](){return console.assert(null!=this[i9]&&this[i9].size>0,"Sampler correlated object is undefined"),this[i9]}get[su](){return console.assert(null!=this[i7],"Sampler source is undefined"),this[i7]}constructor(e,t,i){null==(i=null!=i?i:{}).minFilter&&(i.minFilter=t?t.minFilter:E.LinearMipmapLinear),null==i.magFilter&&(i.magFilter=t?t.magFilter:E.Linear),null==i.wrapS&&(i.wrapS=t?t.wrapS:C.Repeat),null==i.wrapT&&(i.wrapT=t?t.wrapT:C.Repeat),super(e,i,new Set(t?[t]:[]))}get name(){return this[i7].name||""}get minFilter(){return this[su].minFilter}get magFilter(){return this[su].magFilter}get wrapS(){return this[su].wrapS}get wrapT(){return this[su].wrapT}setMinFilter(e){this[sg]("minFilter",e)}setMagFilter(e){this[sg]("magFilter",e)}setWrapS(e){this[sg]("wrapS",e)}setWrapT(e){this[sg]("wrapT",e)}[sg](e,t){let i=this[su];
655if(null!=i){if(sh(e,t))for(let s of(i[e]=t,this[sc]))s[e]=t,s.needsUpdate=!0;this[se]()}}}/* @license 656 * Copyright 2020 Google LLC. All Rights Reserved. 657 * Licensed under the Apache License, Version 2.0 (the 'License'); 658 * you may not use this file except in compliance with the License. 659 * You may obtain a copy of the License at 660 * 661 * http://www.apache.org/licenses/LICENSE-2.0 662 * 663 * Unless required by applicable law or agreed to in writing, software 664 * distributed under the License is distributed on an 'AS IS' BASIS, 665 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 666 * See the License for the specific language governing permissions and 667 * limitations under the License. 668 */let sp=Symbol("image"),sm=Symbol("sampler");class sI extends st{constructor(e,t,i=null,s=null,r=null){super(e,i||{},new Set(t?[t]:[])),this[sm]=new sd(e,t,s),this[sp]=new sn(e,t,r)}get name(){return this[i7].name||""}set name(e){this[i7].name=e}get sampler(){return this[sm]}get source(){return this[sp]}}let sf=Symbol("texture"),sE=Symbol("transform"),sC=Symbol("materials"),sB=Symbol("usage");(u=y||(y={}))[u.Base=0]="Base",u[u.MetallicRoughness=1]="MetallicRoughness",u[u.Normal=2]="Normal",u[u.Occlusion=3]="Occlusion",u[u.Emissive=4]="Emissive";class sQ{constructor(e,t,i,s,r,a){if(this[B]=null,this[Q]={rotation:0,scale:new es.FM8(1,1),offset:new es.FM8(0,0)},a&&i){let t=r.textures?r.textures[a.index]:null,s=t&&r.samplers?r.samplers[t.sampler]:null,n=t&&r.images?r.images[t.source]:null;this[sE].rotation=i.rotation,this[sE].scale.copy(i.repeat),this[sE].offset.copy(i.offset),this[sf]=new sI(e,i,t,s,n)}this.onUpdate=e,this[sC]=s,this[sB]=t}get texture(){return this[sf]}setTexture(e){let t=null!=e?e.source[sa]:null,i=es.knz;if(this[sf]=e,this[sC])for(let e of this[sC]){switch(this[sB]){case y.Base:e.map=t;break;case y.MetallicRoughness:i=es.rnI,e.metalnessMap=t,e.roughnessMap=t;break;case y.Normal:i=es.rnI,e.normalMap=t;break;case y.Occlusion:i=es.rnI,e.aoMap=t;break;case y.Emissive:e.emissiveMap=t}e.needsUpdate=!0}t&&(t.encoding=i,t.rotation=this[sE].rotation,t.repeat=this[sE].scale,t.offset=this[sE].offset),this.onUpdate()}}B=sf,Q=sE;/* @license 669 * Copyright 2020 Google LLC. All Rights Reserved. 670 * Licensed under the Apache License, Version 2.0 (the 'License'); 671 * you may not use this file except in compliance with the License. 672 * You may obtain a copy of the License at 673 * 674 * http://www.apache.org/licenses/LICENSE-2.0 675 * 676 * Unless required by applicable law or agreed to in writing, software 677 * distributed under the License is distributed on an 'AS IS' BASIS, 678 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 679 * See the License for the specific language governing permissions and 680 * limitations under the License. 681 */let sy=Symbol("threeMaterials"),sw=Symbol("baseColorTexture"),sv=Symbol("metallicRoughnessTexture");class sb extends st{constructor(e,t,i,s){super(e,i,s),null==i.baseColorFactor&&(i.baseColorFactor=[1,1,1,1]),null==i.roughnessFactor&&(i.roughnessFactor=1),null==i.metallicFactor&&(i.metallicFactor=1);let{baseColorTexture:r,metallicRoughnessTexture:a}=i,{map:n,metalnessMap:A}=s.values().next().value;this[sw]=new sQ(e,y.Base,n,s,t,r||null),this[sv]=new sQ(e,y.MetallicRoughness,A,s,t,a||null)}get[sy](){return this[i9]}get baseColorFactor(){return this[i7].baseColorFactor}get metallicFactor(){return this[i7].metallicFactor}get roughnessFactor(){return this[i7].roughnessFactor}get baseColorTexture(){return this[sw]}get metallicRoughnessTexture(){return this[sv]}setBaseColorFactor(e){let t=new es.Ilk;for(let i of(e instanceof Array?t.fromArray(e):t.set(e).convertSRGBToLinear(),this[sy]))i.color.set(t),e instanceof Array?i.opacity=e[3]:(e=[0,0,0,i.opacity],t.toArray(e));let i=this[i7];i.baseColorFactor=e,this[se]()}setMetallicFactor(e){for(let t of this[sy])t.metalness=e;let t=this[i7];t.metallicFactor=e,this[se]()}setRoughnessFactor(e){for(let t of this[sy])t.roughness=e;let t=this[i7];t.roughnessFactor=e,this[se]()}}let sS=Symbol("pbrMetallicRoughness"),sx=Symbol("normalTexture"),sM=Symbol("occlusionTexture"),sR=Symbol("emissiveTexture"),sD=Symbol("backingThreeMaterial"),sT=Symbol("applyAlphaCutoff"),sL=Symbol("lazyLoadGLTFInfo"),sF=Symbol("initialize"),sk=Symbol("getLoadedMaterial"),sU=Symbol("ensureMaterialIsLoaded"),sN=Symbol("gltfIndex"),sG=Symbol("setActive"),s_=Symbol("variantIndices"),sP=Symbol("isActive"),sO=Symbol("variantSet"),sH=Symbol("modelVariants");class sq extends st{constructor(e,t,i,s,r,a,n,A){super(e,i,n),this[w]=new Set,this[sN]=s,this[sP]=r,this[sH]=a,null==A?this[sF](t):this[sL]=A}get[(w=sO,sD)](){return this[i9].values().next().value}[sF](e){let t=this[se],i=this[i7],s=this[i9];i.extensions&&i.extensions.KHR_materials_pbrSpecularGlossiness&&console.warn(`Material ${i.name} uses a deprecated extension 682 "KHR_materials_pbrSpecularGlossiness", please use 683 "pbrMetallicRoughness" instead. Specular Glossiness materials are 684 currently supported for rendering, but not for our scene-graph API, 685 nor for auto-generation of USDZ for Quick Look.`),null==i.pbrMetallicRoughness&&(i.pbrMetallicRoughness={}),this[sS]=new sb(t,e,i.pbrMetallicRoughness,s),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);let{normalTexture:r,occlusionTexture:a,emissiveTexture:n}=i,{normalMap:A,aoMap:o,emissiveMap:l}=s.values().next().value;this[sx]=new sQ(t,y.Normal,A,s,e,r||null),this[sM]=new sQ(t,y.Occlusion,o,s,e,a||null),this[sR]=new sQ(t,y.Emissive,l,s,e,n||null)}
685async [sk](){if(null!=this[sL]){let{set:e,material:t}=await this[sL].doLazyLoad();return this[i9]=e,this[sF](this[sL].gltf),this[sL]=void 0,this.ensureLoaded=async()=>{},t}return this[i9].values().next().value}[sU](){if(null!=this[sL])throw Error(`Material "${this.name}" has not been loaded, call 'await 686 myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[sk]()}get isLoaded(){return null==this[sL]}get isActive(){return this[sP]}[sG](e){this[sP]=e}get name(){return this[i7].name}set name(e){let t=this[i7];if(null!=t&&(t.name=e),null!=this[i9])for(let t of this[i9])t.name=e}get pbrMetallicRoughness(){return this[sU](),this[sS]}get normalTexture(){return this[sU](),this[sx]}get occlusionTexture(){return this[sU](),this[sM]}get emissiveTexture(){return this[sU](),this[sR]}get emissiveFactor(){return this[sU](),this[i7].emissiveFactor}get index(){return this[sN]}[s_](){return this[sO]}hasVariant(e){let t=this[sH].get(e);return null!=t&&this[sO].has(t.index)}setEmissiveFactor(e){this[sU]();let t=new es.Ilk;for(let i of(e instanceof Array?t.fromArray(e):t.set(e).convertSRGBToLinear(),this[i9]))i.emissive.set(t);this[i7].emissiveFactor=t.toArray(),this[se]()}[sT](){this[sU]();let e=this[i7];for(let t of this[i9])"MASK"===this[i7].alphaMode?t.alphaTest=e.alphaCutoff:t.alphaTest=void 0,t.needsUpdate=!0}setAlphaCutoff(e){this[sU](),this[i7].alphaCutoff=e,this[sT](),this[se]()}getAlphaCutoff(){return this[sU](),this[i7].alphaCutoff}setDoubleSided(e){for(let t of(this[sU](),this[i9]))t.side=e?es.ehD:es.Wl3,t.needsUpdate=!0;this[i7].doubleSided=e,this[se]()}getDoubleSided(){return this[sU](),this[i7].doubleSided}setAlphaMode(e){this[sU]();let t=(e,t)=>{e.transparent=t,e.depthWrite=!t};for(let i of(this[i7].alphaMode=e,this[i9]))t(i,"BLEND"===e),this[sT](),i.needsUpdate=!0;this[se]()}getAlphaMode(){return this[sU](),this[i7].alphaMode}}let sK=Symbol("materials"),sJ=Symbol("variantToMaterialMap"),sV=Symbol("modelVariants"),sY=Symbol("mesh");Symbol("primitives"),Symbol("loadVariant"),Symbol("prepareVariantsForExport"),Symbol("switchVariant");let sj=Symbol("children"),sz=Symbol("initialMaterialIdx"),sW=Symbol("activeMaterialIdx");class sX{constructor(e){this.name="",this[v]=[],this.name=e}}v=sj;class sZ extends sX{constructor(e,t,i,s){super(e.name),this[b]=new Map,this[S]=new Map,this[x]=0,this[M]=0,this[sY]=e;let{gltf:r,threeGLTF:a,threeObjectMap:n}=s;this[sV]=i,this.mesh.userData.variantData=i;let A=n.get(e.material);null!=A.materials?this[sz]=this[sW]=A.materials:console.error(`Primitive (${e.name}) missing initial material reference.`);let o=e.userData.associations||{};if(null==o.meshes){console.error("Mesh is missing primitive index association");return}let l=r.meshes||[],h=l[o.meshes].primitives||[],c=h[o.primitives];if(null==c){console.error("Mesh primitive definition is missing.");return}if(null!=c.material)this[sK].set(c.material,t[c.material]);else{let e=t.findIndex(e=>"Default"===e.name);e>=0?this[sK].set(e,t[e]):console.warn("gltfPrimitive has no material!")}if(c.extensions&&c.extensions.KHR_materials_variants){let e=c.extensions.KHR_materials_variants,s=a.parser.json.extensions,r=s.KHR_materials_variants.variants;for(let s of e.mappings){let e=t[s.material];for(let t of(this[sK].set(s.material,e),s.variants)){let{name:s}=r[t];this[sJ].set(t,e),e[s_]().add(t),i.has(s)||i.set(s,{name:s,index:t})}}}}get mesh(){return this[sY]}async setActiveMaterial(e){let t=this[sK].get(e);return null!=t&&(this.mesh.material=await t[sk](),this[sW]=e),this.mesh.material}getActiveMaterial(){return this[sK].get(this[sW])}getMaterial(e){return this[sK].get(e)}async enableVariant(e){if(null==e)return this.setActiveMaterial(this[sz]);if(null!=this[sJ]&&this[sV].has(e)){let t=this[sV].get(e);return this.enableVariantHelper(t.index)}return null}async enableVariantHelper(e){if(null!=this[sJ]&&null!=e){let t=this[sJ].get(e);if(null!=t)return this.setActiveMaterial(t.index)}return null}async instantiateVariants(){if(null!=this[sJ])for(let e of this[sJ].keys()){let t=this.mesh.userData.variantMaterials.get(e);if(null!=t.material)continue;let i=await this.enableVariantHelper(e);null!=i&&(t.material=i)}}get variantInfo(){return this[sJ]}addVariant(e,t){if(!this.ensureVariantIsUnused(t))return!1;this[sV].has(t)||this[sV].set(t,{name:t,index:this[sV].size});let i=this[sV].get(t),s=i.index;return e[s_]().add(s),this[sJ].set(s,e),this[sK].set(e.index,e),this.updateV
686ariantUserData(s,e),!0}deleteVariant(e){if(this.variantInfo.has(e)){this.variantInfo.delete(e);let t=this.mesh.userData.variantMaterials;null!=t&&t.delete(e)}}updateVariantUserData(e,t){t[s_]().add(e),this.mesh.userData.variantData=this[sV],this.mesh.userData.variantMaterials=this.mesh.userData.variantMaterials||new Map;let i=this.mesh.userData.variantMaterials;i.set(e,{material:t[i9].values().next().value,gltfMaterialIndex:t.index})}ensureVariantIsUnused(e){let t=this[sV].get(e);return!(null!=t&&this.variantInfo.has(t.index))||(console.warn(`Primitive cannot add variant '${e}' for this material, it already exists.`),!1)}}b=sK,S=sJ,x=sz,M=sW;let s$=Symbol("materials"),s0=Symbol("hierarchy"),s1=Symbol("roots"),s2=Symbol("primitives");Symbol("loadVariant");let s3=Symbol("correlatedSceneGraph"),s4=Symbol("prepareVariantsForExport"),s8=Symbol("switchVariant"),s5=Symbol("threeScene"),s6=Symbol("materialsFromPoint"),s9=Symbol("materialFromPoint"),s7=Symbol("variantData"),re=Symbol("availableVariants"),rt=Symbol("modelOnUpdate"),ri=Symbol("cloneMaterial");class rs{constructor(e,t,i,s){this.gltf=e,this.gltfElementMap=t,this.mapKey=i,this.doLazyLoad=s}}class rr{constructor(e,t=()=>{}){this[R]=[],this[D]=[],this[T]=[],this[L]=[],this[F]=()=>{},this[k]=new Map,this[rt]=t,this[s3]=e;let{gltf:i,threeGLTF:s,gltfElementMap:r}=e;for(let[e,a]of(this[s5]=s.scene,i.materials.entries())){let n=r.get(a);if(null!=n)this[s$].push(new sq(t,i,a,e,!0,this[s7],n));else{let a=i.materials||[],A=a[e],o=e,l=async()=>{let e=await s.parser.getDependency("material",o),t=new Set;return r.set(A,t),t.add(e),{set:t,material:e}};this[s$].push(new sq(t,i,A,e,!1,this[s7],n,new rs(i,r,A,l)))}}let a=new Map,n=[];for(let e of s.scene.children)n.push(e);for(;n.length>0;){let t=n.pop(),i=null;t instanceof es.Kj0?(i=new sZ(t,this.materials,this[s7],e),this[s2].push(i)):i=new sX(t.name);let s=a.get(t);for(let e of(null!=s?s[sj].push(i):this[s1].push(i),this[s0].push(i),t.children))n.push(e),a.set(t,i)}}get materials(){return this[s$]}[(R=s$,D=s0,T=s1,L=s2,F=rt,k=s7,re)](){let e=Array.from(this[s7].values());return e.sort((e,t)=>e.index-t.index),e.map(e=>e.name)}getMaterialByName(e){let t=this[s$].filter(t=>t.name===e);return t.length>0?t[0]:null}[s6](e){let t=e.intersectObject(this[s5],!0);return t.map(e=>{let t=this[s0].find(t=>t instanceof sZ&&t.mesh===e.object);return null!=t?t.getActiveMaterial():null})}[s9](e){let t=this[s6](e);return t.length>0?t[0]:null}async [s8](e){for(let t of this[s2])await t.enableVariant(e);for(let e of this.materials)e[sG](!1);for(let e of this[s2])this.materials[e.getActiveMaterial().index][sG](!0)}async [s4](){let e=[];for(let t of this[s2])e.push(t.instantiateVariants());await Promise.all(e)}[ri](e,t){let i=this.materials[e];i.isLoaded||console.error(`Cloning an unloaded material, 687 call 'material.ensureLoaded() before cloning the material.`);let s=i[i9],r=JSON.parse(JSON.stringify(i[i7]));r.name=t;let a=this[s3].gltf;a.materials.push(r);let n=new Set;for(let[e,i]of s.entries()){let r=i.clone();r.name=t+(s.size>1?"_inst"+e:""),n.add(r)}let A=new sq(this[rt],this[s3].gltf,r,this[s$].length,!1,this[s7],n);return this[s$].push(A),A}createMaterialInstanceForVariant(e,t,i,s=!0){let r=null;for(let s of this[s2]){let a=this[s7].get(i);null!=a&&s.variantInfo.has(a.index)||null==s.getMaterial(e)||(this.hasVariant(i)||this.createVariant(i),null==r&&(r=this[ri](e,t)),s.addVariant(r,i))}if(s&&null!=r)for(let t of(r[sG](!0),this.materials[e][sG](!1),this[s2]))t.enableVariant(i);return r}createVariant(e){this[s7].has(e)?console.warn(`Variant '${e}'' already exists`):this[s7].set(e,{name:e,index:this[s7].size})}hasVariant(e){return this[s7].has(e)}setMaterialToVariant(e,t){if(null==this[re]().find(e=>e===t)){console.warn(`Can't add material to '${t}', the variant does not exist.'`);return}if(e<0||e>=this.materials.length){console.error("setMaterialToVariant(): materialIndex is out of bounds.");return}for(let i of this[s2]){let s=i.getMaterial(e);null!=s&&i.addVariant(s,t)}}updateVariantName(e,t){let i=this[s7].get(e);null!=i&&(i.name=t,this[s7].set(t,i),this[s7].delete(e))}deleteVariant(e){let t=this[s7].get(e);if(null!=t){for(let i of this.materials)i.hasVariant(e)&&i[sO].delete(t.index);for(let e of this[s2])e.deleteVariant(t.index);this[s7].delete(e)}}}/* @license 688 * Copyright 2020 Google LLC. All Rights Reserved. 689 * Licensed under the Apache License, Version 2.0 (the 'License');
690 * you may not use this file except in compliance with the License. 691 * You may obtain a copy of the License at 692 * 693 * http://www.apache.org/licenses/LICENSE-2.0 694 * 695 * Unless required by applicable law or agreed to in writing, software 696 * distributed under the License is distributed on an 'AS IS' BASIS, 697 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 698 * See the License for the specific language governing permissions and 699 * limitations under the License. 700 */var ra=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let rn=Symbol("currentGLTF"),rA=Symbol("originalGltfJson"),ro=Symbol("model"),rl=Symbol("getOnUpdateMethod"),rh=Symbol("textureLoader"),rc=(e,t)=>({type:"number",number:e,unit:t}),rg=(()=>{let e={};return t=>{let i=t;if(i in e)return e[i];let s=[],r=0;for(;t;){if(++r>1e3){t="";break}let e=ru(t),i=e.nodes[0];if(null==i||0===i.terms.length)break;s.push(i),t=e.remainingInput}return e[i]=s}})(),ru=(()=>{let e=/^(\-\-|[a-z\u0240-\uffff])/i,t=/^([\*\+\/]|[\-]\s)/i,i=/^[\),]/;return s=>{let r=[];for(;s.length&&(s=s.trim(),!i.test(s));)if("("===s[0]){let{nodes:e,remainingInput:t}=rI(s);s=t,r.push({type:"function",name:{type:"ident",value:"calc"},arguments:e})}else if(e.test(s)){let e=rd(s),t=e.nodes[0];if("("===(s=e.remainingInput)[0]){let{nodes:e,remainingInput:i}=rI(s);r.push({type:"function",name:t,arguments:e}),s=i}else r.push(t)}else if(t.test(s))r.push({type:"operator",value:s[0]}),s=s.slice(1);else{let{nodes:e,remainingInput:t}="#"===s[0]?rm(s):rp(s);if(0===e.length)break;r.push(e[0]),s=t}return{nodes:[{type:"expression",terms:r}],remainingInput:s}}})(),rd=(()=>{let e=/[^a-z0-9_\-\u0240-\uffff]/i;return t=>{let i=t.match(e),s=null==i?t:t.substr(0,i.index),r=null==i?"":t.substr(i.index);return{nodes:[{type:"ident",value:s}],remainingInput:r}}})(),rp=(()=>{let e=/[\+\-]?(\d+[\.]\d+|\d+|[\.]\d+)([eE][\+\-]?\d+)?/,t=/^[a-z%]+/i,i=/^(m|mm|cm|rad|deg|[%])$/;return s=>{let r=s.match(e),a=null==r?"0":r[0];s=null==a?s:s.slice(a.length);let n=s.match(t),A=null!=n&&""!==n[0]?n[0]:null,o=null==n?s:s.slice(A.length);return null==A||i.test(A)||(A=null),{nodes:[{type:"number",number:parseFloat(a)||0,unit:A}],remainingInput:o}}})(),rm=(()=>{let e=/^[a-f0-9]*/i;return t=>{t=t.slice(1).trim();let i=t.match(e),s=null==i?[]:[{type:"hex",value:i[0]}];return{nodes:s,remainingInput:null==i?t:t.slice(i[0].length)}}})(),rI=e=>{let t=[];for(e=e.slice(1).trim();e.length;){let i=ru(e);if(t.push(i.nodes[0]),","===(e=i.remainingInput.trim())[0])e=e.slice(1).trim();else if(")"===e[0]){e=e.slice(1);break}}return{nodes:t,remainingInput:e}},rf=Symbol("visitedTypes");class rE{constructor(e){this[rf]=e}walk(e,t){let i=e.slice();for(;i.length;){let e=i.shift();switch(this[rf].indexOf(e.type)>-1&&t(e),e.type){case"expression":i.unshift(...e.terms);break;case"function":i.unshift(e.name,...e.arguments)}}}}let rC=Object.freeze({type:"number",number:0,unit:null}),rB=(e,t=0)=>{let{number:i,unit:s}=e;if(isFinite(i)){if("rad"===e.unit||null==e.unit)return e}else i=t,s="rad";let r="deg"===s&&null!=i,a=r?i:0;return{type:"number",number:a*Math.PI/180,unit:"rad"}},rQ=(e,t=0)=>{let i,{number:s,unit:r}=e;if(isFinite(s)){if("m"===e.unit)return e}else s=t,r="m";switch(r){default:i=1;break;case"cm":i=.01;break;case"mm":i=.001}let a=i*s;return{type:"number",number:a,unit:"m"}},ry=(()=>{let e=e=>e,t={rad:e,deg:rB,m:e,mm:rQ,cm:rQ};return(e,i=rC)=>{isFinite(e.number)||(e.number=i.number,e.unit=i.unit);let{unit:s}=e;if(null==s)return e;let r=t[s];return null==r?i:r(e)}})();/* @license 701 * Copyright 2020 Google LLC. All Rights Reserved. 702 * Licensed under the Apache License, Version 2.0 (the 'License'); 703 * you may not use this file except in compliance with the License. 704 * You may obtain a copy of the License at 705 * 706 * http://www.apache.org/licenses/LICENSE-2.0 707 * 708 * Unless required by applicable law or agreed to in writing, softw
708are 709 * distributed under the License is distributed on an 'AS IS' BASIS, 710 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 711 * See the License for the specific language governing permissions and 712 * limitations under the License. 713 */class rw extends t1{constructor(e){super(document.createElement("div")),this.normal=new es.Pa4(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=e.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(e.position),this.updateNormal(e.normal)}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(e){if(null==e)return;let t=rg(e)[0].terms;for(let e=0;e<3;++e)this.position.setComponent(e,ry(t[e]).number);this.updateMatrixWorld()}updateNormal(e){if(null==e)return;let t=rg(e)[0].terms;for(let e=0;e<3;++e)this.normal.setComponent(e,ry(t[e]).number)}orient(e){this.pivot.style.transform=`rotate(${e}rad)`}updateVisibility(e){e?this.element.classList.remove("hide"):this.element.classList.add("hide"),this.slot.assignedNodes().forEach(t=>{if(t.nodeType!==Node.ELEMENT_NODE)return;let i=t.dataset.visibilityAttribute;if(null!=i){let s=`data-${i}`;e?t.setAttribute(s,""):t.removeAttribute(s)}t.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:e}}))}),this.initialized=!0}}let rv=(e,t,i)=>{let s=i,r=new es.Pa4;return e.traverseVisible(e=>{let i,a;e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){if(n.isGeometry){let A=n.vertices;for(i=0,a=A.length;i<a;i++)r.copy(A[i]),e.isSkinnedMesh?e.boneTransform(i,r):r.applyMatrix4(e.matrixWorld),s=t(s,r)}else if(n.isBufferGeometry){let{position:A}=n.attributes;if(void 0!==A)for(i=0,a=A.count;i<a;i++)r.fromBufferAttribute(A,i),e.isSkinnedMesh?e.boneTransform(i,r):r.applyMatrix4(e.matrixWorld),s=t(s,r)}}}),s},rb={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` 714 715 varying vec2 vUv; 716 717 void main() { 718 719 vUv = uv; 720 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 721 722 }`,fragmentShader:` 723 724 uniform sampler2D tDiffuse; 725 uniform float h; 726 727 varying vec2 vUv; 728 729 void main() { 730 731 vec4 sum = vec4( 0.0 ); 732 733 sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051; 734 sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918; 735 sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245; 736 sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531; 737 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 738 sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531; 739 sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245; 740 sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918; 741 sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051; 742 743 gl_FragColor = sum; 744 745 }`},rS={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:` 746 747 varying vec2 vUv; 748 749 void main() { 750 751 vUv = uv; 752 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 753 754 }`,fragmentShader:` 755 756 uniform sampler2D tDiffuse; 757 uniform float v; 758 759 varying vec2 vUv; 760 761 void main() { 762 763 vec4 sum = vec4( 0.0 ); 764 765 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051; 766 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918; 767 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245; 768 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531; 769 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 770 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531; 771 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245; 772 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918; 773 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051; 774 775 gl_FragColor = sum; 776 777 }`};class rx extends es.Tme{constructor(e,t,i){super(),this.camera=new es.iKG,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new es.lRF,this.horizontalBlurMaterial=new es.jyz(rb),this.verticalBlurMaterial=new es.jyz(rS),this.intensity=0,this.softness=1,this.boundingBox=new es.ZzF,this.size=new es.Pa4,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;let{camera:s}=this;s.rotation.x=Math.PI/2,s.left=-.5,s.right=.5,s.bottom=-.5,s.top=.5,this.add(s);let r=new es._12,a=new es.vBJ({opacity:1,transparent:!0,side:es._Li});this.floor=new es.Kj0(r,a),this.floor.userData.shadow=!0,s.add(this.floor),this.blurPlane=new es.Kj0(r),this.blurPlane.visible=!1,s.add(this.blurPlane),e.target.add(this),this.depthMaterial.onBeforeCompile=function(e){e.fragmentShader=e.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(e,t,i)}setScene(e,t,i){let{boundingBox:s,size:r,rotation:a,position:n}=this;if(this.isAnimated=e.animationNames.length>0,this.boundingBox.copy(e.boundingBox),this.size.copy(e.size),this.maxDimension=Math.max(r.x,r.y,r.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(n),"back"===i){let{min:e,max:t}=s;[e.y,e.z]=[e.z,e.y],[t.y,t.z]=[t.z,t.y],[r.y,r.z]=[r.z,r.y],a.x=Math.PI/2,a.y=Math.PI}else a.x=0,a.y=0;if(this.isAnimated){let e=s.min.y,t=s.max.y;r.y=this.maxDimension,s.expandByVector(r.subScalar(this.maxDimension).multiplyScalar(-.5)),s.min.y=e,s.max.y=t,r.set(this.maxDimension,t-e,this.maxDimension)}"bottom"===i?n.y=s.min.y:n.z=s.min.y,this.setSoftness(t)}setSoftness(e){this.softness=e;let{size:t,camera:i}=this,s=this.isAnimated?2:1;this.setMapSize(s*Math.pow(2,9-3*e));let r=t.y/2,a=t.y*s;i.near=0,i.far=(1-e)*a+e*r,this.depthMaterial.opacity=1/e,i.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(e){let{size:t}=this;this.isAnimated&&(e*=2);let i=Math.floor(t.x>t.z?e:e*t.x/t.z),s=Math.floor(t.x>t.z?e*t.z/t.x:e),r=10+i,a=10+s;if(null!=this.renderTarget&&(this.renderTarget.width!==r||this.renderTarget.height!==a)&&(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){let e={format:es.wk1};
777this.renderTarget=new es.dd2(r,a,e),this.renderTargetBlur=new es.dd2(r,a,e),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(t.x*(1+10/i),t.z*(1+10/s),1),this.needsUpdate=!0}setIntensity(e){if(this.intensity=e,e>0){var t;this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=e*((1-(t=this.softness*this.softness))*.3+1*t)}else this.visible=!1,this.floor.visible=!1}getIntensity(){return this.intensity}setOffset(e){this.floor.position.z=-e+.001*this.maxDimension}render(e,t){t.overrideMaterial=this.depthMaterial;let i=e.getClearAlpha();e.setClearAlpha(0),this.floor.visible=!1;let s=e.xr.enabled;e.xr.enabled=!1;let r=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.render(t,this.camera),t.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(e),e.xr.enabled=s,e.setRenderTarget(r),e.setClearAlpha(i)}blurShadow(e){let{camera:t,horizontalBlurMaterial:i,verticalBlurMaterial:s,renderTarget:r,renderTargetBlur:a,blurPlane:n}=this;n.visible=!0,n.material=i,i.uniforms.h.value=1/this.renderTarget.width,i.uniforms.tDiffuse.value=this.renderTarget.texture,e.setRenderTarget(a),e.render(n,t),n.material=s,s.uniforms.v.value=1/this.renderTarget.height,s.uniforms.tDiffuse.value=this.renderTargetBlur.texture,e.setRenderTarget(r),e.render(n,t),n.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()}}let rM=new es.Pa4,rR=new es.Pa4,rD=new es.Pa4,rT=new es.iMs,rL=new es.Pa4,rF=new es.FM8;class rk extends es.xsS{constructor({canvas:e,element:t,width:i,height:s}){super(),this.annotationRenderer=new t6,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 es.cPb(45,1,.1,100),this.xrCamera=null,this.url=null,this.target=new es.Tme,this.animationNames=[],this.boundingBox=new es.ZzF,this.boundingSphere=new es.aLr,this.size=new es.Pa4,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 es.Pa4,this.targetDamperX=new iQ,this.targetDamperY=new iQ,this.targetDamperZ=new iQ,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.name="ModelScene",this.element=t,this.canvas=e,this.camera=new es.cPb(45,1,.1,100),this.camera.name="MainCamera",this.add(this.target),this.setSize(i,s),this.target.name="Target",this.mixer=new es.Xcj(this.target);let{domElement:r}=this.annotationRenderer,{style:a}=r;a.display="none",a.pointerEvents="none",a.position="absolute",a.top="0",this.element.shadowRoot.querySelector(".default").appendChild(r),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(e){this.reset(),this._model=e,this.target.add(e),await this.setupScene()}async setSource(e,t=()=>{}){let i;if(!e||e===this.url){t(1);return}if(this.reset(),this.url=e,null!=this.externalRenderer){let e=await this.externalRenderer.load(t);this.boundingSphere.radius=e.framedRadius,this.idealAspect=e.fieldOfViewAspect;return}null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{i=await new Promise(async(i,s)=>{this.cancelPendingSourceChange=()=>s();try{let s=await this.element[ar].loader.load(e,this.element,t);i(s)}catch(e){s(e)}})}catch(e){if(null==e)return;throw e}this.cancelPendingSourceChange=null,this.reset(),this.url=e,this._currentGLTF=i,null!=i&&(this._model=i.scene,this.target.add(i.scene));let{animations:s}=i,r=new Map,a=[];for(let e of s)r.set(e.name,e),a.push(e.name);this.animations=s,this.animationsByName=r,this.animationNames=a,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity)}reset(){this.url=null,this.queueRender(),null!=this.shadow&&this.shadow.setIntensity(0),this.bakedSha
777dows.clear();let{_model:e}=this;null!=e&&(e.removeFromParent(),this._model=null);let t=this._currentGLTF;null!=t&&(t.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.shadow=null),this.element[rn]=null,this.element[rA]=null,this.element[ro]=null}get currentGLTF(){return this._currentGLTF}setSize(e,t){if(this.width!==e||this.height!==t){if(this.width=Math.max(e,1),this.height=Math.max(t,1),this.annotationRenderer.setSize(e,t),this.aspect=this.width/this.height,null!=this.externalRenderer){let i=eQ();this.externalRenderer.resize(e*i,t*i)}this.queueRender()}}markBakedShadow(e){e.userData.shadow=!0,this.bakedShadows.add(e)}unmarkBakedShadow(e){e.userData.shadow=!1,e.visible=!0,this.bakedShadows.delete(e),this.boundingBox.expandByObject(e)}findBakedShadows(e){let t=new es.ZzF;e.traverse(e=>{if(!e.isMesh)return;let i=e.material;if(!i.transparent)return;t.setFromObject(e);let s=t.getSize(rL),r=Math.min(s.x,s.y,s.z),a=Math.max(s.x,s.y,s.z);a<100*r||this.markBakedShadow(e)})}checkBakedShadows(){let{min:e,max:t}=this.boundingBox,i=new es.ZzF;for(let s of(this.boundingBox.getSize(this.size),this.bakedShadows))i.setFromObject(s),i.min.y<e.y+this.size.y/100&&i.min.x<=e.x&&i.max.x>=t.x&&i.min.z<=e.z&&i.max.z>=t.z||i.min.z<e.z+this.size.z/100&&i.min.x<=e.x&&i.max.x>=t.x&&i.min.y<=e.y&&i.max.y>=t.y||this.unmarkBakedShadow(s)}applyTransform(){let{model:e}=this;if(null==e)return;let t=rg(this.element.orientation)[0].terms,i=ry(t[0]).number,s=ry(t[1]).number,r=ry(t[2]).number;e.quaternion.setFromEuler(new es.USm(s,r,i,"YXZ"));let a=rg(this.element.scale)[0].terms;e.scale.set(a[0].number,a[1].number,a[2].number)}updateBoundingBox(){let{model:e}=this;if(null==e)return;this.target.remove(e),this.findBakedShadows(e);let t=(e,t)=>e.expandByPoint(t);this.setBakedShadowVisibility(!1),this.boundingBox=rv(e,t,new es.ZzF),this.boundingBox.isEmpty()&&(this.setBakedShadowVisibility(!0),this.bakedShadows.forEach(e=>this.unmarkBakedShadow(e)),this.boundingBox=rv(e,t,new es.ZzF)),this.checkBakedShadows(),this.setBakedShadowVisibility(),this.boundingBox.getSize(this.size),this.target.add(e)}async updateFraming(){let{model:e}=this;if(null==e)return;this.target.remove(e),this.setBakedShadowVisibility(!1);let{center:t}=this.boundingSphere;this.element.requestUpdate("cameraTarget"),await this.element.updateComplete,t.copy(this.getTarget()),this.boundingSphere.radius=Math.sqrt(rv(e,(e,i)=>Math.max(e,t.distanceToSquared(i)),0)),this.idealAspect=rv(e,(e,i)=>{i.sub(t);let s=Math.sqrt(i.x*i.x+i.z*i.z);return Math.max(e,s/(this.idealCameraDistance()-Math.abs(i.y)))},0)/Math.tan(this.framedFoVDeg/2*Math.PI/180),this.setBakedShadowVisibility(),this.target.add(e)}setBakedShadowVisibility(e=this.shadowIntensity<=0){for(let t of this.bakedShadows)t.visible=e}idealCameraDistance(){let e=this.framedFoVDeg/2*Math.PI/180;return this.boundingSphere.radius/Math.sin(e)}adjustedFoV(e){let t=Math.tan(e/2*Math.PI/180)*Math.max(1,this.idealAspect/this.aspect);return 2*Math.atan(t)*180/Math.PI}getNDC(e,t){if(null!=this.xrCamera)rF.set(e/window.screen.width,t/window.screen.height);else{let i=this.element.getBoundingClientRect();rF.set((e-i.x)/this.width,(t-i.y)/this.height)}return rF.multiplyScalar(2).subScalar(1),rF.y*=-1,rF}getSize(){return{width:this.width,height:this.height}}setEnvironmentAndSkybox(e,t){this.element[ar].arRenderer.presentedScene!==this&&(this.environment=e,this.background=t,this.queueRender())}setTarget(e,t,i){this.goalTarget.set(-e,-t,-i)}setTargetDamperDecayTime(e){this.targetDamperX.setDecayTime(e),this.targetDamperY.setDecayTime(e),this.targetDamperZ.setDecayTime(e)}getTarget(){return this.goalTarget.clone().multiplyScalar(-1)}jumpToGoal(){this.updateTarget(1e4)}updateTarget(e){let t=this.goalTarget,i=this.target.position;if(t.equals(i))return!1;{let s=this.boundingSphere.radius/10,{x:r,y:a,z:n}=i;return r=this.targetDamperX.update(r,t.x,e,s),a=this.targetDamperY.update(a,t.y,e,s),n=this.targetDamperZ.update(n,t.z,e,s),this.target.position.set(r,a,n),this.target.updateMatrixWorld(),this.queueRender(),!0}}pointTowards(e,t){let{x:i,z:s}=this.position;this.yaw=Math.atan2(e-i,t-s)}get model(){return this._model}set yaw(e){this.rotation.y=e,this.queueRender()}get yaw(){return this.rotation.y}set animationTime(e){this.mixer.setTime(e),this.queueShadowRender()}get animationTime(){if(null!=this.currentAnimationAction){let e=Math.max(this.currentAnimationAction._loopCount,0);return this.currentAnimationAction.loop===es.uEv&&(1&e)==1?this.duration-this.currentAnimationAction.time:this.currentAnimationAction.time}return 0}set animationTimeScale(e){this.mixer.timeScale=e}get animationTimeScale(){return this.mixer.timeScale}get duration(){return null!=this.currentAnimationAction&&this.currentAnimationAction.getClip()?this.currentAnimationAction.getClip().duration:0}get hasActiveAnimation(){return null!=this.currentAnimationAction}playAnimation(e=null,t=0,i=es.YKA,s=1/0){if(null==this._currentGLTF)return;let{animations:r}=this;if(null==r||0===r.length){console.warn("Cannot play animation (model does not have any animations)");return}let a=null;if(null!=e&&null==(a=this.animationsByName.get(e))){let t=parseInt(e);!isNaN(t)&&t>=0&&t<r.length&&(a=r[t])}null==a&&(a=r[0]);try{let{currentAnimationAction:e}=this,r=this.mixer.clipAction(a,this);this.currentAnimationAction=r,this.element.paused?this.mixer.stopAllAction():(r.paused=!1,null!=e&&r!==e?r.crossFadeFrom(e,t,!1):this.animationTimeScale>0&&this.animationTime==this.duration&&(this.animationTime=0)),r.setLoop(i,s),r.enabled=!0,r.clampWhenFinished=!0,r.play()}catch(e){console.error(e)}}stopAnimation(){this.currentAnimationAction=null,this.mixer.stopAllAction()}updateAnimation(e){this.mixer.update(e),this.queueShadowRender()}subscribeMixerEvent(e,t){this.mixer.addEventListener(e,t)}updateShadow(){let e=this.shadow;if(null!=e){let t="wall"===this.element.arPlacement?"back":"bottom";e.setScene(this,this.shadowSoftness,t),e.needsUpdate=!0}}renderShadow(e){let t=this.shadow;null!=t&&!0==t.needsUpdate&&(t.render(e,this),t.needsUpdate=!1)}queueShadowRender(){null!=this.shadow&&(this.shadow.needsUpdate=!0)}setShadowIntensity(e){if(this.shadowIntensity=e,null!=this._currentGLTF&&(this.setBakedShadowVisibility(),!(e<=0)||null!=this.shadow)){if
777(null==this.shadow){let e="wall"===this.element.arPlacement?"back":"bottom";this.shadow=new rx(this,this.shadowSoftness,e)}this.shadow.setIntensity(e)}}setShadowSoftness(e){this.shadowSoftness=e;let t=this.shadow;null!=t&&t.setSoftness(e)}setShadowOffset(e){let t=this.shadow;null!=t&&t.setOffset(e)}get raycaster(){return rT}positionAndNormalFromPoint(e,t=this){this.raycaster.setFromCamera(e,this.getCamera());let i=this.raycaster.intersectObject(t,!0),s=i.find(e=>e.object.visible&&!e.object.userData.shadow);return null==s||null==s.face?null:null==s.uv?{position:s.point,normal:s.face.normal,uv:null}:(s.face.normal.applyNormalMatrix(new es.Vkp().getNormalMatrix(s.object.matrixWorld)),{position:s.point,normal:s.face.normal,uv:s.uv})}addHotspot(e){this.target.add(e),this.annotationRenderer.domElement.appendChild(e.element)}removeHotspot(e){this.target.remove(e)}forHotspots(e){let{children:t}=this.target;for(let i=0,s=t.length;i<s;i++){let s=t[i];s instanceof rw&&e(s)}}updateHotspots(e){this.forHotspots(t=>{rM.copy(e),rR.setFromMatrixPosition(t.matrixWorld),rM.sub(rR),rD.copy(t.normal).transformDirection(this.target.matrixWorld),0>rM.dot(rD)?t.hide():t.show()})}orientHotspots(e){this.forHotspots(t=>{t.orient(e)})}setHotspotsVisibility(e){this.forHotspots(t=>{t.visible=e})}updateSchema(e){var t;let{schemaElement:i,element:s}=this,{alt:r,poster:a,iosSrc:n}=s;if(null!=e){let s=[{"@type":"MediaObject",contentUrl:e,encodingFormat:(null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase())==="gltf"?"model/gltf+json":"model/gltf-binary"}];n&&s.push({"@type":"MediaObject",contentUrl:n,encodingFormat:"model/vnd.usdz+zip"}),i.textContent=JSON.stringify({"@context":"http://schema.org/","@type":"3DModel",image:null!=a?a:void 0,name:null!=r?r:void 0,encoding:s}),document.head.appendChild(i)}else null!=i.parentElement&&i.parentElement.removeChild(i)}}/* @license 778 * Copyright 2019 Google LLC. All Rights Reserved. 779 * Licensed under the Apache License, Version 2.0 (the 'License'); 780 * you may not use this file except in compliance with the License. 781 * You may obtain a copy of the License at 782 * 783 * http://www.apache.org/licenses/LICENSE-2.0 784 * 785 * Unless required by applicable law or agreed to in writing, software 786 * distributed under the License is distributed on an 'AS IS' BASIS, 787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 788 * See the License for the specific language governing permissions and 789 * limitations under the License. 790 */let rU=async e=>new Promise((t,i)=>{let s=e.match(/data:(.*);/);if(!s)return i(Error(`${e} is not a valid data Url`));let r=s[1],a=e.replace(/data:image\/\w+;base64,/,""),n=atob(a),A=[];for(let e=0;e<n.length;e+=512){let t=n.slice(e,e+512),i=Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);let s=new Uint8Array(i);A.push(s)}t(new Blob(A,{type:r}))});/* @license 791 * Copyright 2019 Google LLC. All Rights Reserved. 792 * Licensed under the Apache License, Version 2.0 (the 'License'); 793 * you may not use this file except in compliance with the License. 794 * You may obtain a copy of the License at 795 * 796 * http://www.apache.org/licenses/LICENSE-2.0 797 * 798 * Unless required by applicable law or agreed to in writing, software 799 * distributed under the License is distributed on an 'AS IS' BASIS, 800 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 801 * See the License for the specific language governing permissions and 802 * limitations under the License. 803 */class rN extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(){let e={progress:0,completed:!1};return this.ongoingActivities.add(e),1===this.ongoingActivityCount&&this.announceTotalProgress(e,0),t=>{let i;return(i=Math.max(eB(t,0,1),e.progress))!==e.progress&&this.announceTotalProgress(e,i),e.progress}}announceTotalProgress(e,t){let i=0,s=0;for(let r of(1==t&&(e.completed=!0),this.ongoingActivities)){let{progress:e}=r;i+=1-e,!0===r.completed&&s++}let r=e.progress;e.progress=t,this.totalProgress+=(t-r)*(1-this.totalProgress)/i;let a=s===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:a}})),s===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}/* @license 804 * Copyright 2019 Google LLC. All Rights Reserved. 805 * Licensed under the Apache License, Version 2.0 (the 'License');
806 * you may not use this file except in compliance with the License. 807 * You may obtain a copy of the License at 808 * 809 * http://www.apache.org/licenses/LICENSE-2.0 810 * 811 * Unless required by applicable law or agreed to in writing, software 812 * distributed under the License is distributed on an 'AS IS' BASIS, 813 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 814 * See the License for the specific language governing permissions and 815 * limitations under the License. 816 */var rG=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let r_=document.createElement("canvas"),rP=Symbol("fallbackResizeHandler"),rO=Symbol("defaultAriaLabel"),rH=Symbol("resizeObserver"),rq=Symbol("clearModelTimeout"),rK=Symbol("onContextLost"),rJ=Symbol("loaded"),rV=Symbol("status"),rY=Symbol("onFocus"),rj=Symbol("onBlur"),rz=Symbol("updateSize"),rW=Symbol("intersectionObserver"),rX=Symbol("isElementInViewport"),rZ=Symbol("announceModelVisibility"),r$=Symbol("ariaLabel"),r0=Symbol("altDefaulted"),r1=Symbol("statusElement"),r2=Symbol("updateStatus"),r3=Symbol("loadedTime"),r4=Symbol("updateSource"),r8=Symbol("markLoaded"),r5=Symbol("container"),r6=Symbol("input"),r9=Symbol("canvas"),r7=Symbol("scene"),ae=Symbol("needsRender"),at=Symbol("tick"),ai=Symbol("onModelLoad"),as=Symbol("onResize"),ar=Symbol("renderer"),aa=Symbol("progressTracker"),an=Symbol("getLoaded"),aA=Symbol("getModelIsVisible"),ao=Symbol("shouldAttemptPreload"),al=e=>({x:e.x,y:e.y,z:e.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),ah=e=>({u:e.x,v:e.y,toString(){return`${this.u} ${this.v}`}});class ac extends er.fl{constructor(){let e,t;super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[U]=!1,this[N]=!1,this[G]=0,this[_]="",this[P]=null,this[O]=eC(()=>{let e=this.getBoundingClientRect();this[rz](e)},50),this[H]=eC(e=>{let t=this.modelIsVisible;t!==e&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:t}}))},0),this[q]=null,this[K]=null,this[J]=new rN,this[V]=()=>{this[r1].textContent=this[rV]},this[Y]=()=>{this[r1].textContent=""},this[j]=e=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:e.sourceEvent}}))},this.attachShadow({mode:"open"});let i=this.shadowRoot;if(ek(i),this[r5]=i.querySelector(".container"),this[r6]=i.querySelector(".userIn
816put"),this[r9]=i.querySelector("canvas"),this[r1]=i.querySelector("#status"),this[rO]=this[r6].getAttribute("aria-label"),this.isConnected){let i=this.getBoundingClientRect();e=i.width,t=i.height}else e=300,t=150;this[r7]=new rk({canvas:this[r9],element:this,width:e,height:t}),Promise.resolve().then(()=>{this[rz](this.getBoundingClientRect())}),eA&&(this[rH]=new ResizeObserver(e=>{if(!this[ar].isPresenting)for(let t of e)t.target===this&&this[rz](t.contentRect)})),eo?this[rW]=new IntersectionObserver(e=>{for(let t of e)if(t.target===this){let e=this.modelIsVisible;this[rX]=t.isIntersecting,this[rZ](e),this[rX]&&!this.loaded&&this[r4]()}},{root:null,rootMargin:"0px",threshold:1e-5}):this[rX]=!0}static get is(){return"model-viewer"}static set modelCacheSize(e){t0[tZ].evictionThreshold=e}static get modelCacheSize(){return t0[tZ].evictionThreshold}static set minimumRenderScale(e){e>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),e<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),i6.singleton.minScale=e}static get minimumRenderScale(){return i6.singleton.minScale}get loaded(){return this[an]()}get[(U=rX,N=rJ,G=r3,_=rV,P=rq,O=rP,H=rZ,q=rH,K=rW,J=aa,ar)](){return i6.singleton}get modelIsVisible(){return this[aA]()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),eA?this[rH].observe(this):self.addEventListener("resize",this[rP]),eo&&this[rW].observe(this),this.addEventListener("focus",this[rY]),this.addEventListener("blur",this[rj]);let e=this[ar];e.addEventListener("contextlost",this[rK]),e.registerScene(this[r7]),null!=this[rq]&&(self.clearTimeout(this[rq]),this[rq]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),eA?this[rH].unobserve(this):self.removeEventListener("resize",this[rP]),eo&&this[rW].unobserve(this),this.removeEventListener("focus",this[rY]),this.removeEventListener("blur",this[rj]);let e=this[ar];e.removeEventListener("contextlost",this[rK]),e.unregisterScene(this[r7]),this[rq]=self.setTimeout(()=>{this[r7].dispose(),this[rq]=null},1e3)}updated(e){super.updated(e),e.has("src")&&(null==this.src?(this[rJ]=!1,this[r3]=0,this[r7].reset()):this.src!==this[r7].url&&(this[rJ]=!1,this[r3]=0,this[r4]())),e.has("alt")&&this[r6].setAttribute("aria-label",this[r$]),e.has("withCredentials")&&(t0.withCredentials=this.withCredentials),e.has("generateSchema")&&(this.generateSchema?this[r7].updateSchema(this.src):this[r7].updateSchema(null))}toDataURL(e,t){return this[ar].displayCanvas(this[r7]).toDataURL(e,t)}async toBlob(e){let t=e?e.mimeType:void 0,i=e?e.qualityArgument:void 0,s=e?e.idealAspect:void 0,{width:r,height:a,idealAspect:n,aspect:A}=this[r7],{dpr:o,scaleFactor:l}=this[ar],h=r*l*o,c=a*l*o,g=0,u=0;if(!0===s){if(n>A){let e=c;u=(e-(c=Math.round(h/n)))/2}else{let e=h;g=(e-(h=Math.round(c*n)))/2}}r_.width=h,r_.height=c;try{return new Promise(async(e,s)=>(r_.getContext("2d").drawImage(this[ar].displayCanvas(this[r7]),g,u,h,c,0,0,h,c),r_.msToBlob&&(!t||"image/png"===t))?e(r_.msToBlob()):r_.toBlob?void r_.toBlob(t=>{if(!t)return s(Error("Unable to retrieve canvas blob"));e(t)},t,i):e(await rU(r_.toDataURL(t,i))))}finally{this[rz]({width:r,height:a})}}registerRenderer(e){this[r7].externalRenderer=e}unregisterRenderer(){this[r7].externalRenderer=null}get[r$](){return this[r0]}get[r0](){return null==this.alt||"null"===this.alt?this[rO]:this.alt}[an](){return this[rJ]}[aA](){return this.loaded&&this[rX]}[ao](){return!!this.src&&this[rX]}[rz]({width:e,height:t}){this[r5].style.width=`${e}px`,this[r5].style.height=`${t}px`,this[as]({width:parseFloat(e),height:parseFloat(t)})}[at](e,t){}[r8](){this[rJ]||(this[rJ]=!0,this[r3]=performance.now())}[ae](){this[r7].queueRender()}[ai](){}[r2](e){this[rV]=e;let t=this.getRootNode();null!=t&&t.activeElement===this&&this[r1].textContent!=e&&(this[r1].textContent=e)}[(V=rY,Y=rj,as)](e){this[r7].setSize(e.width,e.height)}async [(j=rK,r4)](){let e=this[r7];if(this.loaded||!this[ao]()||this.src===e.url)return;this.generateSchema&&e.updateSchema(this.src),this[r2]("Loading"),e.stopAnimation();let t=this[aa].beginActivity(),i=this.src;try{let s=e.setSource(i,e=>t(.95*eB(e,0,1))),r=this[eM]();await Promise.all([s,r]),this[r8](),this[ai](),await new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("load",{detail:{url:i}})),e()})})})}catch(e){this.dispatchEvent(new CustomEvent("error",{detail:{type:"loadfailure",sourceError:e}}))}finally{t(1)}}}rG([(0,ei.Cb)({type:String})],ac.prototype,"alt",void 0),rG([(0,ei.Cb)({type:String})],ac.prototype,"src",void 0),rG([(0,ei.Cb)({type:Boolean,attribute:"with-credentials"})],ac.prototype,"withCredentials",void 0),rG([(0,ei.Cb)({type:Boolean,attribute:"generate-schema"})],ac.prototype,"generateSchema",void 0);/* @license 817 * Copyright 2019 Google LLC. All Rights Reserved. 818 * Licensed under the Apache License, Version 2.0 (the 'License');
819 * you may not use this file except in compliance with the License. 820 * You may obtain a copy of the License at 821 * 822 * http://www.apache.org/licenses/LICENSE-2.0 823 * 824 * Unless required by applicable law or agreed to in writing, software 825 * distributed under the License is distributed on an 'AS IS' BASIS, 826 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 827 * See the License for the specific language governing permissions and 828 * limitations under the License. 829 */var ag=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let au=Symbol("changeAnimation"),ad=Symbol("paused"),ap={repetitions:1/0,pingpong:!1},am=Symbol("hotspotMap"),aI=Symbol("mutationCallback"),af=Symbol("observer"),aE=Symbol("addHotspot"),aC=Symbol("removeHotspot"),aB=new es.yGw,aQ=new es.Vkp;/*! 830fflate - fast JavaScript compression/decompression 831<https://101arrowz.github.io/fflate> 832Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE 833version 0.6.9 834*/var ay={},aw=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},av=function(e){return new Worker(e)};try{URL.revokeObjectURL(aw(""))}catch(e){aw=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},av=function(e){return new Worker(e,{type:"module"})}}var ab=Uint8Array,aS=Uint16Array,ax=Uint32Array,aM=new ab([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]),aR=new ab([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]),aD=new ab([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aT=function(e,t){for(var i=new aS(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];for(var r=new ax(i[30]),s=1;s<30;++s)for(var a=i[s];a<i[s+1];++a)r[a]=a-i[s]<<5|s;return[i,r]},aL=aT(aM,2),aF=aL[0],ak=aL[1];aF[28]=258,ak[258]=28;for(var aU=aT(aR,0),aN=aU[0],aG=aU[1],a_=new aS(32768),aP=0;aP<32768;++aP){var aO=(43690&aP)>>>1|(21845&aP)<<1;aO=(61680&(aO=(52428&aO)>>>2|(13107&aO)<<2))>>>4|(3855&aO)<<4,a_[aP]=((65280&aO)>>>8|(255&aO)<<8)>>>1}for(var aH=function(e,t,i){for(var s,r=e.length,a=0,n=new aS(t);a<r;++a)++n[e[a]-1];var A=new aS(t);for(a=0;a<t;++a)A[a]=A[a-1]+n[a-1]<<1;if(i){s=new aS(1<<t);var o=15-t;for(a=0;a<r;++a)if(e[a])for(var l=a<<4|e[a],h=t-e[a],c=A[e[a]-1]++<<h,g=c|(1<<h)-1;c<=g;++c)s[a_[c]>>>o]=l}else for(a=0,s=new aS(r);a<r;++a)e[a]&&(s[a]=a_[A[e[a]-1]++]>>>15-e[a]);return s},aq=new ab(288),aP=0;aP<144;++aP)aq[aP]=8;for(var aP=144;aP<256;++aP)aq[aP]=9;for(var aP=256;aP<280;++aP)aq[aP]=7;for(var aP=280;aP<288;++aP)aq[aP]=8;for(var aK=new ab(32),aP=0;aP<32;++aP)aK[aP]=5;var aJ=aH(aq,9,0),aV=aH(aK,5,0),aY=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},aj=function(e,t,i){var s=t/8|0;return(e[s]|e[s+1]<<8)>>(7&t)&i},az=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},aW=function(e){return(e/8|0)+(7&e&&1)},aX=function(e,t,i){(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof aS?aS:e instanceof ax?ax:ab)(i-t);return s.set(e.subarray(t,i)),s},aZ=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},a$=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},a0=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,a=i.slice();if(!r)return[a6,0];if(1==r){var n=new ab(i[0].s+1);return n[i[0].s]=1,[n,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var A=i[0],o=i[1],l=0,h=1,c=2;for(i[0]={s:-1,f:A.f+o.f,l:A,r:o};h!=r-1;)A=i[i[l].f<i[c].f?l++:c++],o=i[l!=h&&i[l].f<i[c].f?l++:c++],i[h++]={s:-1,f:A.f+o.f,l:A,r:o};for(var g=a[0].s,s=1;s<r;++s)a[s].s>g&&(g=a[s].s);var u=new aS(g+1),d=a1(i[h-1],u,0);if(d>t){var s=0,p=0,m=d-t,I=1<<m;for(a.sort(function(e,t){return u[t.s]-u[e.s]||e.f-t.f});s<r;++s){var f=a[s].s;if(u[f]>t)p+=I-(1<<d-u[f]),u[f]=t;else break}for(p>>>=m;p>0;){var E=a[s].s;u[E]<t?p-=1<<t-u[E]++-1:++s}for(;s>=0&&p;--s){var C=a[s].s;u[C]==t&&(--u[C],++p)}d=t}return[new ab(u),d]},a1=function(e,t,i){return -1==e.s?Math.max(a1(e.l,t,i+1),a1(e.r,t,i+1)):t[e.s]=i},a2=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new aS(++t),s=0,r=e[0],a=1,n=function(e){i[s++]=e},A=1;A<=t;++A)if(e[A]==r&&A!=t)++a;else{if(!r&&a>2){for(;a>138;a-=138)n(32754);a>
8342&&(n(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(n(r),--a;a>6;a-=6)n(8304);a>2&&(n(a-3<<5|8208),a=0)}for(;a--;)n(r);a=1,r=e[A]}return[i.subarray(0,s),t]},a3=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},a4=function(e,t,i){var s=i.length,r=aW(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var a=0;a<s;++a)e[r+a+4]=i[a];return(r+4+s)*8},a8=function(e,t,i,s,r,a,n,A,o,l,h){aZ(t,h++,i),++r[256];for(var c,g,u,d,p=a0(r,15),m=p[0],I=p[1],f=a0(a,15),E=f[0],C=f[1],B=a2(m),Q=B[0],y=B[1],w=a2(E),v=w[0],b=w[1],S=new aS(19),x=0;x<Q.length;++x)S[31&Q[x]]++;for(var x=0;x<v.length;++x)S[31&v[x]]++;for(var M=a0(S,7),R=M[0],D=M[1],T=19;T>4&&!R[aD[T-1]];--T);var L=l+5<<3,F=a3(r,aq)+a3(a,aK)+n,k=a3(r,m)+a3(a,E)+n+14+3*T+a3(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(L<=F&&L<=k)return a4(t,h,e.subarray(o,o+l));if(aZ(t,h,1+(k<F)),h+=2,k<F){c=aH(m,I,0),g=m,u=aH(E,C,0),d=E;var U=aH(R,D,0);aZ(t,h,y-257),aZ(t,h+5,b-1),aZ(t,h+10,T-4),h+=14;for(var x=0;x<T;++x)aZ(t,h+3*x,R[aD[x]]);h+=3*T;for(var N=[Q,v],G=0;G<2;++G)for(var _=N[G],x=0;x<_.length;++x){var P=31&_[x];aZ(t,h,U[P]),h+=R[P],P>15&&(aZ(t,h,_[x]>>>5&127),h+=_[x]>>>12)}}else c=aJ,g=aq,u=aV,d=aK;for(var x=0;x<A;++x)if(s[x]>255){var P=s[x]>>>18&31;a$(t,h,c[P+257]),h+=g[P+257],P>7&&(aZ(t,h,s[x]>>>23&31),h+=aM[P]);var O=31&s[x];a$(t,h,u[O]),h+=d[O],O>3&&(a$(t,h,s[x]>>>5&8191),h+=aR[O])}else a$(t,h,c[s[x]]),h+=g[s[x]];return a$(t,h,c[256]),h+g[256]},a5=new ax([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),a6=new ab(0),a9=function(e,t,i,s,r,a){var n=e.length,A=new ab(s+n+5*(1+Math.ceil(n/7e3))+r),o=A.subarray(s,A.length-r),l=0;if(!t||n<8)for(var h=0;h<=n;h+=65535){var c=h+65535;c<n?l=a4(o,l,e.subarray(h,c)):(o[h]=a,l=a4(o,l,e.subarray(h,n)))}else{for(var g=a5[t-1],u=g>>>13,d=8191&g,p=(1<<i)-1,m=new aS(32768),I=new aS(p+1),f=Math.ceil(i/3),E=2*f,C=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<E)&p},B=new ax(25e3),Q=new aS(288),y=new aS(32),w=0,v=0,h=0,b=0,S=0,x=0;h<n;++h){var M=C(h),R=32767&h,D=I[M];if(m[R]=D,I[M]=R,S<=h){var T=n-h;if((w>7e3||b>24576)&&T>423){l=a8(e,o,0,B,Q,y,v,b,x,h-x,l),b=w=v=0,x=h;for(var L=0;L<286;++L)Q[L]=0;for(var L=0;L<30;++L)y[L]=0}var F=2,k=0,U=d,N=R-D&32767;if(T>2&&M==C(h-N))for(var G=Math.min(u,T)-1,_=Math.min(32767,h),P=Math.min(258,T);N<=_&&--U&&R!=D;){if(e[h+F]==e[h+F-N]){for(var O=0;O<P&&e[h+O]==e[h+O-N];++O);if(O>F){if(F=O,k=N,O>G)break;for(var H=Math.min(N,O-2),q=0,L=0;L<H;++L){var K=h-N+L+32768&32767,J=m[K],V=K-J+32768&32767;V>q&&(q=V,D=K)}}}D=m[R=D],N+=R-D+32768&32767}if(k){B[b++]=268435456|ak[F]<<18|aG[k];var Y=31&ak[F],j=31&aG[k];v+=aM[Y]+aR[j],++Q[257+Y],++y[j],S=h+F,++w}else B[b++]=e[h],++Q[e[h]]}}l=a8(e,o,a,B,Q,y,v,b,x,h-x,l),!a&&7&l&&(l=a4(o,l+1,a6))}return aX(A,0,s+aW(l)+r)},a7=function(){for(var e=new ax(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),ne=function(){var e=-1;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=a7[255&i^t[s]]^i>>>8;e=i},d:function(){return~e}}},nt=function(e,t){var i={};for(var s in e)i[s]=e[s];for(var s in t)i[s]=t[s];return i},ni=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},ns=function(e,t,i,s){for(var r in e){var a=e[r],n=t+r;a instanceof ab?i[n]=[a,s]:Array.isArray(a)?i[n]=[a[0],nt(s,a[1])]:ns(a,n+"/",i,s)}},nr="undefined"!=typeof TextEncoder&&new TextEncoder,na="undefined"!=typeof TextDecoder&&new TextDecoder;try{na.decode(a6,{stream:!0})}catch(e){}function nn(e,t){if(t){for(var i=new ab(e.length),s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}if(nr)return nr.encode(e);for(var r=e.length,a=new ab(e.length+(e.length>>1)),n=0,A=function(e){a[n++]=e},s=0;s<r;++s){if(n+5>a.length){var o=new ab(n+8+(r-s<<1));o.set(a),a=o}var l=e.charCodeAt(s);l<128||t?A(l):(l<2048?A(192|l>>6):(l>55295&&l<57344?(A(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>18),A(128|l>>12&63)):A(224|l>>12),A(128|l>>6&63)),A(128|63&l))}return aX(a,0,n)}var nA=function(e){var t=0;if(e)for(var i in e){var s=e[i].length;if(s>65535)throw"extra field too long";t+=s+4}return t},no=function(e,t,i,s,r,a,n,A){var o=s.length,l=i.extra,h=A&&A.length,c=nA(l);ni(e,t,null!=n?33639248:67324752),t+=4,null!=n&&(e[t++]=20,e[t++]=i.os),e[t]=20,t+=2,e[t++]=i.flag<<1|(null==a&&8),e[t++]=r&&8,e[t++]=255&i.compression,e[t++]=i.compression>>8;var g=new Date(null==i.mtime?Date.now():i.mtime),u=g.getFullYear()-1980;if(u<0||u>119)throw"date not in range 1980-2099";if(ni(e,t,u<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>>1),t+=4,null!=a&&(ni(e,t,i.crc),ni(e,t+4,a),ni(e,t+8,i.size)),ni(e,t+12,o),ni(e,t+14,c),t+=16,null!=n&&(ni(e,t,h),ni(e,t+6,i.attrs),ni(e,t+10,n),t+=14),e.set(s,t),t+=o,c)for(var d in l){var p=l[d],m=p.length;ni(e,t,+d),ni(e,t+2,m),e.set(p,t+4),t+=4+m}return h&&(e.set(A,t),t+=h),t},nl=function(e,t,i,s,r){ni(e,t,101010256),ni(e,t+8,i),ni(e,t+10,i),ni(e,t+12,
834s),ni(e,t+16,r)};class nh{async parse(e){let t={},i="model.usda";t[i]=null;let s=nc(),r={},a={};for(let n in e.traverseVisible(e=>{if(e.isMesh){let a=e.geometry,n=e.material;if(n.isMeshStandardMaterial){let A="geometries/Geometry_"+a.id+".usd";if(!(A in t)){var i;let e;let s=function(e){let t=function(e){let t=e.attributes,i=t.position.count;return` 835 def Mesh "Geometry" 836 { 837 int[] faceVertexCounts = [${function(e){let t=null!==e.index?e.index.count:e.attributes.position.count;return Array(t/3).fill(3).join(", ")}(e)}] 838 int[] faceVertexIndices = [${function(e){let t=e.index,i=[];if(null!==t)for(let e=0;e<t.count;e++)i.push(t.getX(e));else{let t=e.attributes.position.count;for(let e=0;e<t;e++)i.push(e)}return i.join(", ")}(e)}] 839 normal3f[] normals = [${nd(t.normal,i)}] ( 840 interpolation = "vertex" 841 ) 842 point3f[] points = [${nd(t.position,i)}] 843 float2[] primvars:st = [${function(e,t){if(void 0===e)return console.warn("USDZExporter: UVs missing."),Array(t).fill("(0, 0)").join(", ");let i=[];for(let t=0;t<e.count;t++){let s=e.getX(t),r=e.getY(t);i.push(`(${s.toPrecision(7)}, ${1-r.toPrecision(7)})`)}return i.join(", ")}(t.uv,i)}] ( 844 interpolation = "vertex" 845 ) 846 uniform token subdivisionScheme = "none" 847 } 848`}(e);return` 849def "Geometry" 850{ 851 ${t} 852} 853`}(a);t[A]=(i=s,nn(nc()+i))}n.uuid in r||(r[n.uuid]=n),s+=function(e,t,i){let s="Object_"+e.id,r=ng(e.matrixWorld);return 0>e.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),`def Xform "${s}" ( 854 prepend references = @./geometries/Geometry_${t.id}.usd@</Geometry> 855) 856{ 857 matrix4d xformOp:transform = ${r} 858 uniform token[] xformOpOrder = ["xformOp:transform"] 859 860 rel material:binding = </Materials/Material_${i.id}> 861} 862 863`}(e,a,n)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",e)}else e.isCamera&&(s+=function(e){let t=e.name?e.name:"Camera_"+e.id,i=ng(e.matrixWorld);return(0>e.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),e.isOrthographicCamera)?`def Camera "${t}" 864 { 865 matrix4d xformOp:transform = ${i} 866 uniform token[] xformOpOrder = ["xformOp:transform"] 867 868 float2 clippingRange = (${e.near}, ${e.far}) 869 float horizontalAperture = ${(Math.abs(e.left)+Math.abs(e.right))*10} 870 float verticalAperture = ${(Math.abs(e.top)+Math.abs(e.bottom))*10} 871 token projection = "orthographic" 872 } 873 874 `:`def Camera "${t}" 875 { 876 matrix4d xformOp:transform = ${i} 877 uniform token[] xformOpOrder = ["xformOp:transform"] 878 879 float2 clippingRange = (${e.near}, ${e.far}) 880 float focalLength = ${e.getFocalLength()} 881 float focusDistance = ${e.focus} 882 float horizontalAperture = ${e.getFilmWidth()} 883 token projection = "perspective" 884 float verticalAperture = ${e.getFilmHeight()} 885 } 886 887 `}(e))}),s+=function(e,t){let i=[];for(let s in e){let r=e[s];i.push(function(e,t){let i=" ",s=[],r=[];function a(i,s,r){let a=i.id+(r?"_"+r.getHexString():""),n=1023===i.format;return t[a]=i,` 888 def Shader "Transform2d_${s}" ( 889 sdrMetadata = { 890 string role = "math" 891 } 892 ) 893 { 894 uniform token info:id = "UsdTransform2d" 895 float2 inputs:in.connect = </Materials/Material_${e.id}/uvReader_st.outputs:result> 896 float2 inputs:scale = ${nm(i.repeat)} 897 float2 inputs:translation = ${nm(i.offset)} 898 float2 outputs:result 899 } 900 901 def Shader "Texture_${i.id}_${s}" 902 { 903 uniform token info:id = "UsdUVTexture" 904 asset inputs:file = @textures/Texture_${a}.${n?"png":"jpg"}@ 905 float2 inputs:st.connect = </Materials/Material_${e.id}/Transform2d_${s}.outputs:result> 906 token inputs:wrapS = "repeat" 907 token inputs:wrapT = "repeat" 908 float outputs:r 909 float outputs:g 910 float outputs:b 911 float3 outputs:rgb 912 ${e.transparent||e.alphaTest>0?"float outputs:a":""} 913 }`}return e.side===es.ehD&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",e),null!==e.map?(s.push(`${i}color3f inputs:diffuseColor.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:rgb>`),e.transparent?s.push(`${i}
913float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`):e.alphaTest>0&&(s.push(`${i}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.map.id}_diffuse.outputs:a>`),s.push(`${i}float inputs:opacityThreshold = ${e.alphaTest}`)),r.push(a(e.map,"diffuse",e.color))):s.push(`${i}color3f inputs:diffuseColor = ${np(e.color)}`),null!==e.emissiveMap?(s.push(`${i}color3f inputs:emissiveColor.connect = </Materials/Material_${e.id}/Texture_${e.emissiveMap.id}_emissive.outputs:rgb>`),r.push(a(e.emissiveMap,"emissive"))):e.emissive.getHex()>0&&s.push(`${i}color3f inputs:emissiveColor = ${np(e.emissive)}`),null!==e.normalMap&&(s.push(`${i}normal3f inputs:normal.connect = </Materials/Material_${e.id}/Texture_${e.normalMap.id}_normal.outputs:rgb>`),r.push(a(e.normalMap,"normal"))),null!==e.aoMap&&(s.push(`${i}float inputs:occlusion.connect = </Materials/Material_${e.id}/Texture_${e.aoMap.id}_occlusion.outputs:r>`),r.push(a(e.aoMap,"occlusion"))),null!==e.roughnessMap&&1===e.roughness?(s.push(`${i}float inputs:roughness.connect = </Materials/Material_${e.id}/Texture_${e.roughnessMap.id}_roughness.outputs:g>`),r.push(a(e.roughnessMap,"roughness"))):s.push(`${i}float inputs:roughness = ${e.roughness}`),null!==e.metalnessMap&&1===e.metalness?(s.push(`${i}float inputs:metallic.connect = </Materials/Material_${e.id}/Texture_${e.metalnessMap.id}_metallic.outputs:b>`),r.push(a(e.metalnessMap,"metallic"))):s.push(`${i}float inputs:metallic = ${e.metalness}`),null!==e.alphaMap?(s.push(`${i}float inputs:opacity.connect = </Materials/Material_${e.id}/Texture_${e.alphaMap.id}_opacity.outputs:r>`),s.push(`${i}float inputs:opacityThreshold = 0.0001`),r.push(a(e.alphaMap,"opacity"))):s.push(`${i}float inputs:opacity = ${e.opacity}`),e.isMeshPhysicalMaterial&&(s.push(`${i}float inputs:clearcoat = ${e.clearcoat}`),s.push(`${i}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`),s.push(`${i}float inputs:ior = ${e.ior}`)),` 914 def Material "Material_${e.id}" 915 { 916 def Shader "PreviewSurface" 917 { 918 uniform token info:id = "UsdPreviewSurface" 919${s.join("\n")} 920 int inputs:useSpecularWorkflow = 0 921 token outputs:surface 922 } 923 924 token outputs:surface.connect = </Materials/Material_${e.id}/PreviewSurface.outputs:surface> 925 token inputs:frame:stPrimvarName = "st" 926 927 def Shader "uvReader_st" 928 { 929 uniform token info:id = "UsdPrimvarReader_float2" 930 token inputs:varname.connect = </Materials/Material_${e.id}.inputs:frame:stPrimvarName> 931 float2 inputs:fallback = (0.0, 0.0) 932 float2 outputs:result 933 } 934 935${r.join("\n")} 936 937 } 938`}(r,t))}return`def "Materials" 939{ 940${i.join("")} 941} 942 943`}(r,a),t[i]=nn(s),s=null,a){let e=a[n],i=n.split("_")[1],s=1023===e.format,r=function(e,t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let i=1024/Math.max(e.width,e.height),s=document.createElement("canvas");s.width=e.width*Math.min(1,i),s.height=e.height*Math.min(1,i);let r=s.getContext("2d");if(r.drawImage(e,0,0,s.width,s.height),void 0!==t){let e=parseInt(t,16),i=(e>>16&255)/255,a=(e>>8&255)/255,n=(255&e)/255,A=r.getImageData(0,0,s.width,s.height),o=A.data;for(let e=0;e<o.length;e+=4)o[e+0]=o[e+0]*i,o[e+1]=o[e+1]*a,o[e+2]=o[e+2]*n;r.putImageData(A,0,0)}return s}}(e.image,i),A=await new Promise(e=>r.toBlob(e,s?"image/png":"image/jpeg",1));t[`textures/Texture_${n}.${s?"png":"jpg"}`]=new Uint8Array(await A.arrayBuffer())}let n=0;for(let e in t){let i=t[e],s=34+e.length;n+=s;let r=63&n;if(4!==r){let s=64-r,a=new Uint8Array(s);t[e]=[i,{extra:{12345:a}}]}n=i.length}return function(e,t){t||(t={});var i={},s=[];ns(e,"",i,t);var r=0,a=0;for(var n in i){var A=i[n],o=A[0],l=A[1],h=0==l.level?0:8,c=nn(n),g=c.length,u=l.comment,d=u&&nn(u),p=d&&d.length,m=nA(l.extra);if(g>65535)throw"filename too long";var I=h?function(e,t){var i;return a9(e,null==(i=t||{}).level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+i.mem,0,0,!0)}(o,l):o,f=I.length,E=ne();E.p(o),s.push(nt(l,{size:o.length,crc:E.d(),c:I,f:c,m:d,u:g!=n.length||d&&u.length!=p,o:r,compression:h})),r+=30+g+m+f,a+=76+2*(g+m)+(p||0)+f}for(var C=new ab(a+22),B=r,Q=a-r,y=0;y<s.length;++y){var c=s[y];no(C,c.o,c,c.f,c.u,c.c.length);var w=30+c.f.length+nA(c.extra);C.set(c.c,c.o+w),no(C,r,c,c.f,c.u,c.c.length,c.o,c.m),r+=16+w+(c.m?c.m.length:0)}return nl(C,r,s.length,Q,B),C}(t,{level:0})}}function nc(){return`#usda 1.0 944( 945 customLayerData = {
946 string creator = "Three.js USDZExporter" 947 } 948 metersPerUnit = 1 949 upAxis = "Y" 950) 951 952`}function ng(e){let t=e.elements;return`( ${nu(t,0)}, ${nu(t,4)}, ${nu(t,8)}, ${nu(t,12)} )`}function nu(e,t){return`(${e[t+0]}, ${e[t+1]}, ${e[t+2]}, ${e[t+3]})`}function nd(e,t){if(void 0===e)return console.warn("USDZExporter: Normals missing."),Array(t).fill("(0, 0, 0)").join(", ");let i=[];for(let t=0;t<e.count;t++){let s=e.getX(t),r=e.getY(t),a=e.getZ(t);i.push(`(${s.toPrecision(7)}, ${r.toPrecision(7)}, ${a.toPrecision(7)})`)}return i.join(", ")}function np(e){return`(${e.r}, ${e.g}, ${e.b})`}function nm(e){return`(${e.x}, ${e.y})`}/* @license 953 * Copyright 2019 Google LLC. All Rights Reserved. 954 * Licensed under the Apache License, Version 2.0 (the 'License'); 955 * you may not use this file except in compliance with the License. 956 * You may obtain a copy of the License at 957 * 958 * http://www.apache.org/licenses/LICENSE-2.0 959 * 960 * Unless required by applicable law or agreed to in writing, software 961 * distributed under the License is distributed on an 'AS IS' BASIS, 962 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 963 * See the License for the specific language governing permissions and 964 * limitations under the License. 965 */var nI=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let nf=!1,nE=!1,nC="#model-viewer-no-ar-fallback",nB=(d=["quick-look","scene-viewer","webxr","none"],e=>{try{let t=rg(e),i=(t.length?t[0].terms:[]).filter(e=>e&&"ident"===e.type).map(e=>e.value).filter(e=>d.indexOf(e)>-1),s=new Set;for(let e of i)s.add(e);return s}catch(e){}return new Set}),nQ={QUICK_LOOK:"quick-look",SCENE_VIEWER:"scene-viewer",WEBXR:"webxr",NONE:"none"},ny=Symbol("arButtonContainer"),nw=Symbol("enterARWithWebXR"),nv=Symbol("openSceneViewer"),nb=Symbol("openIOSARQuickLook"),nS=Symbol("canActivateAR"),nx=Symbol("arMode"),nM=Symbol("arModes"),nR=Symbol("arAnchor"),nD=Symbol("preload"),nT=Symbol("onARButtonContainerClick"),nL=Symbol("onARStatus"),nF=Symbol("onARTracking"),nk=Symbol("onARTap"),nU=Symbol("selectARMode"),nN=Symbol("triggerLoad"),nG=Symbol("evaluate"),n_=Symbol("lastValue");class nP{constructor(){this[z]=null}static evaluatableFor(e,t=rC){if(e instanceof nP)return e;if("number"===e.type)return"%"===e.unit?new nq(e,t):e;switch(e.name.value){case"calc":return new nj(e,t);case"env":return new nJ(e)}return rC}static evaluate(e){return e instanceof nP?e.evaluate():e}static isConstant(e){return!(e instanceof nP)||e.isConstant}static applyIntrinsics(e,t){let{basis:i,keywords:s}=t,{auto:r}=s;return i.map((t,i)=>{let a=null==r[i]?t:r[i],n=e[i]?e[i]:a;if("ident"===n.type){let e=n.value;e in s&&(n=s[e][i])}return((null==n||"ident"===n.type)&&(n=a),"%"===n.unit)?rc(n.number/100*t.number,t.unit):(n=ry(n,t)).unit!==t.unit?t:n})}get isConstant(){return!1}evaluate(){return this.isConstant&&null!=this[n_]||(this[n_]=this[nG]()),this[n_]}}z=n_;let nO=Symbol("percentage"),nH=Symbol("basis");class nq extends nP{constructor(e,t){super(),this[nO]=e,this[nH]=t}get isConstant(){return!0}[nG](){return rc(this[nO].number/100*this[nH].number,this[nH].unit)}}let nK=Symbol("identNode");class nJ extends nP{constructor(e){super(),this[W]=null;let t=e.arguments.length?e.arguments[0].terms[0]:null;null!=t&&"ident"===t.type&&(this[nK]=t)}get isConstant(){return!1}[(W=nK,nG)](){if(null!=this[nK]&&"window-scroll-y"===this[nK].value){let e=window.pageYOffset,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),i=e/(t-window.innerHeight)||0;return{type:"number",number:i,unit:null}}return rC}}let nV=/[\*\/]/,nY=Symbol("evaluator");class nj extends nP{constructor(e,t=rC){if(super(),this[X]=null,1!==e.arguments.length)return;let i=e.arguments[0].terms.slice(),s=[];for(;i.length;){let e=i.shift();if(s.length>0){let i=s[s.length-1];if("operator"===i.type&&nV.test(i.value)){let i=s.pop(),r=s.pop();if(null==r)return;s.push(new nZ(i,nP.evaluatableFor(r,t),nP.evaluatableFor(e,t)));continue}}s.push("operator"===e.type?e:nP.evaluatableFor(e,t))}for(;s.length>2;){let[e,i,r]=s.splice(0,3);if("operator"!==i.type)return;s.unshift(new nZ(i,nP.evaluatableFor(e,t),nP.evaluatableFor(r,t)))}1===s.length&&(this[nY]=s[0])}get isConstant(){return null==this[nY]||nP.isConstant(this[nY])}[(X=nY,nG)](){return null!=this[nY]?nP.evaluate(this[nY]):rC}}let nz=Symbol("operator"),nW=Symbol("left"),nX=Symbol("right");class nZ extends nP{constructor(e,t,i){super(),this[nz]=e,this[nW]=t,this[nX]=i}get isConstant(){return nP.isConstant(this[nW])&&nP.isConstant(this[nX])}[nG](){let e;let t=ry(nP.evaluate(this[nW])),i=ry(nP.evaluate(this[nX])),{number:s,unit:r}=t,{number:a,unit:n}=i;if(null!=n&&null!=r&&n!=r)return rC;switch(this[nz].value){case"+":e=s+a;break;case"-":e=s-a;break;case"/":e=s/a;break;case"*":e=s*a;break;default:return rC}return{type:"number",number:e,unit:r||n}}}let n$=Symbol("evaluatables"),n0=Symbol("intrinsics");class n1 extends nP{constructor(e,t){super(),this[n0]=t;let i=e[0],s=null!=i?i.terms:[];this[n$]=t.basis.map((e,t)=>{let i=s[t];return null==i?{type:"ident",value:"auto"}:"ident"===i.type?i:nP.evaluatableFor(i,e)})}get isConstant(){for(let e of this[n$])if(!nP.isConstant(e))return!1;return!0}[nG](){let e=this[n$].map(e=>nP.evaluate(e));return nP.applyIntrinsics(e,this[n0]).map(e=>e.number)}}let n2=Symbol("instances"),n3=Symbol("activateListener"),n4=Symbol("deactivateListener"),n8=Symbol("notifyInstances"),n5=Symbol("notify"),n6=Symbol("callback");class n9{constructor(e){this[n6]=e}static[n8](){for(let e of n9[n2])e[n5]()}static[(Z=n2,n3)](){window.addEventListener("scroll",this[n8],{passive:!0})}static[n4](){window.removeEventListener("scroll",this[n8])}observe(){0===n9[n2].size&&n9[n3](),n9[n2].add(this)}disconnect(){n9[n2].delete(this),0===n9[n2].size&&n9[n4]()}[n5](){this[n6]()}}n9[Z]=new Set;let n7=Symbol("computeStyleCallback"),Ae=Symbol("astWalker"),At=Symbol("dependencies"),Ai=Symbol("onScroll");class As{constructor(e){this[$]={},this[ee]=new rE(["function"]),this[et]=()=>{this[n7]({relatedState:"window-scroll"})},this[n7]=e}observeEffectsFor(e){let t={},i=this[At];for(let s in this[Ae].walk(e,e=>{let{name:s}=e,r=e.arguments[0],a=r.terms[0];if("env"===s.value&&null!=a&&"ident"===a.type&&"window-scroll-y"===a.value&&null==t["window-scroll"]){let e="window-scroll"in i?i["window-scroll"]:new n9(this[Ai]);e.observe(),delete i["window-scroll"],t["window-scroll"]=e}}),i){let e=i[s];e.disconnect()}this[At]=t}dispose(){for(let e in this[At]){let t=this[At][e];t.disconnect()}}}$=At,ee=Ae,et=Ai;/* @license 966 * Copyright 2019 Google LLC. All Rights Reserved. 967 * Licensed under the Apache License, Version 2.0 (the 'License');
968 * you may not use this file except in compliance with the License. 969 * You may obtain a copy of the License at 970 * 971 * http://www.apache.org/licenses/LICENSE-2.0 972 * 973 * Unless required by applicable law or agreed to in writing, software 974 * distributed under the License is distributed on an 'AS IS' BASIS, 975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 976 * See the License for the specific language governing permissions and 977 * limitations under the License. 978 */let Ar=e=>{let t=e.observeEffects||!1,i=e.intrinsics instanceof Function?e.intrinsics:()=>e.intrinsics;return(s,r)=>{let a=s.updated,n=s.connectedCallback,A=s.disconnectedCallback,o=Symbol(`${r}StyleEffector`),l=Symbol(`${r}StyleEvaluator`),h=Symbol(`${r}UpdateEvaluator`),c=Symbol(`${r}EvaluateAndSync`);Object.defineProperties(s,{[o]:{value:null,writable:!0},[l]:{value:null,writable:!0},[h]:{value:function(){let e=rg(this[r]);this[l]=new n1(e,i(this)),null==this[o]&&t&&(this[o]=new As(()=>this[c]())),null!=this[o]&&this[o].observeEffectsFor(e)}},[c]:{value:function(){if(null==this[l])return;let t=this[l].evaluate();this[e.updateHandler](t)}},updated:{value:function(e){e.has(r)&&(this[h](),this[c]()),a.call(this,e)}},connectedCallback:{value:function(){n.call(this),this.requestUpdate(r,this[r])}},disconnectedCallback:{value:function(){A.call(this),null!=this[o]&&(this[o].dispose(),this[o]=null)}}})}},Aa=new es.FM8,An=new es.Pa4,AA=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"}),Ao=Math.PI/8,Al={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class Ah extends es.pBf{constructor(e,t,i){super(),this.camera=e,this.element=t,this.scene=i,this.orbitSensitivity=1,this.inputSensitivity=1,this.changeSource=Al.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new es.Vkp,this.panPerPixel=0,this.spherical=new es.$V,this.goalSpherical=new es.$V,this.thetaDamper=new iQ,this.phiDamper=new iQ,this.radiusDamper=new iQ,this.logFov=Math.log(AA.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new iQ,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=e=>{if(this.enablePan)e.preventDefault();else for(let e of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:e.id})))},this.touchModeZoom=(e,t)=>{if(!this._disableZoom){let e=this.twoTouchDistance(this.pointers[0],this.pointers[1]),t=.04*(this.lastSeparation-e)*50/this.scene.height;this.lastSeparation=e,this.userAdjustOrbit(0,0,t)}this.panPerPixel>0&&this.movePan(e,t)},this.disableScroll=e=>{e.preventDefault()},this.touchModeRotate=(e,t)=>{let{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;let s=Math.abs(e),r=Math.abs(t);if(this.changeSource===Al.USER_INTERACTION&&("pan-y"===i&&r>s||"pan-x"===i&&s>r)){this.touchMode=null;return}this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(e,t)},this.onPointerDown=e=>{if(this.pointers.length>2)return;let{element:t}=this;0===this.pointers.length&&(t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=e.clientX,this.startPointerPosition.clientY=e.clientY,this.startTime=performance.now());try{t.setPointerCapture(e.pointerId)}catch(e){}this.pointers.push({clientX:e.clientX,clientY:e.clientY,id:e.pointerId}),this.isUserPointing=!1,"touch"===e.pointerType?(this.changeSource=e.altKey?Al.AUTOMATIC:Al.USER_INTERACTION,this.onTouchChange(e)):(this.changeSource=Al.USER_INTERACTION,this.onMouseDown(e))},this.onPointerMove=e=>{let t=this.pointers.find(t=>t.id===e.pointerId);if(null==t)return;let i=this.pointers.length,s=(e.clientX-t.clientX)/i,r=(e.clientY-t.clientY)/i;(0!==s||0!==r)&&(t.clientX=e.clientX,t.clientY=e.clientY,"touch"===e.pointerType?(this.changeSource=e.altKey?Al.AUTOMATIC:Al.USER_INTERACTION,null!==this.touchMode&&this.touchMode(s,r)):(this.changeSource=Al.USER_INTERACTION,this.panPerPixel>0?this.movePan(s,r):this.handleSinglePointerMove(s,r)))},this.onPointerUp=e=>{let{element:t}=this,i=this.pointers.findIndex(t=>t.id===e.pointerId);-1!==i&&this.pointers.splice(i,1),this.panPerPixel>0&&!e.altKey&&this.resetRadius(),0===this.pointers.length?(t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("touchmove",this.disableScroll),this.enablePan&&this.enableTap&&this.recenter(e)):null!==this.touchMode&&this.onTouchChange(e),this.scene.element[AF].style.opacity=0,t.style.cursor="grab",this.panPerPixel=0,this.isUserPointing&&this.dispatchEvent({type:"pointer-change-end"})},this.onWheel=e=>{this.changeSource=Al.USER_INTERACTION;
978let t=e.deltaY*(1==e.deltaMode?18:1)*.04/30;this.userAdjustOrbit(0,0,t),e.preventDefault()},this.onKeyDown=e=>{let{changeSource:t}=this;this.changeSource=Al.USER_INTERACTION;let i=e.shiftKey&&this.enablePan?this.panKeyCodeHandler(e):this.orbitZoomKeyCodeHandler(e);i?e.preventDefault():this.changeSource=t},this._options=Object.assign({},AA),this.setOrbit(0,Math.PI/2,1),this.setFieldOfView(100),this.jumpToGoal()}get interactionEnabled(){return this._interactionEnabled}enableInteraction(){if(!1===this._interactionEnabled){let{element:e}=this;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointercancel",this.onPointerUp),this._disableZoom||e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown),e.addEventListener("touchmove",()=>{},{passive:!1}),e.addEventListener("contextmenu",this.onContext),this.element.style.cursor="grab",this._interactionEnabled=!0,this.updateTouchActionStyle()}}disableInteraction(){if(!0===this._interactionEnabled){let{element:e}=this;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("contextmenu",this.onContext),e.style.cursor="",this.touchMode=null,this._interactionEnabled=!1,this.updateTouchActionStyle()}}get options(){return this._options}set disableZoom(e){this._disableZoom!=e&&(this._disableZoom=e,!0===e?this.element.removeEventListener("wheel",this.onWheel):this.element.addEventListener("wheel",this.onWheel),this.updateTouchActionStyle())}getCameraSpherical(e=new es.$V){return e.copy(this.spherical)}getFieldOfView(){return this.camera.fov}applyOptions(e){Object.assign(this._options,e),this.setOrbit(),this.setFieldOfView(Math.exp(this.goalLogFov))}updateNearFar(e,t){this.camera.near=Math.max(e,t/1e3),this.camera.far=t,this.camera.updateProjectionMatrix()}updateAspect(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}setOrbit(e=this.goalSpherical.theta,t=this.goalSpherical.phi,i=this.goalSpherical.radius){let{minimumAzimuthalAngle:s,maximumAzimuthalAngle:r,minimumPolarAngle:a,maximumPolarAngle:n,minimumRadius:A,maximumRadius:o}=this._options,{theta:l,phi:h,radius:c}=this.goalSpherical,g=eB(e,s,r);isFinite(s)||isFinite(r)||(this.spherical.theta=this.wrapAngle(this.spherical.theta-g)+g);let u=eB(t,a,n),d=eB(i,A,o);return(g!==l||u!==h||d!==c)&&(this.goalSpherical.theta=g,this.goalSpherical.phi=u,this.goalSpherical.radius=d,this.goalSpherical.makeSafe(),!0)}setRadius(e){this.goalSpherical.radius=e,this.setOrbit()}setFieldOfView(e){let{minimumFieldOfView:t,maximumFieldOfView:i}=this._options;e=eB(e,t,i),this.goalLogFov=Math.log(e)}setDamperDecayTime(e){this.thetaDamper.setDecayTime(e),this.phiDamper.setDecayTime(e),this.radiusDamper.setDecayTime(e),this.fovDamper.setDecayTime(e)}adjustOrbit(e,t,i){let{theta:s,phi:r,radius:a}=this.goalSpherical,{minimumRadius:n,maximumRadius:A,minimumFieldOfView:o,maximumFieldOfView:l}=this._options,h=this.spherical.theta-s,c=Math.PI-.001,g=s-eB(e,-c-h,c-h),u=0===i?0:((i>0?A:n)-a)/(Math.log(i>0?l:o)-this.goalLogFov),d=a+i*(isFinite(u)?u:(A-n)*2);if(this.setOrbit(g,r-t,d),0!==i){let e=this.goalLogFov+i;this.setFieldOfView(Math.exp(e))}}jumpToGoal(){this.update(0,1e4)}update(e,t){if(this.isStationary())return;let{maximumPolarAngle:i,maximumRadius:s}=this._options,r=this.spherical.theta-this.goalSpherical.theta;!(Math.abs(r)>Math.PI)||isFinite(this._options.minimumAzimuthalAngle)||isFinite(this._options.maximumAzimuthalAngle)||(this.spherical.theta-=2*Math.sign(r)*Math.PI),this.spherical.theta=this.thetaDamper.update(this.spherical.theta,this.goalSpherical.theta,t,Math.PI),this.spherical.phi=this.phiDamper.update(this.spherical.phi,this.goalSpherical.phi,t,i),this.spherical.radius=this.radiusDamper.update(this.spherical.radius,this.goalSpherical.radius,t,s),this.logFov=this.fovDamper.update(this.logFov,this.goalLogFov,t,1),this.moveCamera()}updateTouchActionStyle(){let{style:e}=this.element;if(this._interactionEnabled){let{touchAction:t}=this._options;this._disableZoom&&"none"!==t?e.touchAction="manipulation":e.touchAction=t}else e.touchAction=""}isStationary(){return this.goalSpherical.theta===this.spherical.theta&&this.goalSpherical.phi===this.spherical.phi&&this.goalSpherical.radiu
978s===this.spherical.radius&&this.goalLogFov===this.logFov}dispatchChange(){this.dispatchEvent({type:"change",source:this.changeSource})}moveCamera(){this.spherical.makeSafe(),this.camera.position.setFromSpherical(this.spherical),this.camera.setRotationFromEuler(new es.USm(this.spherical.phi-Math.PI/2,this.spherical.theta,0,"YXZ")),this.camera.fov!==Math.exp(this.logFov)&&(this.camera.fov=Math.exp(this.logFov),this.camera.updateProjectionMatrix()),this.dispatchChange()}userAdjustOrbit(e,t,i){this.adjustOrbit(e*this.orbitSensitivity*this.inputSensitivity,t*this.orbitSensitivity*this.inputSensitivity,i*this.inputSensitivity),this.dispatchChange()}wrapAngle(e){let t=(e+Math.PI)/(2*Math.PI);return 2*(t-Math.floor(t))*Math.PI-Math.PI}pixelLengthToSphericalAngle(e){return 2*Math.PI*e/this.element.clientHeight}twoTouchDistance(e,t){let{clientX:i,clientY:s}=e,{clientX:r,clientY:a}=t,n=r-i,A=a-s;return Math.sqrt(n*n+A*A)}handleSinglePointerMove(e,t){let i=this.pixelLengthToSphericalAngle(e),s=this.pixelLengthToSphericalAngle(t);!1===this.isUserPointing&&(this.isUserPointing=!0,this.dispatchEvent({type:"pointer-change-start"})),this.userAdjustOrbit(i,s,0)}initializePan(){let{theta:e,phi:t}=this.spherical,i=e-this.scene.yaw;this.panPerPixel=.018/this.scene.height,this.panProjection.set(-Math.cos(i),-Math.cos(t)*Math.sin(i),0,0,Math.sin(t),0,Math.sin(i),-Math.cos(t)*Math.cos(i),0)}movePan(e,t){let{scene:i}=this,s=An.set(e,t,0).multiplyScalar(this.inputSensitivity),r=this.spherical.radius*Math.exp(this.logFov)*this.panPerPixel;s.multiplyScalar(r);let a=i.getTarget();a.add(s.applyMatrix3(this.panProjection)),i.boundingSphere.clampPoint(a,a),i.setTarget(a.x,a.y,a.z),this.dispatchChange()}recenter(e){if(performance.now()>this.startTime+300||Math.abs(e.clientX-this.startPointerPosition.clientX)>2||Math.abs(e.clientY-this.startPointerPosition.clientY)>2)return;let{scene:t}=this,i=t.positionAndNormalFromPoint(t.getNDC(e.clientX,e.clientY));if(null==i){let{cameraTarget:e}=t.element;t.element.cameraTarget="",t.element.cameraTarget=e,this.userAdjustOrbit(0,0,1)}else t.target.worldToLocal(i.position),t.setTarget(i.position.x,i.position.y,i.position.z)}resetRadius(){let{scene:e}=this,t=e.positionAndNormalFromPoint(Aa.set(0,0));if(null==t)return;e.target.worldToLocal(t.position);let i=e.getTarget(),{theta:s,phi:r}=this.spherical,a=s-e.yaw,n=An.set(Math.sin(r)*Math.sin(a),Math.cos(r),Math.sin(r)*Math.cos(a)),A=n.dot(t.position.sub(i));i.add(n.multiplyScalar(A)),e.setTarget(i.x,i.y,i.z),this.setOrbit(void 0,void 0,this.goalSpherical.radius-A)}onTouchChange(e){if(1===this.pointers.length)this.touchMode=this.touchModeRotate;else{if(this._disableZoom){this.touchMode=null,this.element.removeEventListener("touchmove",this.disableScroll);return}this.touchMode=this.touchDecided&&null===this.touchMode?null:this.touchModeZoom,this.touchDecided=!0,this.element.addEventListener("touchmove",this.disableScroll,{passive:!1}),this.lastSeparation=this.twoTouchDistance(this.pointers[0],this.pointers[1]),this.enablePan&&null!=this.touchMode&&(this.initializePan(),e.altKey||(this.scene.element[AF].style.opacity=1))}}onMouseDown(e){this.panPerPixel=0,this.enablePan&&(2===e.button||e.ctrlKey||e.metaKey||e.shiftKey)&&(this.initializePan(),this.scene.element[AF].style.opacity=1),this.element.style.cursor="grabbing"}orbitZoomKeyCodeHandler(e){let t=!0;switch(e.key){case"PageUp":this.userAdjustOrbit(0,0,.04);break;case"PageDown":this.userAdjustOrbit(0,0,-.04);break;case"ArrowUp":this.userAdjustOrbit(0,-Ao,0);break;case"ArrowDown":this.userAdjustOrbit(0,Ao,0);break;case"ArrowLeft":this.userAdjustOrbit(-Ao,0,0);break;case"ArrowRight":this.userAdjustOrbit(Ao,0,0);break;default:t=!1}return t}panKeyCodeHandler(e){this.initializePan();let t=!0;switch(e.key){case"ArrowUp":this.movePan(0,-10);break;case"ArrowDown":this.movePan(0,10);break;case"ArrowLeft":this.movePan(-10,0);break;case"ArrowRight":this.movePan(10,0);break;default:t=!1}return t}}/* @license 979 * Copyright 2019 Google LLC. All Rights Reserved. 980 * Licensed under the Apache License, Version 2.0 (the 'License');
981 * you may not use this file except in compliance with the License. 982 * You may obtain a copy of the License at 983 * 984 * http://www.apache.org/licenses/LICENSE-2.0 985 * 986 * Unless required by applicable law or agreed to in writing, software 987 * distributed under the License is distributed on an 'AS IS' BASIS, 988 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 989 * See the License for the specific language governing permissions and 990 * limitations under the License. 991 */let Ac=e=>e<.5?2*e*e:-1+(4-2*e)*e,Ag=(e,t,i=Ac)=>s=>e+(t-e)*i(s),Au=(e,t)=>{var i;let s=t.map((i=0,e=>i+=e));return t=>{t=eB(t,0,1)*s[s.length-1];let i=s.findIndex(e=>e>=t),r=i<1?0:s[i-1],a=s[i];return e[i]((t-r)/(a-r))}},Ad=e=>{let t=[],i=[],s=e.initialValue;for(let r=0;r<e.keyframes.length;++r){let a=e.keyframes[r],{value:n,frames:A}=a,o=a.ease||Ac,l=Ag(s,n,o);t.push(l),i.push(A),s=n}return Au(t,i)};/* @license 992 * Copyright 2019 Google LLC. All Rights Reserved. 993 * Licensed under the Apache License, Version 2.0 (the 'License'); 994 * you may not use this file except in compliance with the License. 995 * You may obtain a copy of the License at 996 * 997 * http://www.apache.org/licenses/LICENSE-2.0 998 * 999 * Unless required by applicable law or agreed to in writing, software 1000 * distributed under the License is distributed on an 'AS IS' BASIS, 1001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1002 * See the License for the specific language governing permissions and 1003 * limitations under the License. 1004 */var Ap=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let Am=Ad({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}]}),AI=Ad({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),Af="0deg 75deg 105%",AE=["front","right","back","left"],AC=["upper-","","lower-"],AB={AUTO:"auto"},AQ={BASIC:"basic",WIGGLE:"wiggle"},Ay=()=>({basis:[rB(rc(30,"deg"))],keywords:{auto:[null]}}),Aw=()=>({basis:[rB(rc(12,"deg"))],keywords:{auto:[null]}}),Av=(()=>{let e=rg(Af)[0].terms,t=ry(e[0]),i=ry(e[1]);return e=>{let s=e[r7].idealCameraDistance();return{basis:[t,i,rc(s,"m")],keywords:{auto:[null,null,rc(105,"%")]}}}})(),Ab=e=>{let t=2.2*e[r7].boundingSphere.radius;return{basis:[rc(-1/0,"rad"),rc(Math.PI/8,"rad"),rc(t,"m")],keywords:{auto:[null,null,null]}}},AS=e=>{let t=Av(e),i=new n1([],t),s=i.evaluate()[2];return{basis:[rc(1/0,"rad"),rc(Math.PI-Math.PI/8,"rad"),rc(s,"m")],keywords:{auto:[null,null,null]}}},Ax=e=>{let t=e[r7].boundingBox.getCenter(new es.Pa4);return{basis:[rc(t.x,"m"),rc(t.y,"m"),rc(t.z,"m")],keywords:{auto:[null,null,null]}}},AM=Math.PI/2,AR=Math.PI/3,AD=AM/2,AT=2*Math.PI,AL=Symbol("controls"),AF=Symbol("panElement"),Ak=Symbol("promptElement"),AU=Symbol("promptAnimatedContainer"),AN=Symbol("fingerAnimatedContainers"),AG=Symbol("deferInteractionPrompt"),A_=Symbol("updateAria"),AP=Symbol("updateCameraForRadius"),AO=Symbol("onChange"),AH=Symbol("onPointerChange"),Aq=Symbol("waitingToPromptUser"),AK=Symbol("userHasInteracted"),AJ=Symbol("promptElementVisibleTime"),AV=Symbol("lastPromptOffset"),AY=Symbol("lastSpherical"),Aj=Symbol("jumpCamera"),Az=Symbol("initialized"),AW=Symbol("maintainThetaPhi"),AX=Symbol("syncCameraOrbit"),AZ=Symbol("syncFieldOfView"),A$=Symbol("syncCameraTarget"),A0=Symbol("syncMinCameraOrbit"),A1=Symbol("syncMaxCameraOrbit"),A2=Symbol("syncMinFieldOfView"),A3=Symbol("syncMaxFieldOfView");/* @license 1005 * Copyright 2019 Google LLC. All Rights Reserved. 1006 * Licensed under the Apache License, Version 2.0 (the 'License'); 1007 * you may not use this file except in compliance with the License. 1008 * You may obtain a copy of the License at 1009 * 1010 * http://www.apache.org/licenses/LICENSE-2.0 1011 * 1012 * Unless required by applicable law or agreed to in writing, softw
1012are 1013 * distributed under the License is distributed on an 'AS IS' BASIS, 1014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1015 * See the License for the specific language governing permissions and 1016 * limitations under the License. 1017 */var A4=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let A8={AUTO:"auto"},A5={AUTO:"auto",EAGER:"eager"},A6=Symbol("defaultProgressBarElement"),A9=Symbol("posterContainerElement"),A7=Symbol("defaultPosterElement"),oe=Symbol("shouldDismissPoster"),ot=Symbol("hidePoster"),oi=Symbol("modelIsRevealed"),os=Symbol("updateProgressBar"),or=Symbol("ariaLabelCallToAction"),oa=Symbol("onProgress");/* @license 1018 * Copyright 2019 Google LLC. All Rights Reserved. 1019 * Licensed under the Apache License, Version 2.0 (the 'License'); 1020 * you may not use this file except in compliance with the License. 1021 * You may obtain a copy of the License at 1022 * 1023 * http://www.apache.org/licenses/LICENSE-2.0 1024 * 1025 * Unless required by applicable law or agreed to in writing, software 1026 * distributed under the License is distributed on an 'AS IS' BASIS, 1027 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1028 * See the License for the specific language governing permissions and 1029 * limitations under the License. 1030 */var on=function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};let oA={basis:[rB(rc(Math.PI/32,"rad"))],keywords:{auto:[null]}},oo=Symbol("autoRotateStartTime"),ol=Symbol("radiansPerSecond"),oh=Symbol("syncRotationRate"),oc=Symbol("onCameraChange"),og=(e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this[t]=new Map,this[i]=e=>{e.forEach(e=>{e instanceof MutationRecord&&"childList"!==e.type||(e.addedNodes.forEach(e=>{this[aE](e)}),e.removedNodes.forEach(e=>{this[aC](e)}),this[ae]())})},this[s]=new MutationObserver(this[aI])}connectedCallback(){super.connectedCallback();for(let e=0;e<this.children.length;++e)this[aE](this.children[e]);let{ShadyDOM:e}=self;null==e?this[af].observe(this,{childList:!0}):this[af]=e.observeChildren(this,this[aI])}disconnectedCallback(){super.disconnectedCallback();let{ShadyDOM:e}=self;null==e?this[af].disconnect():e.unobserveChildren(this[af])}[(t=am,i=aI,s=af,at)](e,t){super[at](e,t);let i=this[r7],{annotationRenderer:s}=i,r=i.getCamera();i.shouldRender()&&(i.updateHotspots(r.position),s.domElement.style.display="",s.render(i,r))}updateHotspot(e){let t=this[am].get(e.name);null!=t&&(t.updatePosition(e.position),t.updateNormal(e.normal),this[ae]())}queryHotspot(e){let t=this[am].get(e);if(null==t)return null;let i=al(t.position),s=al(t.normal),r=t.facingCamera,a=this[r7],n=a.getCamera(),A=new es.Pa4;A.setFromMatrixPosition(t.matrixWorld),A.project(n);let o=a.width/2,l=a.height/2;A.x=A.x*o+o,A.y=-(A.y*l)+l;let h=al(new es.Pa4(A.x,A.y,A.z));return Number.isFinite(h.x)&&Number.isFinite(h.y)?{position:i,normal:s,canvasPosition:h,facingCamera:r}:null}positionAndNormalFromPoint(e,t){let i=this[r7],s=i.getNDC(e,t),r=i.positionAndNormalFromPoint(s);if(null==r)return null;aB.copy(i.target.matrixWorld).invert();let a=al(r.position.applyMatrix4(aB));aQ.getNormalMatrix(aB);let n=al(r.normal.applyNormalMatrix(aQ)),A=null;return null!=r.uv&&(A=ah(r.uv)),{position:a,normal:n,uv:A}}[aE](e){if(!(e instanceof HTMLElement&&0===e.slot.indexOf("hotspot")))return;let t=this[am].get(e.slot);null!=t?t.increment():(t=new rw({name:e.slot,position:e.dataset.position,normal:e.dataset.normal}),this[am].set(e.slot,t),this[r7].addHotspot(t)),this[r7].queueRender()}[aC](e){if(!(e instanceof HTMLElement))return;let t=this[am].get(e.slot);
1030t&&(t.decrement()&&(this[r7].removeHotspot(t),this[am].delete(e.slot)),this[r7].queueRender())}}return r})((e=>{var t,i,s,r;class a extends e{constructor(){super(...arguments),this[t]=void 0,this[i]=null,this[s]=new es.dpR,this[r]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[ro]}get availableVariants(){return this.model?this.model[re]():[]}get originalGltfJson(){return this[rA]}[(t=ro,i=rn,s=rh,r=rA,rl)](){return()=>{this[ae]()}}async createTexture(e,t="image/png"){let i=this[rn],s=await new Promise(t=>this[rh].load(e,t));return i&&s?(s.encoding=es.knz,s.wrapS=es.rpg,s.wrapT=es.rpg,s.flipY=!1,s.userData.mimeType=t,new sI(this[rl](),s)):null}async updated(e){if(super.updated(e),e.has("variantName")){let e=this[aa].beginActivity();e(.1);let t=this[ro],{variantName:i}=this;null!=t&&(await t[s8](i),this[ae](),this.dispatchEvent(new CustomEvent("variant-applied"))),e(1)}if(e.has("orientation")||e.has("scale")){if(!this.loaded)return;let e=this[r7];e.applyTransform(),e.updateBoundingBox(),e.updateShadow(),this[ar].arRenderer.onUpdateScene(),this[ae]()}}[ai](){super[ai]();let{currentGLTF:e}=this[r7];if(null!=e){let{correlatedSceneGraph:t}=e;null!=t&&e!==this[rn]&&(this[ro]=new rr(t,this[rl]()),this[rA]=JSON.parse(JSON.stringify(t.gltf))),"variants"in e.userData&&this.requestUpdate("variantName")}this[rn]=e}async exportScene(e){let t=this[r7];return new Promise(async(i,s)=>{let r={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(r,e),r.animations=t.animations,r.truncateDrawRange=!0;let a=t.shadow,n=!1;null!=a&&(n=a.visible,a.visible=!1),await this[ro][s4]();let A=new t9().register(e=>new iE(e));A.parse(t.model,e=>i(new Blob([r.binary?e:JSON.stringify(e)],{type:r.binary?"application/octet-stream":"application/json"})),()=>s("glTF export failed"),r),null!=a&&(a.visible=n)})}materialFromPoint(e,t){let i=this[r7],s=i.getNDC(e,t);return i.raycaster.setFromCamera(s,i.getCamera()),this[ro][s9](i.raycaster)}}return ra([(0,ei.Cb)({type:String,attribute:"variant-name"})],a.prototype,"variantName",void 0),ra([(0,ei.Cb)({type:String,attribute:"orientation"})],a.prototype,"orientation",void 0),ra([(0,ei.Cb)({type:String,attribute:"scale"})],a.prototype,"scale",void 0),a})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.autoRotate=!1,this.autoRotateDelay=3e3,this.rotationPerSecond="auto",this[t]=performance.now(),this[i]=0,this[s]=e=>{this.autoRotate&&"user-interaction"===e.detail.source&&(this[oo]=performance.now())}}connectedCallback(){super.connectedCallback(),this.addEventListener("camera-change",this[oc]),this[oo]=performance.now()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("camera-change",this[oc]),this[oo]=performance.now()}updated(e){super.updated(e),e.has("autoRotate")&&(this[oo]=performance.now())}[(t=oo,i=ol,oh)](e){this[ol]=e[0]}[at](e,t){if(super[at](e,t),!this.autoRotate||!this[aA]()||this[ar].isPresenting)return;let i=Math.min(t,e-this[oo]-this.autoRotateDelay);i>0&&(this[r7].yaw=this.turntableRotation+this[ol]*i*.001)}get turntableRotation(){return this[r7].yaw}resetTurntableRotation(e=0){this[r7].yaw=e}}return s=oc,on([(0,ei.Cb)({type:Boolean,attribute:"auto-rotate"})],r.prototype,"autoRotate",void 0),on([(0,ei.Cb)({type:Number,attribute:"auto-rotate-delay"})],r.prototype,"autoRotateDelay",void 0),on([Ar({intrinsics:oA,updateHandler:oh}),(0,ei.Cb)({type:String,attribute:"rotation-per-second"})],r.prototype,"rotationPerSecond",void 0),r})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.environmentImage=null,this.skyboxImage=null,this.shadowIntensity=0,this.shadowSoftness=1,this.exposure=1,this[t]=null,this[i]=null,this[s]=null}updated(e){super.updated(e),e.has("shadowIntensity")&&(this[r7].setShadowIntensity(.5*this.shadowIntensity),this[ae]()),e.has("shadowSoftness")&&(this[r7].setShadowSoftness(this.shadowSoftness),this[ae]()),e.has("exposure")&&(this[r7].exposure=this.exposure,this[ae]()),(e.has("environmentImage")||e.has("skyboxImage"))&&this[ao]()&&this[eM]()}
1030hasBakedShadow(){return this[r7].bakedShadows.size>0}async [(t=eS,i=ex,s=eR,eM)](){let{skyboxImage:e,environmentImage:t}=this;null!=this[eR]&&(this[eR](),this[eR]=null);let{textureUtils:i}=this[ar];if(null==i)return;let s=this[aa].beginActivity();try{let{environmentMap:r,skybox:a}=await i.generateEnvironmentMapAndSkybox(em(e),t,e=>s(eB(e,0,1)));this[eS]!==r&&(this[eS]=r,this.dispatchEvent(new CustomEvent("environment-change"))),null!=a?this[ex]=a.name===r.name?r:a:this[ex]=null,this[r7].setEnvironmentAndSkybox(this[eS],this[ex]),this[r7].dispatchEvent({type:"envmap-update"})}catch(e){if(e instanceof Error)throw this[r7].setEnvironmentAndSkybox(null,null),e}finally{s(1)}}}return eb([(0,ei.Cb)({type:String,attribute:"environment-image"})],r.prototype,"environmentImage",void 0),eb([(0,ei.Cb)({type:String,attribute:"skybox-image"})],r.prototype,"skyboxImage",void 0),eb([(0,ei.Cb)({type:Number,attribute:"shadow-intensity"})],r.prototype,"shadowIntensity",void 0),eb([(0,ei.Cb)({type:Number,attribute:"shadow-softness"})],r.prototype,"shadowSoftness",void 0),eb([(0,ei.Cb)({type:Number})],r.prototype,"exposure",void 0),r})((e=>{var t,i,s,r,a,n,A,o,l,h,c,g,u,d,p;class m extends e{constructor(){super(...arguments),this.cameraControls=!1,this.cameraOrbit=Af,this.cameraTarget="auto auto auto",this.fieldOfView="auto",this.minCameraOrbit="auto",this.maxCameraOrbit="auto",this.minFieldOfView="auto",this.maxFieldOfView="auto",this.interactionPromptThreshold=3e3,this.interactionPrompt=AB.AUTO,this.interactionPromptStyle=AQ.WIGGLE,this.orbitSensitivity=1,this.touchAction="none",this.disableZoom=!1,this.disablePan=!1,this.disableTap=!1,this.interpolationDecay=50,this[t]=this.shadowRoot.querySelector(".interaction-prompt"),this[i]=this.shadowRoot.querySelector("#prompt"),this[s]=[this.shadowRoot.querySelector("#finger0"),this.shadowRoot.querySelector("#finger1")],this[r]=this.shadowRoot.querySelector(".pan-target"),this[a]=0,this[n]=1/0,this[A]=!1,this[o]=!1,this[l]=new Ah(this[r7].camera,this[r6],this[r7]),this[h]=new es.$V,this[c]=!1,this[g]=!1,this[u]=!1,this[d]=({source:e})=>{this[A_](),this[ae](),e===Al.USER_INTERACTION&&(this[AK]=!0,this[AG]()),this.dispatchEvent(new CustomEvent("camera-change",{detail:{source:e}}))},this[p]=e=>{"pointer-change-start"===e.type?this[r5].classList.add("pointer-tumbling"):this[r5].classList.remove("pointer-tumbling")}}get inputSensitivity(){return this[AL].inputSensitivity}set inputSensitivity(e){this[AL].inputSensitivity=e}getCameraOrbit(){let{theta:e,phi:t,radius:i}=this[AY];return{theta:e,phi:t,radius:i,toString(){return`${this.theta}rad ${this.phi}rad ${this.radius}m`}}}getCameraTarget(){return al(this[ar].isPresenting?this[ar].arRenderer.target:this[r7].getTarget())}getFieldOfView(){return this[AL].getFieldOfView()}getMinimumFieldOfView(){return this[AL].options.minimumFieldOfView}getMaximumFieldOfView(){return this[AL].options.maximumFieldOfView}getIdealAspect(){return this[r7].idealAspect}jumpCameraToGoal(){this[Aj]=!0,this.requestUpdate(Aj,!1)}resetInteractionPrompt(){this[AV]=0,this[AJ]=1/0,this[AK]=!1,this[Aq]=this.interactionPrompt===AB.AUTO&&this.cameraControls}zoom(e){let t=new WheelEvent("wheel",{deltaY:-30*e});this[r6].dispatchEvent(t)}connectedCallback(){super.connectedCallback(),this[AL].addEventListener("change",this[AO]),this[AL].addEventListener("pointer-change-start",this[AH]),this[AL].addEventListener("pointer-change-end",this[AH])}disconnectedCallback(){super.disconnectedCallback(),this[AL].removeEventListener("change",this[AO]),this[AL].removeEventListener("pointer-change-start",this[AH]),this[AL].removeEventListener("pointer-change-end",this[AH])}updated(e){super.updated(e);let t=this[AL],i=this[r7];if(e.has("cameraControls")&&(this.cameraControls?(t.enableInteraction(),this.interactionPrompt===AB.AUTO&&(this[Aq]=!0)):(t.disableInteraction(),this[AG]()),this[r6].setAttribute("aria-label",this[r$])),e.has("disableZoom")&&(t.disableZoom=this.disableZoom),e.has("disablePan")&&(t.enablePan=!this.disablePan),e.has("disableTap")&&(t.enableTap=!this.disableTap),(e.has("interactionPrompt")||e.has("cameraControls")||e.has("src"))&&(this.interactionPrompt===AB.AUTO&&this.cameraControls&&!this[AK]?this[Aq]=!0:this[AG]()),e.has("interactionPromptStyle")&&(this[AU].style.opacity=this.interactionPromptStyle==AQ.BASIC?"1":"0"),e.has("touchAction")){let e=this.touchAction;t.applyOptions({touchAction:e}),t.updateTouchActionStyle()}e.has("orbitSensitivity")&&(t.orbitSensitivity=this.orbitSensitivity),e.has("interpolationDecay")&&(t.setDamperDecayTime(this.interpolationDecay),i.setTargetDamperDecayTime(this.interpolationDecay)),!0===this[Aj]&&Promise.resolve().then(()=>{t.jumpToGoal(),i.jumpToGoal(),this[Aj]=!1})}async updateFraming(){let e=this[r7],t=e.adjustedFoV(e.framedFoVDeg);await e.updateFraming();let i=e.adjustedFoV(e.framedFoVDeg),s=this[AL].getFieldOfView()/t;this[AL].setFieldOfView(i*s),this[AW]=!0,this.requestUpdate("maxFieldOfView"),this.requestUpdate("fieldOfView"),this.requestUpdate("minCameraOrbit"),this.requestUpdate("maxCameraOrbit"),this.requestUpdate("cameraOrbit"),await this.updateComplete}interact(e,t,i){let s=this[r6],r=this[AN];if("1"===r[0].style.opacity){console.warn("interact() failed because an existing interaction is running.");return}let a=[];a.push({x:Ad(t.x),y:Ad(t.y)});let n=[{x:a[0].x(0),y:a[0].y(0)}];null!=i&&(a.push({x:Ad(i.x),y:Ad(i.y)}),n.push({x:a[1].x(0),y:a[1].y(0)}));let A=performance.now(),{width:o,height:l}=this[r7],h=e=>{for(let[t,i]of n.entries()){let{style:a}=r[t];a.transform=`translateX(${o*i.x}px) translateY(${l*i.y}px)`,"pointerdown"===e?a.opacity="1":"pointerup"===e&&(a.opacity="0");let n={pointerId:t-5678,pointerType:"touch",target:s,clientX:o*i.x,clientY:l*i.y,altKey:!0};s.dispatchEvent(new PointerEvent(e,n))}},c=()=>{let{changeSource:t}=this[AL];if(t!==Al.AUTOMATIC||!s.isConnected){for(let e of this[AN])e.style.opacity="0";h("pointercancel"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",g);return}let i=Math.min(1,(performance.now()-A)/e);for(let[e,t]of n.entries())t.x=a[e].x(i),t.y=a[e].y(i);h("pointermove"),i<1?requestAnimationFrame(c):(h("pointerup"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",g))},g=()=>{let e=0;"hidden"===document.visibilityState?e=performance.now()-A:A=performance.now()-e};document.addEventListener("visibilitychange",g),h("pointerdown"),requestAnimationFrame(c)}[(t=Ak,i=AU,s=AN,r=AF,a=AV,n=AJ,A=AK,o=Aq,l=AL,h=AY,c=Aj,g=Az,u=AW,AZ)](e){let t=this[r7];t.framedFoVDeg=180*e[0]/Math.PI,this[AL].setFieldOfView(t.adjustedFoV(t.framedFoVDeg))}[AX](e){let t=this[AL];if(this[AW]){let{theta:t,phi:i}=this.getCameraOrbit();e[0]=t,e[1]=i,this[AW]=!1}t.changeSource=Al.NONE,t.setOrbit(e[0],e[1],e[2])}[A0](e){this[AL].applyOptions({minimumAzimuthalAngle:e[0],minimumPolarAngle:e[1],minimumRadius:e[2]}),this.jumpCameraToGoal()}[A1](e){this[AL].applyOptions({maximumAzimuthalAngle:e[0],maximumPolarAngle:e[1],maximumRadius:e[2]}),this[AP](e[2]),this.jumpCameraToGoal()}[A2](e){this[AL].applyOptions({minimumFieldOfView:180*e[0]/Math.PI}),this.jumpCameraToGoal()}[A3](e){let t=this[r7].adjustedFoV(180*e[0]/Math.PI);this[AL].applyOptions({maximumFieldOfView:t}),this.jumpCameraToGoal()}[A$](e){let[t,i,s]=e;this[ar].arRenderer.isPresenting||this[r7].setTarget(t,i,s),this[AL].changeSource=Al.NONE,this[ar].arRenderer.updateTarget()}[at](e,t){if(super[at](e,t),this[ar].isPresenting||!this[aA]())return;let i=this[AL],s=this[r7],r=performance.now();if(this[Aq]&&this.loaded&&r>this[r3]+this.interactionPromptThreshold&&(this[Aq]=!1,this[AJ]=r,this[Ak].classList.add("visible")),isFinite(this[AJ])&&this.interactionPromptStyle===AQ.WIGGLE){let e=(r-this[AJ])/5e3%1,t=Am(e),a=AI(e);if(this[AU].style.opacity=`${a}`,t!==this[AV]){let e=t*s.width*.05,r=(t-this[AV])*Math.PI/16;this[AU].style.transform=`translateX(${e}
1030px)`,i.changeSource=Al.AUTOMATIC,i.adjustOrbit(r,0,0),this[AV]=t}}i.update(e,t),s.updateTarget(t)&&this[AO]({type:"change",source:i.changeSource})}[AG](){this[Aq]=!1,this[Ak].classList.remove("visible"),this[AJ]=1/0}[AP](e){let t=Math.max(this[r7].boundingSphere.radius,e);this[AL].updateNearFar(0,2*t)}[A_](){let{theta:e,phi:t}=this[AL].getCameraSpherical(this[AY]),i=AE[(4+Math.floor((e%AT+AD)/AM))%4],s=AC[Math.floor(t/AR)];this[r2](`View from stage ${s}${i}`)}get[r$](){return super[r$]+(this.cameraControls?". Use mouse, touch or arrow keys to move.":"")}async [as](e){let t=this[AL],i=this[r7],s=i.adjustedFoV(i.framedFoVDeg);super[as](e);let r=i.adjustedFoV(i.framedFoVDeg)/s,a=t.getFieldOfView()*(isFinite(r)?r:1);t.updateAspect(this[r7].aspect),this.requestUpdate("maxFieldOfView",this.maxFieldOfView),await this.updateComplete,this[AL].setFieldOfView(a),this.jumpCameraToGoal()}[ai](){super[ai](),this[Az]?this[AW]=!0:this[Az]=!0,this.requestUpdate("maxFieldOfView",this.maxFieldOfView),this.requestUpdate("fieldOfView",this.fieldOfView),this.requestUpdate("minCameraOrbit",this.minCameraOrbit),this.requestUpdate("maxCameraOrbit",this.maxCameraOrbit),this.requestUpdate("cameraOrbit",this.cameraOrbit),this.requestUpdate("cameraTarget",this.cameraTarget),this.jumpCameraToGoal()}}return d=AO,p=AH,Ap([(0,ei.Cb)({type:Boolean,attribute:"camera-controls"})],m.prototype,"cameraControls",void 0),Ap([Ar({intrinsics:Av,observeEffects:!0,updateHandler:AX}),(0,ei.Cb)({type:String,attribute:"camera-orbit",hasChanged:()=>!0})],m.prototype,"cameraOrbit",void 0),Ap([Ar({intrinsics:Ax,observeEffects:!0,updateHandler:A$}),(0,ei.Cb)({type:String,attribute:"camera-target",hasChanged:()=>!0})],m.prototype,"cameraTarget",void 0),Ap([Ar({intrinsics:Ay,observeEffects:!0,updateHandler:AZ}),(0,ei.Cb)({type:String,attribute:"field-of-view",hasChanged:()=>!0})],m.prototype,"fieldOfView",void 0),Ap([Ar({intrinsics:Ab,updateHandler:A0}),(0,ei.Cb)({type:String,attribute:"min-camera-orbit",hasChanged:()=>!0})],m.prototype,"minCameraOrbit",void 0),Ap([Ar({intrinsics:AS,updateHandler:A1}),(0,ei.Cb)({type:String,attribute:"max-camera-orbit",hasChanged:()=>!0})],m.prototype,"maxCameraOrbit",void 0),Ap([Ar({intrinsics:Aw,updateHandler:A2}),(0,ei.Cb)({type:String,attribute:"min-field-of-view",hasChanged:()=>!0})],m.prototype,"minFieldOfView",void 0),Ap([Ar({intrinsics:Ay,updateHandler:A3}),(0,ei.Cb)({type:String,attribute:"max-field-of-view",hasChanged:()=>!0})],m.prototype,"maxFieldOfView",void 0),Ap([(0,ei.Cb)({type:Number,attribute:"interaction-prompt-threshold"})],m.prototype,"interactionPromptThreshold",void 0),Ap([(0,ei.Cb)({type:String,attribute:"interaction-prompt"})],m.prototype,"interactionPrompt",void 0),Ap([(0,ei.Cb)({type:String,attribute:"interaction-prompt-style"})],m.prototype,"interactionPromptStyle",void 0),Ap([(0,ei.Cb)({type:Number,attribute:"orbit-sensitivity"})],m.prototype,"orbitSensitivity",void 0),Ap([(0,ei.Cb)({type:String,attribute:"touch-action"})],m.prototype,"touchAction",void 0),Ap([(0,ei.Cb)({type:Boolean,attribute:"disable-zoom"})],m.prototype,"disableZoom",void 0),Ap([(0,ei.Cb)({type:Boolean,attribute:"disable-pan"})],m.prototype,"disablePan",void 0),Ap([(0,ei.Cb)({type:Boolean,attribute:"disable-tap"})],m.prototype,"disableTap",void 0),Ap([(0,ei.Cb)({type:Number,attribute:"interpolation-decay"})],m.prototype,"interpolationDecay",void 0),m})((e=>{var t,i,s,r,a,n,A,o,l,h;class c extends e{constructor(){super(...arguments),this.ar=!1,this.arScale="auto",this.arPlacement="floor",this.arModes="webxr scene-viewer quick-look",this.iosSrc=null,this.xrEnvironment=!1,this[t]=!1,this[i]=this.shadowRoot.querySelector(".ar-button"),this[s]=document.createElement("a"),this[r]=new Set,this[a]=nQ.NONE,this[n]=!1,this[A]=e
1030=>{e.preventDefault(),this.activateAR()},this[o]=({status:e})=>{(e===iS.NOT_PRESENTING||this[ar].arRenderer.presentedScene===this[r7])&&(this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}})),e===iS.NOT_PRESENTING?this.removeAttribute("ar-tracking"):e===iS.SESSION_STARTED&&this.setAttribute("ar-tracking",ix.TRACKING))},this[l]=({status:e})=>{this.setAttribute("ar-tracking",e),this.dispatchEvent(new CustomEvent("ar-tracking",{detail:{status:e}}))},this[h]=e=>{"_apple_ar_quicklook_button_tapped"==e.data&&this.dispatchEvent(new CustomEvent("quick-look-button-tapped"))}}get canActivateAR(){return this[nx]!==nQ.NONE}connectedCallback(){super.connectedCallback(),this[ar].arRenderer.addEventListener("status",this[nL]),this.setAttribute("ar-status",iS.NOT_PRESENTING),this[ar].arRenderer.addEventListener("tracking",this[nF]),this[nR].addEventListener("message",this[nk])}disconnectedCallback(){super.disconnectedCallback(),this[ar].arRenderer.removeEventListener("status",this[nL]),this[ar].arRenderer.removeEventListener("tracking",this[nF]),this[nR].removeEventListener("message",this[nk])}update(e){super.update(e),e.has("arScale")&&(this[r7].canScale="fixed"!==this.arScale),e.has("arPlacement")&&(this[r7].updateShadow(),this[ae]()),e.has("arModes")&&(this[nM]=nB(this.arModes)),(e.has("ar")||e.has("arModes")||e.has("src")||e.has("iosSrc"))&&this[nU]()}async activateAR(){switch(this[nx]){case nQ.QUICK_LOOK:this[nb]();break;case nQ.WEBXR:await this[nw]();break;case nQ.SCENE_VIEWER:this[nv]();break;default:console.warn("No AR Mode can be activated. This is probably due to missing configuration or device capabilities")}}async [(t=nS,i=ny,s=nR,r=nM,a=nx,n=nD,A=nT,o=nL,l=nF,h=nk,nU)](){let e=nQ.NONE;if(this.ar){if(null!=this.src)for(let t of this[nM]){if("webxr"===t&&en&&!nf&&await this[ar].arRenderer.supportsPresentation()){e=nQ.WEBXR;break}if("scene-viewer"===t&&eu&&!nE){e=nQ.SCENE_VIEWER;break}if("quick-look"===t&&ep){e=nQ.QUICK_LOOK;break}}e===nQ.NONE&&null!=this.iosSrc&&ep&&(e=nQ.QUICK_LOOK)}if(e!==nQ.NONE)this[ny].classList.add("enabled"),this[ny].addEventListener("click",this[nT]);else if(this[ny].classList.contains("enabled")){this[ny].removeEventListener("click",this[nT]),this[ny].classList.remove("enabled");let e=iS.FAILED;this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}}))}this[nx]=e}async [nw](){console.log("Attempting to present in AR with WebXR..."),await this[nN]();try{this[ny].removeEventListener("click",this[nT]);let{arRenderer:e}=this[ar];e.placeOnWall="wall"===this.arPlacement,await e.present(this[r7],this.xrEnvironment)}catch(e){console.warn("Error while trying to present in AR with WebXR"),console.error(e),await this[ar].arRenderer.stopPresenting(),nf=!0,console.warn("Falling back to next ar-mode"),await this[nU](),this.activateAR()}finally{this[nU]()}}async [nN](){this.loaded||(this[nD]=!0,this[r4](),await ev(this,"load"),this[nD]=!1)}[ao](){return super[ao]()||this[nD]}[nv](){let e=self.location.toString(),t=new URL(e),i=new URL(this.src,e),s=new URLSearchParams(i.search);if(t.hash=nC,s.set("mode","ar_preferred"),s.has("disable_occlusion")||s.set("disable_occlusion","true"),"fixed"===this.arScale&&s.set("resizable","false"),"wall"===this.arPlacement&&s.set("enable_vertical_placement","true"),s.has("sound")){let t=new URL(s.get("sound"),e);s.set("sound",t.toString())}if(s.has("link")){let t=new URL(s.get("link"),e);s.set("link",t.toString())}let r=`intent://arvr.google.com/scene-viewer/1.0?${s.toString()+"&file="+encodeURIComponent(i.toString())}#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(t.toString())};end;`;self.addEventListener("hashchange",()=>{self.location.hash===nC&&(nE=!0,self.history.back(),console.warn("Error while trying to present in AR with Scene Viewer"),console.warn("Falling back to next ar-mode"),this[nU]())},{once:!0}),this[nR].setAttribute("href",r),console.log("Attempting to present in AR with Scene Viewer..."),this[nR].click()}async [nb](){let e=!this.iosSrc;this[ny].classList.remove("enabled");let t=e?await this.prepareUSDZ():this.iosSrc,i=new URL(t,self.location.toString());if(e){let e=self.location.toString(),t=new URL(e),s=new URL(this.src,t);s.hash&&(i.hash=s.hash)}"fixed"===this.arScale&&(i.hash&&(i.hash+="&"),i.hash+="allowsContentScaling=0");let s=this[nR];s.setAttribute("rel","ar");let r=document.createElement("img");s.appendChild(r),s.setAttribute("href",i.toString()),e&&s.setAttribute("download","model.usdz"),s.style.display="none",s.isConnected||this.shadowRoot.appendChild(s),console.log("Attempting to present in AR with Quick Look..."),s.click(),s.removeChild(r),e&&URL.revokeObjectURL(t),this[ny].classList.add("enabled")}async prepareUSDZ(){let e=this[aa].beginActivity();await this[nN]();let{model:t,shadow:i}=this[r7];if(null==t)return"";let s=!1;null!=i&&(s=i.visible,i.visible=!1),e(.2);let r=new nh,a=await r.parse(t),n=new Blob([a],{type:"model/vnd.usdz+zip"}),A=URL.createObjectURL(n);return e(1),null!=i&&(i.visible=s),A}}return nI([(0,ei.Cb)({type:Boolean,attribute:"ar"})],c.prototype,"ar",void 0),nI([(0,ei.Cb)({type:String,attribute:"ar-scale"})],c.prototype,"arScale",void 0),nI([(0,ei.Cb)({type:String,attribute:"ar-placement"})],c.prototype,"arPlacement",void 0),nI([(0,ei.Cb)({type:String,attribute:"ar-modes"})],c.prototype,"arModes",void 0),nI([(0,ei.Cb)({type:String,attribute:"ios-src"})],c.prototype,"iosSrc",void 0),nI([(0,ei.Cb)({type:Boolean,attribute:"xr-environment"})],c.prototype,"xrEnvironment",void 0),c})((e=>{var t,i,s,r,a,n,A,o;class l extends e{constructor(...e){super(...e),this.poster=null,this.reveal=A8.AUTO,this.loading=A5.AUTO,this[t]=!1,this[i]=!1,this[s]=this.shadowRoot.querySelector(".slot.poster"),this[r]=this.shadowRoot.querySelector("#default-poster"),this[a]=this.shadowRoot.querySelector("#default-progress-bar > .bar"),this[n]=this[A7].getAttribute("aria-label"),this[A]=eE(e=>{let t=this[A6].parentNode;requestAnimationFrame(()=>{this[A6].style.transform=`scaleX(${e})`,0===e&&(t.removeChild(this[A6]),t.appendChild(this[A6])),1===e?this[A6].classList.add("hide"):this[A6].classList.remove("hide")})},100),this[o]=e=>{let t=e.detail.totalProgress;1===t&&(this[os].flush(),this.loaded&&(this[oe]||this.reveal===A8.AUTO)&&this[ot]()),this[os](t),this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:t}}))};let l=self.ModelViewerElement||{}
1030,h=l.dracoDecoderLocation||"https://www.gstatic.com/draco/versioned/decoders/1.4.1/";t0.setDRACODecoderLocation(h);let c=l.ktx2TranscoderLocation||"https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/";t0.setKTX2TranscoderLocation(c),l.meshoptDecoderLocation&&t0.setMeshoptDecoderLocation(l.meshoptDecoderLocation)}static set dracoDecoderLocation(e){t0.setDRACODecoderLocation(e)}static get dracoDecoderLocation(){return t0.getDRACODecoderLocation()}static set ktx2TranscoderLocation(e){t0.setKTX2TranscoderLocation(e)}static get ktx2TranscoderLocation(){return t0.getKTX2TranscoderLocation()}static set meshoptDecoderLocation(e){t0.setMeshoptDecoderLocation(e)}static get meshoptDecoderLocation(){return t0.getMeshoptDecoderLocation()}static mapURLs(e){i6.singleton.loader[tX].manager.setURLModifier(e)}dismissPoster(){this.loaded?this[ot]():(this[oe]=!0,this[r4]())}showPoster(){let e=this[A9];if(e.classList.contains("show"))return;e.classList.add("show"),this[r6].classList.remove("show");let t=this[A7];t.removeAttribute("tabindex"),t.removeAttribute("aria-hidden");let i=this.modelIsVisible;this[oi]=!1,this[rZ](i)}getDimensions(){return al(this[r7].size)}getBoundingBoxCenter(){return al(this[r7].boundingBox.getCenter(new es.Pa4))}connectedCallback(){super.connectedCallback(),this.showPoster(),this[aa].addEventListener("progress",this[oa])}disconnectedCallback(){super.disconnectedCallback(),this[aa].removeEventListener("progress",this[oa])}async updated(e){super.updated(e),e.has("poster")&&null!=this.poster&&(this[A7].style.backgroundImage=`url(${this.poster})`),e.has("alt")&&this[A7].setAttribute("aria-label",this[r0]),(e.has("reveal")||e.has("loading"))&&this[r4]()}[(t=oi,i=oe,s=A9,r=A7,a=A6,n=or,A=os,o=oa,ao)](){return!!this.src&&(this[oe]||this.loading===A5.EAGER||this.reveal===A8.AUTO&&this[rX])}[ot](){this[oe]=!1;let e=this[A9];if(!e.classList.contains("show"))return;e.classList.remove("show"),this[r6].classList.add("show");let t=this.modelIsVisible;this[oi]=!0,this[rZ](t);let i=this.getRootNode();i&&i.activeElement===this&&this[r6].focus();let s=this[A7];s.setAttribute("aria-hidden","true"),s.tabIndex=-1,this.dispatchEvent(new CustomEvent("poster-dismissed"))}[aA](){return super[aA]()&&this[oi]}}return A4([(0,ei.Cb)({type:String})],l.prototype,"poster",void 0),A4([(0,ei.Cb)({type:String})],l.prototype,"reveal",void 0),A4([(0,ei.Cb)({type:String})],l.prototype,"loading",void 0),l})((e=>{var t;class i extends e{constructor(...e){super(e),this.autoplay=!1,this.animationName=void 0,this.animationCrossfadeDuration=300,this[t]=!0,this[r7].subscribeMixerEvent("loop",e=>{let t=e.action._loopCount;this.dispatchEvent(new CustomEvent("loop",{detail:{count:t}}))}),this[r7].subscribeMixerEvent("finished",()=>{this[ad]=!0,this.dispatchEvent(new CustomEvent("finished"))})}get availableAnimations(){return this.loaded?this[r7].animationNames:[]}get duration(){return this[r7].duration}get paused(){return this[ad]}get currentTime(){return this[r7].animationTime}set currentTime(e){this[r7].animationTime=e,this[ae]()}get timeScale(){return this[r7].animationTimeScale}set timeScale(e){this[r7].animationTimeScale=e}pause(){this[ad]||(this[ad]=!0,this.dispatchEvent(new CustomEvent("pause")))}play(e){this.availableAnimations.length>0&&(this[ad]=!1,this[au](e),this.dispatchEvent(new CustomEvent("play")))}[(t=ad,ai)](){super[ai](),this[ad]=!0,this.autoplay&&this.play()}[at](e,t){super[at](e,t),!this[ad]&&(this[aA]()||this[ar].isPresenting)&&(this[r7].updateAnimation(t/1e3),this[ae]())}updated(e){super.updated(e),e.has("autoplay")&&this.autoplay&&this.play(),e.has("animationName")&&this[au]()}[au](e=ap){var t;let i=null!==(t=e.repetitions)&&void 0!==t?t:1/0,s=e.pingpong?es.uEv:1===i?es.jAl:es.YKA;this[r7].playAnimation(this.animationName,this.animationCrossfadeDuration/1e3,s,i),this[ad]&&(this[r7].updateAnimation(0),this[ae]())}}return ag([(0,ei.Cb)({type:Boolean})],i.prototype,"autoplay",void 0),ag([(0,ei.Cb)({type:String,attribute:"animation-name"})],i.prototype,"animationName",void 0),ag([(0,ei.Cb)({type:Number,attribute:"animation-crossfade-duration"})],i.prototype,"animationCrossfadeDuration",void 0),i})((e=>{var t;let i=e=>{if(null==e.shadowRoot||e.hasAttribute("data-js-focus-visible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(e.shadowRoot);else{let t=()=>{self.applyFocusVisiblePolyfill(e.shadowRoot)};return self.addEventListener("focus-visible-polyfill-ready",t,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",t)}}return()=>{}},s=Symbol("endPolyfillCoordination");class r extends e{constructor(){super(...arguments),this[t]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),null==this[s]&&(this[s]=i(this))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),null!=this[s]&&(this[s](),this[s]=null)}}return t=s,r})(ac)))))))));customElements.define("model-viewer",og);var ou=i(2265),od=i(57437);let op=ou.forwardRef(function(e,t){let{src:i,alt:s,poster:r,style:a}=e;return(0,od.jsx)("div",{style:{...a},ref:t,children:i?(0,od.jsx)("model-viewer",{src:i,alt:s||"3D Model","camera-controls":!0,poster:r||null,style:{width:"100%",height:"100%"}}):null})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.