shop-components 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/shop-components.cjs
CHANGED
|
@@ -4831,7 +4831,7 @@ void main(void)\r
|
|
|
4831
4831
|
font-weight: ${t.weight};
|
|
4832
4832
|
font-style: ${t.style};
|
|
4833
4833
|
font-display: ${t.display};
|
|
4834
|
-
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Cx(e)),typeof e=="number"?Ex(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,Dr.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=V.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};ph.availableFonts={},ph.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Za=ph;const Un=class Br extends ls{constructor(e="",t={}){super(W.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=W.from(i,{scaleMode:V.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new K,s.trim=new K,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),u=document.createElementNS(o,"div"),d=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Br.defaultMaxWidth,this.maxHeight=Br.defaultMaxHeight,this._domElement=u,this._styleElement=d,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(d),this._foreignObject.appendChild(u),this._image=i,this._loadImage=new Image,this._autoResolution=Br.defaultAutoResolution,this._resolution=Br.defaultResolution??V.RESOLUTION,this.text=e,this.style=t}measureText(e){var d,l;const{text:t,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),u=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",u.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(d=this._style)==null?void 0:d.toCSS(s)}),this._styleElement.textContent=(l=this._style)==null?void 0:l.toGlobalCSS()),{width:h+i.padding*2,height:u+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:s}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await t.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const u=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(u)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=i.width/s,t.trim.height=t._frame.height=i.height/s,t.trim.x=-n,t.trim.y=-n,t.orig.width=t._frame.width-n*2,t.orig.height=t._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,o,a;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Br.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=t,(s=this._svgRoot)==null||s.remove(),this._svgRoot=t,(n=this._domElement)==null||n.remove(),this._domElement=t,(o=this._foreignObject)==null||o.remove(),this._foreignObject=t,(a=this._styleElement)==null||a.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=vi(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=vi(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Za?(this.ownsStyle=!1,this._style=e):e instanceof Si?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Za.from(e)):(this.ownsStyle=!0,this._style=new Za(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};Un.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Un.defaultMaxWidth=2024,Un.defaultMaxHeight=2024,Un.defaultAutoResolution=!0;function UA(r,e){const t=URL.createObjectURL(r),i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}function hm(r){return r.length===0?0:r.reduce((t,i)=>t+i,0)/r.length}function mh(r,e){const t=new Blob([r],{type:e});return URL.createObjectURL(t)}function cm(){return/Mac|iPod|iPhone|iPad/.test(navigator.platform)||/Mac OS|iOS/.test(navigator.userAgent)}function GA(r){let e=document.createElement("canvas");const t=e.getContext("2d");if(e.width=r.width,e.height=r.height,!t)return;t.drawImage(r,0,0);const i=W.from(e);return e=null,i}function gh(r){let e=document.createElement("canvas");const t=e.getContext("2d");return e.width=r.width,e.height=r.height,t?(t.drawImage(r,0,0),e.toDataURL("image/png",.75)):void 0}function zA(r,e=43){const t=r*Math.PI/180;return e/(2*Math.tan(t/2))}var um={};/*!
|
|
4834
|
+
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Cx(e)),typeof e=="number"?Ex(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,Dr.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=V.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};ph.availableFonts={},ph.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Za=ph;const Un=class Br extends ls{constructor(e="",t={}){super(W.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=W.from(i,{scaleMode:V.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new K,s.trim=new K,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),u=document.createElementNS(o,"div"),d=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Br.defaultMaxWidth,this.maxHeight=Br.defaultMaxHeight,this._domElement=u,this._styleElement=d,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(d),this._foreignObject.appendChild(u),this._image=i,this._loadImage=new Image,this._autoResolution=Br.defaultAutoResolution,this._resolution=Br.defaultResolution??V.RESOLUTION,this.text=e,this.style=t}measureText(e){var d,l;const{text:t,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),u=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",u.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(d=this._style)==null?void 0:d.toCSS(s)}),this._styleElement.textContent=(l=this._style)==null?void 0:l.toGlobalCSS()),{width:h+i.padding*2,height:u+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:s}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await t.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const u=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(u)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:t,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:o}=t;t.trim.width=t._frame.width=i.width/s,t.trim.height=t._frame.height=i.height/s,t.trim.x=-n,t.trim.y=-n,t.orig.width=t._frame.width-n*2,t.orig.height=t._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,o,a;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Br.defaultDestroyOptions,e),super.destroy(e);const t=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=t,(s=this._svgRoot)==null||s.remove(),this._svgRoot=t,(n=this._domElement)==null||n.remove(),this._domElement=t,(o=this._foreignObject)==null||o.remove(),this._foreignObject=t,(a=this._styleElement)==null||a.remove(),this._styleElement=t,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=t,this._image.src="",this._image=t}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const t=vi(this.scale.x)||1;this.scale.x=t*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const t=vi(this.scale.y)||1;this.scale.y=t*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Za?(this.ownsStyle=!1,this._style=e):e instanceof Si?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Za.from(e)):(this.ownsStyle=!0,this._style=new Za(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};Un.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Un.defaultMaxWidth=2024,Un.defaultMaxHeight=2024,Un.defaultAutoResolution=!0;function UA(r,e){const t=URL.createObjectURL(r),i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}function hm(r){return r.length===0?0:r.reduce((t,i)=>t+i,0)/r.length}function mh(r,e){const t=new Blob([r],{type:e});return URL.createObjectURL(t)}function cm(){return/Mac|iPod|iPhone|iPad/.test(navigator==null?void 0:navigator.platform)||/Mac OS|iOS/.test(navigator==null?void 0:navigator.userAgent)}function GA(r){let e=document.createElement("canvas");const t=e.getContext("2d");if(e.width=r.width,e.height=r.height,!t)return;t.drawImage(r,0,0);const i=W.from(e);return e=null,i}function gh(r){let e=document.createElement("canvas");const t=e.getContext("2d");return e.width=r.width,e.height=r.height,t?(t.drawImage(r,0,0),e.toDataURL("image/png",.75)):void 0}function zA(r,e=43){const t=r*Math.PI/180;return e/(2*Math.tan(t/2))}var um={};/*!
|
|
4835
4835
|
* howler.js v2.2.4
|
|
4836
4836
|
* howlerjs.com
|
|
4837
4837
|
*
|
|
@@ -4849,7 +4849,7 @@ void main(void)\r
|
|
|
4849
4849
|
* goldfirestudios.com
|
|
4850
4850
|
*
|
|
4851
4851
|
* MIT License
|
|
4852
|
-
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var s=i._howls.length-1;s>=0;s--)i._howls[s].stereo(t);return i},HowlerGlobal.prototype.pos=function(t,i,s){var n=this;if(!n.ctx||!n.ctx.listener)return n;if(i=typeof i!="number"?n._pos[1]:i,s=typeof s!="number"?n._pos[2]:s,typeof t=="number")n._pos=[t,i,s],typeof n.ctx.listener.positionX<"u"?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]);else return n._pos;return n},HowlerGlobal.prototype.orientation=function(t,i,s,n,o,a){var h=this;if(!h.ctx||!h.ctx.listener)return h;var u=h._orientation;if(i=typeof i!="number"?u[1]:i,s=typeof s!="number"?u[2]:s,n=typeof n!="number"?u[3]:n,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof t=="number")h._orientation=[t,i,s,n,o,a],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(s,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(t,i,s,n,o,a);else return u;return h},Howl.prototype.init=function(t){return function(i){var s=this;return s._orientation=i.orientation||[1,0,0],s._stereo=i.stereo||null,s._pos=i.pos||null,s._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},s._onstereo=i.onstereo?[{fn:i.onstereo}]:[],s._onpos=i.onpos?[{fn:i.onpos}]:[],s._onorientation=i.onorientation?[{fn:i.onorientation}]:[],t.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"stereo",action:function(){s.stereo(t,i)}}),s;var n=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof t=="number")s._stereo=t,s._pos=[t,0,0];else return s._stereo;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h)if(typeof t=="number")h._stereo=t,h._pos=[t,0,0],h._node&&(h._pannerAttr.panningModel="equalpower",(!h._panner||!h._panner.pan)&&e(h,n),n==="spatial"?typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):h._panner.setPosition(t,0,0):h._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),s._emit("stereo",h._id);else return h._stereo}return s},Howl.prototype.pos=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(t,i,s,n)}}),o;if(i=typeof i!="number"?0:i,s=typeof s!="number"?-.5:s,typeof n>"u")if(typeof t=="number")o._pos=[t,i,s];else return o._pos;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._pos=[t,i,s],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setPosition(t,i,s)),o._emit("pos",u._id);else return u._pos}return o},Howl.prototype.orientation=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(t,i,s,n)}}),o;if(i=typeof i!="number"?o._orientation[1]:i,s=typeof s!="number"?o._orientation[2]:s,typeof n>"u")if(typeof t=="number")o._orientation=[t,i,s];else return o._orientation;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._orientation=[t,i,s],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setOrientation(t,i,s)),o._emit("orientation",u._id);else return u._orientation}return o},Howl.prototype.pannerAttr=function(){var t=this,i=arguments,s,n,o;if(!t._webAudio)return t;if(i.length===0)return t._pannerAttr;if(i.length===1)if(typeof i[0]=="object")s=i[0],typeof n>"u"&&(s.pannerAttr||(s.pannerAttr={coneInnerAngle:s.coneInnerAngle,coneOuterAngle:s.coneOuterAngle,coneOuterGain:s.coneOuterGain,distanceModel:s.distanceModel,maxDistance:s.maxDistance,refDistance:s.refDistance,rolloffFactor:s.rolloffFactor,panningModel:s.panningModel}),t._pannerAttr={coneInnerAngle:typeof s.pannerAttr.coneInnerAngle<"u"?s.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof s.pannerAttr.coneOuterAngle<"u"?s.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof s.pannerAttr.coneOuterGain<"u"?s.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof s.pannerAttr.distanceModel<"u"?s.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof s.pannerAttr.maxDistance<"u"?s.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof s.pannerAttr.refDistance<"u"?s.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof s.pannerAttr.rolloffFactor<"u"?s.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof s.pannerAttr.panningModel<"u"?s.pannerAttr.panningModel:t._panningModel});else return o=t._soundById(parseInt(i[0],10)),o?o._pannerAttr:t._pannerAttr;else i.length===2&&(s=i[0],n=parseInt(i[1],10));for(var a=t._getSoundIds(n),h=0;h<a.length;h++)if(o=t._soundById(a[h]),o){var u=o._pannerAttr;u={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:u.coneOuterGain,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:u.distanceModel,maxDistance:typeof s.maxDistance<"u"?s.maxDistance:u.maxDistance,refDistance:typeof s.refDistance<"u"?s.refDistance:u.refDistance,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:u.rolloffFactor,panningModel:typeof s.panningModel<"u"?s.panningModel:u.panningModel};var d=o._panner;d||(o._pos||(o._pos=t._pos||[0,0,-.5]),e(o,"spatial"),d=o._panner),d.coneInnerAngle=u.coneInnerAngle,d.coneOuterAngle=u.coneOuterAngle,d.coneOuterGain=u.coneOuterGain,d.distanceModel=u.distanceModel,d.maxDistance=u.maxDistance,d.refDistance=u.refDistance,d.rolloffFactor=u.rolloffFactor,d.panningModel=u.panningModel}return t},Sound.prototype.init=function(t){return function(){var i=this,s=i._parent;i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,t.call(this),i._stereo?s.stereo(i._stereo):i._pos&&s.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var i=this,s=i._parent;return i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,i._stereo?s.stereo(i._stereo):i._pos?s.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,s._refreshBuffer(i)),t.call(this)}}(Sound.prototype.reset);var e=function(t,i){i=i||"spatial",i==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()})(um);const HA="data:audio/mpeg;base64,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";let VA=class{constructor(){this.sound=new um.Howl({src:[HA]})}play(){this.sound.play()}};const ii=r=>{var e,t;if(typeof r.destroy=="function"){r.destroy();return}for(;r.children.length>0;)ii(r.children[0]),(e=r.children[0])==null||e.removeFromParent();if(r instanceof y.Mesh)try{(t=r.geometry)==null||t.dispose()}catch{}};function WA(r){return new y.Vector3(r[0],r[1],r[2])}function $A(){let r=3,e=Math.max(1/window.devicePixelRatio,.5);return window.innerWidth/window.innerHeight<.65&&(r=4,e=1/window.devicePixelRatio),{tiles:r,renderScale:e}}function XA(r){let e=!1,t=!1,i=!1,s=1/0,n=1/0,o=1/0,a=-1/0,h=-1/0,u=-1/0,d=0,l=0;return r.traverse(f=>{if(f.isMesh&&f.geometry){const p=f;if(p.userData.ignoreSize||p.material.userData.isLOGO)return;p.geometry.computeBoundingBox();let g=p.geometry.attributes.position;const m=p.geometry.morphAttributes.position;let _=p.morphTargetInfluences;const v=Object.keys(p.morphTargetDictionary||{});v.includes("width")&&(t=!0),v.includes("length")&&(e=!0),v.includes("height")&&(i=!0);for(let x=0;x<g.count;x++){let b=g.getX(x),w=g.getY(x),C=g.getZ(x);l=Math.max(w,l),m&&_&&m.forEach((T,M)=>{const P=_&&_[M]||0;b+=T.getX(x)*P,w+=T.getY(x)*P,C+=T.getZ(x)*P}),b<s&&(s=b),w<n&&(n=w),C<o&&(o=C),b>a&&(a=b),w>h&&(h=w),C>u&&(u=C);const S=Math.sqrt(b*b+w*w);S>d&&(d=S)}}}),{box:new y.Box3(new y.Vector3(s,n,o),new y.Vector3(a,h,u)),maxRadius:d,height:l,hasWidth:t,hasLength:e,hasHeight:i}}function jA(r,e,t=null){let i=0;return function(){let s=t||this,n=arguments;clearTimeout(i),i=window.setTimeout(function(){r.apply(s,n)},e)}}class YA{constructor(e,t,i){this.length=e,this.width=t,this.height=i}}const Ad=r=>{var i;let e=0,t=0;if(r.geometry){r.geometry.computeBoundingBox();const s=new y.Vector3;(i=r.geometry.boundingBox)==null||i.getSize(s),s.y?(t=s.y,!s.x&&s.z?e=s.z:s.x&&!s.z?e=s.x:s.x&&s.z&&(e=s.z)):(e=s.z,t=s.x)}return{width:e,height:t}};function tc(){if(typeof navigator>"u")return!1;if(qA())return!0;const r=navigator.userAgent.toLowerCase();return/iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(r)}function qA(){try{if(typeof wx<"u"&&wx.getSystemInfo||typeof my<"u"&&my.alert||typeof tt<"u"&&tt.getSystemInfo||typeof swan<"u"&&swan.getSystemInfo)return!0}catch{}return!1}const dm=new ig.GLTFExporter,rs=new Jm.GLTFLoader,No=new eg.DRACOLoader;window.dracoPath?No.setDecoderPath(window.dracoPath):No.setDecoderPath("./draco/");No.setDecoderConfig({type:"wasm"});rs.setDRACOLoader(No);const ZA=new tg.DRACOExporter,Td=[115,103,108,98];function KA(r,e,t){const i=JSON.stringify(e),s=new TextEncoder().encode(i),n=new Uint8Array([115,103,108,98]),o=new Uint8Array(2);o[0]=t>>8,o[1]=t&255;const a=new Uint8Array(4);a[0]=s.length>>24,a[1]=s.length>>16&255,a[2]=s.length>>8&255,a[3]=s.length&255;const h=new Uint8Array(r),u=n.length+o.length+a.length+s.length+h.length,d=new Uint8Array(u);let l=0;return d.set(n,l),l+=n.length,d.set(o,l),l+=o.length,d.set(a,l),l+=a.length,d.set(s,l),l+=s.length,d.set(h,l),d.buffer}function QA(r){const e=new Uint8Array(r.slice(0,4));let t=!0;for(let l=0;l<Td.length;l++)if(e[l]!==Td[l]){t=!1;break}if(!t)throw new Error("Invalid file format");const s=new DataView(r,4,2).getUint16(0,!1),o=new DataView(r,6,4).getUint32(0,!1),a=new Uint8Array(r.slice(10,10+o)),h=new TextDecoder().decode(a),u=JSON.parse(h),d=r.slice(10+o);return{version:s,jsonDescription:u,glbContent:d}}class Uo{constructor(e){this.props=e,this.cache=new Map}load(e,t,i,s){if(this.props.useCache&&this.cache.has(e)){t(this.cache.get(e));return}const n=this;fetch(e).then(o=>{if(!o.ok){s==null||s(new ErrorEvent("NetworkError",{message:"NetworkError for "+e+": "+o.statusText}));return}return o.arrayBuffer()}).then(async o=>{o||s==null||s(new ErrorEvent("Error",{message:"Not a valid sglb file."}));try{const a=n.parse(o);if(!a.glbContent){s==null||s(new ErrorEvent("Error",{message:"No glb content."}));return}const h=mh(a.glbContent,"model/gltf-binary"),u=await rs.loadAsync(h);URL.revokeObjectURL(h),a.glbContent=void 0,a.glb=u.scene,o=void 0,this.cache.set(e,a),t(a)}catch(a){s==null||s(new ErrorEvent("Error",{message:a==null?void 0:a.message}))}}).catch(o=>{s==null||s(new ErrorEvent("Error",{message:o.message}))})}async loadAsync(e){if(this.props.useCache&&this.cache.has(e))return this.cache.get(e);try{const t=await fetch(e);if(!t.ok)throw new Error(`NetworkError for ${e}: ${t.statusText}`);const i=await t.arrayBuffer();if(!i)throw new Error("Not a valid sglb file.");const s=this.parse(i);if(!s.glbContent)throw new Error("No GLB content.");const n=mh(s.glbContent,"model/gltf-binary"),o=await rs.loadAsync(n);return URL.revokeObjectURL(n),s.glbContent=void 0,s.glb=o.scene,this.cache.set(e,s),s}catch(t){throw t}}parse(e){return QA(e)}clear(){[...this.cache.values()]}}/**
|
|
4852
|
+
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var s=i._howls.length-1;s>=0;s--)i._howls[s].stereo(t);return i},HowlerGlobal.prototype.pos=function(t,i,s){var n=this;if(!n.ctx||!n.ctx.listener)return n;if(i=typeof i!="number"?n._pos[1]:i,s=typeof s!="number"?n._pos[2]:s,typeof t=="number")n._pos=[t,i,s],typeof n.ctx.listener.positionX<"u"?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]);else return n._pos;return n},HowlerGlobal.prototype.orientation=function(t,i,s,n,o,a){var h=this;if(!h.ctx||!h.ctx.listener)return h;var u=h._orientation;if(i=typeof i!="number"?u[1]:i,s=typeof s!="number"?u[2]:s,n=typeof n!="number"?u[3]:n,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof t=="number")h._orientation=[t,i,s,n,o,a],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(s,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(t,i,s,n,o,a);else return u;return h},Howl.prototype.init=function(t){return function(i){var s=this;return s._orientation=i.orientation||[1,0,0],s._stereo=i.stereo||null,s._pos=i.pos||null,s._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},s._onstereo=i.onstereo?[{fn:i.onstereo}]:[],s._onpos=i.onpos?[{fn:i.onpos}]:[],s._onorientation=i.onorientation?[{fn:i.onorientation}]:[],t.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(t,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"stereo",action:function(){s.stereo(t,i)}}),s;var n=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof t=="number")s._stereo=t,s._pos=[t,0,0];else return s._stereo;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h)if(typeof t=="number")h._stereo=t,h._pos=[t,0,0],h._node&&(h._pannerAttr.panningModel="equalpower",(!h._panner||!h._panner.pan)&&e(h,n),n==="spatial"?typeof h._panner.positionX<"u"?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):h._panner.setPosition(t,0,0):h._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),s._emit("stereo",h._id);else return h._stereo}return s},Howl.prototype.pos=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(t,i,s,n)}}),o;if(i=typeof i!="number"?0:i,s=typeof s!="number"?-.5:s,typeof n>"u")if(typeof t=="number")o._pos=[t,i,s];else return o._pos;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._pos=[t,i,s],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setPosition(t,i,s)),o._emit("pos",u._id);else return u._pos}return o},Howl.prototype.orientation=function(t,i,s,n){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(t,i,s,n)}}),o;if(i=typeof i!="number"?o._orientation[1]:i,s=typeof s!="number"?o._orientation[2]:s,typeof n>"u")if(typeof t=="number")o._orientation=[t,i,s];else return o._orientation;for(var a=o._getSoundIds(n),h=0;h<a.length;h++){var u=o._soundById(a[h]);if(u)if(typeof t=="number")u._orientation=[t,i,s],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(s,Howler.ctx.currentTime)):u._panner.setOrientation(t,i,s)),o._emit("orientation",u._id);else return u._orientation}return o},Howl.prototype.pannerAttr=function(){var t=this,i=arguments,s,n,o;if(!t._webAudio)return t;if(i.length===0)return t._pannerAttr;if(i.length===1)if(typeof i[0]=="object")s=i[0],typeof n>"u"&&(s.pannerAttr||(s.pannerAttr={coneInnerAngle:s.coneInnerAngle,coneOuterAngle:s.coneOuterAngle,coneOuterGain:s.coneOuterGain,distanceModel:s.distanceModel,maxDistance:s.maxDistance,refDistance:s.refDistance,rolloffFactor:s.rolloffFactor,panningModel:s.panningModel}),t._pannerAttr={coneInnerAngle:typeof s.pannerAttr.coneInnerAngle<"u"?s.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof s.pannerAttr.coneOuterAngle<"u"?s.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof s.pannerAttr.coneOuterGain<"u"?s.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof s.pannerAttr.distanceModel<"u"?s.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof s.pannerAttr.maxDistance<"u"?s.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof s.pannerAttr.refDistance<"u"?s.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof s.pannerAttr.rolloffFactor<"u"?s.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof s.pannerAttr.panningModel<"u"?s.pannerAttr.panningModel:t._panningModel});else return o=t._soundById(parseInt(i[0],10)),o?o._pannerAttr:t._pannerAttr;else i.length===2&&(s=i[0],n=parseInt(i[1],10));for(var a=t._getSoundIds(n),h=0;h<a.length;h++)if(o=t._soundById(a[h]),o){var u=o._pannerAttr;u={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:u.coneOuterGain,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:u.distanceModel,maxDistance:typeof s.maxDistance<"u"?s.maxDistance:u.maxDistance,refDistance:typeof s.refDistance<"u"?s.refDistance:u.refDistance,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:u.rolloffFactor,panningModel:typeof s.panningModel<"u"?s.panningModel:u.panningModel};var d=o._panner;d||(o._pos||(o._pos=t._pos||[0,0,-.5]),e(o,"spatial"),d=o._panner),d.coneInnerAngle=u.coneInnerAngle,d.coneOuterAngle=u.coneOuterAngle,d.coneOuterGain=u.coneOuterGain,d.distanceModel=u.distanceModel,d.maxDistance=u.maxDistance,d.refDistance=u.refDistance,d.rolloffFactor=u.rolloffFactor,d.panningModel=u.panningModel}return t},Sound.prototype.init=function(t){return function(){var i=this,s=i._parent;i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,t.call(this),i._stereo?s.stereo(i._stereo):i._pos&&s.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var i=this,s=i._parent;return i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,i._stereo?s.stereo(i._stereo):i._pos?s.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,s._refreshBuffer(i)),t.call(this)}}(Sound.prototype.reset);var e=function(t,i){i=i||"spatial",i==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()})(um);const HA="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjQxLjEwMAAAAAAAAAAAAAAA//NwwAAAAAAAAAAAAEluZm8AAAAPAAAAFAAACOAAICAgICwsLCwsNzc3NzdDQ0NDQ09PT09PW1tbW1tmZmZmZnJycnJyfn5+fn6KioqKipWVlZWVoaGhoaGtra2trbm5ubm5xcXFxcXQ0NDQ0Nzc3Nzc6Ojo6Oj09PT09P//////AAAAAExhdmM1OC43NQAAAAAAAAAAAAAAACQCwAAAAAAAAAjgTZykiAAAAAAAAAAAAAAAAAD/80DEABJhFmQCwwYUIDsKrsHAWBMRyeJYliQJBg5RYsWU/W3z/8OLc/3AAAQiIAIjv+7vUCJXd4jucQABAE3lwffiDBD+JC58oCH8H/1h/WH//1HPwTUMFrULH9ELKxULyTodFKYbO//zQsQRFFkScKDSRhyGWpIFpG91I7Fi/F6D2RWwN6TN/t9CiVSG5wMw74ogYcHoEwTFyMmTf4KkxEwmRfjXIYv1tpIOZRv/3O9ibtjR6gYmbGCgQ+Fk0mfSmybOX1cf78g7D6nP6qxCgf/zQMQbF+EacktaSABfy+3JKszHdMgcwwcl/kNFIuAo0I0DD1fWVs/crTSTTRInof3cmIwyLBwGQqCSLq7hyvtRPBB4aFyyXHov9X///7UXKqoIIcgcHict89/0y+n+nf/C0DIjB/+P//NCxBYZU9q0AYpoAHNyXSLn/+EjEbJclC4eJT//8e5aMAWeE4////wvAyAvYjZLjAD0Lg9D0kCU/////zwwBdJcYAehKBIwtYyx6FyXC4XP//////x7l83NDpfqd6gAcA/+wu9A2FGg//NAxAwXCnsq/5M4AhQKAOwmRvQRhjhOe5S8UkAmVHpU8IVU3lwejjIcayXOOceGwjf+D05I8oAu2x382o1ZHHV//31NU4441lmqcv///+RNGrUJKImnTf//iVYK1UZquoZESSy3egH/80LEChchBtMfyzAAk191v20qimbuNqavb211BthJKSJAG2aucbdLeVFVmRjZEVvzOggIwuUFDgvEZA7UeuUqNMLOraDQ5CVCk5m9BsmT3kbNrBdolcFSsqXGwQTWyYUX2wEDEgKkvZb/80DECRYRUpWsikYY1HXLbDZksYxtCHBShdHt/DgYCOM6r8AmUSpfGZYzH7ARMBCj1JtmY/hmwoGio0XBUShoklC5GsNeDR38RQ6d01DyrENtqp6mCJ5GJUckmpUBaIgYK6C0fPjmUf/zQsQLFil+cajTBhydxPRO4mLMWWSGQF2qa1f3PPlHQDJdzCxnwgkzB1SQohrpNRYRgtobv07tBLUFc27jQdWoQY0JNpiMJy654enBVoqnQR571uq/i9rpL1oAqAupJATLLk5L+QT3Kf/zQMQOE9D2bWFaGACZyWQZdt1rd3OVY8s/y2dBlg0m12PFzdFSlYrboY6gMOE1hJp7iFqmDcopF8F2OKEPnktdThRLoy9iuyj//0vD4+qf///++38OsIIFFhpEFZMC4s+gZmilJz1X//NCxBkaW8allZI4AWPWKBoLFWrwfuYvukbk4Rt9tBuJYOBoWpfzfjQaNMp//+OGEzzzDIif3+n/4PBIEt5hjDc9zxv/////nseeNDHGg0MQwxBEFn//////4TpB9d/s9thcHddpssFg//NAxAsVCT8GX5BAAigUAPBBdOBaKEIpaajR1VyCNH/gAwAfjRX8G7B4zfx0HANA8BpjQ6FhfqKxRBQURleGbrufzJywVGVfRdOzp5///ERCxhb//8wqijBAwUYMBCjVWZsv26uwYU3/80LEERRTIuTLwxABmdQgEBGKFNo9amfRWcpnayOUsKJ/UpWo/qyL////sj1b+pc3oarStSWpf/VP+hlotDN/0MVjKMKDAZGL/Ar8QWpCR0msAoVgrMoeT3xHIZd3qARkQge7hzlejQD/80DEGxPQ5sryeYYUBCI58AEvohe5nAMDcPxAbUxN6VCB4xCid97iaTyonF0l4upInmIpD//V0f/OllFls0vEBipVlYYRWhuzlHgpEiJSRmYJQaiptezfqvKm1PBRJKiq7M3s1yoqKv/zQsQmFBEGuojBkAQdCzTSpHY0FSwdboEQKi7pZN986g7UVOkf5ZR6VdbbQwZ+79PW6VoWdwZqA4VT2QGoxuuO0VZgbATjSNkSqqresUZ4lDGM5tfbuZzGHYfri5YKg0eDjgQjhm0Wpf/zQMQxE1jyoqhoxFD16D4jzQUUULEB1QXZhRIdIbHFtSlSvX5anFh11QTHaABkiBXOXoXxGW9galRr4fRiew3yOag/4HjxOydOM9ZyyokPlRKdFBa0CjY1luBiKXXwLw6oeMWEhjoS//NCxD4TUNKKIJpMJNTRh7nf/3kekmjdSWypy9UZXQgZMDh3pnAWB4O2M6nAaelR4r1OmVPFSwoksiWRUE1zc+f1lPc0ZudtdFDr4LLpoSwwGkpVO+oD6Tlb3HsYL7d+R1//td2LQMNF//NAxEwTaP5xYqJMCFlqIwAbEoCJNDEp9/3itYVbV6Yx/v0nuLdzyy50qHQw3cafmKlb6zBo0yXeRMnQG5J4jE7j4PFAkTSpQ9pexojMMsL0PIqP/Z1Xp/TpnVZZ27eWtNWRSSSyWyz/80LEWRSo1nDhWhgAlsstlkskgADyNOHqG5rlhLnSyI0a5oClU7uw0JnJQq2kTMBUYADEskGQ9wdHohh2xMKnCubKTIdyRgT83NEIrcfJpJOL3fV7l9cyXXJwJRDGpJLTZJF1+3OPUX3/80DEYiVyorJfmlgDRVRdYm21rHJXTVH0+ajd35ouiSF1tVcmLGnFummxbrhsXfHNzcf/2qgd/7XhppiSaYkmmQGRpnCsAMAEB4tQrXVA0VOiINSMWfljtMTHsRdZ3iL/V1neW6zvLf/zQsQnDSAiMFXMGADWd4i6zvEX+W/yzud5ZUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==";let VA=class{constructor(){this.sound=new um.Howl({src:[HA]})}play(){this.sound.play()}};const ii=r=>{var e,t;if(typeof r.destroy=="function"){r.destroy();return}for(;r.children.length>0;)ii(r.children[0]),(e=r.children[0])==null||e.removeFromParent();if(r instanceof y.Mesh)try{(t=r.geometry)==null||t.dispose()}catch{}};function WA(r){return new y.Vector3(r[0],r[1],r[2])}function $A(){let r=3,e=Math.max(1/window.devicePixelRatio,.5);return window.innerWidth/window.innerHeight<.65&&(r=4,e=1/window.devicePixelRatio),{tiles:r,renderScale:e}}function XA(r){let e=!1,t=!1,i=!1,s=1/0,n=1/0,o=1/0,a=-1/0,h=-1/0,u=-1/0,d=0,l=0;return r.traverse(f=>{if(f.isMesh&&f.geometry){const p=f;if(p.userData.ignoreSize||p.material.userData.isLOGO)return;p.geometry.computeBoundingBox();let g=p.geometry.attributes.position;const m=p.geometry.morphAttributes.position;let _=p.morphTargetInfluences;const v=Object.keys(p.morphTargetDictionary||{});v.includes("width")&&(t=!0),v.includes("length")&&(e=!0),v.includes("height")&&(i=!0);for(let x=0;x<g.count;x++){let b=g.getX(x),w=g.getY(x),C=g.getZ(x);l=Math.max(w,l),m&&_&&m.forEach((T,M)=>{const P=_&&_[M]||0;b+=T.getX(x)*P,w+=T.getY(x)*P,C+=T.getZ(x)*P}),b<s&&(s=b),w<n&&(n=w),C<o&&(o=C),b>a&&(a=b),w>h&&(h=w),C>u&&(u=C);const S=Math.sqrt(b*b+w*w);S>d&&(d=S)}}}),{box:new y.Box3(new y.Vector3(s,n,o),new y.Vector3(a,h,u)),maxRadius:d,height:l,hasWidth:t,hasLength:e,hasHeight:i}}function jA(r,e,t=null){let i=0;return function(){let s=t||this,n=arguments;clearTimeout(i),i=window.setTimeout(function(){r.apply(s,n)},e)}}class YA{constructor(e,t,i){this.length=e,this.width=t,this.height=i}}const Ad=r=>{var i;let e=0,t=0;if(r.geometry){r.geometry.computeBoundingBox();const s=new y.Vector3;(i=r.geometry.boundingBox)==null||i.getSize(s),s.y?(t=s.y,!s.x&&s.z?e=s.z:s.x&&!s.z?e=s.x:s.x&&s.z&&(e=s.z)):(e=s.z,t=s.x)}return{width:e,height:t}};function tc(){if(typeof navigator>"u")return!1;if(qA())return!0;const r=navigator.userAgent.toLowerCase();return/iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(r)}function qA(){try{if(typeof wx<"u"&&wx.getSystemInfo||typeof my<"u"&&my.alert||typeof tt<"u"&&tt.getSystemInfo||typeof swan<"u"&&swan.getSystemInfo)return!0}catch{}return!1}const dm=new ig.GLTFExporter,rs=new Jm.GLTFLoader,No=new eg.DRACOLoader;window&&window.dracoPath?No.setDecoderPath(window.dracoPath):No.setDecoderPath("./draco/");No.setDecoderConfig({type:"wasm"});rs.setDRACOLoader(No);const ZA=new tg.DRACOExporter,Td=[115,103,108,98];function KA(r,e,t){const i=JSON.stringify(e),s=new TextEncoder().encode(i),n=new Uint8Array([115,103,108,98]),o=new Uint8Array(2);o[0]=t>>8,o[1]=t&255;const a=new Uint8Array(4);a[0]=s.length>>24,a[1]=s.length>>16&255,a[2]=s.length>>8&255,a[3]=s.length&255;const h=new Uint8Array(r),u=n.length+o.length+a.length+s.length+h.length,d=new Uint8Array(u);let l=0;return d.set(n,l),l+=n.length,d.set(o,l),l+=o.length,d.set(a,l),l+=a.length,d.set(s,l),l+=s.length,d.set(h,l),d.buffer}function QA(r){const e=new Uint8Array(r.slice(0,4));let t=!0;for(let l=0;l<Td.length;l++)if(e[l]!==Td[l]){t=!1;break}if(!t)throw new Error("Invalid file format");const s=new DataView(r,4,2).getUint16(0,!1),o=new DataView(r,6,4).getUint32(0,!1),a=new Uint8Array(r.slice(10,10+o)),h=new TextDecoder().decode(a),u=JSON.parse(h),d=r.slice(10+o);return{version:s,jsonDescription:u,glbContent:d}}class Uo{constructor(e){this.props=e,this.cache=new Map}load(e,t,i,s){if(this.props.useCache&&this.cache.has(e)){t(this.cache.get(e));return}const n=this;fetch(e).then(o=>{if(!o.ok){s==null||s(new ErrorEvent("NetworkError",{message:"NetworkError for "+e+": "+o.statusText}));return}return o.arrayBuffer()}).then(async o=>{o||s==null||s(new ErrorEvent("Error",{message:"Not a valid sglb file."}));try{const a=n.parse(o);if(!a.glbContent){s==null||s(new ErrorEvent("Error",{message:"No glb content."}));return}const h=mh(a.glbContent,"model/gltf-binary"),u=await rs.loadAsync(h);URL.revokeObjectURL(h),a.glbContent=void 0,a.glb=u.scene,o=void 0,this.cache.set(e,a),t(a)}catch(a){s==null||s(new ErrorEvent("Error",{message:a==null?void 0:a.message}))}}).catch(o=>{s==null||s(new ErrorEvent("Error",{message:o.message}))})}async loadAsync(e){if(this.props.useCache&&this.cache.has(e))return this.cache.get(e);try{const t=await fetch(e);if(!t.ok)throw new Error(`NetworkError for ${e}: ${t.statusText}`);const i=await t.arrayBuffer();if(!i)throw new Error("Not a valid sglb file.");const s=this.parse(i);if(!s.glbContent)throw new Error("No GLB content.");const n=mh(s.glbContent,"model/gltf-binary"),o=await rs.loadAsync(n);return URL.revokeObjectURL(n),s.glbContent=void 0,s.glb=o.scene,this.cache.set(e,s),s}catch(t){throw t}}parse(e){return QA(e)}clear(){[...this.cache.values()]}}/**
|
|
4853
4853
|
* @license
|
|
4854
4854
|
* Copyright 2019 Google LLC
|
|
4855
4855
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -5028,7 +5028,7 @@ d="${this.getPath(e)}"></path>`)}
|
|
|
5028
5028
|
border-radius: 100%;
|
|
5029
5029
|
transition: background-color .15s linear;
|
|
5030
5030
|
cursor: pointer;
|
|
5031
|
-
`,t.addEventListener("pointerdown",this.onPointerDown,!1),t.addEventListener("pointerenter",this.onPointerEnter,!1),t.addEventListener("pointermove",this.onPointerMove,!1),t.addEventListener("click",this.onMouseClick,!1),this.context=t.getContext("2d"),t}destroy(){cancelAnimationFrame(this._animator),this.orbit.removeEventListener("change",this._update),this.orbit.enabled=this.orbitState,window.removeEventListener("pointermove",this.onDrag,!1),window.removeEventListener("pointerup",this.onPointerUp,!1),this._emitter.removeAllListeners(),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!1),this.domElement.removeEventListener("pointerenter",this.onPointerEnter,!1),this.domElement.removeEventListener("pointermove",this.onPointerMove,!1),this.domElement.removeEventListener("click",this.onMouseClick,!1),this.domElement.remove(),window.clearTimeout(this._textTimer),this._text.remove()}}class zS{get isFinished(){return this.params?this.framesDone>=this.params.frames:!0}set visible(e){this.shadowCatcherMesh.visible=e,this.progShadowGrp.visible=e,e||(this.isRendering=!1)}get paused(){return this.params?this.params.paused:!0}set paused(e){this.params&&(this.params.paused=e,e&&(this.isRendering=!1))}constructor(e,t,{resolution:i=1024,shadowMapRes:s=512,shadowBias:n=.001,lightCount:o=8,size:a=4,frames:h=40,lightRadius:u=2,ambientWeight:d=.5,alphaTest:l=.98,paused:c=!1}={}){this.params={enabled:!0,frames:h,lightRadius:u,ambientWeight:d,alphaTest:l,debugHelpers:!1,size:a,paused:c},this.scene=t,this.renderer=e,this.buffer1Active=!1,this.dirLights=[],this.dirLightsHelpers=[],this.clearColor=new y.Color,this.clearAlpha=0,this.progress=0,this.discardMaterial=new VS,this.lights=[],this.meshes=[],this.objectsToShow=[],this.autoHiddenObjects=[],this.objectsToShowSet=new Set,this.objectsToShowAncestors=new Set,this.framesDone=0,this.fixedCamera=null,this.isRendering=!1,this.isZUp=y.Object3D.DEFAULT_UP.z===1,this.progShadowGrp=new y.Group,this.progShadowGrp.name="progressive_shadow_assets",this.scene.add(this.progShadowGrp),this.lightOrigin=new y.Group,this.lightOrigin.name="light_origin",this.isZUp?this.lightOrigin.position.set(a,a,a*1.5):this.lightOrigin.position.set(a,a,a),this.progShadowGrp.add(this.lightOrigin),this.lightGroup=new y.Group,this.lightGroup.name="all_dir_lights",this.progShadowGrp.add(this.lightGroup);const f=Math.PI;for(let m=0;m<o;m++){const _=new y.DirectionalLight(16777215,f/o);_.name="dir_light_"+m,_.castShadow=!0,_.shadow.bias=n,_.shadow.camera.near=.1,_.shadow.camera.far=50,_.shadow.camera.right=a/2,_.shadow.camera.left=-a/2,_.shadow.camera.top=a/2,_.shadow.camera.bottom=-a/2,_.shadow.mapSize.width=s,_.shadow.mapSize.height=s,this.dirLights.push(_),this.lightGroup.add(_)}const p=/(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent)?y.HalfFloatType:y.FloatType;this.progressiveLightMap1=new y.WebGLRenderTarget(i,i,{type:p}),this.progressiveLightMap2=new y.WebGLRenderTarget(i,i,{type:p}),this.progressiveLightMap1.texture.colorSpace=y.NoColorSpace,this.progressiveLightMap2.texture.colorSpace=y.NoColorSpace,this.shadowCatcherMaterial=new HS({map:this.progressiveLightMap2.texture,transparent:!0,opacity:1});const g=new y.PlaneGeometry(a,a);this.isZUp||g.rotateX(-Math.PI/2),this.shadowCatcherMesh=new y.Mesh(g,this.shadowCatcherMaterial),this.isZUp?this.shadowCatcherMesh.position.z=.001:this.shadowCatcherMesh.position.y=.001,this.shadowCatcherMesh.name="shadowCatcherMesh",this.shadowCatcherMesh.receiveShadow=!0,this.progShadowGrp.add(this.shadowCatcherMesh),this.addObjectToShow(this.progShadowGrp),this.addObjectToShow(this.lightGroup),this.addObjectToShow(this.lightOrigin),this.addObjectToShow(this.shadowCatcherMesh),this.rebuildObjectsToShowAncestors(),this.debugHelpersGroup=new y.Group,this.targetMat=new y.MeshLambertMaterial({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:h},this.targetMat.onBeforeCompile=m=>{m.vertexShader=`varying vec2 vUv;
|
|
5031
|
+
`,t.addEventListener("pointerdown",this.onPointerDown,!1),t.addEventListener("pointerenter",this.onPointerEnter,!1),t.addEventListener("pointermove",this.onPointerMove,!1),t.addEventListener("click",this.onMouseClick,!1),this.context=t.getContext("2d"),t}destroy(){cancelAnimationFrame(this._animator),this.orbit.removeEventListener("change",this._update),this.orbit.enabled=this.orbitState,window.removeEventListener("pointermove",this.onDrag,!1),window.removeEventListener("pointerup",this.onPointerUp,!1),this._emitter.removeAllListeners(),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!1),this.domElement.removeEventListener("pointerenter",this.onPointerEnter,!1),this.domElement.removeEventListener("pointermove",this.onPointerMove,!1),this.domElement.removeEventListener("click",this.onMouseClick,!1),this.domElement.remove(),window.clearTimeout(this._textTimer),this._text.remove()}}class zS{get isFinished(){return this.params?this.framesDone>=this.params.frames:!0}set visible(e){this.shadowCatcherMesh.visible=e,this.progShadowGrp.visible=e,e||(this.isRendering=!1)}get paused(){return this.params?this.params.paused:!0}set paused(e){this.params&&(this.params.paused=e,e&&(this.isRendering=!1))}constructor(e,t,{resolution:i=1024,shadowMapRes:s=512,shadowBias:n=.001,lightCount:o=8,size:a=4,frames:h=40,lightRadius:u=2,ambientWeight:d=.5,alphaTest:l=.98,paused:c=!1}={}){this.params={enabled:!0,frames:h,lightRadius:u,ambientWeight:d,alphaTest:l,debugHelpers:!1,size:a,paused:c},this.scene=t,this.renderer=e,this.buffer1Active=!1,this.dirLights=[],this.dirLightsHelpers=[],this.clearColor=new y.Color,this.clearAlpha=0,this.progress=0,this.discardMaterial=new VS,this.lights=[],this.meshes=[],this.objectsToShow=[],this.autoHiddenObjects=[],this.objectsToShowSet=new Set,this.objectsToShowAncestors=new Set,this.framesDone=0,this.fixedCamera=null,this.isRendering=!1,this.isZUp=y.Object3D.DEFAULT_UP.z===1,this.progShadowGrp=new y.Group,this.progShadowGrp.name="progressive_shadow_assets",this.scene.add(this.progShadowGrp),this.lightOrigin=new y.Group,this.lightOrigin.name="light_origin",this.isZUp?this.lightOrigin.position.set(a,a,a*1.5):this.lightOrigin.position.set(a,a,a),this.progShadowGrp.add(this.lightOrigin),this.lightGroup=new y.Group,this.lightGroup.name="all_dir_lights",this.progShadowGrp.add(this.lightGroup);const f=Math.PI;for(let m=0;m<o;m++){const _=new y.DirectionalLight(16777215,f/o);_.name="dir_light_"+m,_.castShadow=!0,_.shadow.bias=n,_.shadow.camera.near=.1,_.shadow.camera.far=50,_.shadow.camera.right=a/2,_.shadow.camera.left=-a/2,_.shadow.camera.top=a/2,_.shadow.camera.bottom=-a/2,_.shadow.mapSize.width=s,_.shadow.mapSize.height=s,this.dirLights.push(_),this.lightGroup.add(_)}const p=/(Android|iPad|iPhone|iPod)/g.test(navigator==null?void 0:navigator.userAgent)?y.HalfFloatType:y.FloatType;this.progressiveLightMap1=new y.WebGLRenderTarget(i,i,{type:p}),this.progressiveLightMap2=new y.WebGLRenderTarget(i,i,{type:p}),this.progressiveLightMap1.texture.colorSpace=y.NoColorSpace,this.progressiveLightMap2.texture.colorSpace=y.NoColorSpace,this.shadowCatcherMaterial=new HS({map:this.progressiveLightMap2.texture,transparent:!0,opacity:1});const g=new y.PlaneGeometry(a,a);this.isZUp||g.rotateX(-Math.PI/2),this.shadowCatcherMesh=new y.Mesh(g,this.shadowCatcherMaterial),this.isZUp?this.shadowCatcherMesh.position.z=.001:this.shadowCatcherMesh.position.y=.001,this.shadowCatcherMesh.name="shadowCatcherMesh",this.shadowCatcherMesh.receiveShadow=!0,this.progShadowGrp.add(this.shadowCatcherMesh),this.addObjectToShow(this.progShadowGrp),this.addObjectToShow(this.lightGroup),this.addObjectToShow(this.lightOrigin),this.addObjectToShow(this.shadowCatcherMesh),this.rebuildObjectsToShowAncestors(),this.debugHelpersGroup=new y.Group,this.targetMat=new y.MeshLambertMaterial({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:h},this.targetMat.onBeforeCompile=m=>{m.vertexShader=`varying vec2 vUv;
|
|
5032
5032
|
`+m.vertexShader.slice(0,-1)+"vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";const _=m.fragmentShader.indexOf("void main() {");m.fragmentShader=`varying vec2 vUv;
|
|
5033
5033
|
`+m.fragmentShader.slice(0,_)+`uniform sampler2D previousShadowMap;
|
|
5034
5034
|
uniform float averagingWindow;
|
|
@@ -5074,4 +5074,4 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
5074
5074
|
user-select: none;
|
|
5075
5075
|
touch-action: none;
|
|
5076
5076
|
-webkit-touch-callout: none;
|
|
5077
|
-
`),this._controlsGizmo&&this._controlsGizmo.appendTo(e),this.stats.dom.style.bottom="0",this.stats.dom.style.top="auto",this.resize(),this._resizeObserver=new ResizeObserver(this.resize.bind(this)),this._resizeObserver.observe(e)}add(e){this._container.add(e)}updatePosition(){}removeFromParent(){var t;const e=this.renderer.domElement.parentElement;e&&((t=this._resizeObserver)==null||t.unobserve(e),e.removeChild(this.renderer.domElement))}clean(){this.amr.clean(),this._progressShadow.clear()}destroy(){var t,i,s;this._destroyed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._clock.stop(),(t=this._controlsGizmo)==null||t.destroy(),this.amr.destroy(),this.amr.removeFromParent(),this._progressShadow.destroy(),Pt.removeAll(),this.stats.dom.remove(),this._emitter.removeAllListeners(),(i=this._fitAnimation)==null||i.stop(),window.removeEventListener("drag",this._drag),document.removeEventListener("wheel",this._detectTrackpad),window.removeEventListener("pointermove",this._pointermove),this.renderer.domElement.removeEventListener("pointerdown",this._pointerdown);const e=this.renderer.domElement.parentElement;e&&((s=this._resizeObserver)==null||s.unobserve(e)),this.controls.dispose(),this.renderer.domElement.remove(),this.renderer.dispose(),this._composer.dispose(),ii(this.scene),this.scene.clear()}}class Bm{constructor(e){this.deps=e,this.canvas=null,this.pixelBuffer=null,this.orthoCamera=new y.OrthographicCamera(-1,1,1,-1,.1,1e3),this.orthoCamera.position.set(0,0,5),this.perspectiveCamera=new y.PerspectiveCamera(45,1,.1,2e3)}async capture(e){var p,g,m,_,v,x;const t=this.deps.renderer,i=(e==null?void 0:e.subject)??this.deps.subject;if(!i)throw new Error("TriViewCapture: subject is required.");const s=new y.Vector2;t.getSize(s);const n=((p=e==null?void 0:e.size)==null?void 0:p.width)??Math.round(s.x),o=((g=e==null?void 0:e.size)==null?void 0:g.height)??Math.round(s.y),a=(e==null?void 0:e.margin)??.15,h=(e==null?void 0:e.includeOverlay)??!1,u=n/o||1,d=this.resolveViews(e==null?void 0:e.views),l=new y.WebGLRenderTarget(n,o,{format:y.RGBAFormat,type:y.UnsignedByteType});l.texture.colorSpace=y.SRGBColorSpace,l.texture.generateMipmaps=!1,l.depthBuffer=!0;const c=this.storeRendererState(t),f={};try{(_=(m=this.deps).onBeforeCapture)==null||_.call(m);const b=this.computeBounds(i);this.applyRendererState(t,n,o,e==null?void 0:e.backgroundColor);for(const w of d){const C=this.configureCamera(b,w,u,a,n,o);t.setRenderTarget(l),t.clear(!0,!0,!0),t.render(this.deps.scene,C),h&&this.deps.overlayScene&&(t.clearDepth(),t.render(this.deps.overlayScene,C));const S=this.readPixels(t,l,n,o);f[w.key]=S}}finally{l.dispose(),this.restoreRendererState(t,c),(x=(v=this.deps).onAfterCapture)==null||x.call(v)}return f}resolveViews(e){return e&&e.length?e.map(t=>({key:t.key,direction:t.direction.clone(),up:t.up.clone(),plane:t.plane})):[{key:"top",direction:new y.Vector3(0,0,1),up:new y.Vector3(0,1,0),plane:{width:"x",height:"y",depth:"z"}},{key:"front",direction:new y.Vector3(0,-1,0),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"}},{key:"side",direction:new y.Vector3(1,0,0),up:new y.Vector3(0,0,1),plane:{width:"y",height:"z",depth:"x"}},{key:"perspective",direction:new y.Vector3(1,1,1),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"},mode:"perspective",fov:39.6}]}computeBounds(e){const t=new y.Box3,i=new y.Box3,s=new y.Vector3,n=new y.Vector3,o=new y.Sphere;return e.updateMatrixWorld(!0),e.traverse(a=>{if(!a.visible)return;const u=a.geometry;if(!u)return;u.boundingBox||u.computeBoundingBox();const d=u.boundingBox;d&&(i.copy(d).applyMatrix4(a.matrixWorld),t.union(i))}),t.isEmpty()?(t.setFromCenterAndSize(s,new y.Vector3(.001,.001,.001)),n.set(.001,.001,.001),o.center.copy(s),o.radius=.001):(t.getCenter(s),t.getSize(n),t.getBoundingSphere(o)),(!Number.isFinite(o.radius)||o.radius<=0)&&(o.radius=Math.max(n.length()*.5,.001)),{box:t,center:s,size:n,sphere:o}}configureCamera(e,t,i,s,n,o){const a=t.direction.clone().normalize();a.lengthSq()===0&&a.set(0,0,1);const h=t.up.clone().normalize();if(Math.abs(h.dot(a))>.999&&(h.set(0,0,1),Math.abs(h.dot(a))>.999&&h.set(0,1,0)),(t.mode??"orthographic")==="perspective"){const b=this.perspectiveCamera,w=t.fov??45,C=y.MathUtils.degToRad(w),S=Math.max(Math.tan(C/2),1e-4),T=Math.max(S*(i||1),1e-4),M=this.getPerspectiveDirection(t,e.size).normalize(),P=new y.Vector3().crossVectors(M,h).normalize();P.lengthSq()<1e-6&&P.set(1,0,0);const R=new y.Vector3().crossVectors(P,M).normalize(),E=Math.max(e.size.x*.5,1e-4),A=Math.max(e.size.y*.5,1e-4),I=Math.max(e.size.z*.5,1e-4),D=[new y.Vector3(-E,-A,-I),new y.Vector3(-E,-A,I),new y.Vector3(-E,A,-I),new y.Vector3(-E,A,I),new y.Vector3(E,-A,-I),new y.Vector3(E,-A,I),new y.Vector3(E,A,-I),new y.Vector3(E,A,I)];let B=0,k=-1/0;for(const L of D){const F=P.dot(L),G=R.dot(L),Q=M.dot(L);k=Math.max(k,Q);const ee=Q+Math.abs(F)/T,oe=Q+Math.abs(G)/S;B=Math.max(B,ee,oe)}B=Math.max(B,k+.1);const z=B*(1+s);let q=1/0;for(const L of D){const F=M.dot(L),G=z-F;G>.001&&(q=Math.min(q,G))}return b.fov=w,b.aspect=i||n/Math.max(o,1),b.near=Math.max(.1,Number.isFinite(q)?q*.5:z*.1),b.far=Math.max(b.near+1,z+e.sphere.radius*3),b.position.copy(e.center).add(M.clone().multiplyScalar(z)),b.up.copy(R),b.lookAt(e.center),b.updateProjectionMatrix(),b.updateMatrixWorld(!0),b}const d=this.orthoCamera,l=e.size,c=e.center,f=Math.max(l[t.plane.width]*.5,.01),p=Math.max(l[t.plane.height]*.5,.01),g=Math.max(l[t.plane.depth]*.5,.01);let m=f*(1+s),_=p*(1+s);m/i>_?_=m/i:m=_*i;const v=g*(1+s)+Math.max(m,_),x=c.clone().add(a.multiplyScalar(v));return d.left=-m,d.right=m,d.top=_,d.bottom=-_,d.near=.1,d.far=v*4,d.zoom=1,d.position.copy(x),d.up.copy(h),d.lookAt(c),d.updateProjectionMatrix(),d.updateMatrixWorld(!0),d}getPerspectiveDirection(e,t){const i=e.direction.clone();i.lengthSq()===0&&i.set(1,1,1);const s=new y.Vector3(Math.abs(i.x)||1,Math.abs(i.y)||1,Math.abs(i.z)||1),n=new y.Vector3(Math.sign(i.x||1),Math.sign(i.y||1),Math.sign(i.z||1)),o=.25,a=new y.Vector3(Math.max(o,s.x)*Math.max(t.x,.001),Math.max(o,s.y)*Math.max(t.y,.001),0),h=Math.max((t.x+t.y)*.5,.001),u=Math.max(t.z,.001),d=Math.max(o,s.z),l=u*.5+h*.5;return a.z=d*l,a.multiply(n),a}storeRendererState(e){const t=new y.Vector2;e.getSize(t);const i=new y.Vector4;e.getViewport(i);const s=new y.Vector4;e.getScissor(s);const n=e.getClearColor(new y.Color),o=e.getClearAlpha();return{size:t,pixelRatio:e.getPixelRatio(),viewport:i,scissor:s,scissorTest:e.getScissorTest(),autoClear:e.autoClear,target:e.getRenderTarget(),clearColor:n,clearAlpha:o}}applyRendererState(e,t,i,s){if(e.setPixelRatio(1),e.setSize(t,i,!1),e.setViewport(0,0,t,i),e.setScissor(0,0,t,i),e.setScissorTest(!1),e.autoClear=!0,s!==void 0)if(s===null){const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}else s instanceof y.Color?e.setClearColor(s,1):e.setClearColor(new y.Color(s),1);else{const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}}restoreRendererState(e,t){e.setPixelRatio(t.pixelRatio),e.setSize(t.size.x,t.size.y,!1),e.setViewport(t.viewport.x,t.viewport.y,t.viewport.z,t.viewport.w),e.setScissor(t.scissor.x,t.scissor.y,t.scissor.z,t.scissor.w),e.setScissorTest(t.scissorTest),e.autoClear=t.autoClear,e.setRenderTarget(t.target),e.setClearColor(t.clearColor,t.clearAlpha)}readPixels(e,t,i,s){const n=i*s*4;(!this.pixelBuffer||this.pixelBuffer.length!==n)&&(this.pixelBuffer=new Uint8Array(n)),e.readRenderTargetPixels(t,0,0,i,s,this.pixelBuffer);const o=this.ensureCanvas(i,s),a=o.getContext("2d");if(!a)throw new Error("TriViewCapture: failed to get 2D context.");const h=a.createImageData(i,s),u=h.data,d=this.pixelBuffer;for(let l=0;l<s;l+=1){const f=(s-l-1)*i*4,p=l*i*4;u.set(d.subarray(f,f+i*4),p)}return a.putImageData(h,0,0),o.toDataURL("image/png")}ensureCanvas(e,t){if(typeof document>"u")throw new Error("TriViewCapture: document is not available in this environment.");return this.canvas||(this.canvas=document.createElement("canvas")),(this.canvas.width!==e||this.canvas.height!==t)&&(this.canvas.width=e,this.canvas.height=t),this.canvas}}const KS="shop-components",QS="0.1.68",JS="Shop components",eE="dist/shop-components.umd.js",tE="dist/shop-components.mjs",iE="dist/main.d.ts",rE={dts:"tsc --emitDeclarationOnly & tsc & storybook build -o dist",test:'echo "Error: no test specified" && exit 1',dev:"storybook dev -p 6006",build:"storybook build -o dist",vite:"vite build",vitedev:"vite dev",version:"auto-changelog -p && git add CHANGELOG.md"},sE=["dist","package.json"],nE=[],oE="machengda<machengda@seer-group.com>",aE="ISC",lE={"@needle-tools/gltf-progressive":"^3.3.5","@storybook/addon-essentials":"^8.0.6","@storybook/addon-links":"^8.0.6","@storybook/addon-mdx-gfm":"^8.0.6","@storybook/addon-themes":"^8.0.6","@storybook/blocks":"^8.0.6","@storybook/web-components":"^8.0.6","@storybook/web-components-vite":"^8.0.6","auto-changelog":"^2.4.0",react:"^18.2.0","react-dom":"^18.2.0",storybook:"^8.0.6",vite:"^5.1.6","vite-plugin-dts":"^3.7.3"},hE={"string-width":"4.2.3"},cE={"@nodetoy/three-nodetoy":"^0.1.36","@tweakpane/core":"^2.0.3","@tweenjs/tween.js":"^23.1.2","@types/bezier-js":"^4.1.1","@types/howler":"^2.2.11","@types/three":"0.180.0","bezier-js":"^6.1.4",eventemitter3:"^5.0.1",howler:"^2.2.4",lit:"^3.1.0","pixi-viewport":"^5.0.2","pixi.js":"7.4.0","stats-fps.js":"0.0.6",stylus:"^0.63.0",terser:"^5.44.0",three:"0.180.0","three-gpu-pathtracer":"0.0.23","three-mesh-bvh":"^0.7.5","troika-three-text":"^0.49.1",tweakpane:"^4.0.3"},uE={name:KS,version:QS,description:JS,main:eE,module:tE,types:iE,scripts:rE,files:sE,keywords:nE,author:oE,license:aE,devDependencies:lE,resolutions:hE,dependencies:cE};function Qd(){const r="Nebular Engin",e=uE.version,t=`%c ${r} %c v${e} `;console.log(t,"background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;","background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;")}const Jd="__SHOP_COMPONENTS_BANNER_PRINTED__";try{const r=globalThis;r[Jd]||(r[Jd]=!0,Qd())}catch{Qd()}exports.Amr=Tm;exports.Line=ET;exports.Logo=yh;exports.SGLBLoader=Uo;exports.SLOT_EVENTS=Le;exports.Scene3D=ZS;exports.Skin=Mh;exports.Slot=_h;exports.SlotState=Dm;exports.TriViewCapture=Bm;exports.arrayBufferToUrl=mh;exports.calculateArrayAverage=hm;exports.calculateFocalLength=zA;exports.createSGLBFile=KA;exports.downloadBlob=UA;exports.dracoExporter=ZA;exports.font=jS;exports.gltfExporter=dm;exports.gltfLoader=rs;exports.imageBitmapToPixiTexture=GA;exports.imageBitmapToUrl=gh;exports.isAppleDevice=cm;exports.textureLoader=ac;
|
|
5077
|
+
`),this._controlsGizmo&&this._controlsGizmo.appendTo(e),this.stats.dom.style.bottom="0",this.stats.dom.style.top="auto",this.resize(),this._resizeObserver=new ResizeObserver(this.resize.bind(this)),this._resizeObserver.observe(e)}add(e){this._container.add(e)}updatePosition(){}removeFromParent(){var t;const e=this.renderer.domElement.parentElement;e&&((t=this._resizeObserver)==null||t.unobserve(e),e.removeChild(this.renderer.domElement))}clean(){this.amr.clean(),this._progressShadow.clear()}destroy(){var t,i,s;this._destroyed=!0,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._clock.stop(),(t=this._controlsGizmo)==null||t.destroy(),this.amr.destroy(),this.amr.removeFromParent(),this._progressShadow.destroy(),Pt.removeAll(),this.stats.dom.remove(),this._emitter.removeAllListeners(),(i=this._fitAnimation)==null||i.stop(),window.removeEventListener("drag",this._drag),document.removeEventListener("wheel",this._detectTrackpad),window.removeEventListener("pointermove",this._pointermove),this.renderer.domElement.removeEventListener("pointerdown",this._pointerdown);const e=this.renderer.domElement.parentElement;e&&((s=this._resizeObserver)==null||s.unobserve(e)),this.controls.dispose(),this.renderer.domElement.remove(),this.renderer.dispose(),this._composer.dispose(),ii(this.scene),this.scene.clear()}}class Bm{constructor(e){this.deps=e,this.canvas=null,this.pixelBuffer=null,this.orthoCamera=new y.OrthographicCamera(-1,1,1,-1,.1,1e3),this.orthoCamera.position.set(0,0,5),this.perspectiveCamera=new y.PerspectiveCamera(45,1,.1,2e3)}async capture(e){var p,g,m,_,v,x;const t=this.deps.renderer,i=(e==null?void 0:e.subject)??this.deps.subject;if(!i)throw new Error("TriViewCapture: subject is required.");const s=new y.Vector2;t.getSize(s);const n=((p=e==null?void 0:e.size)==null?void 0:p.width)??Math.round(s.x),o=((g=e==null?void 0:e.size)==null?void 0:g.height)??Math.round(s.y),a=(e==null?void 0:e.margin)??.15,h=(e==null?void 0:e.includeOverlay)??!1,u=n/o||1,d=this.resolveViews(e==null?void 0:e.views),l=new y.WebGLRenderTarget(n,o,{format:y.RGBAFormat,type:y.UnsignedByteType});l.texture.colorSpace=y.SRGBColorSpace,l.texture.generateMipmaps=!1,l.depthBuffer=!0;const c=this.storeRendererState(t),f={};try{(_=(m=this.deps).onBeforeCapture)==null||_.call(m);const b=this.computeBounds(i);this.applyRendererState(t,n,o,e==null?void 0:e.backgroundColor);for(const w of d){const C=this.configureCamera(b,w,u,a,n,o);t.setRenderTarget(l),t.clear(!0,!0,!0),t.render(this.deps.scene,C),h&&this.deps.overlayScene&&(t.clearDepth(),t.render(this.deps.overlayScene,C));const S=this.readPixels(t,l,n,o);f[w.key]=S}}finally{l.dispose(),this.restoreRendererState(t,c),(x=(v=this.deps).onAfterCapture)==null||x.call(v)}return f}resolveViews(e){return e&&e.length?e.map(t=>({key:t.key,direction:t.direction.clone(),up:t.up.clone(),plane:t.plane})):[{key:"top",direction:new y.Vector3(0,0,1),up:new y.Vector3(0,1,0),plane:{width:"x",height:"y",depth:"z"}},{key:"front",direction:new y.Vector3(0,-1,0),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"}},{key:"side",direction:new y.Vector3(1,0,0),up:new y.Vector3(0,0,1),plane:{width:"y",height:"z",depth:"x"}},{key:"perspective",direction:new y.Vector3(1,1,1),up:new y.Vector3(0,0,1),plane:{width:"x",height:"z",depth:"y"},mode:"perspective",fov:39.6}]}computeBounds(e){const t=new y.Box3,i=new y.Box3,s=new y.Vector3,n=new y.Vector3,o=new y.Sphere;return e.updateMatrixWorld(!0),e.traverse(a=>{if(!a.visible)return;const u=a.geometry;if(!u)return;u.boundingBox||u.computeBoundingBox();const d=u.boundingBox;d&&(i.copy(d).applyMatrix4(a.matrixWorld),t.union(i))}),t.isEmpty()?(t.setFromCenterAndSize(s,new y.Vector3(.001,.001,.001)),n.set(.001,.001,.001),o.center.copy(s),o.radius=.001):(t.getCenter(s),t.getSize(n),t.getBoundingSphere(o)),(!Number.isFinite(o.radius)||o.radius<=0)&&(o.radius=Math.max(n.length()*.5,.001)),{box:t,center:s,size:n,sphere:o}}configureCamera(e,t,i,s,n,o){const a=t.direction.clone().normalize();a.lengthSq()===0&&a.set(0,0,1);const h=t.up.clone().normalize();if(Math.abs(h.dot(a))>.999&&(h.set(0,0,1),Math.abs(h.dot(a))>.999&&h.set(0,1,0)),(t.mode??"orthographic")==="perspective"){const b=this.perspectiveCamera,w=t.fov??45,C=y.MathUtils.degToRad(w),S=Math.max(Math.tan(C/2),1e-4),T=Math.max(S*(i||1),1e-4),M=this.getPerspectiveDirection(t,e.size).normalize(),P=new y.Vector3().crossVectors(M,h).normalize();P.lengthSq()<1e-6&&P.set(1,0,0);const R=new y.Vector3().crossVectors(P,M).normalize(),E=Math.max(e.size.x*.5,1e-4),A=Math.max(e.size.y*.5,1e-4),I=Math.max(e.size.z*.5,1e-4),D=[new y.Vector3(-E,-A,-I),new y.Vector3(-E,-A,I),new y.Vector3(-E,A,-I),new y.Vector3(-E,A,I),new y.Vector3(E,-A,-I),new y.Vector3(E,-A,I),new y.Vector3(E,A,-I),new y.Vector3(E,A,I)];let B=0,k=-1/0;for(const L of D){const F=P.dot(L),G=R.dot(L),Q=M.dot(L);k=Math.max(k,Q);const ee=Q+Math.abs(F)/T,oe=Q+Math.abs(G)/S;B=Math.max(B,ee,oe)}B=Math.max(B,k+.1);const z=B*(1+s);let q=1/0;for(const L of D){const F=M.dot(L),G=z-F;G>.001&&(q=Math.min(q,G))}return b.fov=w,b.aspect=i||n/Math.max(o,1),b.near=Math.max(.1,Number.isFinite(q)?q*.5:z*.1),b.far=Math.max(b.near+1,z+e.sphere.radius*3),b.position.copy(e.center).add(M.clone().multiplyScalar(z)),b.up.copy(R),b.lookAt(e.center),b.updateProjectionMatrix(),b.updateMatrixWorld(!0),b}const d=this.orthoCamera,l=e.size,c=e.center,f=Math.max(l[t.plane.width]*.5,.01),p=Math.max(l[t.plane.height]*.5,.01),g=Math.max(l[t.plane.depth]*.5,.01);let m=f*(1+s),_=p*(1+s);m/i>_?_=m/i:m=_*i;const v=g*(1+s)+Math.max(m,_),x=c.clone().add(a.multiplyScalar(v));return d.left=-m,d.right=m,d.top=_,d.bottom=-_,d.near=.1,d.far=v*4,d.zoom=1,d.position.copy(x),d.up.copy(h),d.lookAt(c),d.updateProjectionMatrix(),d.updateMatrixWorld(!0),d}getPerspectiveDirection(e,t){const i=e.direction.clone();i.lengthSq()===0&&i.set(1,1,1);const s=new y.Vector3(Math.abs(i.x)||1,Math.abs(i.y)||1,Math.abs(i.z)||1),n=new y.Vector3(Math.sign(i.x||1),Math.sign(i.y||1),Math.sign(i.z||1)),o=.25,a=new y.Vector3(Math.max(o,s.x)*Math.max(t.x,.001),Math.max(o,s.y)*Math.max(t.y,.001),0),h=Math.max((t.x+t.y)*.5,.001),u=Math.max(t.z,.001),d=Math.max(o,s.z),l=u*.5+h*.5;return a.z=d*l,a.multiply(n),a}storeRendererState(e){const t=new y.Vector2;e.getSize(t);const i=new y.Vector4;e.getViewport(i);const s=new y.Vector4;e.getScissor(s);const n=e.getClearColor(new y.Color),o=e.getClearAlpha();return{size:t,pixelRatio:e.getPixelRatio(),viewport:i,scissor:s,scissorTest:e.getScissorTest(),autoClear:e.autoClear,target:e.getRenderTarget(),clearColor:n,clearAlpha:o}}applyRendererState(e,t,i,s){if(e.setPixelRatio(1),e.setSize(t,i,!1),e.setViewport(0,0,t,i),e.setScissor(0,0,t,i),e.setScissorTest(!1),e.autoClear=!0,s!==void 0)if(s===null){const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}else s instanceof y.Color?e.setClearColor(s,1):e.setClearColor(new y.Color(s),1);else{const n=e.getClearColor(new y.Color);e.setClearColor(n,0)}}restoreRendererState(e,t){e.setPixelRatio(t.pixelRatio),e.setSize(t.size.x,t.size.y,!1),e.setViewport(t.viewport.x,t.viewport.y,t.viewport.z,t.viewport.w),e.setScissor(t.scissor.x,t.scissor.y,t.scissor.z,t.scissor.w),e.setScissorTest(t.scissorTest),e.autoClear=t.autoClear,e.setRenderTarget(t.target),e.setClearColor(t.clearColor,t.clearAlpha)}readPixels(e,t,i,s){const n=i*s*4;(!this.pixelBuffer||this.pixelBuffer.length!==n)&&(this.pixelBuffer=new Uint8Array(n)),e.readRenderTargetPixels(t,0,0,i,s,this.pixelBuffer);const o=this.ensureCanvas(i,s),a=o.getContext("2d");if(!a)throw new Error("TriViewCapture: failed to get 2D context.");const h=a.createImageData(i,s),u=h.data,d=this.pixelBuffer;for(let l=0;l<s;l+=1){const f=(s-l-1)*i*4,p=l*i*4;u.set(d.subarray(f,f+i*4),p)}return a.putImageData(h,0,0),o.toDataURL("image/png")}ensureCanvas(e,t){if(typeof document>"u")throw new Error("TriViewCapture: document is not available in this environment.");return this.canvas||(this.canvas=document.createElement("canvas")),(this.canvas.width!==e||this.canvas.height!==t)&&(this.canvas.width=e,this.canvas.height=t),this.canvas}}const KS="shop-components",QS="0.2.1",JS="Shop components",eE="dist/shop-components.umd.js",tE="dist/shop-components.mjs",iE="dist/main.d.ts",rE={dts:"tsc --emitDeclarationOnly & tsc & storybook build -o dist",test:'echo "Error: no test specified" && exit 1',dev:"storybook dev -p 6006",build:"storybook build -o dist",vite:"vite build",vitedev:"vite dev",version:"auto-changelog -p && git add CHANGELOG.md"},sE=["dist","package.json"],nE=[],oE="machengda<machengda@seer-group.com>",aE="ISC",lE={"@needle-tools/gltf-progressive":"^3.3.5","@storybook/addon-essentials":"^8.0.6","@storybook/addon-links":"^8.0.6","@storybook/addon-mdx-gfm":"^8.0.6","@storybook/addon-themes":"^8.0.6","@storybook/blocks":"^8.0.6","@storybook/web-components":"^8.0.6","@storybook/web-components-vite":"^8.0.6","auto-changelog":"^2.4.0",react:"^18.2.0","react-dom":"^18.2.0",storybook:"^8.0.6",vite:"^5.1.6","vite-plugin-dts":"^3.7.3"},hE={"string-width":"4.2.3"},cE={"@nodetoy/three-nodetoy":"^0.1.36","@tweakpane/core":"^2.0.3","@tweenjs/tween.js":"^23.1.2","@types/bezier-js":"^4.1.1","@types/howler":"^2.2.11","@types/three":"0.180.0","bezier-js":"^6.1.4",eventemitter3:"^5.0.1",howler:"^2.2.4",lit:"^3.1.0","pixi-viewport":"^5.0.2","pixi.js":"7.4.0","stats-fps.js":"0.0.6",stylus:"^0.63.0",terser:"^5.44.0",three:"0.180.0","three-gpu-pathtracer":"0.0.23","three-mesh-bvh":"^0.7.5","troika-three-text":"^0.49.1",tweakpane:"^4.0.3"},uE={name:KS,version:QS,description:JS,main:eE,module:tE,types:iE,scripts:rE,files:sE,keywords:nE,author:oE,license:aE,devDependencies:lE,resolutions:hE,dependencies:cE};function Qd(){const r="Nebular Engin",e=uE.version,t=`%c ${r} %c v${e} `;console.log(t,"background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;","background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;")}const Jd="__SHOP_COMPONENTS_BANNER_PRINTED__";try{const r=globalThis;r[Jd]||(r[Jd]=!0,Qd())}catch{Qd()}exports.Amr=Tm;exports.Line=ET;exports.Logo=yh;exports.SGLBLoader=Uo;exports.SLOT_EVENTS=Le;exports.Scene3D=ZS;exports.Skin=Mh;exports.Slot=_h;exports.SlotState=Dm;exports.TriViewCapture=Bm;exports.arrayBufferToUrl=mh;exports.calculateArrayAverage=hm;exports.calculateFocalLength=zA;exports.createSGLBFile=KA;exports.downloadBlob=UA;exports.dracoExporter=ZA;exports.font=jS;exports.gltfExporter=dm;exports.gltfLoader=rs;exports.imageBitmapToPixiTexture=GA;exports.imageBitmapToUrl=gh;exports.isAppleDevice=cm;exports.textureLoader=ac;
|
package/dist/shop-components.mjs
CHANGED
|
@@ -31191,7 +31191,7 @@ function uf(s, e) {
|
|
|
31191
31191
|
return URL.createObjectURL(t);
|
|
31192
31192
|
}
|
|
31193
31193
|
function rS() {
|
|
31194
|
-
return /Mac|iPod|iPhone|iPad/.test(navigator.platform) || /Mac OS|iOS/.test(navigator.userAgent);
|
|
31194
|
+
return /Mac|iPod|iPhone|iPad/.test(navigator == null ? void 0 : navigator.platform) || /Mac OS|iOS/.test(navigator == null ? void 0 : navigator.userAgent);
|
|
31195
31195
|
}
|
|
31196
31196
|
function oI(s) {
|
|
31197
31197
|
let e = document.createElement("canvas");
|
|
@@ -32514,7 +32514,7 @@ function dS() {
|
|
|
32514
32514
|
return !1;
|
|
32515
32515
|
}
|
|
32516
32516
|
const fS = new m0(), An = new d0(), fa = new f0();
|
|
32517
|
-
window.dracoPath ? fa.setDecoderPath(window.dracoPath) : fa.setDecoderPath("./draco/");
|
|
32517
|
+
window && window.dracoPath ? fa.setDecoderPath(window.dracoPath) : fa.setDecoderPath("./draco/");
|
|
32518
32518
|
fa.setDecoderConfig({ type: "wasm" });
|
|
32519
32519
|
An.setDRACOLoader(fa);
|
|
32520
32520
|
const hI = new p0(), pf = [115, 103, 108, 98];
|
|
@@ -36878,7 +36878,7 @@ class sC {
|
|
|
36878
36878
|
const _ = new Vg(16777215, f / o);
|
|
36879
36879
|
_.name = "dir_light_" + m, _.castShadow = !0, _.shadow.bias = n, _.shadow.camera.near = 0.1, _.shadow.camera.far = 50, _.shadow.camera.right = a / 2, _.shadow.camera.left = -a / 2, _.shadow.camera.top = a / 2, _.shadow.camera.bottom = -a / 2, _.shadow.mapSize.width = r, _.shadow.mapSize.height = r, this.dirLights.push(_), this.lightGroup.add(_);
|
|
36880
36880
|
}
|
|
36881
|
-
const p = /(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent) ? Et : ht;
|
|
36881
|
+
const p = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? Et : ht;
|
|
36882
36882
|
this.progressiveLightMap1 = new di(i, i, { type: p }), this.progressiveLightMap2 = new di(i, i, { type: p }), this.progressiveLightMap1.texture.colorSpace = Kc, this.progressiveLightMap2.texture.colorSpace = Kc, this.shadowCatcherMaterial = new rC({
|
|
36883
36883
|
map: this.progressiveLightMap2.texture,
|
|
36884
36884
|
transparent: !0,
|
|
@@ -37776,7 +37776,7 @@ class dC {
|
|
|
37776
37776
|
return this.canvas || (this.canvas = document.createElement("canvas")), (this.canvas.width !== e || this.canvas.height !== t) && (this.canvas.width = e, this.canvas.height = t), this.canvas;
|
|
37777
37777
|
}
|
|
37778
37778
|
}
|
|
37779
|
-
const fC = "shop-components", pC = "0.1
|
|
37779
|
+
const fC = "shop-components", pC = "0.2.1", mC = "Shop components", gC = "dist/shop-components.umd.js", _C = "dist/shop-components.mjs", yC = "dist/main.d.ts", vC = {
|
|
37780
37780
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
37781
37781
|
test: 'echo "Error: no test specified" && exit 1',
|
|
37782
37782
|
dev: "storybook dev -p 6006",
|