lunchboxjs 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,23 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("three");function Ie(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const p=Ie(ke),X=["WebGLRenderer","Scene","Group","Object3D","Mesh","Sprite","BoxGeometry","BufferGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","ExtrudeGeometry","IcosahedronGeometry","InstancedBufferGeometry","LatheGeometry","OctahedronGeometry","PlaneGeometry","PolyhedronGeometry","RingGeometry","ShapeGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","WireframeGeometry","PointsMaterial","ShaderMaterial","ShadowMaterial","SpriteMaterial","MeshToonMaterial","MeshBasicMaterial","MeshDepthMaterial","MeshPhongMaterial","LineBasicMaterial","RawShaderMaterial","MeshMatcapMaterial","MeshNormalMaterial","LineDashedMaterial","MeshLambertMaterial","MeshStandardMaterial","MeshDistanceMaterial","MeshPhysicalMaterial","Light","SpotLight","SpotLightHelper","PointLight","PointLightHelper","AmbientLight","RectAreaLight","HemisphereLight","HemisphereLightHelper","DirectionalLight","DirectionalLightHelper","CubeCamera","ArrayCamera","StereoCamera","PerspectiveCamera","OrthographicCamera","Texture","CubeTexture","DataTexture","DepthTexture","VideoTexture","CanvasTexture","CompressedTexture","CatmullRomCurve3","Points","Raycaster","CameraHelper","Color","TextureLoader"];/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("lit"),se=require("three");function ie(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const l=ie(se),O=["WebGLRenderer","Scene","Group","Object3D","Mesh","Sprite","BoxGeometry","BufferGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","ExtrudeGeometry","IcosahedronGeometry","InstancedBufferGeometry","LatheGeometry","OctahedronGeometry","PlaneGeometry","PolyhedronGeometry","RingGeometry","ShapeGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","WireframeGeometry","PointsMaterial","ShaderMaterial","ShadowMaterial","SpriteMaterial","MeshToonMaterial","MeshBasicMaterial","MeshDepthMaterial","MeshPhongMaterial","LineBasicMaterial","RawShaderMaterial","MeshMatcapMaterial","MeshNormalMaterial","LineDashedMaterial","MeshLambertMaterial","MeshStandardMaterial","MeshDistanceMaterial","MeshPhysicalMaterial","Light","SpotLight","SpotLightHelper","PointLight","PointLightHelper","AmbientLight","RectAreaLight","HemisphereLight","HemisphereLightHelper","DirectionalLight","DirectionalLightHelper","CubeCamera","ArrayCamera","StereoCamera","PerspectiveCamera","OrthographicCamera","Texture","CubeTexture","DataTexture","DepthTexture","VideoTexture","CanvasTexture","CompressedTexture","CatmullRomCurve3","Points","Raycaster","CameraHelper","Color","TextureLoader"],B=(i,e,t)=>{if(!e)return;const r=Array.isArray(e)?e:e.match(/([^[.\]])+/g),s=r==null?void 0:r.reduce((n,o)=>n&&n[o],i);return s===void 0?t:s};function q(i){if(!i)return!1;const e=i.constructor&&i.constructor.toString().substring(0,5)==="class";if(i.prototype===void 0)return e;const t=i.prototype.constructor&&i.prototype.constructor.toString&&i.prototype.constructor.toString().substring(0,5)==="class";return e||t}const ne=()=>{const i="[object Number]",t=Object.prototype.toString;function r(n){return!!n&&typeof n=="object"}return function(o){return typeof o=="number"||r(o)&&t.call(o)==i}},z=ne(),F=(i,e,t)=>{const r=Array.isArray(e)?e:e.match(/([^[.\]])+/g);r==null||r.reduce((s,n,o)=>(s[n]===void 0&&(s[n]={}),o===r.length-1&&(s[n]=t),s[n]),i)},M="data-three-uuid",P=i=>{var t,r,s;let e=i.parentNode;for(;e&&!(e!=null&&e.instance)&&!((t=e==null?void 0:e.three)!=null&&t.scene);)e=(e==null?void 0:e.parentNode)||(e==null?void 0:e.host)||((s=(r=e.getRootNode)==null?void 0:r.call(e))==null?void 0:s.host);return e};function b(i,e){return i?i instanceof ShadowRoot?b(i.host,e):i instanceof HTMLElement&&(typeof e=="string"&&i.matches(e)||typeof e=="function"&&e(i))?i:b(i.parentNode,e):null}const T=(i,e,t)=>{var n,o;const r=B(i,e);if(z(t)&&(r!=null&&r.setScalar))r.setScalar(+t);else if(r!=null&&r.set)if(typeof t=="string"){const a=t.split(","),c=a.every(h=>!h.match(/^[^\d,]+$/));if((n=t.toLowerCase().trim().match(/^#[\dabcdef]{3,6}$/))!=null&&n.length)if(t.length===4){const h=[t[1],t[1],t[2],t[2],t[3],t[3]].join("");r.set(+`0x${h}`)}else r.set(+`0x${t.slice(1)}`);else a!=null&&a.length&&c?r.set(...a.map(h=>+h)):r.set(t)}else{const a=Array.isArray(t)?t:[t];r.set(...a)}else F(i,e,t);const s=i;typeof s.type=="string"&&((o=s.type)!=null&&o.toLowerCase().endsWith("material"))&&(s.needsUpdate=!0)},C={$scene:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.scene},$camera:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.camera},$renderer:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.renderer},$domElement:i=>{var t;const e=i.closest("three-lunchbox");return(t=e==null?void 0:e.three.renderer)==null?void 0:t.domElement}},_=(i,e)=>{var r;if(typeof i!="string")return i;if(i==="")return!0;const t=(r=C[i])==null?void 0:r.call(C,e);return CSS.supports("color",i)?new l.Color(i):t??i};/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const k=globalThis,Q=k.ShadowRoot&&(k.ShadyCSS===void 0||k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ee=Symbol(),oe=new WeakMap;let _e=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Q&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=oe.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&oe.set(t,e))}return e}toString(){return this.cssText}};const Be=i=>new _e(typeof i=="string"?i:i+"",void 0,ee),Ge=(i,...e)=>{const t=i.length===1?i[0]:e.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new _e(t,i,ee)},ze=(i,e)=>{if(Q)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),r=k.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=t.cssText,i.appendChild(s)}},ae=Q?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Be(t)})(i):i;/**
5
+ */const A=globalThis,R=A.ShadowRoot&&(A.ShadyCSS===void 0||A.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),U=new WeakMap;let oe=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(R&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=U.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&U.set(t,e))}return e}toString(){return this.cssText}};const ae=i=>new oe(typeof i=="string"?i:i+"",void 0,W),ce=(i,e)=>{if(R)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),s=A.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=t.cssText,i.appendChild(r)}},j=R?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return ae(t)})(i):i;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:qe,defineProperty:Ve,getOwnPropertyDescriptor:We,getOwnPropertyNames:Fe,getOwnPropertySymbols:Je,getPrototypeOf:Ke}=Object,g=globalThis,he=g.trustedTypes,Ze=he?he.emptyScript:"",q=g.reactiveElementPolyfillSupport,O=(i,e)=>i,I={toAttribute(i,e){switch(e){case Boolean:i=i?Ze:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},te=(i,e)=>!qe(i,e),ce={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:te};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let S=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ce){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,t);r!==void 0&&Ve(this.prototype,e,r)}}static getPropertyDescriptor(e,t,s){const{get:r,set:n}=We(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:r,set(o){const a=r==null?void 0:r.call(this);n==null||n.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ce}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const e=Ke(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const t=this.properties,s=[...Fe(t),...Je(t)];for(const r of s)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,r]of t)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const r=this._$Eu(t,s);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)t.unshift(ae(r))}else e!==void 0&&t.push(ae(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ze(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){var n;const s=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:I).toAttribute(t,s.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var n,o;const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const a=s.getPropertyOptions(r),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:I;this._$Em=r;const c=h.fromAttribute(t,a.type);this[r]=c??((o=this._$Ej)==null?void 0:o.get(r))??c,this._$Em=null}}requestUpdate(e,t,s,r=!1,n){var o;if(e!==void 0){const a=this.constructor;if(r===!1&&(n=this[e]),s??(s=a.getPropertyOptions(e)),!((s.hasChanged??te)(n,t)||s.useDefault&&s.reflect&&n===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(a._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:r,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(s=this._$EO)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[O("elementProperties")]=new Map,S[O("finalized")]=new Map,q==null||q({ReactiveElement:S}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.2");/**
9
+ */const{is:he,defineProperty:le,getOwnPropertyDescriptor:de,getOwnPropertyNames:ue,getOwnPropertySymbols:pe,getPrototypeOf:me}=Object,p=globalThis,D=p.trustedTypes,fe=D?D.emptyScript:"",S=p.reactiveElementPolyfillSupport,g=(i,e)=>i,w={toAttribute(i,e){switch(e){case Boolean:i=i?fe:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},N=(i,e)=>!he(i,e),k={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:N};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),p.litPropertyMetadata??(p.litPropertyMetadata=new WeakMap);class y extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=k){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);s!==void 0&&le(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=de(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);n==null||n.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=me(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,r=[...ue(t),...pe(t)];for(const s of r)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,s]of t)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const s=this._$Eu(t,r);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const s of r)t.unshift(j(s))}else e!==void 0&&t.push(j(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ce(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){const o=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:w).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var n,o;const r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=r.getPropertyOptions(s),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:w;this._$Em=s;const h=c.fromAttribute(t,a.type);this[s]=h??((o=this._$Ej)==null?void 0:o.get(s))??h,this._$Em=null}}requestUpdate(e,t,r,s=!1,n){var o;if(e!==void 0){const a=this.constructor;if(s===!1&&(n=this[e]),r??(r=a.getPropertyOptions(e)),!((r.hasChanged??N)(n,t)||r.useDefault&&r.reflect&&n===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(a._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:n},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[n,o]of s){const{wrapped:a}=o,c=this[n];a!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,o,c)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[g("elementProperties")]=new Map,y[g("finalized")]=new Map,S==null||S({ReactiveElement:y}),(p.reactiveElementVersions??(p.reactiveElementVersions=[])).push("2.1.2");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const x=globalThis,le=i=>i,B=x.trustedTypes,de=B?B.createPolicy("lit-html",{createHTML:i=>i}):void 0,be="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,ve="?"+$,Ye=`<${ve}>`,w=document,N=()=>w.createComment(""),L=i=>i===null||typeof i!="object"&&typeof i!="function",se=Array.isArray,Xe=i=>se(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",V=`[
14
- \f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ue=/-->/g,pe=/>/g,_=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),me=/'/g,fe=/"/g,Ce=/^(?:script|style|textarea|title)$/i,Qe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),re=Qe(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),ye=new WeakMap,b=w.createTreeWalker(w,129);function we(i,e){if(!se(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return de!==void 0?de.createHTML(e):e}const et=(i,e)=>{const t=i.length-1,s=[];let r,n=e===2?"<svg>":e===3?"<math>":"",o=M;for(let a=0;a<t;a++){const h=i[a];let c,d,l=-1,m=0;for(;m<h.length&&(o.lastIndex=m,d=o.exec(h),d!==null);)m=o.lastIndex,o===M?d[1]==="!--"?o=ue:d[1]!==void 0?o=pe:d[2]!==void 0?(Ce.test(d[2])&&(r=RegExp("</"+d[2],"g")),o=_):d[3]!==void 0&&(o=_):o===_?d[0]===">"?(o=r??M,l=-1):d[1]===void 0?l=-2:(l=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?_:d[3]==='"'?fe:me):o===fe||o===me?o=_:o===ue||o===pe?o=M:(o=_,r=void 0);const E=o===_&&i[a+1].startsWith("/>")?" ":"";n+=o===M?h+Ye:l>=0?(s.push(c),h.slice(0,l)+be+h.slice(l)+$+E):h+$+(l===-2?a:E)}return[we(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class U{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let n=0,o=0;const a=e.length-1,h=this.parts,[c,d]=et(e,t);if(this.el=U.createElement(c,s),b.currentNode=this.el.content,t===2||t===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=b.nextNode())!==null&&h.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const l of r.getAttributeNames())if(l.endsWith(be)){const m=d[o++],E=r.getAttribute(l).split($),D=/([.?@])?(.*)/.exec(m);h.push({type:1,index:n,name:D[2],strings:E,ctor:D[1]==="."?st:D[1]==="?"?rt:D[1]==="@"?it:z}),r.removeAttribute(l)}else l.startsWith($)&&(h.push({type:6,index:n}),r.removeAttribute(l));if(Ce.test(r.tagName)){const l=r.textContent.split($),m=l.length-1;if(m>0){r.textContent=B?B.emptyScript:"";for(let E=0;E<m;E++)r.append(l[E],N()),b.nextNode(),h.push({type:2,index:++n});r.append(l[m],N())}}}else if(r.nodeType===8)if(r.data===ve)h.push({type:2,index:n});else{let l=-1;for(;(l=r.data.indexOf($,l+1))!==-1;)h.push({type:7,index:n}),l+=$.length-1}n++}}static createElement(e,t){const s=w.createElement("template");return s.innerHTML=e,s}}function P(i,e,t=i,s){var o,a;if(e===T)return e;let r=s!==void 0?(o=t._$Co)==null?void 0:o[s]:t._$Cl;const n=L(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=r:t._$Cl=r),r!==void 0&&(e=P(i,r._$AS(i,e.values),r,s)),e}class tt{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=((e==null?void 0:e.creationScope)??w).importNode(t,!0);b.currentNode=r;let n=b.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new j(n,n.nextSibling,this,e):h.type===1?c=new h.ctor(n,h.name,h.strings,this,e):h.type===6&&(c=new nt(n,this,e)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(n=b.nextNode(),o++)}return b.currentNode=w,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class j{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=P(this,e,t),L(e)?e===u||e==null||e===""?(this._$AH!==u&&this._$AR(),this._$AH=u):e!==this._$AH&&e!==T&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==u&&L(this._$AH)?this._$AA.nextSibling.data=e:this.T(w.createTextNode(e)),this._$AH=e}$(e){var n;const{values:t,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=U.createElement(we(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(t);else{const o=new tt(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=ye.get(e.strings);return t===void 0&&ye.set(e.strings,t=new U(e)),t}k(e){se(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const n of e)r===t.length?t.push(s=new j(this.O(N()),this.O(N()),this,this.options)):s=t[r],s._$AI(n),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e!==this._$AB;){const r=le(e).nextSibling;le(e).remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class z{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=u}_$AI(e,t=this,s,r){const n=this.strings;let o=!1;if(n===void 0)e=P(this,e,t,0),o=!L(e)||e!==this._$AH&&e!==T,o&&(this._$AH=e);else{const a=e;let h,c;for(e=n[0],h=0;h<n.length-1;h++)c=P(this,a[s+h],t,h),c===T&&(c=this._$AH[h]),o||(o=!L(c)||c!==this._$AH[h]),c===u?e=u:e!==u&&(e+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!r&&this.j(e)}j(e){e===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class st extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===u?void 0:e}}class rt extends z{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==u)}}class it extends z{constructor(e,t,s,r,n){super(e,t,s,r,n),this.type=5}_$AI(e,t=this){if((e=P(this,e,t,0)??u)===T)return;const s=this._$AH,r=e===u&&s!==u||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==u&&(s===u||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class nt{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){P(this,e)}}const W=x.litHtmlPolyfillSupport;W==null||W(U,j),(x.litHtmlVersions??(x.litHtmlVersions=[])).push("3.3.2");const ot=(i,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let r=s._$litPart$;if(r===void 0){const n=(t==null?void 0:t.renderBefore)??null;s._$litPart$=r=new j(e.insertBefore(N(),n),n,void 0,t??{})}return r._$AI(i),r};/**
13
+ */const Ee={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:N},ye=(i=Ee,e,t)=>{const{kind:r,metadata:s}=t;let n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){const{name:o}=t;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,i,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(r==="setter"){const{name:o}=t;return function(a){const c=this[o];e.call(this,a),this.requestUpdate(o,c,i,!0,a)}}throw Error("Unsupported decorator location: "+r)};function u(i){return(e,t)=>typeof t=="object"?ye(i,e,t):((r,s,n)=>{const o=s.hasOwnProperty(n);return s.constructor.createProperty(n,r),o?Object.getOwnPropertyDescriptor(s,n):void 0})(i,e,t)}/**
16
14
  * @license
17
15
  * Copyright 2017 Google LLC
18
16
  * SPDX-License-Identifier: BSD-3-Clause
19
- */const v=globalThis;class C extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ot(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return T}}var Ae;C._$litElement$=!0,C.finalized=!0,(Ae=v.litElementHydrateSupport)==null||Ae.call(v,{LitElement:C});const F=v.litElementPolyfillSupport;F==null||F({LitElement:C});(v.litElementVersions??(v.litElementVersions=[])).push("4.2.2");const Se=(i,e,t)=>{if(!e)return;const s=Array.isArray(e)?e:e.match(/([^[.\]])+/g),r=s==null?void 0:s.reduce((n,o)=>n&&n[o],i);return r===void 0?t:r};function Te(i){if(!i)return!1;const e=i.constructor&&i.constructor.toString().substring(0,5)==="class";if(i.prototype===void 0)return e;const t=i.prototype.constructor&&i.prototype.constructor.toString&&i.prototype.constructor.toString().substring(0,5)==="class";return e||t}const at=()=>{const i="[object Number]",t=Object.prototype.toString;function s(n){return!!n&&typeof n=="object"}return function(o){return typeof o=="number"||s(o)&&t.call(o)==i}},Pe=at(),Me=(i,e,t)=>{const s=Array.isArray(e)?e:e.match(/([^[.\]])+/g);s==null||s.reduce((r,n,o)=>(r[n]===void 0&&(r[n]={}),o===s.length-1&&(r[n]=t),r[n]),i)},ie="data-three-uuid",K=i=>{var t,s,r;let e=i.parentNode;for(;e&&!(e!=null&&e.instance)&&!((t=e==null?void 0:e.three)!=null&&t.scene);)e=(e==null?void 0:e.parentNode)||(e==null?void 0:e.host)||((r=(s=e.getRootNode)==null?void 0:s.call(e))==null?void 0:r.host);return e};function R(i,e){return i?i instanceof ShadowRoot?R(i.host,e):i instanceof HTMLElement&&(typeof e=="string"&&i.matches(e)||typeof e=="function"&&e(i))?i:R(i.parentNode,e):null}const Z=(i,e,t)=>{var n,o;const s=Se(i,e);if(Pe(t)&&(s!=null&&s.setScalar))s.setScalar(+t);else if(s!=null&&s.set)if(typeof t=="string"){const a=t.split(","),h=a.every(c=>!c.match(/^[^\d,]+$/));if((n=t.toLowerCase().trim().match(/^#[\dabcdef]{3,6}$/))!=null&&n.length)if(t.length===4){const c=[t[1],t[1],t[2],t[2],t[3],t[3]].join("");s.set(+`0x${c}`)}else s.set(+`0x${t.slice(1)}`);else a!=null&&a.length&&h?s.set(...a.map(c=>+c)):s.set(t)}else{const a=Array.isArray(t)?t:[t];s.set(...a)}else Me(i,e,t);const r=i;typeof r.type=="string"&&((o=r.type)!=null&&o.toLowerCase().endsWith("material"))&&(r.needsUpdate=!0)},J={$scene:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.scene},$camera:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.camera},$renderer:i=>{const e=i.closest("three-lunchbox");return e==null?void 0:e.three.renderer},$domElement:i=>{var t;const e=i.closest("three-lunchbox");return(t=e==null?void 0:e.three.renderer)==null?void 0:t.domElement}},G=(i,e)=>{var s;if(typeof i!="string")return i;if(i==="")return!0;const t=(s=J[i])==null?void 0:s.call(J,e);return CSS.supports("color",i)?new p.Color(i):t??i};/**
20
- * @license
21
- * Copyright 2017 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- */const ht={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:te},ct=(i=ht,e,t)=>{const{kind:s,metadata:r}=t;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),s==="accessor"){const{name:o}=t;return{set(a){const h=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,h,i,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(s==="setter"){const{name:o}=t;return function(a){const h=this[o];e.call(this,a),this.requestUpdate(o,h,i,!0,a)}}throw Error("Unsupported decorator location: "+s)};function y(i){return(e,t)=>typeof t=="object"?ct(i,e,t):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,e,t)}/**
24
- * @license
25
- * Copyright 2017 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- */function lt(i){return y({...i,state:!0,attribute:!1})}var dt=Object.defineProperty,Oe=(i,e,t,s)=>{for(var r=void 0,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=o(e,t,r)||r);return r&&dt(e,t,r),r};const Y="raycast",Ee=[Y,"args","data"],$e=i=>i.split("-");class H extends C{constructor(e){super(),this.classSource=e,this.instance=null,this.dispose=[],this.mutationObserver=null,this.tryAddOnce=!1,this.connected=!1}observeAttributes(){this.mutationObserver=new MutationObserver(e=>{e.forEach(t=>{var r;if(!t.attributeName||(r=Object.getPrototypeOf(this).constructor.observedAttributes)!=null&&r.includes(t.attributeName))return;const s=this.attributes.getNamedItem(t.attributeName);s&&this.updateProperty(s)})}),this.mutationObserver.observe(this,{attributes:!0})}parsedArgs(){const e=this.args??this.getAttribute("args")??[];return typeof e=="string"?JSON.parse(e):e}createUnderlyingThreeObject(){this.instance=new this.classSource(...this.parsedArgs().map(e=>G(e,this)))}refreshAttributes(){this.getAttributeNames().forEach(e=>{const t=this.attributes.getNamedItem(e);t&&this.updateProperty(t)}),Array.from(this.attributes).forEach(this.updateProperty.bind(this))}async onUnderlyingThreeObjectReady(){var s,r,n,o;const e=this.instance;e.uuid&&this.setAttribute(ie,e.uuid);let t=K(this);for(;this!=null&&this.connected&&!this.tryAddOnce&&!t;)await new Promise(requestAnimationFrame),t=K(this);if(t&&t.instance||(s=t==null?void 0:t.three)!=null&&s.scene){const a=this.instance,h=this.instance,c=t.instance,d=t.instance??((r=t.three)==null?void 0:r.scene),l=this.instance;if((n=a.type)!=null&&n.toLowerCase().includes("geometry")&&c.geometry)c.geometry=a;else if((o=h.type)!=null&&o.toLowerCase().includes("material")&&c.material)c.material=h;else if(d.add)try{d.add(l),this.dispatchEvent(new CustomEvent("instanceadded",{detail:{instance:this.instance,parent:d}}))}catch{throw new Error(`Error adding ${this.tagName} to ${d}`)}const m=this.getAttribute("attach");m&&this.executeAttach(m,this.instance)}}connectedCallback(){super.connectedCallback(),this.observeAttributes.call(this),this.createUnderlyingThreeObject.call(this),this.refreshAttributes.call(this),this.dispatchEvent(new CustomEvent("instancecreated",{detail:{instance:this.instance}})),this.connected=!0,this.onUnderlyingThreeObjectReady.call(this)}updateProperty(e){const{name:t,value:s}=e;let r=t;Object.keys(this.instance??{}).forEach(a=>{a.toLowerCase()===r&&(r=a)});const n=$e(r);if(Ee.includes(r)||Ee.includes(n[0]))return;let o=G(s,this);try{o=JSON.parse(s===""?"true":s)}catch{}this.instance&&Z(this.instance,n,o)}executeAttach(e,t){const s=this.parentElement;s.instance&&Z(s.instance,$e(e),t)}disconnectedCallback(){super.disconnectedCallback();const e=[this.instance];this.disposeThreeObjects.call(this,e),this.connected=!1}disposeThreeObjects(e){e.forEach(t=>{var n,o;if(!t)return;const s=t,r=t;(n=s.dispose)==null||n.call(s),(o=r.removeFromParent)==null||o.call(r)})}render(){return re`<slot></slot>`}createRenderRoot(){return this}}Oe([y({type:Boolean,attribute:"try-add-once"})],H.prototype,"tryAddOnce");Oe([lt()],H.prototype,"connected");const xe=i=>{const e=typeof i=="string"?p[i]:i;if(!Te(e))return null;const t=i.toString().toLowerCase().endsWith("loader");class s extends H{constructor(){super(e)}}class r extends H{constructor(){super(...arguments),this.loader=null}createUnderlyingThreeObject(){this.loader=new e(...this.parsedArgs().map(o=>G(o,this)))}async onUnderlyingThreeObjectReady(){const o=this.getAttribute("src");if(!o)throw new Error("Loader requires a source.");if(!this.loader)throw new Error(`Missing loader ${this.tagName}`);this.loader.load(o,a=>{this.instance=a;const h=this.getAttribute("attach");h&&this.executeAttach(h,a),this.refreshAttributes.call(this),this.dispatchEvent(new CustomEvent("loaded",{detail:{instance:a}}))},void 0,a=>{throw new Error(`error loading: ${o}`+a)})}disconnectedCallback(){super.disconnectedCallback(),this.disposeThreeObjects.call(this,[this.loader])}}return t?r:s};var ut=Object.defineProperty,A=(i,e,t,s)=>{for(var r=void 0,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=o(e,t,r)||r);return r&&ut(e,t,r),r};const pt="orthographic",ge=1/0,ne=class ne extends C{constructor(){super(),this.scratchV2=new p.Vector2,this.background=null,this.dpr=ge,this.headless=!1,this.manualRender=!1,this.dispatchBeforeRender=!1,this.dispatchAfterRender=!1,this.rendererArgs=[],this.cameraArgs=[],this.raycaster=new p.Raycaster,this.raycastPool=[],this.frame=1/0,this.three=this.createThree(),this.resizeObserver=new ResizeObserver(e=>{e.forEach(({target:t,contentRect:s})=>{var r;if(t===this&&((r=this.three.renderer)==null||r.setSize(s.width*this.dpr,s.height*this.dpr),this.three.camera)){const n=s.width/s.height;if(this.three.camera.type.toLowerCase()==="perspectivecamera")this.three.camera.aspect=n,this.three.camera.updateProjectionMatrix();else if(this.three.camera.type.toLowerCase()==="orthographiccamera"){const o=s.height/s.width,a=10;this.three.camera.top=o*a,this.three.camera.bottom=-o*a,this.three.camera.right=a,this.three.camera.left=-a,this.three.camera.updateProjectionMatrix()}this.manualRender||this.renderThree()}})})}createDefaultScene(){return new p.Scene}createThree(){return{scene:this.createDefaultScene(),camera:null,renderer:null}}connectedCallback(){if(super.connectedCallback(),this.dpr===ge&&(this.dpr=window.devicePixelRatio),this.three.camera||(this.getAttribute(pt)!==null?this.three.camera=new p.OrthographicCamera(...this.cameraArgs):this.three.camera=new p.PerspectiveCamera(...this.cameraArgs.length?this.cameraArgs:[75])),["scene","camera","renderer"].forEach(e=>{const t=this[e]??this.getAttribute(e)??{},s=typeof t=="string"?JSON.parse(t):t;Object.entries(s).forEach(([r,n])=>{this.three[e]&&Z(this.three[e],r.split("-"),G(n,this))})}),this.resizeObserver.observe(this),this.background!==null&&(this.three.scene.background=new p.Color(this.background)),!this.three.renderer&&!this.headless){const e=new p.WebGLRenderer(...this.rendererArgs);e.domElement.addEventListener("pointermove",this.onPointerMove.bind(this)),e.domElement.addEventListener("mousemove",this.onPointerMove.bind(this)),e.domElement.addEventListener("click",this.onClick.bind(this)),this.three.renderer=e}this.dispatchEvent(new CustomEvent("three-ready",{bubbles:!0,composed:!0,detail:{lunchbox:this}})),this.manualRender||this.updateLoop()}disconnectedCallback(){var e,t,s,r;(e=this.three.renderer)==null||e.domElement.removeEventListener("pointermove",this.onPointerMove.bind(this)),(t=this.three.renderer)==null||t.domElement.removeEventListener("mousemove",this.onPointerMove.bind(this)),(s=this.three.renderer)==null||s.domElement.removeEventListener("click",this.onClick.bind(this)),(r=this.three.renderer)==null||r.dispose(),this.resizeObserver.unobserve(this),cancelAnimationFrame(this.frame)}handleDefaultSlotChange(e){e.target.assignedElements().forEach(t=>{const s=t;s.instance instanceof p.Object3D&&t.getAttributeNames().includes(Y)&&t.getAttributeNames().includes(Y)&&this.raycastPool.push(s.instance)}),this.renderThree()}runRaycast(e){var a,h;if(!this.raycastPool.length||!this.three.camera)return[];const t=((a=this.three.renderer)==null?void 0:a.domElement.width)??0,s=((h=this.three.renderer)==null?void 0:h.domElement.height)??0,r=this.scratchV2.clone().set(e.clientX/(t/this.dpr)*2-1,-(e.clientY/(s/this.dpr))*2+1);return this.raycaster.setFromCamera(r,this.three.camera),this.raycaster.intersectObjects(this.raycastPool).map(c=>({intersect:c,element:this.querySelector(`[${ie}="${c.object.uuid}"]`)}))}onPointerMove(e){this.runRaycast.bind(this)(e).forEach(s=>{var r,n,o,a;e.type==="pointermove"?((r=s.element)==null||r.dispatchEvent(new PointerEvent("pointermove")),(n=s.element)==null||n.dispatchEvent(new CustomEvent(Ne,{detail:s}))):e.type==="mousemove"&&((o=s.element)==null||o.dispatchEvent(new MouseEvent("mousemove")),(a=s.element)==null||a.dispatchEvent(new CustomEvent(Le,{detail:s})))})}onClick(e){let t=[];if(e instanceof TouchEvent){const s=e.touches[0];t=this.runRaycast.bind(this)(s),t.forEach(r=>{var n;(n=r.element)==null||n.dispatchEvent(new TouchEvent("touchstart"))})}else t=this.runRaycast.bind(this)(e),t.forEach(s=>{var r;(r=s.element)==null||r.dispatchEvent(new MouseEvent("click"))});t.forEach(s=>{var r;(r=s.element)==null||r.dispatchEvent(new CustomEvent(Ue,{detail:s}))})}updateLoop(){this.renderThree(),this.manualRender||(this.frame=requestAnimationFrame(this.updateLoop.bind(this)))}renderThree(e,t){var s;this.dispatchBeforeRender&&this.dispatchEvent(new CustomEvent(He,{})),this.three.camera&&((s=this.three.renderer)==null||s.render(e??this.three.scene,t??this.three.camera),this.dispatchAfterRender&&this.dispatchEvent(new CustomEvent(je,{})))}render(){var e;return re`
17
+ */function be(i){return u({...i,state:!0,attribute:!1})}var ge=Object.defineProperty,V=(i,e,t,r)=>{for(var s=void 0,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(e,t,s)||s);return s&&ge(e,t,s),s};const $="raycast",G=[$,"args","data"],I=i=>i.split("-");class v extends E.LitElement{constructor(e){super(),this.classSource=e,this.instance=null,this.dispose=[],this.mutationObserver=null,this.tryAddOnce=!1,this.connected=!1}observeAttributes(){this.mutationObserver=new MutationObserver(e=>{e.forEach(t=>{var s;if(!t.attributeName||(s=Object.getPrototypeOf(this).constructor.observedAttributes)!=null&&s.includes(t.attributeName))return;const r=this.attributes.getNamedItem(t.attributeName);r&&this.updateProperty(r)})}),this.mutationObserver.observe(this,{attributes:!0})}parsedArgs(){const e=this.args??this.getAttribute("args")??[];return typeof e=="string"?JSON.parse(e):e}createUnderlyingThreeObject(){this.instance=new this.classSource(...this.parsedArgs().map(e=>_(e,this)))}refreshAttributes(){this.getAttributeNames().forEach(e=>{const t=this.attributes.getNamedItem(e);t&&this.updateProperty(t)}),Array.from(this.attributes).forEach(this.updateProperty.bind(this))}async onUnderlyingThreeObjectReady(){var r,s,n,o;const e=this.instance;e.uuid&&this.setAttribute(M,e.uuid);let t=P(this);for(;this!=null&&this.connected&&!this.tryAddOnce&&!t;)await new Promise(requestAnimationFrame),t=P(this);if(t&&t.instance||(r=t==null?void 0:t.three)!=null&&r.scene){const a=this.instance,c=this.instance,h=t.instance,f=t.instance??((s=t.three)==null?void 0:s.scene),re=this.instance;if((n=a.type)!=null&&n.toLowerCase().includes("geometry")&&h.geometry)h.geometry=a;else if((o=c.type)!=null&&o.toLowerCase().includes("material")&&h.material)h.material=c;else if(f.add)try{f.add(re),this.dispatchEvent(new CustomEvent("instanceadded",{detail:{instance:this.instance,parent:f}}))}catch{throw new Error(`Error adding ${this.tagName} to ${f}`)}const x=this.getAttribute("attach");x&&this.executeAttach(x,this.instance)}}connectedCallback(){super.connectedCallback(),this.observeAttributes.call(this),this.createUnderlyingThreeObject.call(this),this.refreshAttributes.call(this),this.dispatchEvent(new CustomEvent("instancecreated",{detail:{instance:this.instance}})),this.connected=!0,this.onUnderlyingThreeObjectReady.call(this)}updateProperty(e){const{name:t,value:r}=e;let s=t;Object.keys(this.instance??{}).forEach(a=>{a.toLowerCase()===s&&(s=a)});const n=I(s);if(G.includes(s)||G.includes(n[0]))return;let o=_(r,this);try{o=JSON.parse(r===""?"true":r)}catch{}this.instance&&T(this.instance,n,o)}executeAttach(e,t){const r=this.parentElement;r.instance&&T(r.instance,I(e),t)}disconnectedCallback(){super.disconnectedCallback();const e=[this.instance];this.disposeThreeObjects.call(this,e),this.connected=!1}disposeThreeObjects(e){e.forEach(t=>{var n,o;if(!t)return;const r=t,s=t;(n=r.dispose)==null||n.call(r),(o=s.removeFromParent)==null||o.call(s)})}render(){return E.html`<slot></slot>`}createRenderRoot(){return this}}V([u({type:Boolean,attribute:"try-add-once"})],v.prototype,"tryAddOnce");V([be()],v.prototype,"connected");const J=i=>{const e=typeof i=="string"?l[i]:i;if(!q(e))return null;const t=i.toString().toLowerCase().endsWith("loader");class r extends v{constructor(){super(e)}}class s extends v{constructor(){super(...arguments),this.loader=null}createUnderlyingThreeObject(){this.loader=new e(...this.parsedArgs().map(o=>_(o,this)))}async onUnderlyingThreeObjectReady(){const o=this.getAttribute("src");if(!o)throw new Error("Loader requires a source.");if(!this.loader)throw new Error(`Missing loader ${this.tagName}`);this.loader.load(o,a=>{this.instance=a;const c=this.getAttribute("attach");c&&this.executeAttach(c,a),this.refreshAttributes.call(this),this.dispatchEvent(new CustomEvent("loaded",{detail:{instance:a}}))},void 0,a=>{throw new Error(`error loading: ${o}`+a)})}disconnectedCallback(){super.disconnectedCallback(),this.disposeThreeObjects.call(this,[this.loader])}}return t?s:r};var ve=Object.defineProperty,m=(i,e,t,r)=>{for(var s=void 0,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=o(e,t,s)||s);return s&&ve(e,t,s),s};const Ae="orthographic",H=1/0,L=class L extends E.LitElement{constructor(){super(),this.scratchV2=new l.Vector2,this.background=null,this.dpr=H,this.headless=!1,this.manualRender=!1,this.dispatchBeforeRender=!1,this.dispatchAfterRender=!1,this.rendererArgs=[],this.cameraArgs=[],this.raycaster=new l.Raycaster,this.raycastPool=[],this.frame=1/0,this.three=this.createThree(),this.resizeObserver=new ResizeObserver(e=>{e.forEach(({target:t,contentRect:r})=>{var s;if(t===this&&((s=this.three.renderer)==null||s.setSize(r.width*this.dpr,r.height*this.dpr),this.three.camera)){const n=r.width/r.height;if(this.three.camera.type.toLowerCase()==="perspectivecamera")this.three.camera.aspect=n,this.three.camera.updateProjectionMatrix();else if(this.three.camera.type.toLowerCase()==="orthographiccamera"){const o=r.height/r.width,a=10;this.three.camera.top=o*a,this.three.camera.bottom=-o*a,this.three.camera.right=a,this.three.camera.left=-a,this.three.camera.updateProjectionMatrix()}this.manualRender||this.renderThree()}})})}createDefaultScene(){return new l.Scene}createThree(){return{scene:this.createDefaultScene(),camera:null,renderer:null}}connectedCallback(){if(super.connectedCallback(),this.dpr===H&&(this.dpr=window.devicePixelRatio),this.three.camera||(this.getAttribute(Ae)!==null?this.three.camera=new l.OrthographicCamera(...this.cameraArgs):this.three.camera=new l.PerspectiveCamera(...this.cameraArgs.length?this.cameraArgs:[75])),["scene","camera","renderer"].forEach(e=>{const t=this[e]??this.getAttribute(e)??{},r=typeof t=="string"?JSON.parse(t):t;Object.entries(r).forEach(([s,n])=>{this.three[e]&&T(this.three[e],s.split("-"),_(n,this))})}),this.resizeObserver.observe(this),this.background!==null&&(this.three.scene.background=new l.Color(this.background)),!this.three.renderer&&!this.headless){const e=new l.WebGLRenderer(...this.rendererArgs);e.domElement.addEventListener("pointermove",this.onPointerMove.bind(this)),e.domElement.addEventListener("mousemove",this.onPointerMove.bind(this)),e.domElement.addEventListener("click",this.onClick.bind(this)),this.three.renderer=e}this.dispatchEvent(new CustomEvent("three-ready",{bubbles:!0,composed:!0,detail:{lunchbox:this}})),this.manualRender||this.updateLoop()}disconnectedCallback(){var e,t,r,s;(e=this.three.renderer)==null||e.domElement.removeEventListener("pointermove",this.onPointerMove.bind(this)),(t=this.three.renderer)==null||t.domElement.removeEventListener("mousemove",this.onPointerMove.bind(this)),(r=this.three.renderer)==null||r.domElement.removeEventListener("click",this.onClick.bind(this)),(s=this.three.renderer)==null||s.dispose(),this.resizeObserver.unobserve(this),cancelAnimationFrame(this.frame)}handleDefaultSlotChange(e){e.target.assignedElements().forEach(t=>{const r=t;r.instance instanceof l.Object3D&&t.getAttributeNames().includes($)&&t.getAttributeNames().includes($)&&this.raycastPool.push(r.instance)}),this.renderThree()}runRaycast(e){var a,c;if(!this.raycastPool.length||!this.three.camera)return[];const t=((a=this.three.renderer)==null?void 0:a.domElement.width)??0,r=((c=this.three.renderer)==null?void 0:c.domElement.height)??0,s=this.scratchV2.clone().set(e.clientX/(t/this.dpr)*2-1,-(e.clientY/(r/this.dpr))*2+1);return this.raycaster.setFromCamera(s,this.three.camera),this.raycaster.intersectObjects(this.raycastPool).map(h=>({intersect:h,element:this.querySelector(`[${M}="${h.object.uuid}"]`)}))}onPointerMove(e){this.runRaycast.bind(this)(e).forEach(r=>{var s,n,o,a;e.type==="pointermove"?((s=r.element)==null||s.dispatchEvent(new PointerEvent("pointermove")),(n=r.element)==null||n.dispatchEvent(new CustomEvent(Y,{detail:r}))):e.type==="mousemove"&&((o=r.element)==null||o.dispatchEvent(new MouseEvent("mousemove")),(a=r.element)==null||a.dispatchEvent(new CustomEvent(Z,{detail:r})))})}onClick(e){let t=[];if(e instanceof TouchEvent){const r=e.touches[0];t=this.runRaycast.bind(this)(r),t.forEach(s=>{var n;(n=s.element)==null||n.dispatchEvent(new TouchEvent("touchstart"))})}else t=this.runRaycast.bind(this)(e),t.forEach(r=>{var s;(s=r.element)==null||s.dispatchEvent(new MouseEvent("click"))});t.forEach(r=>{var s;(s=r.element)==null||s.dispatchEvent(new CustomEvent(X,{detail:r}))})}updateLoop(){this.renderThree(),this.manualRender||(this.frame=requestAnimationFrame(this.updateLoop.bind(this)))}renderThree(e,t){var r;this.dispatchBeforeRender&&this.dispatchEvent(new CustomEvent(Q,{})),this.three.camera&&((r=this.three.renderer)==null||r.render(e??this.three.scene,t??this.three.camera),this.dispatchAfterRender&&this.dispatchEvent(new CustomEvent(ee,{})))}render(){var e;return E.html`
28
18
  <slot @slotchange=${this.handleDefaultSlotChange}></slot>
29
19
  ${(e=this.three.renderer)==null?void 0:e.domElement}
30
- `}};ne.styles=Ge`
20
+ `}};L.styles=E.css`
31
21
  :host {
32
22
  width: 100%;
33
23
  height: 100%;
@@ -40,4 +30,4 @@
40
30
  max-width: 100%;
41
31
  max-height: 100%;
42
32
  }
43
- `;let f=ne;A([y()],f.prototype,"background");A([y()],f.prototype,"dpr");A([y()],f.prototype,"headless");A([y({attribute:"manual-render",type:Boolean})],f.prototype,"manualRender");A([y({attribute:"dispatch-before-render",type:Boolean})],f.prototype,"dispatchBeforeRender");A([y({attribute:"dispatch-after-render",type:Boolean})],f.prototype,"dispatchAfterRender");A([y({attribute:"renderer-args",type:Object})],f.prototype,"rendererArgs");A([y({attribute:"camera-args",type:Object})],f.prototype,"cameraArgs");class Re extends C{constructor(){super(...arguments),this.parentLunchbox=null,this.frame=-1,this.scratchV3=new p.Vector3,this.scratchFrustum=new p.Frustum,this.scratchMatrix4=new p.Matrix4}tryAttachUpdate(){var o;const e=(o=this.parentLunchbox)==null?void 0:o.instance;if(!e)return!1;if(!e.isObject3D)throw new Error("html-anchor must be the child of an Object3D");const t=R(this,a=>{var h;return!!((h=a==null?void 0:a.three)!=null&&h.renderer)});if(!t)return console.error("three-lunchbox parent required for html-anchor"),!1;const s=t.three.camera;if(!s)return console.error("camera required for html-anchor"),!1;const r=t.three.renderer;if(!(r!=null&&r.domElement))return console.error("renderer and DOM element required for html-anchor"),!1;const n=()=>{this.frame=requestAnimationFrame(n),s.updateMatrix(),s.updateMatrixWorld(),e.getWorldPosition(this.scratchV3);const a=this.scratchV3.clone();this.scratchV3.project(s),this.scratchV3.multiplyScalar(.5).addScalar(.5),this.scratchV3.y=1-this.scratchV3.y;const h=this.scratchV3.clone().set(r.domElement.width,r.domElement.height,1);h.divideScalar(devicePixelRatio),this.scratchV3.multiply(h);const c=e.position.clone().distanceTo(s.getWorldPosition(this.scratchV3.clone()));this.scratchFrustum.setFromProjectionMatrix(this.scratchMatrix4.clone().multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse));const d=this.scratchFrustum.containsPoint(a);this.style.setProperty("--left",`${this.scratchV3.x}px`),this.style.setProperty("--top",`${this.scratchV3.y}px`),this.style.setProperty("--distance-from-camera",`${c}`),this.style.setProperty("--in-frustum",`${d?1:0}`),d?this.classList.add("in-frustum"):this.classList.remove("in-frustum")};return n(),!0}connectedCallback(){super.connectedCallback();const e=this.parentNode;if(!e)throw new Error("html-anchor requires a 3D parent");this.parentLunchbox=e,this.tryAttachUpdate()||this.parentLunchbox.addEventListener("instanceadded",()=>{if(!this.tryAttachUpdate())throw new Error("error attaching html-anchor to Object3D")},{once:!0})}disconnectedCallback(){this.frame!==-1&&cancelAnimationFrame(this.frame)}render(){return re`<slot></slot>`}createRenderRoot(){return this}}const mt=({prependList:i=[]}={})=>{Object.entries({"three-lunchbox":f,"html-anchor":Re}).forEach(([t,s])=>{customElements.get(t)||customElements.define(t,s)}),[...i,...X].forEach(t=>{const s=De(t);if(customElements.get(s))return;const r=xe(t);r&&customElements.define(s,r)})},ft=(i,e,t=window)=>{if(t.customElements.get(i)){console.log(`${i} already registered as a custom element. Try a different name if registering is still required.`);return}const s=xe(e);if(s)t.customElements.define(i,s);else throw new Error(`Could not extend ${i}. The second paramater must be a class.`)},Ne="threepointermove",Le="threemousemove",Ue="threeclick",He="beforerender",je="afterrender",De=i=>{let e=i.split(/\.?(?=[A-Z])/).join("-").toLowerCase().replace(/-g-l-/,"-gl-");return e.includes("-")||(e=`three-${e}`),e},yt=X.map(De);exports.AFTER_RENDER_EVENT_NAME=je;exports.BEFORE_RENDER_EVENT_NAME=He;exports.HtmlAnchor=Re;exports.THREE_CLICK_EVENT_NAME=Ue;exports.THREE_MOUSE_MOVE_EVENT_NAME=Le;exports.THREE_POINTER_MOVE_EVENT_NAME=Ne;exports.THREE_UUID_ATTRIBUTE_NAME=ie;exports.ThreeBase=H;exports.ThreeLunchbox=f;exports.autoComponents=X;exports.closestPassShadow=R;exports.extend=ft;exports.get=Se;exports.getCandidateParent=K;exports.initLunchbox=mt;exports.isClass=Te;exports.isNumber=Pe;exports.set=Me;exports.webComponentNames=yt;
33
+ `;let d=L;m([u()],d.prototype,"background");m([u()],d.prototype,"dpr");m([u()],d.prototype,"headless");m([u({attribute:"manual-render",type:Boolean})],d.prototype,"manualRender");m([u({attribute:"dispatch-before-render",type:Boolean})],d.prototype,"dispatchBeforeRender");m([u({attribute:"dispatch-after-render",type:Boolean})],d.prototype,"dispatchAfterRender");m([u({attribute:"renderer-args",type:Object})],d.prototype,"rendererArgs");m([u({attribute:"camera-args",type:Object})],d.prototype,"cameraArgs");class K extends E.LitElement{constructor(){super(...arguments),this.parentLunchbox=null,this.frame=-1,this.scratchV3=new l.Vector3,this.scratchFrustum=new l.Frustum,this.scratchMatrix4=new l.Matrix4}tryAttachUpdate(){var o;const e=(o=this.parentLunchbox)==null?void 0:o.instance;if(!e)return!1;if(!e.isObject3D)throw new Error("html-anchor must be the child of an Object3D");const t=b(this,a=>{var c;return!!((c=a==null?void 0:a.three)!=null&&c.renderer)});if(!t)return console.error("three-lunchbox parent required for html-anchor"),!1;const r=t.three.camera;if(!r)return console.error("camera required for html-anchor"),!1;const s=t.three.renderer;if(!(s!=null&&s.domElement))return console.error("renderer and DOM element required for html-anchor"),!1;const n=()=>{this.frame=requestAnimationFrame(n),r.updateMatrix(),r.updateMatrixWorld(),e.getWorldPosition(this.scratchV3);const a=this.scratchV3.clone();this.scratchV3.project(r),this.scratchV3.multiplyScalar(.5).addScalar(.5),this.scratchV3.y=1-this.scratchV3.y;const c=this.scratchV3.clone().set(s.domElement.width,s.domElement.height,1);c.divideScalar(devicePixelRatio),this.scratchV3.multiply(c);const h=e.position.clone().distanceTo(r.getWorldPosition(this.scratchV3.clone()));this.scratchFrustum.setFromProjectionMatrix(this.scratchMatrix4.clone().multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse));const f=this.scratchFrustum.containsPoint(a);this.style.setProperty("--left",`${this.scratchV3.x}px`),this.style.setProperty("--top",`${this.scratchV3.y}px`),this.style.setProperty("--distance-from-camera",`${h}`),this.style.setProperty("--in-frustum",`${f?1:0}`),f?this.classList.add("in-frustum"):this.classList.remove("in-frustum")};return n(),!0}connectedCallback(){super.connectedCallback();const e=this.parentNode;if(!e)throw new Error("html-anchor requires a 3D parent");this.parentLunchbox=e,this.tryAttachUpdate()||this.parentLunchbox.addEventListener("instanceadded",()=>{if(!this.tryAttachUpdate())throw new Error("error attaching html-anchor to Object3D")},{once:!0})}disconnectedCallback(){this.frame!==-1&&cancelAnimationFrame(this.frame)}render(){return E.html`<slot></slot>`}createRenderRoot(){return this}}const _e=({prependList:i=[]}={})=>{Object.entries({"three-lunchbox":d,"html-anchor":K}).forEach(([t,r])=>{customElements.get(t)||customElements.define(t,r)}),[...i,...O].forEach(t=>{const r=te(t);if(customElements.get(r))return;const s=J(t);s&&customElements.define(r,s)})},we=(i,e,t=window)=>{if(t.customElements.get(i)){console.log(`${i} already registered as a custom element. Try a different name if registering is still required.`);return}const r=J(e);if(r)t.customElements.define(i,r);else throw new Error(`Could not extend ${i}. The second paramater must be a class.`)},Y="threepointermove",Z="threemousemove",X="threeclick",Q="beforerender",ee="afterrender",te=i=>{let e=i.split(/\.?(?=[A-Z])/).join("-").toLowerCase().replace(/-g-l-/,"-gl-");return e.includes("-")||(e=`three-${e}`),e},Ce=O.map(te);exports.AFTER_RENDER_EVENT_NAME=ee;exports.BEFORE_RENDER_EVENT_NAME=Q;exports.HtmlAnchor=K;exports.THREE_CLICK_EVENT_NAME=X;exports.THREE_MOUSE_MOVE_EVENT_NAME=Z;exports.THREE_POINTER_MOVE_EVENT_NAME=Y;exports.THREE_UUID_ATTRIBUTE_NAME=M;exports.ThreeBase=v;exports.ThreeLunchbox=d;exports.autoComponents=O;exports.closestPassShadow=b;exports.extend=we;exports.get=B;exports.getCandidateParent=P;exports.initLunchbox=_e;exports.isClass=q;exports.isNumber=z;exports.set=F;exports.webComponentNames=Ce;