5622 lines
1.3 MiB
5622 lines
1.3 MiB
import{$ as An,$a as fo,$b as vf,A as we,Aa as ar,Ab as cf,B as Um,Ba as In,Bb as yl,C as P,Ca as xl,Cb as Mi,D as A,Da as yi,Db as Xr,E as zi,Ea as Bt,Eb as Pu,F as Vr,Fa as Ut,Fb as go,G as ii,Ga as Wm,Gb as ja,H as Hi,Ha as Xm,Hb as df,I as Ft,Ia as Eu,Ib as uf,J as Pn,Ja as Ci,Jb as No,K as F,Ka as Dt,Kb as hf,L as Br,La as oe,Lb as wi,M as Nn,Ma as wn,Mb as pf,N as or,Na as u,Nb as Au,O as _n,Oa as D,Ob as qi,P as zm,Pa as me,Pb as pi,Q as an,Qa as cn,Qb as mf,R as Gi,Ra as qm,Rb as ff,S as _l,Sa as Hr,Sb as Iu,T as d,Ta as Gr,Tb as Ka,U as Ur,Ua as Wr,Ub as $i,V as qa,Va as On,Vb as Cl,W as rr,Wa as Xi,Wb as Ou,X as xi,Xa as po,Xb as qr,Y as Zt,Ya as mo,Yb as mn,Z as vl,Za as $m,Zb as gf,_ as ke,_b as _f,a as he,aa as Gt,ab as le,ac as Ml,b as De,ba as Wi,bb as Ym,c as zn,ca as bi,cb as Qt,cc as wl,d as wu,da as Hm,db as en,dc as Sl,e as yt,ea as Gm,eb as $a,f as Om,fa as Su,fb as jm,g as Dm,ga as Jt,gb as Dn,h as km,ha as zr,hb as $t,i as ho,ia as R,ib as Ya,j as Rm,ja as N,jb as Km,k as Nm,ka as ct,kb as Tu,l as Lm,la as Ln,lb as Zm,m as Ui,ma as ve,mb as Jm,n as ir,na as xe,nb as Qm,o as fl,oa as Q,ob as bl,p as Fm,pa as _,pb as ef,q as Ro,qa as f,qb as tt,r as Xa,ra as ye,s as ni,sa as v,sb as tf,t as Vm,ta as b,tb as nf,u as Bm,ua as Te,ub as of,v as gl,va as Z,vb as rf,w as Fr,wa as Ee,wb as sr,x as Yn,xa as z,xb as af,y as Tn,ya as ne,yb as sf,z as Lt,za as g,zb as lf}from"./chunk-SDV3ZBF6.js";function Ru(o){let t=o.cloneNode(!0),e=t.querySelectorAll("[id]"),n=o.nodeName.toLowerCase();t.removeAttribute("id");for(let i=0;i<e.length;i++)e[i].removeAttribute("id");return n==="canvas"?yf(o,t):(n==="input"||n==="select"||n==="textarea")&&bf(o,t),xf("canvas",o,t,yf),xf("input, textarea, select",o,t,bf),t}function xf(o,t,e,n){let i=t.querySelectorAll(o);if(i.length){let r=e.querySelectorAll(o);for(let a=0;a<i.length;a++)n(i[a],r[a])}}var mx=0;function bf(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${mx++}`)}function yf(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch{}}function zu(o){let t=o.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Nu(o,t,e){let{top:n,bottom:i,left:r,right:a}=o;return e>=n&&e<=i&&t>=r&&t<=a}function fx(o,t){let e=t.left<o.left,n=t.left+t.width>o.right,i=t.top<o.top,r=t.top+t.height>o.bottom;return e||n||i||r}function Qa(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function Cf(o,t,e,n){let{top:i,right:r,bottom:a,left:s,width:l,height:c}=o,h=l*t,p=c*t;return n>i-p&&n<a+p&&e>s-h&&e<r+h}var El=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:zu(e)})})}handleScroll(t){let e=Mi(t),n=this.positions.get(e);if(!n)return null;let i=n.scrollPosition,r,a;if(e===this._document){let c=this.getViewportScrollPosition();r=c.top,a=c.left}else r=e.scrollTop,a=e.scrollLeft;let s=i.top-r,l=i.left-a;return this.positions.forEach((c,h)=>{c.clientRect&&e!==h&&e.contains(h)&&Qa(c.clientRect,s,l)}),i.top=r,i.left=a,{top:s,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function kf(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let n=t.createElement("div");return e.forEach(i=>n.appendChild(i)),n}function Hu(o,t,e){for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];i?o.setProperty(n,i,e?.has(n)?"important":""):o.removeProperty(n)}return o}function $r(o,t){let e=t?"":"none";Hu(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Mf(o,t,e){Hu(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function Tl(o,t){return t&&t!="none"?o+" "+t:o}function wf(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=es(t.left,t.top)}function es(o,t){return`translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var Za={capture:!0},Du={passive:!1,capture:!0},gx=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(n,i){},styles:[`@layer cdk-resets {
|
|
.cdk-drag-preview {
|
|
background: none;
|
|
border: none;
|
|
padding: 0;
|
|
color: inherit;
|
|
inset: auto;
|
|
}
|
|
}
|
|
.cdk-drag-placeholder *,
|
|
.cdk-drag-preview * {
|
|
pointer-events: none !important;
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})(),Gu=(()=>{class o{_ngZone=we(Pn);_document=we(Hi);_styleLoader=we(sr);_renderer=we(rr).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new yt;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=F([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new yt;pointerUp=new yt;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,Du)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,n){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(gx),this._activeDragInstances.update(i=>[...i,e]),this._activeDragInstances().length===1)){let i=n.type.startsWith("touch"),r=s=>this.pointerUp.next(s),a=[["scroll",s=>this._scroll.next(s),Za],["selectstart",this._preventDefaultWhileDragging,Du]];i?a.push(["touchend",r,Za],["touchcancel",r,Za]):a.push(["mouseup",r,Za]),i||a.push(["mousemove",s=>this.pointerMove.next(s),Du]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=a.map(([s,l,c])=>this._renderer.listen(this._document,s,l,c))})}}stopDragging(e){this._activeDragInstances.update(n=>{let i=n.indexOf(e);return i>-1?(n.splice(i,1),[...n]):n}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let n=[this._scroll];return e&&e!==this._document&&n.push(new wu(i=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",a=>{this._activeDragInstances().length&&i.next(a)},Za);return()=>{r()}}))),Ui(...n)}registerDirectiveNode(e,n){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,n)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Sf(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function _x(o){let t=getComputedStyle(o),e=ku(t,"transition-property"),n=e.find(s=>s==="transform"||s==="all");if(!n)return 0;let i=e.indexOf(n),r=ku(t,"transition-duration"),a=ku(t,"transition-delay");return Sf(r[i])+Sf(a[i])}function ku(o,t){return o.getPropertyValue(t).split(",").map(n=>n.trim())}var vx=new Set(["position"]),Lu=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,n,i,r,a,s,l,c,h){this._document=t,this._rootElement=e,this._direction=n,this._initialDomRect=i,this._previewTemplate=r,this._previewClass=a,this._pickupPositionOnPage=s,this._initialTransform=l,this._zIndex=c,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Ef(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return _x(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,n=t?t.template:null,i;if(n&&t){let r=t.matchSize?this._initialDomRect:null,a=t.viewContainer.createEmbeddedView(n,t.context);a.detectChanges(),i=kf(a,this._document),this._previewEmbeddedView=a,t.matchSize?wf(i,r):i.style.transform=es(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else i=Ru(this._rootElement),wf(i,this._initialDomRect),this._initialTransform&&(i.style.transform=this._initialTransform);return Hu(i.style,{"pointer-events":"none",margin:Ef(i)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},vx),$r(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("popover","manual"),i.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>i.classList.add(r)):i.classList.add(e)),i}};function Ef(o){return"showPopover"in o}var xx={passive:!0},Tf={passive:!1},bx={passive:!1,capture:!0},yx=800,Pf="cdk-drag-placeholder",Af=new Set(["position"]);function Rf(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let n=o.get(xi,null,{optional:!0})||o.get(rr).createRenderer(null,null);return new Fu(t,e,o.get(Hi),o.get(Pn),o.get($i),o.get(Gu),n)}var Fu=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=F(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new yt;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=zn.EMPTY;_pointerUpSubscription=zn.EMPTY;_scrollSubscription=zn.EMPTY;_resizeSubscription=zn.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>$r(e,t)))}_disabled=!1;beforeStarted=new yt;started=new yt;released=new yt;ended=new yt;entered=new yt;exited=new yt;dropped=new yt;moved=this._moveEvents;data;constrainPosition;constructor(t,e,n,i,r,a,s){this._config=e,this._document=n,this._ngZone=i,this._viewportRuler=r,this._dragDropRegistry=a,this._renderer=s,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new El(n),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(n=>go(n)),this._handles.forEach(n=>$r(n,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(n=>{this._handles.indexOf(n)>-1&&e.add(n)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=go(t);if(e!==this._rootElement){this._removeRootElementListeners();let n=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[n.listen(e,"mousedown",this._pointerDown,Tf),n.listen(e,"touchstart",this._pointerDown,xx),n.listen(e,"dragstart",this._nativeDragStart,Tf)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?go(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&fx(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),n=0,i=0;e.left<t.left?n=t.left-e.left:e.right>t.right&&(n=t.right-e.right),e.top<t.top?i=t.top-e.top:e.bottom>t.bottom&&(i=t.bottom-e.bottom);let r=this._activeTransform.x,a=this._activeTransform.y,s=r+n,l=a+i;this._rootElement.style.transform=es(s,l),this._activeTransform={x:s,y:l},this._passiveTransform={x:s,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),$r(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),$r(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let i=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(i+r>=this._config.dragStartThreshold){let s=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!s){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let n=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(n),this._dropContainer)this._updateActiveDropContainer(n,e);else{let i=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=n.x-i.x+this._passiveTransform.x,r.y=n.y-i.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:n,event:t,distance:this._getDragDistance(n),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){Ja(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),n=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",Cx,bx)}),n){let i=this._rootElement,r=i.parentNode,a=this._placeholder=this._createPlaceholderElement(),s=this._marker=this._marker||this._document.createComment("");r.insertBefore(s,i),this._initialTransform=i.style.transform||"",this._preview=new Lu(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),Mf(i,!1,Af),this._document.body.appendChild(r.replaceChild(a,i)),this.started.next({source:this,event:t}),n.start(),this._initialContainer=n,this._initialIndex=n.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(n?n.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let n=this.isDragging(),i=Ja(e),r=!i&&e.button!==0,a=this._rootElement,s=Mi(e),l=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+yx>Date.now(),c=i?cf(e):lf(e);if(s&&s.draggable&&e.type==="mousedown"&&e.preventDefault(),n||r||l||c)return;if(this._handles.length){let m=a.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=zu(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let p=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:p.x,y:p.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Mf(this._rootElement,!0,Af),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,n=e.getItemIndex(this),i=this._getPointerPositionOnPage(t),r=this._getDragDistance(i),a=e._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:r,dropPoint:i,event:t}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:r,dropPoint:i,event:t}),e.drop(this,n,this._initialIndex,this._initialContainer,a,r,i,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:n,y:i}){let r=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let a=this._dropContainer.getItemIndex(this),s=this._dropContainer.getItemAtIndex(a+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,s),this._dropContainer=r,this._dropContainer.enter(this,t,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(n,i),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(n=>{let i=s=>{(!s||this._preview&&Mi(s)===this._preview.element&&s.propertyName==="transform")&&(a(),n(),clearTimeout(r))},r=setTimeout(i,e*1.5),a=this._preview.addEventListener("transitionend",i)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,n;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),n=kf(this._placeholderRef,this._document)):n=Ru(this._rootElement),n.style.pointerEvents="none",n.classList.add(Pf),n}_getPointerPositionInElement(t,e,n){let i=e===this._rootElement?null:e,r=i?i.getBoundingClientRect():t,a=Ja(n)?n.targetTouches[0]:n,s=this._getViewportScrollPosition(),l=a.pageX-r.left-s.left,c=a.pageY-r.top-s.top;return{x:r.left-t.left+l,y:r.top-t.top+c}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),n=Ja(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,i=n.pageX-e.left,r=n.pageY-e.top;if(this._ownerSVGElement){let a=this._ownerSVGElement.getScreenCTM();if(a){let s=this._ownerSVGElement.createSVGPoint();return s.x=i,s.y=r,s.matrixTransform(a.inverse())}}return{x:i,y:r}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:n,y:i}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?i=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(n=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:a}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,s=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),h=s.top+a,p=s.bottom-(c-a),m=s.left+r,x=s.right-(l-r);n=If(n,m,x),i=If(i,h,p)}return{x:n,y:i}}_updatePointerDirectionDelta(t){let{x:e,y:n}=t,i=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,a=Math.abs(e-r.x),s=Math.abs(n-r.y);return a>this._config.pointerDirectionChangeThreshold&&(i.x=e>r.x?1:-1,r.x=e),s>this._config.pointerDirectionChangeThreshold&&(i.y=n>r.y?1:-1,r.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,$r(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let n=1/this.scale,i=es(t*n,e*n),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Tl(i,this._initialTransform)}_applyPreviewTransform(t,e){let n=this._previewTemplate?.template?void 0:this._initialTransform,i=es(t,e);this._preview.setTransform(Tl(i,n))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let n=this._rootElement.getBoundingClientRect(),i=this._boundaryElement.getBoundingClientRect();if(i.width===0&&i.height===0||n.width===0&&n.height===0)return;let r=i.left-n.left,a=n.right-i.right,s=i.top-n.top,l=n.bottom-i.bottom;i.width>n.width?(r>0&&(t+=r),a>0&&(t-=a)):t=0,i.height>n.height?(s>0&&(e+=s),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:Ja(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let n=Mi(t);this._boundaryRect&&n!==this._boundaryElement&&n.contains(this._boundaryElement)&&Qa(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=yl(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let n=this._previewContainer||"global";if(n==="parent")return t;if(n==="global"){let i=this._document;return e||i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement||i.body}return go(n)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,n){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let i=this._anchor??=Ru(this._placeholder);i.classList.remove(Pf),i.classList.add("cdk-drag-anchor"),i.style.transform="",n?n.before(i):go(e.element).appendChild(i)}}};function If(o,t,e){return Math.max(t,Math.min(e,o))}function Ja(o){return o.type[0]==="t"}function Cx(o){o.preventDefault()}function Nf(o,t,e){let n=Of(t,o.length-1),i=Of(e,o.length-1);if(n===i)return;let r=o[n],a=i<n?-1:1;for(let s=n;s!==i;s+=a)o[s]=o[s+a];o[i]=r}function Of(o,t){return Math.max(0,Math.min(t,o))}var Pl=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,n,i){let r=this._itemPositions,a=this._getItemIndexFromPointerPosition(t,e,n,i);if(a===-1&&r.length>0)return null;let s=this.orientation==="horizontal",l=r.findIndex(y=>y.drag===t),c=r[a],h=r[l].clientRect,p=c.clientRect,m=l>a?1:-1,x=this._getItemOffsetPx(h,p,m),M=this._getSiblingOffsetPx(l,r,m),S=r.slice();return Nf(r,l,a),r.forEach((y,C)=>{if(S[C]===y)return;let I=y.drag===t,L=I?x:M,k=I?t.getPlaceholderElement():y.drag.getRootElement();y.offset+=L;let H=Math.round(y.offset*(1/y.drag.scale));s?(k.style.transform=Tl(`translate3d(${H}px, 0, 0)`,y.initialTransform),Qa(y.clientRect,0,L)):(k.style.transform=Tl(`translate3d(0, ${H}px, 0)`,y.initialTransform),Qa(y.clientRect,L,0))}),this._previousSwap.overlaps=Nu(p,e,n),this._previousSwap.drag=c.drag,this._previousSwap.delta=s?i.x:i.y,{previousIndex:l,currentIndex:a}}enter(t,e,n,i){let r=this._activeDraggables,a=r.indexOf(t),s=t.getPlaceholderElement();a>-1&&r.splice(a,1);let l=i==null||i<0?this._getItemIndexFromPointerPosition(t,e,n):i,c=r[l];if(c===t&&(c=r[l+1]),!c&&(l==null||l===-1||l<r.length-1)&&this._shouldEnterAsFirstChild(e,n)&&(c=r[0]),c&&!this._dragDropRegistry.isDragging(c)){let h=c.getRootElement();h.parentElement.insertBefore(s,h),r.splice(l,0,t)}else this._element.appendChild(s),r.push(t);s.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let n=this._itemPositions.find(i=>i.drag===t)?.initialTransform;e.style.transform=n||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:n})=>{Qa(n,t,e)}),this._itemPositions.forEach(({drag:n})=>{this._dragDropRegistry.isDragging(n)&&n._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let n=e.getVisibleElement();return{drag:e,offset:0,initialTransform:n.style.transform||"",clientRect:zu(n)}}).sort((e,n)=>t?e.clientRect.left-n.clientRect.left:e.clientRect.top-n.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,n){let i=this.orientation==="horizontal",r=i?e.left-t.left:e.top-t.top;return n===-1&&(r+=i?e.width-t.width:e.height-t.height),r}_getSiblingOffsetPx(t,e,n){let i=this.orientation==="horizontal",r=e[t].clientRect,a=e[t+n*-1],s=r[i?"width":"height"]*n;if(a){let l=i?"left":"top",c=i?"right":"bottom";n===-1?s-=a.clientRect[l]-r[c]:s+=r[l]-a.clientRect[c]}return s}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let n=this._itemPositions,i=this.orientation==="horizontal";if(n[0].drag!==this._activeDraggables[0]){let a=n[n.length-1].clientRect;return i?t>=a.right:e>=a.bottom}else{let a=n[0].clientRect;return i?t<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(t,e,n,i){let r=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:s,clientRect:l})=>{if(s===t)return!1;if(i){let c=r?i.x:i.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&c===this._previousSwap.delta)return!1}return r?e>=Math.floor(l.left)&&e<Math.floor(l.right):n>=Math.floor(l.top)&&n<Math.floor(l.bottom)});return a===-1||!this._sortPredicate(a,t)?-1:a}},Vu=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let n=0;n<e.length;n++){let i=e[n];this._relatedNodes.push([i,i.nextSibling])}this.withItems(t)}sort(t,e,n,i){let r=this._getItemIndexFromPointerPosition(t,e,n),a=this._previousSwap;if(r===-1||this._activeItems[r]===t)return null;let s=this._activeItems[r];if(a.drag===s&&a.overlaps&&a.deltaX===i.x&&a.deltaY===i.y)return null;let l=this.getItemIndex(t),c=t.getPlaceholderElement(),h=s.getRootElement();r>l?h.after(c):h.before(c),Nf(this._activeItems,l,r);let p=this._getRootNode().elementFromPoint(e,n);return a.deltaX=i.x,a.deltaY=i.y,a.drag=s,a.overlaps=h===p||h.contains(p),{previousIndex:l,currentIndex:r}}enter(t,e,n,i){let r=this._activeItems.indexOf(t);r>-1&&this._activeItems.splice(r,1);let a=i==null||i<0?this._getItemIndexFromPointerPosition(t,e,n):i;a===-1&&(a=this._getClosestItemIndexToPointer(t,e,n));let s=this._activeItems[a];s&&!this._dragDropRegistry.isDragging(s)?(this._activeItems.splice(a,0,t),s.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let n=this._relatedNodes.length-1;n>-1;n--){let[i,r]=this._relatedNodes[n];i.parentNode===t&&i.nextSibling!==r&&(r===null?t.appendChild(i):r.parentNode===t&&t.insertBefore(i,r))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,n){let i=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(n)),r=i?this._activeItems.findIndex(a=>{let s=a.getRootElement();return i===s||s.contains(i)}):-1;return r===-1||!this._sortPredicate(r,t)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=yl(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,n){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let i=1/0,r=-1;for(let a=0;a<this._activeItems.length;a++){let s=this._activeItems[a];if(s!==t){let{x:l,y:c}=s.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,n-c);h<i&&(i=h,r=a)}}return r}},Df=.05,Lf=.05,mi=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(mi||{}),Hn=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(Hn||{});function Ff(o,t){return new Bu(t,o.get(Gu),o.get(Hi),o.get(Pn),o.get($i))}var Bu=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new yt;entered=new yt;exited=new yt;dropped=new yt;sorted=new yt;receivingStarted=new yt;receivingStopped=new yt;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=zn.EMPTY;_verticalScrollDirection=mi.NONE;_horizontalScrollDirection=Hn.NONE;_scrollNode;_stopScrollTimers=new yt;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,n,i,r){this._dragDropRegistry=e,this._ngZone=i,this._viewportRuler=r;let a=this.element=go(t);this._document=n,this.withOrientation("vertical").withElementContainer(a),e.registerDropContainer(this),this._parentPositions=new El(n)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,n,i){this._draggingStarted(),i==null&&this.sortingDisabled&&(i=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,n,i),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,n,i,r,a,s,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:n,container:this,previousContainer:i,isPointerOverContainer:r,distance:a,dropPoint:s,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(n=>n._withDropContainer(this)),this.isDragging()&&(e.filter(i=>i.isDragging()).every(i=>t.indexOf(i)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Pl&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new Vu(this._document,this._dragDropRegistry);else{let e=new Pl(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,n)=>this.sortPredicate(e,n,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=go(this.element),n=this._scrollableElements.indexOf(this._container),i=this._scrollableElements.indexOf(t);return n>-1&&this._scrollableElements.splice(n,1),i>-1&&this._scrollableElements.splice(i,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,n,i){if(this.sortingDisabled||!this._domRect||!Cf(this._domRect,Df,e,n))return;let r=this._sortStrategy.sort(t,e,n,i);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let n,i=mi.NONE,r=Hn.NONE;if(this._parentPositions.positions.forEach((a,s)=>{s===this._document||!a.clientRect||n||Cf(a.clientRect,Df,t,e)&&([i,r]=Mx(s,a.clientRect,this._direction,t,e),(i||r)&&(n=s))}),!i&&!r){let{width:a,height:s}=this._viewportRuler.getViewportSize(),l={width:a,height:s,top:0,right:a,bottom:s,left:0};i=Vf(l,e),r=Bf(l,t),n=window}n&&(i!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||n!==this._scrollNode)&&(this._verticalScrollDirection=i,this._horizontalScrollDirection=r,this._scrollNode=n,(i||r)&&n?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Lm(0,Dm).pipe(ni(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===mi.UP?t.scrollBy(0,-e):this._verticalScrollDirection===mi.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===Hn.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===Hn.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Nu(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,n){return this._siblings.find(i=>i._canReceive(t,e,n))}_canReceive(t,e,n){if(!this._domRect||!Nu(this._domRect,e,n)||!this.enterPredicate(t,this))return!1;let i=this._getShadowRoot().elementFromPoint(e,n);return i?i===this._container||this._container.contains(i):!1}_startReceiving(t,e){let n=this._activeSiblings;!n.has(t)&&e.every(i=>this.enterPredicate(i,this)||this._draggables.indexOf(i)>-1)&&(n.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=yl(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Vf(o,t){let{top:e,bottom:n,height:i}=o,r=i*Lf;return t>=e-r&&t<=e+r?mi.UP:t>=n-r&&t<=n+r?mi.DOWN:mi.NONE}function Bf(o,t){let{left:e,right:n,width:i}=o,r=i*Lf;return t>=e-r&&t<=e+r?Hn.LEFT:t>=n-r&&t<=n+r?Hn.RIGHT:Hn.NONE}function Mx(o,t,e,n,i){let r=Vf(t,i),a=Bf(t,n),s=mi.NONE,l=Hn.NONE;if(r){let c=o.scrollTop;r===mi.UP?c>0&&(s=mi.UP):o.scrollHeight-c>o.clientHeight&&(s=mi.DOWN)}if(a){let c=o.scrollLeft;e==="rtl"?a===Hn.RIGHT?c<0&&(l=Hn.RIGHT):o.scrollWidth+c>o.clientWidth&&(l=Hn.LEFT):a===Hn.LEFT?c>0&&(l=Hn.LEFT):o.scrollWidth-c>o.clientWidth&&(l=Hn.RIGHT)}return[s,l]}var wx=(()=>{class o{_injector=we(ii);constructor(){}createDrag(e,n){return Rf(this._injector,e,n)}createDropList(e){return Ff(this._injector,e)}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Al=new Lt("CDK_DRAG_PARENT");var Sx=new Lt("CdkDragHandle");var Uf=new Lt("CDK_DRAG_CONFIG"),zf=new Lt("CdkDropList"),Hf=(()=>{class o{element=we(_n);dropContainer=we(zf,{optional:!0,skipSelf:!0});_ngZone=we(Pn);_viewContainerRef=we(vl);_dir=we(qi,{optional:!0});_changeDetectorRef=we(Dn);_selfHandle=we(Sx,{optional:!0,self:!0});_parentDrag=we(Al,{optional:!0,skipSelf:!0});_dragDropRegistry=we(Gu);_destroyed=new yt;_handles=new Om([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new Ft;released=new Ft;ended=new Ft;entered=new Ft;exited=new Ft;dropped=new Ft;moved=new wu(e=>{let n=this._dragRef.moved.pipe(ho(i=>({source:this,pointerPosition:i.pointerPosition,event:i.event,delta:i.delta,distance:i.distance}))).subscribe(e);return()=>{n.unsubscribe()}});_injector=we(ii);constructor(){let e=this.dropContainer,n=we(Uf,{optional:!0});this._dragRef=Rf(this._injector,this.element,{dragStartThreshold:n&&n.dragStartThreshold!=null?n.dragStartThreshold:5,pointerDirectionChangeThreshold:n&&n.pointerDirectionChangeThreshold!=null?n.pointerDirectionChangeThreshold:5,zIndex:n?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),n&&this._assignDefaults(n),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(ni(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){Ur(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let n=e.rootElementSelector,i=e.freeDragPosition;n&&!n.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,i&&!i.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let n=this._handles.getValue();n.push(e),this._handles.next(n)}_removeHandle(e){let n=this._handles.getValue(),i=n.indexOf(e);i>-1&&(n.splice(i,1),this._handles.next(n))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,n=e;this.rootElementSelector&&(n=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(n||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):go(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let n=this._dir,i=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof i=="object"&&i?i:Pu(i),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(a).withPreviewContainer(this.previewContainer||"global"),n&&e.withDirection(n.value)}}),e.beforeStarted.pipe(fl(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let n=this.element.nativeElement.parentElement;for(;n;){let i=this._dragDropRegistry.getDragDirectiveForNode(n);if(i){e.withParent(i._dragRef);break}n=n.parentElement}})}_handleEvents(e){e.started.subscribe(n=>{this.started.emit({source:this,event:n.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(n=>{this.released.emit({source:this,event:n.event})}),e.ended.subscribe(n=>{this.ended.emit({source:this,distance:n.distance,dropPoint:n.dropPoint,event:n.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(n=>{this.entered.emit({container:n.container.data,item:this,currentIndex:n.currentIndex})}),e.exited.subscribe(n=>{this.exited.emit({container:n.container.data,item:this})}),e.dropped.subscribe(n=>{this.dropped.emit({previousIndex:n.previousIndex,currentIndex:n.currentIndex,previousContainer:n.previousContainer.data,container:n.container.data,isPointerOverContainer:n.isPointerOverContainer,item:this,distance:n.distance,dropPoint:n.dropPoint,event:n.event})})}_assignDefaults(e){let{lockAxis:n,dragStartDelay:i,constrainPosition:r,previewClass:a,boundaryElement:s,draggingDisabled:l,rootElementSelector:c,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=i||0,this.lockAxis=n||null,r&&(this.constrainPosition=r),a&&(this.previewClass=a),s&&(this.boundaryElement=s),c&&(this.rootElementSelector=c),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Bm(e=>{let n=e.map(i=>i.element);this._selfHandle&&this.rootElementSelector&&n.push(this.element),this._dragRef.withHandles(n)}),Xa(e=>Ui(...e.map(n=>n._stateChanges.pipe(Ro(n))))),ni(this._destroyed)).subscribe(e=>{let n=this._dragRef,i=e.element.nativeElement;e.disabled?n.disableHandle(i):n.enableHandle(i)})}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(n,i){n&2&&oe("cdk-drag-disabled",i.disabled)("cdk-drag-dragging",i._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",$t],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ya]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[On([{provide:Al,useExisting:o}]),Nn]})}return o})(),Uu=new Lt("CdkDropListGroup"),Gf=(()=>{class o{_items=new Set;disabled=!1;ngOnDestroy(){this._items.clear()}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["","cdkDropListGroup",""]],inputs:{disabled:[2,"cdkDropListGroupDisabled","disabled",$t]},exportAs:["cdkDropListGroup"],features:[On([{provide:Uu,useExisting:o}])]})}return o})(),Wf=(()=>{class o{element=we(_n);_changeDetectorRef=we(Dn);_scrollDispatcher=we(Ka);_dir=we(qi,{optional:!0});_group=we(Uu,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new yt;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=we(wi).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new Ft;entered=new Ft;exited=new Ft;sorted=new Ft;_unsortedItems=new Set;constructor(){let e=we(Uf,{optional:!0}),n=we(ii);this._dropListRef=Ff(n,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(i,r)=>this.enterPredicate(i.data,r.data),this._dropListRef.sortPredicate=(i,r,a)=>this.sortPredicate(i,r.data,a.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(n=>n._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let n=this._latestSortedRefs.indexOf(e._dragRef);n>-1&&(this._latestSortedRefs.splice(n,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,n)=>e._dragRef.getVisibleElement().compareDocumentPosition(n._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(Ro(this._dir.value),ni(this._destroyed)).subscribe(n=>e.withDirection(n)),e.beforeStarted.subscribe(()=>{let n=ja(this.connectedTo).map(i=>{if(typeof i=="string"){let r=o._dropLists.find(a=>a.id===i);return r}return i});if(this._group&&this._group._items.forEach(i=>{n.indexOf(i)===-1&&n.push(i)}),!this._scrollableParentsResolved){let i=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(i),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let i=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(i)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=Pu(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(n.filter(i=>i&&i!==this).map(i=>i._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(n=>n._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(n=>{this.entered.emit({container:this,item:n.item.data,currentIndex:n.currentIndex})}),e.exited.subscribe(n=>{this.exited.emit({container:this,item:n.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(n=>{this.sorted.emit({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:n.item.data})}),e.dropped.subscribe(n=>{this.dropped.emit({previousIndex:n.previousIndex,currentIndex:n.currentIndex,previousContainer:n.previousContainer.data,container:n.container.data,item:n.item.data,isPointerOverContainer:n.isPointerOverContainer,distance:n.distance,dropPoint:n.dropPoint,event:n.event}),this._changeDetectorRef.markForCheck()}),Ui(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:n,draggingDisabled:i,sortingDisabled:r,listAutoScrollDisabled:a,listOrientation:s}=e;this.disabled=i??!1,this.sortingDisabled=r??!1,this.autoScrollDisabled=a??!1,this.orientation=s||"vertical",this.lockAxis=n||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(n,i){n&2&&(Jt("id",i.id),oe("cdk-drop-list-disabled",i.disabled)("cdk-drop-list-dragging",i._dropListRef.isDragging())("cdk-drop-list-receiving",i._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",$t],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",$t],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",$t],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",$t]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[On([{provide:Uu,useValue:void 0},{provide:zf,useExisting:o}])]})}return o})(),Ex=new Lt("CdkDragPreview"),Xf=(()=>{class o{templateRef=we(qa);_drag=we(Al,{optional:!0});data;matchSize=!1;constructor(){this._drag?._setPreviewTemplate(this)}ngOnDestroy(){this._drag?._resetPreviewTemplate(this)}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["ng-template","cdkDragPreview",""]],inputs:{data:"data",matchSize:[2,"matchSize","matchSize",$t]},features:[On([{provide:Ex,useExisting:o}])]})}return o})(),Tx=new Lt("CdkDragPlaceholder"),qf=(()=>{class o{templateRef=we(qa);_drag=we(Al,{optional:!0});data;constructor(){this._drag?._setPlaceholderTemplate(this)}ngOnDestroy(){this._drag?._resetPlaceholderTemplate(this)}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"},features:[On([{provide:Tx,useExisting:o}])]})}return o})();var $f=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({providers:[wx],imports:[Cl]})}return o})();var Il=()=>[];function Ix(o,t){if(o&1&&(_(0,"span",5),u(1),f(),_(2,"span",6),u(3),f()),o&2){let e=g(),n=e.$implicit,i=e.$index;d(),D(n.name||"Category "+(i+1)),d(2),D((n.items||Xi(2,Il)).length)}}function Ox(o,t){if(o&1&&(_(0,"th"),u(1),f()),o&2){let e=t.$implicit;d(),D(e)}}function Dx(o,t){if(o&1&&(_(0,"td"),u(1),f()),o&2){let e=t.$implicit,n=g().$implicit,i=g(5);d(),D(i.asText(n[e]))}}function kx(o,t){if(o&1){let e=Z();_(0,"tr",9),z("click",function(){let i=P(e),r=i.$implicit,a=i.$index,s=g(3),l=s.$implicit,c=s.$index,h=g(2);return A(h.selectCategoryItem(l,r,a,c))}),ve(1,Dx,2,1,"td",null,ct),f()}if(o&2){let e=t.$index,n=g(3),i=n.$implicit,r=n.$index,a=g(2);oe("selectable",a.isSelectable())("selected",a.isSelected(r,e)),d(),xe(a.keys(i))}}function Rx(o,t){if(o&1&&(_(0,"table",7)(1,"thead")(2,"tr"),ve(3,Ox,2,1,"th",null,ct),f()(),_(5,"tbody"),ve(6,kx,3,4,"tr",8,ct),f()()),o&2){let e=g(2).$implicit,n=g(2);d(3),xe(n.keys(e)),d(3),xe(e.items||Xi(0,Il))}}function Nx(o,t){if(o&1){let e=Z();_(0,"button",11),z("click",function(){let i=P(e),r=i.$implicit,a=i.$index,s=g(3),l=s.$implicit,c=s.$index,h=g(2);return A(h.selectCategoryItem(l,r,a,c))}),u(1),po(2,"json"),f()}if(o&2){let e=t.$implicit,n=t.$index,i=g(3).$index,r=g(2);oe("selectable",r.isSelectable())("selected",r.isSelected(i,n)),Q("disabled",!r.isSelectable()),d(),me(" ",mo(2,6,e)," ")}}function Lx(o,t){if(o&1&&ve(0,Nx,3,8,"button",10,ct),o&2){let e=g(2).$implicit;xe(e.items||Xi(0,Il))}}function Fx(o,t){if(o&1&&(_(0,"section",4),R(1,Rx,8,1,"table",7)(2,Lx,2,1),f()),o&2){let e=g().$implicit,n=g(2);d(),N(n.keys(e).length>0?1:2)}}function Vx(o,t){o&1&&(_(0,"p",1),u(1,"No entries in this category."),f())}function Bx(o,t){if(o&1&&(_(0,"mat-tab"),bi(1,Ix,4,3,"ng-template",3),R(2,Fx,3,1,"section",4)(3,Vx,2,0,"p",1),f()),o&2){let e=t.$implicit;d(2),N((e.items||Xi(1,Il)).length>0?2:3)}}function Ux(o,t){if(o&1&&(_(0,"div",0)(1,"mat-tab-group",2),ve(2,Bx,4,2,"mat-tab",null,ct),f()()),o&2){let e=g();d(),Q("selectedIndex",0),d(),xe(e.categories())}}function zx(o,t){o&1&&(_(0,"p",1),u(1,"No categories available."),f())}var Yf=(()=>{class o{constructor(){this.options=en.required(),this.selectionChanged=Qt(),this.selected=F(null),this.categories=le(()=>this.options().categories??this.options().data?.categories??[]),this.selectable=le(()=>this.options().selectable===!0||this.options().clickable===!0)}keys(e){let n=e.items?.[0];return n?Object.keys(n):[]}asText(e){return e==null?"":typeof e=="object"?JSON.stringify(e):String(e)}selectCategoryItem(e,n,i,r){this.selectable()&&(this.selected.set({categoryIndex:r,itemIndex:i}),this.selectionChanged.emit({category:e.name??null,categoryIndex:r,index:i,selected:n}))}isSelected(e,n){let i=this.selected();return i?.categoryIndex===e&&i.itemIndex===n}isSelectable(){return this.selectable()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-categorized-list-modal"]],inputs:{options:[1,"options"]},outputs:{selectionChanged:"selectionChanged"},decls:2,vars:1,consts:[[1,"categorized-list"],[1,"categorized-empty"],["animationDuration","0ms","dynamicHeight","",1,"categorized-tabs",3,"selectedIndex"],["mat-tab-label",""],[1,"category-panel","scrollbar-neon"],[1,"tab-label"],[1,"tab-count"],[1,"category-table"],[1,"category-row",3,"selectable","selected"],[1,"category-row",3,"click"],["type","button",1,"category-fallback-row",3,"selectable","selected","disabled"],["type","button",1,"category-fallback-row",3,"click","disabled"]],template:function(n,i){n&1&&R(0,Ux,4,1,"div",0)(1,zx,2,0,"p",1),n&2&&N(i.categories().length>0?0:1)},dependencies:[tt,Sl,vf,Ml,wl,bl],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:0}.categorized-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:.85rem .95rem;width:100%;box-sizing:border-box;min-height:0}.categorized-tabs[_ngcontent-%COMP%]{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;--mdc-tab-indicator-active-indicator-color: var(--sw-accent);--mat-tab-header-active-label-text-color: var(--sw-text);--mat-tab-header-active-ripple-color: rgba(209, 27, 45, .18);--mat-tab-header-inactive-ripple-color: rgba(209, 27, 45, .12);border:1px solid rgba(255,255,255,.12);border-radius:12px;overflow:hidden;background:#1113186b}.tab-label[_ngcontent-%COMP%]{font-size:.76rem;font-weight:600;letter-spacing:.02em}.tab-count[_ngcontent-%COMP%]{margin-left:.45rem;display:inline-grid;place-items:center;min-width:1.25rem;height:1.15rem;border-radius:999px;padding:0 .35rem;font-size:.68rem;background:#ffffff1f}.category-panel[_ngcontent-%COMP%]{padding:.65rem .7rem .75rem;max-height:min(56vh,30rem);overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable}.category-panel[_ngcontent-%COMP%]::-webkit-scrollbar{width:.6rem;background:transparent}.category-panel[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#d11b2d0d;border-radius:999px;margin:.3rem 0}.category-panel[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:999px;background:linear-gradient(180deg,#d11b2da6,#d11b2d6b);border:1px solid rgba(209,27,45,.32)}.category-panel[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#d11b2de0,#d11b2d9e)}.category-panel[_ngcontent-%COMP%]{scrollbar-color:rgba(209,27,45,.7) rgba(209,27,45,.08);scrollbar-width:thin}.category-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;white-space:nowrap}.category-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .category-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.56rem .62rem}.category-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:uppercase;letter-spacing:.05em;font-size:.7rem;color:var(--sw-text-soft);border-bottom:1px solid rgba(255,255,255,.12)}.category-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:.82rem;color:var(--sw-text);border-top:1px solid rgba(255,255,255,.06)}.category-row[_ngcontent-%COMP%]{transition:background .12s ease}.category-row.selectable[_ngcontent-%COMP%]{cursor:pointer}.category-row.selectable[_ngcontent-%COMP%]:hover{background:#ffffff0f}.category-row.selected[_ngcontent-%COMP%]{background:var(--sw-accent-soft)}.category-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:first-child td[_ngcontent-%COMP%]{border-top:0}.category-fallback-row[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:.45rem .55rem;color:var(--sw-text);font-size:.79rem;background:#ffffff05;cursor:default}.category-fallback-row[_ngcontent-%COMP%] + .category-fallback-row[_ngcontent-%COMP%]{margin-top:.4rem}.category-fallback-row.selectable[_ngcontent-%COMP%]{cursor:pointer}.category-fallback-row.selectable[_ngcontent-%COMP%]:hover{background:#ffffff0f}.category-fallback-row.selected[_ngcontent-%COMP%]{background:var(--sw-accent-soft);border-color:#d11b2d6b}.category-fallback-row[_ngcontent-%COMP%]:disabled{opacity:1}.categorized-empty[_ngcontent-%COMP%]{margin:0}.categorized-empty[_ngcontent-%COMP%]{padding:.85rem .95rem;color:var(--sw-text-soft)}[_nghost-%COMP%] .categorized-tabs .mat-mdc-tab-header{background:linear-gradient(180deg,#ffffff14,#ffffff05);border-bottom:1px solid rgba(255,255,255,.1)}[_nghost-%COMP%] .categorized-tabs .mat-mdc-tab-body-wrapper, [_nghost-%COMP%] .categorized-tabs .mat-mdc-tab-body, [_nghost-%COMP%] .categorized-tabs .mat-mdc-tab-body-content{display:block}[_nghost-%COMP%] .categorized-tabs .mdc-tab__text-label{color:var(--sw-text-soft)}[_nghost-%COMP%] .categorized-tabs .mdc-tab--active .mdc-tab__text-label{color:var(--sw-text)}[_nghost-%COMP%] .categorized-tabs .mdc-tab-indicator--active .mdc-tab-indicator__content--underline, [_nghost-%COMP%] .categorized-tabs .mdc-tab-indicator__content--underline{border-color:var(--sw-accent)}"],changeDetection:0})}}return o})();function Hx(o,t){if(o&1&&Te(0,"p",0),o&2){let e=g(2);Ee("innerHTML",e.options().message||"",an)}}function Gx(o,t){if(o&1&&(v(0,"p",1),u(1),b()),o&2){let e=g(2);d(),D(e.options().message)}}function Wx(o,t){if(o&1&&R(0,Hx,1,1,"p",0)(1,Gx,2,1,"p",1),o&2){let e=g();N(e.isHtml()?0:1)}}var jf=(()=>{class o{constructor(){this.options=en.required(),this.isHtml=le(()=>this.options().html===!0)}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-confirmation-modal"]],inputs:{options:[1,"options"]},decls:1,vars:1,consts:[[1,"confirmation-copy",3,"innerHTML"],[1,"confirmation-copy"]],template:function(n,i){n&1&&R(0,Wx,2,1),n&2&&N(i.options().message?0:-1)},dependencies:[tt],styles:[".confirmation-copy[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem}"],changeDetection:0})}}return o})();var ts=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected=null;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new yt;constructor(t=!1,e,n=!0,i){this._multiple=t,this._emitChanges=n,this.compareWith=i,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(n=>this._markSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(n=>this._unmarkSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,n=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!n.has(this._getConcreteValue(r,n))).forEach(r=>this._unmarkSelected(r));let i=this._hasQueuedChanges();return this._emitChangeEvent(),i}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let n of e)if(this.compareWith(t,n))return n;return t}else return t}};var Kf=ff();function og(o){return new Ol(o.get($i),o.get(Hi))}var Ol=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=mn(-this._previousScrollPosition.left),t.style.top=mn(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,n=t.style,i=e.style,r=n.scrollBehavior||"",a=i.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Kf&&(n.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Kf&&(n.scrollBehavior=r,i.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}};function rg(o,t){return new Dl(o.get(Ka),o.get(Pn),o.get($i),t)}var Dl=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,n,i){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=i}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(ir(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var ns=class{enable(){}disable(){}attach(){}};function Xu(o,t){return t.some(e=>{let n=o.bottom<e.top,i=o.top>e.bottom,r=o.right<e.left,a=o.left>e.right;return n||i||r||a})}function Zf(o,t){return t.some(e=>{let n=o.top<e.top,i=o.bottom>e.bottom,r=o.left<e.left,a=o.right>e.right;return n||i||r||a})}function os(o,t){return new kl(o.get(Ka),o.get($i),o.get(Pn),t)}var kl=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,n,i){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=i}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:i}=this._viewportRuler.getViewportSize();Xu(e,[{width:n,height:i,bottom:i,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ag=(()=>{class o{_injector=we(ii);constructor(){}noop=()=>new ns;close=e=>rg(this._injector,e);block=()=>og(this._injector);reposition=e=>os(this._injector,e);static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),is=class{positionStrategy;scrollStrategy=new ns;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;usePopover;eventPredicate;constructor(t){if(t){let e=Object.keys(t);for(let n of e)t[n]!==void 0&&(this[n]=t[n])}}};var Rl=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var sg=(()=>{class o{_attachedOverlays=[];_document=we(Hi);_isAttached=!1;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}canReceiveEvent(e,n,i){return i.observers.length<1?!1:e.eventPredicate?e.eventPredicate(n):!0}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),lg=(()=>{class o extends sg{_ngZone=we(Pn);_renderer=we(rr).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let n=this._attachedOverlays;for(let i=n.length-1;i>-1;i--){let r=n[i];if(this.canReceiveEvent(r,e,r._keydownEvents)){this._ngZone.run(()=>r._keydownEvents.next(e));break}}};static \u0275fac=(()=>{let e;return function(i){return(e||(e=or(o)))(i||o)}})();static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),cg=(()=>{class o extends sg{_platform=we(Xr);_ngZone=we(Pn);_renderer=we(rr).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget=null;_cleanups;add(e){if(super.add(e),!this._isAttached){let n=this._document.body,i={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(n,"pointerdown",this._pointerDownListener,i),r.listen(n,"click",this._clickListener,i),r.listen(n,"auxclick",this._clickListener,i),r.listen(n,"contextmenu",this._clickListener,i)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=Mi(e)};_clickListener=e=>{let n=Mi(e),i=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:n;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let s=r[a],l=s._outsidePointerEvents;if(!(!s.hasAttached()||!this.canReceiveEvent(s,e,l))){if(Jf(s.overlayElement,n)||Jf(s.overlayElement,i))break;this._ngZone?this._ngZone.run(()=>l.next(e)):l.next(e)}}};static \u0275fac=(()=>{let e;return function(i){return(e||(e=or(o)))(i||o)}})();static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Jf(o,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,n=t;for(;n;){if(n===o)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var dg=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(n,i){},styles:[`.cdk-overlay-container, .cdk-global-overlay-wrapper {
|
|
pointer-events: none;
|
|
top: 0;
|
|
left: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
.cdk-overlay-container {
|
|
position: fixed;
|
|
}
|
|
@layer cdk-overlay {
|
|
.cdk-overlay-container {
|
|
z-index: 1000;
|
|
}
|
|
}
|
|
.cdk-overlay-container:empty {
|
|
display: none;
|
|
}
|
|
|
|
.cdk-global-overlay-wrapper {
|
|
display: flex;
|
|
position: absolute;
|
|
}
|
|
@layer cdk-overlay {
|
|
.cdk-global-overlay-wrapper {
|
|
z-index: 1000;
|
|
}
|
|
}
|
|
|
|
.cdk-overlay-pane {
|
|
position: absolute;
|
|
pointer-events: auto;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
}
|
|
@layer cdk-overlay {
|
|
.cdk-overlay-pane {
|
|
z-index: 1000;
|
|
}
|
|
}
|
|
|
|
.cdk-overlay-backdrop {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
pointer-events: auto;
|
|
-webkit-tap-highlight-color: transparent;
|
|
opacity: 0;
|
|
touch-action: manipulation;
|
|
}
|
|
@layer cdk-overlay {
|
|
.cdk-overlay-backdrop {
|
|
z-index: 1000;
|
|
transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
}
|
|
}
|
|
@media (prefers-reduced-motion) {
|
|
.cdk-overlay-backdrop {
|
|
transition-duration: 1ms;
|
|
}
|
|
}
|
|
|
|
.cdk-overlay-backdrop-showing {
|
|
opacity: 1;
|
|
}
|
|
@media (forced-colors: active) {
|
|
.cdk-overlay-backdrop-showing {
|
|
opacity: 0.6;
|
|
}
|
|
}
|
|
|
|
@layer cdk-overlay {
|
|
.cdk-overlay-dark-backdrop {
|
|
background: rgba(0, 0, 0, 0.32);
|
|
}
|
|
}
|
|
|
|
.cdk-overlay-transparent-backdrop {
|
|
transition: visibility 1ms linear, opacity 1ms linear;
|
|
visibility: hidden;
|
|
opacity: 1;
|
|
}
|
|
.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing, .cdk-high-contrast-active .cdk-overlay-transparent-backdrop {
|
|
opacity: 0;
|
|
visibility: visible;
|
|
}
|
|
|
|
.cdk-overlay-backdrop-noop-animation {
|
|
transition: none;
|
|
}
|
|
|
|
.cdk-overlay-connected-position-bounding-box {
|
|
position: absolute;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 1px;
|
|
min-height: 1px;
|
|
}
|
|
@layer cdk-overlay {
|
|
.cdk-overlay-connected-position-bounding-box {
|
|
z-index: 1000;
|
|
}
|
|
}
|
|
|
|
.cdk-global-scrollblock {
|
|
position: fixed;
|
|
width: 100%;
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
.cdk-overlay-popover {
|
|
background: none;
|
|
border: none;
|
|
padding: 0;
|
|
outline: 0;
|
|
overflow: visible;
|
|
position: fixed;
|
|
pointer-events: none;
|
|
white-space: normal;
|
|
color: inherit;
|
|
text-decoration: none;
|
|
width: 100%;
|
|
height: 100%;
|
|
inset: auto;
|
|
top: 0;
|
|
left: 0;
|
|
}
|
|
.cdk-overlay-popover::backdrop {
|
|
display: none;
|
|
}
|
|
.cdk-overlay-popover .cdk-overlay-backdrop {
|
|
position: fixed;
|
|
z-index: auto;
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})(),ug=(()=>{class o{_platform=we(Xr);_containerElement;_document=we(Hi);_styleLoader=we(sr);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Iu()){let i=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<i.length;r++)i[r].remove()}let n=this._document.createElement("div");n.classList.add(e),Iu()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}_loadStyles(){this._styleLoader.load(dg)}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),qu=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,n,i){this._renderer=e,this._ngZone=n,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",i)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}};function $u(o){return o&&o.nodeType===1}var Nl=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new yt;_attachments=new yt;_detachments=new yt;_positionStrategy;_scrollStrategy;_locationChanges=zn.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_disposed=!1;_previousHostParent;_keydownEvents=new yt;_outsidePointerEvents=new yt;_afterNextRenderRef;constructor(t,e,n,i,r,a,s,l,c,h=!1,p,m){this._portalOutlet=t,this._host=e,this._pane=n,this._config=i,this._ngZone=r,this._keyboardDispatcher=a,this._document=s,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=h,this._injector=p,this._renderer=m,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}get eventPredicate(){return this._config?.eventPredicate||null}attach(t){if(this._disposed)return null;this._attachHost();let e=this._portalOutlet.attach(t);return this._positionStrategy?.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Ur(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){if(this._disposed)return;let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent(),this._disposed=!0}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=he(he({},this._config),t),this._updateElementSize()}setDirection(t){this._config=De(he({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=mn(this._config.width),t.height=mn(this._config.height),t.minWidth=mn(this._config.minWidth),t.minHeight=mn(this._config.minHeight),t.maxWidth=mn(this._config.maxWidth),t.maxHeight=mn(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachHost(){if(!this._host.parentElement){let t=this._config.usePopover?this._positionStrategy?.getPopoverInsertionPoint?.():null;$u(t)?t.after(this._host):t?.type==="parent"?t.element.appendChild(this._host):this._previousHostParent?.appendChild(this._host)}if(this._config.usePopover)try{this._host.showPopover()}catch{}}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new qu(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._config.usePopover?this._host.prepend(this._backdropRef.element):this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){!this._config.usePopover&&this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,n){let i=ja(e||[]).filter(r=>!!r);i.length&&(n?t.classList.add(...i):t.classList.remove(...i))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Ur(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Qf="cdk-overlay-connected-position-bounding-box",Xx=/([A-Za-z%]+)$/;function Yu(o,t){return new Ll(t,o.get($i),o.get(Hi),o.get(Xr),o.get(ug))}var Ll=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender=!1;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed=!1;_boundingBox=null;_lastPosition=null;_lastScrollVisibility=null;_positionChanges=new yt;_resizeSubscription=zn.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount=null;_popoverLocation="global";positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,n,i,r){this._viewportRuler=e,this._document=n,this._platform=i,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Qf),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._getContainerRect();let t=this._originRect,e=this._overlayRect,n=this._viewportRect,i=this._containerRect,r=[],a;for(let s of this._preferredPositions){let l=this._getOriginPoint(t,i,s),c=this._getOverlayPoint(l,e,s),h=this._getOverlayFit(c,e,n,s);if(h.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(s,l);return}if(this._canFitWithFlexibleDimensions(h,c,n)){r.push({position:s,origin:l,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(l,s)});continue}(!a||a.overlayFit.visibleArea<h.visibleArea)&&(a={overlayFit:h,overlayPoint:c,originPoint:l,position:s,overlayRect:e})}if(r.length){let s=null,l=-1;for(let c of r){let h=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);h>l&&(l=h,s=c)}this._isPushed=!1,this._applyPosition(s.position,s.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&lr(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Qf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;t?(this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._getContainerRect(),this._applyPosition(t,this._getOriginPoint(this._originRect,this._containerRect,t))):this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}withPopoverLocation(t){return this._popoverLocation=t,this}getPopoverInsertionPoint(){return this._popoverLocation==="global"?null:this._popoverLocation!=="inline"?this._popoverLocation:this._origin instanceof _n?this._origin.nativeElement:$u(this._origin)?this._origin:null}_getOriginPoint(t,e,n){let i;if(n.originX=="center")i=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,s=this._isRtl()?t.left:t.right;i=n.originX=="start"?a:s}e.left<0&&(i-=e.left);let r;return n.originY=="center"?r=t.top+t.height/2:r=n.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:i,y:r}}_getOverlayPoint(t,e,n){let i;n.overlayX=="center"?i=-e.width/2:n.overlayX==="start"?i=this._isRtl()?-e.width:0:i=this._isRtl()?0:-e.width;let r;return n.overlayY=="center"?r=-e.height/2:r=n.overlayY=="top"?0:-e.height,{x:t.x+i,y:t.y+r}}_getOverlayFit(t,e,n,i){let r=tg(e),{x:a,y:s}=t,l=this._getOffset(i,"x"),c=this._getOffset(i,"y");l&&(a+=l),c&&(s+=c);let h=0-a,p=a+r.width-n.width,m=0-s,x=s+r.height-n.height,M=this._subtractOverflows(r.width,h,p),S=this._subtractOverflows(r.height,m,x),y=M*S;return{visibleArea:y,isCompletelyWithinViewport:r.width*r.height===y,fitsInViewportVertically:S===r.height,fitsInViewportHorizontally:M==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){let i=n.bottom-e.y,r=n.right-e.x,a=eg(this._overlayRef.getConfig().minHeight),s=eg(this._overlayRef.getConfig().minWidth),l=t.fitsInViewportVertically||a!=null&&a<=i,c=t.fitsInViewportHorizontally||s!=null&&s<=r;return l&&c}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let i=tg(e),r=this._viewportRect,a=Math.max(t.x+i.width-r.width,0),s=Math.max(t.y+i.height-r.height,0),l=Math.max(r.top-n.top-t.y,0),c=Math.max(r.left-n.left-t.x,0),h=0,p=0;return i.width<=r.width?h=c||-a:h=t.x<this._getViewportMarginStart()?r.left-n.left-t.x:0,i.height<=r.height?p=l||-s:p=t.y<this._getViewportMarginTop()?r.top-n.top-t.y:0,this._previousPushAmount={x:h,y:p},{x:t.x+h,y:t.y+p}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!qx(this._lastScrollVisibility,n)){let i=new Rl(t,n);this._positionChanges.next(i)}this._lastScrollVisibility=n}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,i=t.overlayY;t.overlayX==="center"?n="center":this._isRtl()?n=t.overlayX==="start"?"right":"left":n=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${n} ${i}`}_calculateBoundingBoxRect(t,e){let n=this._viewportRect,i=this._isRtl(),r,a,s;if(e.overlayY==="top")a=t.y,r=n.height-a+this._getViewportMarginBottom();else if(e.overlayY==="bottom")s=n.height-t.y+this._getViewportMarginTop()+this._getViewportMarginBottom(),r=n.height-s+this._getViewportMarginTop();else{let x=Math.min(n.bottom-t.y+n.top,t.y),M=this._lastBoundingBoxSize.height;r=x*2,a=t.y-x,r>M&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-M/2)}let l=e.overlayX==="start"&&!i||e.overlayX==="end"&&i,c=e.overlayX==="end"&&!i||e.overlayX==="start"&&i,h,p,m;if(c)m=n.width-t.x+this._getViewportMarginStart()+this._getViewportMarginEnd(),h=t.x-this._getViewportMarginStart();else if(l)p=t.x,h=n.right-t.x-this._getViewportMarginEnd();else{let x=Math.min(n.right-t.x+n.left,t.x),M=this._lastBoundingBoxSize.width;h=x*2,p=t.x-x,h>M&&!this._isInitialRender&&!this._growAfterOpen&&(p=t.x-M/2)}return{top:a,left:p,bottom:s,right:m,width:h,height:r}}_setBoundingBoxStyles(t,e){let n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right="auto",i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;i.width=mn(n.width),i.height=mn(n.height),i.top=mn(n.top)||"auto",i.bottom=mn(n.bottom)||"auto",i.left=mn(n.left)||"auto",i.right=mn(n.right)||"auto",e.overlayX==="center"?i.alignItems="center":i.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?i.justifyContent="center":i.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(i.maxHeight=mn(r)),a&&(i.maxWidth=mn(a))}this._lastBoundingBoxSize=n,lr(this._boundingBox.style,i)}_resetBoundingBoxStyles(){lr(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){lr(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let n={},i=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(i){let h=this._viewportRuler.getViewportScrollPosition();lr(n,this._getExactOverlayY(e,t,h)),lr(n,this._getExactOverlayX(e,t,h))}else n.position="static";let s="",l=this._getOffset(e,"x"),c=this._getOffset(e,"y");l&&(s+=`translateX(${l}px) `),c&&(s+=`translateY(${c}px)`),n.transform=s.trim(),a.maxHeight&&(i?n.maxHeight=mn(a.maxHeight):r&&(n.maxHeight="")),a.maxWidth&&(i?n.maxWidth=mn(a.maxWidth):r&&(n.maxWidth="")),lr(this._pane.style,n)}_getExactOverlayY(t,e,n){let i={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;i.bottom=`${a-(r.y+this._overlayRect.height)}px`}else i.top=mn(r.y);return i}_getExactOverlayX(t,e,n){let i={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let s=this._document.documentElement.clientWidth;i.right=`${s-(r.x+this._overlayRect.width)}px`}else i.left=mn(r.x);return i}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(i=>i.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Zf(t,n),isOriginOutsideView:Xu(t,n),isOverlayClipped:Zf(e,n),isOverlayOutsideView:Xu(e,n)}}_subtractOverflows(t,...e){return e.reduce((n,i)=>n-Math.max(i,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._getViewportMarginTop(),left:n.left+this._getViewportMarginStart(),right:n.left+t-this._getViewportMarginEnd(),bottom:n.top+e-this._getViewportMarginBottom(),width:t-this._getViewportMarginStart()-this._getViewportMarginEnd(),height:e-this._getViewportMarginTop()-this._getViewportMarginBottom()}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&ja(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getViewportMarginStart(){return typeof this._viewportMargin=="number"?this._viewportMargin:this._viewportMargin?.start??0}_getViewportMarginEnd(){return typeof this._viewportMargin=="number"?this._viewportMargin:this._viewportMargin?.end??0}_getViewportMarginTop(){return typeof this._viewportMargin=="number"?this._viewportMargin:this._viewportMargin?.top??0}_getViewportMarginBottom(){return typeof this._viewportMargin=="number"?this._viewportMargin:this._viewportMargin?.bottom??0}_getOriginRect(){let t=this._origin;if(t instanceof _n)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}_getContainerRect(){let t=this._overlayRef.getConfig().usePopover&&this._popoverLocation!=="global",e=this._overlayContainer.getContainerElement();t&&(e.style.display="block");let n=e.getBoundingClientRect();return t&&(e.style.display=""),n}};function lr(o,t){for(let e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function eg(o){if(typeof o!="number"&&o!=null){let[t,e]=o.split(Xx);return!e||e==="px"?parseFloat(t):null}return o||null}function tg(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function qx(o,t){return o===t?!0:o.isOriginClipped===t.isOriginClipped&&o.isOriginOutsideView===t.isOriginOutsideView&&o.isOverlayClipped===t.isOverlayClipped&&o.isOverlayOutsideView===t.isOverlayOutsideView}var ng="cdk-global-overlay-wrapper";function hg(o){return new Fl}var Fl=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(ng),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:i,height:r,maxWidth:a,maxHeight:s}=n,l=(i==="100%"||i==="100vw")&&(!a||a==="100%"||a==="100vw"),c=(r==="100%"||r==="100vh")&&(!s||s==="100%"||s==="100vh"),h=this._xPosition,p=this._xOffset,m=this._overlayRef.getConfig().direction==="rtl",x="",M="",S="";l?S="flex-start":h==="center"?(S="center",m?M=p:x=p):m?h==="left"||h==="end"?(S="flex-end",x=p):(h==="right"||h==="start")&&(S="flex-start",M=p):h==="left"||h==="start"?(S="flex-start",x=p):(h==="right"||h==="end")&&(S="flex-end",M=p),t.position=this._cssPosition,t.marginLeft=l?"0":x,t.marginTop=c?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=l?"0":M,e.justifyContent=S,e.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(ng),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},pg=(()=>{class o{_injector=we(ii);constructor(){}global(){return hg()}flexibleConnectedTo(e){return Yu(this._injector,e)}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),rs=new Lt("OVERLAY_DEFAULT_CONFIG");function ju(o,t){o.get(sr).load(dg);let e=o.get(ug),n=o.get(Hi),i=o.get(wi),r=o.get(Su),a=o.get(qi),s=o.get(xi,null,{optional:!0})||o.get(rr).createRenderer(null,null),l=new is(t),c=o.get(rs,null,{optional:!0})?.usePopover??!0;l.direction=l.direction||a.value,"showPopover"in n.body?l.usePopover=t?.usePopover??c:l.usePopover=!1;let h=n.createElement("div"),p=n.createElement("div");h.id=i.getId("cdk-overlay-"),h.classList.add("cdk-overlay-pane"),p.appendChild(h),l.usePopover&&(p.setAttribute("popover","manual"),p.classList.add("cdk-overlay-popover"));let m=l.usePopover?l.positionStrategy?.getPopoverInsertionPoint?.():null;return $u(m)?m.after(p):m?.type==="parent"?m.element.appendChild(p):e.getContainerElement().appendChild(p),new Nl(new of(h,r,o),p,h,l,o.get(Pn),o.get(lg),n,o.get(Zm),o.get(cg),t?.disableAnimations??o.get(zm,null,{optional:!0})==="NoopAnimations",o.get(Um),s)}var mg=(()=>{class o{scrollStrategies=we(ag);_positionBuilder=we(pg);_injector=we(ii);constructor(){}create(e){return ju(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),$x=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],Yx=new Lt("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=we(ii);return()=>os(o)}}),Yr=(()=>{class o{elementRef=we(_n);constructor(){}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),fg=new Lt("cdk-connected-overlay-default-config"),Vl=(()=>{class o{_dir=we(qi,{optional:!0});_injector=we(ii);_overlayRef;_templatePortal;_backdropSubscription=zn.EMPTY;_attachSubscription=zn.EMPTY;_detachSubscription=zn.EMPTY;_positionSubscription=zn.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=we(Yx);_ngZone=we(Pn);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;disposeOnNavigation=!1;usePopover;matchWidth=!1;set _config(e){typeof e!="string"&&this._assignConfig(e)}backdropClick=new Ft;positionChange=new Ft;attach=new Ft;detach=new Ft;overlayKeydown=new Ft;overlayOutsideClick=new Ft;constructor(){let e=we(qa),n=we(vl),i=we(fg,{optional:!0}),r=we(rs,{optional:!0});this.usePopover=r?.usePopover===!1?null:"global",this._templatePortal=new nf(e,n),this.scrollStrategy=this._scrollStrategyFactory(),i&&this._assignConfig(i)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this._getWidth(),minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=$x);let e=this._overlayRef=ju(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(n=>{this.overlayKeydown.next(n),n.keyCode===27&&!this.disableClose&&!No(n)&&(n.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(n=>{let i=this._getOriginElement(),r=Mi(n);(!i||i!==r&&!i.contains(r))&&this.overlayOutsideClick.next(n)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),n=new is({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation,usePopover:!!this.usePopover});return(this.height||this.height===0)&&(n.height=this.height),(this.minWidth||this.minWidth===0)&&(n.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(n.minHeight=this.minHeight),this.backdropClass&&(n.backdropClass=this.backdropClass),this.panelClass&&(n.panelClass=this.panelClass),n}_updatePositionStrategy(e){let n=this.positions.map(i=>({originX:i.originX,originY:i.originY,overlayX:i.overlayX,overlayY:i.overlayY,offsetX:i.offsetX||this.offsetX,offsetY:i.offsetY||this.offsetY,panelClass:i.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector).withPopoverLocation(this.usePopover===null?"global":this.usePopover)}_createPositionStrategy(){let e=Yu(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Yr?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Yr?this.origin.elementRef.nativeElement:this.origin instanceof _n?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}_getWidth(){return this.width?this.width:this.matchWidth?this._getOriginElement()?.getBoundingClientRect?.().width:void 0}attachOverlay(){this._overlayRef||this._createOverlay();let e=this._overlayRef;e.getConfig().hasBackdrop=this.hasBackdrop,e.updateSize({width:this._getWidth()}),e.hasAttached()||e.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=e.backdropClick().subscribe(n=>this.backdropClick.emit(n)):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Vm(()=>this.positionChange.observers.length>0)).subscribe(n=>{this._ngZone.run(()=>this.positionChange.emit(n)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}_assignConfig(e){this.origin=e.origin??this.origin,this.positions=e.positions??this.positions,this.positionStrategy=e.positionStrategy??this.positionStrategy,this.offsetX=e.offsetX??this.offsetX,this.offsetY=e.offsetY??this.offsetY,this.width=e.width??this.width,this.height=e.height??this.height,this.minWidth=e.minWidth??this.minWidth,this.minHeight=e.minHeight??this.minHeight,this.backdropClass=e.backdropClass??this.backdropClass,this.panelClass=e.panelClass??this.panelClass,this.viewportMargin=e.viewportMargin??this.viewportMargin,this.scrollStrategy=e.scrollStrategy??this.scrollStrategy,this.disableClose=e.disableClose??this.disableClose,this.transformOriginSelector=e.transformOriginSelector??this.transformOriginSelector,this.hasBackdrop=e.hasBackdrop??this.hasBackdrop,this.lockPosition=e.lockPosition??this.lockPosition,this.flexibleDimensions=e.flexibleDimensions??this.flexibleDimensions,this.growAfterOpen=e.growAfterOpen??this.growAfterOpen,this.push=e.push??this.push,this.disposeOnNavigation=e.disposeOnNavigation??this.disposeOnNavigation,this.usePopover=e.usePopover??this.usePopover,this.matchWidth=e.matchWidth??this.matchWidth}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",$t],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",$t],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",$t],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",$t],push:[2,"cdkConnectedOverlayPush","push",$t],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",$t],usePopover:[0,"cdkConnectedOverlayUsePopover","usePopover"],matchWidth:[2,"cdkConnectedOverlayMatchWidth","matchWidth",$t],_config:[0,"cdkConnectedOverlay","_config"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Nn]})}return o})(),Ku=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({providers:[mg],imports:[pi,rf,Ou,Ou]})}return o})();var Mg=(()=>{class o{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,n){this._renderer=e,this._elementRef=n}setProperty(e,n){this._renderer.setProperty(this._elementRef.nativeElement,e,n)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(n){return new(n||o)(Zt(xi),Zt(_n))};static \u0275dir=Gt({type:o})}return o})(),jx=(()=>{class o extends Mg{static \u0275fac=(()=>{let e;return function(i){return(e||(e=or(o)))(i||o)}})();static \u0275dir=Gt({type:o,features:[Wi]})}return o})(),wg=new Lt("");var Kx={provide:wg,useExisting:Fr(()=>Zr),multi:!0};function Zx(){let o=Tu()?Tu().getUserAgent():"";return/android (\d+)/.test(o.toLowerCase())}var Jx=new Lt(""),Zr=(()=>{class o extends Mg{_compositionMode;_composing=!1;constructor(e,n,i){super(e,n),this._compositionMode=i,this._compositionMode==null&&(this._compositionMode=!Zx())}writeValue(e){let n=e??"";this.setProperty("value",n)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(n){return new(n||o)(Zt(xi),Zt(_n),Zt(Jx,8))};static \u0275dir=Gt({type:o,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,i){n&1&&z("input",function(a){return i._handleInput(a.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(a){return i._compositionEnd(a.target.value)})},standalone:!1,features:[On([Kx]),Wi]})}return o})();function Ju(o){return o==null||Qu(o)===0}function Qu(o){return o==null?null:Array.isArray(o)||typeof o=="string"?o.length:o instanceof Set?o.size:null}var Ql=new Lt(""),eh=new Lt(""),Qx=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ul=class{static min(t){return eb(t)}static max(t){return tb(t)}static required(t){return nb(t)}static requiredTrue(t){return ib(t)}static email(t){return ob(t)}static minLength(t){return rb(t)}static maxLength(t){return Sg(t)}static pattern(t){return ab(t)}static nullValidator(t){return zl()}static compose(t){return Og(t)}static composeAsync(t){return Dg(t)}};function eb(o){return t=>{if(t.value==null||o==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<o?{min:{min:o,actual:t.value}}:null}}function tb(o){return t=>{if(t.value==null||o==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>o?{max:{max:o,actual:t.value}}:null}}function nb(o){return Ju(o.value)?{required:!0}:null}function ib(o){return o.value===!0?null:{required:!0}}function ob(o){return Ju(o.value)||Qx.test(o.value)?null:{email:!0}}function rb(o){return t=>{let e=t.value?.length??Qu(t.value);return e===null||e===0?null:e<o?{minlength:{requiredLength:o,actualLength:e}}:null}}function Sg(o){return t=>{let e=t.value?.length??Qu(t.value);return e!==null&&e>o?{maxlength:{requiredLength:o,actualLength:e}}:null}}function ab(o){if(!o)return zl;let t,e;return typeof o=="string"?(e="",o.charAt(0)!=="^"&&(e+="^"),e+=o,o.charAt(o.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=o.toString(),t=o),n=>{if(Ju(n.value))return null;let i=n.value;return t.test(i)?null:{pattern:{requiredPattern:e,actualValue:i}}}}function zl(o){return null}function Eg(o){return o!=null}function Tg(o){return Gm(o)?km(o):o}function Pg(o){let t={};return o.forEach(e=>{t=e!=null?he(he({},t),e):t}),Object.keys(t).length===0?null:t}function Ag(o,t){return t.map(e=>e(o))}function sb(o){return!o.validate}function Ig(o){return o.map(t=>sb(t)?t:e=>t.validate(e))}function Og(o){if(!o)return null;let t=o.filter(Eg);return t.length==0?null:function(e){return Pg(Ag(e,t))}}function th(o){return o!=null?Og(Ig(o)):null}function Dg(o){if(!o)return null;let t=o.filter(Eg);return t.length==0?null:function(e){let n=Ag(e,t).map(Tg);return Nm(n).pipe(ho(Pg))}}function nh(o){return o!=null?Dg(Ig(o)):null}function gg(o,t){return o===null?[t]:Array.isArray(o)?[...o,t]:[o,t]}function kg(o){return o._rawValidators}function Rg(o){return o._rawAsyncValidators}function Zu(o){return o?Array.isArray(o)?o:[o]:[]}function Hl(o,t){return Array.isArray(o)?o.includes(t):o===t}function _g(o,t){let e=Zu(t);return Zu(o).forEach(i=>{Hl(e,i)||e.push(i)}),e}function vg(o,t){return Zu(t).filter(e=>!Hl(o,e))}var Gl=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=th(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=nh(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control?.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},Lo=class extends Gl{name;get formDirective(){return null}get path(){return null}},cr=class extends Gl{_parent=null;name=null;valueAccessor=null},Wl=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var ec=(()=>{class o extends Wl{constructor(e){super(e)}static \u0275fac=function(n){return new(n||o)(Zt(cr,2))};static \u0275dir=Gt({type:o,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,i){n&2&&oe("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)},standalone:!1,features:[Wi]})}return o})(),Ng=(()=>{class o extends Wl{constructor(e){super(e)}static \u0275fac=function(n){return new(n||o)(Zt(Lo,10))};static \u0275dir=Gt({type:o,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(n,i){n&2&&oe("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)("ng-submitted",i.isSubmitted)},standalone:!1,features:[Wi]})}return o})();var as="VALID",Bl="INVALID",jr="PENDING",ss="DISABLED",Fo=class{},Xl=class extends Fo{value;source;constructor(t,e){super(),this.value=t,this.source=e}},cs=class extends Fo{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},ds=class extends Fo{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},Kr=class extends Fo{status;source;constructor(t,e){super(),this.status=t,this.source=e}},ql=class extends Fo{source;constructor(t){super(),this.source=t}},$l=class extends Fo{source;constructor(t){super(),this.source=t}};function Lg(o){return(tc(o)?o.validators:o)||null}function lb(o){return Array.isArray(o)?th(o):o||null}function Fg(o,t){return(tc(t)?t.asyncValidators:o)||null}function cb(o){return Array.isArray(o)?nh(o):o||null}function tc(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function db(o,t,e){let n=o.controls;if(!(t?Object.keys(n):n).length)throw new gl(1e3,"");if(!n[e])throw new gl(1001,"")}function ub(o,t,e){o._forEachChild((n,i)=>{if(e[i]===void 0)throw new gl(-1002,"")})}var Yl=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return fo(this.statusReactive)}set status(t){fo(()=>this.statusReactive.set(t))}_status=le(()=>this.statusReactive());statusReactive=F(void 0);get valid(){return this.status===as}get invalid(){return this.status===Bl}get pending(){return this.status===jr}get disabled(){return this.status===ss}get enabled(){return this.status!==ss}errors;get pristine(){return fo(this.pristineReactive)}set pristine(t){fo(()=>this.pristineReactive.set(t))}_pristine=le(()=>this.pristineReactive());pristineReactive=F(!0);get dirty(){return!this.pristine}get touched(){return fo(this.touchedReactive)}set touched(t){fo(()=>this.touchedReactive.set(t))}_touched=le(()=>this.touchedReactive());touchedReactive=F(!1);get untouched(){return!this.touched}_events=new yt;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(_g(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(_g(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(vg(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(vg(t,this._rawAsyncValidators))}hasValidator(t){return Hl(this._rawValidators,t)}hasAsyncValidator(t){return Hl(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let n=t.sourceControl??this;t.onlySelf||this._parent?.markAsTouched(De(he({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new ds(!0,n))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let n=t.sourceControl??this;this._forEachChild(i=>{i.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:n})}),t.onlySelf||this._parent?._updateTouched(t,n),e&&t.emitEvent!==!1&&this._events.next(new ds(!1,n))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let n=t.sourceControl??this;t.onlySelf||this._parent?.markAsDirty(De(he({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new cs(!1,n))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let n=t.sourceControl??this;this._forEachChild(i=>{i.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),t.onlySelf||this._parent?._updatePristine(t,n),e&&t.emitEvent!==!1&&this._events.next(new cs(!0,n))}markAsPending(t={}){this.status=jr;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Kr(this.status,e)),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.markAsPending(De(he({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=ss,this.errors=null,this._forEachChild(i=>{i.disable(De(he({},t),{onlySelf:!0}))}),this._updateValue();let n=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Xl(this.value,n)),this._events.next(new Kr(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(De(he({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=as,this._forEachChild(n=>{n.enable(De(he({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(De(he({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(t,e){t.onlySelf||(this._parent?.updateValueAndValidity(t),t.skipPristineCheck||this._parent?._updatePristine({},e),this._parent?._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===as||this.status===jr)&&this._runAsyncValidator(n,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Xl(this.value,e)),this._events.next(new Kr(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.updateValueAndValidity(De(he({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ss:as}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=jr,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let n=Tg(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(i=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(i,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((n,i)=>n&&n._find(i),this)}getError(t,e){let n=e?this.get(e):this;return n?.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,n){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||n)&&this._events.next(new Kr(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,n)}_initObservables(){this.valueChanges=new Ft,this.statusChanges=new Ft}_calculateStatus(){return this._allControlsDisabled()?ss:this.errors?Bl:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(jr)?jr:this._anyControlsHaveStatus(Bl)?Bl:as}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let n=!this._anyControlsDirty(),i=this.pristine!==n;this.pristine=n,t.onlySelf||this._parent?._updatePristine(t,e),i&&this._events.next(new cs(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new ds(this.touched,e)),t.onlySelf||this._parent?._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){tc(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=lb(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=cb(this._rawAsyncValidators)}},jl=class extends Yl{constructor(t,e,n){super(Lg(e),Fg(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){ub(this,!0,t),Object.keys(t).forEach(n=>{db(this,!0,n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(n=>{let i=this.controls[n];i&&i.patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t?t[i]:null,De(he({},e),{onlySelf:!0}))}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new $l(this))}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,n)=>n._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,n]of Object.entries(this.controls))if(this.contains(e)&&t(n))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,n,i)=>((n.enabled||this.disabled)&&(e[i]=n.value),e))}_reduceChildren(t,e){let n=t;return this._forEachChild((i,r)=>{n=e(n,i,r)}),n}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var nc=new Lt("",{factory:()=>ih}),ih="always";function hb(o,t){return[...t.path,o]}function Kl(o,t,e=ih){oh(o,t),t.valueAccessor.writeValue(o.value),(o.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(o.disabled),mb(o,t),gb(o,t),fb(o,t),pb(o,t)}function xg(o,t,e=!0){let n=()=>{};t?.valueAccessor?.registerOnChange(n),t?.valueAccessor?.registerOnTouched(n),Jl(o,t),o&&(t._invokeOnDestroyCallbacks(),o._registerOnCollectionChange(()=>{}))}function Zl(o,t){o.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function pb(o,t){if(t.valueAccessor.setDisabledState){let e=n=>{t.valueAccessor.setDisabledState(n)};o.registerOnDisabledChange(e),t._registerOnDestroy(()=>{o._unregisterOnDisabledChange(e)})}}function oh(o,t){let e=kg(o);t.validator!==null?o.setValidators(gg(e,t.validator)):typeof e=="function"&&o.setValidators([e]);let n=Rg(o);t.asyncValidator!==null?o.setAsyncValidators(gg(n,t.asyncValidator)):typeof n=="function"&&o.setAsyncValidators([n]);let i=()=>o.updateValueAndValidity();Zl(t._rawValidators,i),Zl(t._rawAsyncValidators,i)}function Jl(o,t){let e=!1;if(o!==null){if(t.validator!==null){let i=kg(o);if(Array.isArray(i)&&i.length>0){let r=i.filter(a=>a!==t.validator);r.length!==i.length&&(e=!0,o.setValidators(r))}}if(t.asyncValidator!==null){let i=Rg(o);if(Array.isArray(i)&&i.length>0){let r=i.filter(a=>a!==t.asyncValidator);r.length!==i.length&&(e=!0,o.setAsyncValidators(r))}}}let n=()=>{};return Zl(t._rawValidators,n),Zl(t._rawAsyncValidators,n),e}function mb(o,t){t.valueAccessor.registerOnChange(e=>{o._pendingValue=e,o._pendingChange=!0,o._pendingDirty=!0,o.updateOn==="change"&&Vg(o,t)})}function fb(o,t){t.valueAccessor.registerOnTouched(()=>{o._pendingTouched=!0,o.updateOn==="blur"&&o._pendingChange&&Vg(o,t),o.updateOn!=="submit"&&o.markAsTouched()})}function Vg(o,t){o._pendingDirty&&o.markAsDirty(),o.setValue(o._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(o._pendingValue),o._pendingChange=!1}function gb(o,t){let e=(n,i)=>{t.valueAccessor.writeValue(n),i&&t.viewToModelUpdate(n)};o.registerOnChange(e),t._registerOnDestroy(()=>{o._unregisterOnChange(e)})}function Bg(o,t){o==null,oh(o,t)}function _b(o,t){return Jl(o,t)}function vb(o,t){if(!o.hasOwnProperty("model"))return!1;let e=o.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function xb(o){return Object.getPrototypeOf(o.constructor)===jx}function Ug(o,t){o._syncPendingControls(),t.forEach(e=>{let n=e.control;n.updateOn==="submit"&&n._pendingChange&&(e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1)})}function bb(o,t){if(!t)return null;Array.isArray(t);let e,n,i;return t.forEach(r=>{r.constructor===Zr?e=r:xb(r)?n=r:i=r}),i||n||e||null}function yb(o,t){let e=o.indexOf(t);e>-1&&o.splice(e,1)}var Cb={provide:Lo,useExisting:Fr(()=>us)},ls=Promise.resolve(),us=(()=>{class o extends Lo{callSetDisabledState;get submitted(){return fo(this.submittedReactive)}_submitted=le(()=>this.submittedReactive());submittedReactive=F(!1);_directives=new Set;form;ngSubmit=new Ft;options;constructor(e,n,i){super(),this.callSetDisabledState=i,this.form=new jl({},th(e),nh(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ls.then(()=>{let n=this._findContainer(e.path);e.control=n.registerControl(e.name,e.control),Kl(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){ls.then(()=>{this._findContainer(e.path)?.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){ls.then(()=>{let n=this._findContainer(e.path),i=new jl({});Bg(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){ls.then(()=>{this._findContainer(e.path)?.removeControl?.(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,n){ls.then(()=>{this.form.get(e.path).setValue(n)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),Ug(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new ql(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(n){return new(n||o)(Zt(Ql,10),Zt(eh,10),Zt(nc,8))};static \u0275dir=Gt({type:o,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,i){n&1&&z("submit",function(a){return i.onSubmit(a)})("reset",function(){return i.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[On([Cb]),Wi]})}return o})();function bg(o,t){let e=o.indexOf(t);e>-1&&o.splice(e,1)}function yg(o){return typeof o=="object"&&o!==null&&Object.keys(o).length===2&&"value"in o&&"disabled"in o}var zg=class extends Yl{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,n){super(Lg(e),Fg(n,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),tc(e)&&(e.nonNullable||e.initialValueIsDefault)&&(yg(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new $l(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){bg(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){bg(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){yg(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var Mb=o=>o instanceof zg;var wb={provide:cr,useExisting:Fr(()=>hs)},Cg=Promise.resolve(),hs=(()=>{class o extends cr{_changeDetectorRef;callSetDisabledState;control=new zg;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new Ft;constructor(e,n,i,r,a,s){super(),this._changeDetectorRef=a,this.callSetDisabledState=s,this._parent=e,this._setValidators(n),this._setAsyncValidators(i),this.valueAccessor=bb(this,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let n=e.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),vb(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Kl(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Cg.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let n=e.isDisabled.currentValue,i=n!==0&&$t(n);Cg.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?hb(e,this._parent):[e]}static \u0275fac=function(n){return new(n||o)(Zt(Lo,9),Zt(Ql,10),Zt(eh,10),Zt(wg,10),Zt(Dn,8),Zt(nc,8))};static \u0275dir=Gt({type:o,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[On([wb]),Wi,Nn]})}return o})();var Hg=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return o})();var Sb=(()=>{class o extends Lo{callSetDisabledState;get submitted(){return fo(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=le(()=>this._submittedReactive());_submittedReactive=F(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];constructor(e,n,i){super(),this.callSetDisabledState=i,this._setValidators(e),this._setAsyncValidators(n)}ngOnChanges(e){this.onChanges(e)}ngOnDestroy(){this.onDestroy()}onChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}onDestroy(){this.form&&(Jl(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get path(){return[]}addControl(e){let n=this.form.get(e.path);return Kl(n,e,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),n}getControl(e){return this.form.get(e.path)}removeControl(e){xg(e.control||null,e,!1),yb(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}getFormArray(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}updateModel(e,n){this.form.get(e.path).setValue(n)}onReset(){this.resetForm()}resetForm(e=void 0,n={}){this.form.reset(e,n),this._submittedReactive.set(!1)}onSubmit(e){return this.submitted=!0,Ug(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new ql(this.control)),e?.target?.method==="dialog"}_updateDomValue(){this.directives.forEach(e=>{let n=e.control,i=this.form.get(e.path);n!==i&&(xg(n||null,e),Mb(i)&&(Kl(i,e,this.callSetDisabledState),e.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let n=this.form.get(e.path);Bg(n,e),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){let n=this.form?.get(e.path);n&&_b(n,e)&&n.updateValueAndValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm?._registerOnCollectionChange(()=>{})}_updateValidators(){oh(this.form,this),this._oldForm&&Jl(this._oldForm,this)}_checkFormPresent(){this.form}static \u0275fac=function(n){return new(n||o)(Zt(Ql,10),Zt(eh,10),Zt(nc,8))};static \u0275dir=Gt({type:o,features:[Wi,Nn]})}return o})();var Eb={provide:Lo,useExisting:Fr(()=>rh)},rh=(()=>{class o extends Sb{form=null;ngSubmit=new Ft;get control(){return this.form}static \u0275fac=(()=>{let e;return function(i){return(e||(e=or(o)))(i||o)}})();static \u0275dir=Gt({type:o,selectors:[["","formGroup",""]],hostBindings:function(n,i){n&1&&z("submit",function(a){return i.onSubmit(a)})("reset",function(){return i.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[On([Eb]),Wi]})}return o})();function Tb(o){return typeof o=="number"?o:parseInt(o,10)}var Pb=(()=>{class o{_validator=zl;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let n=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):zl,this._onChange?.()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,features:[Nn]})}return o})();var Ab={provide:Ql,useExisting:Fr(()=>ps),multi:!0},ps=(()=>{class o extends Pb{maxlength;inputName="maxlength";normalizeInput=e=>Tb(e);createValidator=e=>Sg(e);static \u0275fac=(()=>{let e;return function(i){return(e||(e=or(o)))(i||o)}})();static \u0275dir=Gt({type:o,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,i){n&2&&Jt("maxlength",i._enabled?i.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[On([Ab]),Wi]})}return o})();var Ib=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({})}return o})();var ic=(()=>{class o{static withConfig(e){return{ngModule:o,providers:[{provide:nc,useValue:e.callSetDisabledState??ih}]}}static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[Ib]})}return o})();var Ob=["notch"],Db=["matFormFieldNotchedOutline",""],kb=["*"],Wg=["iconPrefixContainer"],Xg=["textPrefixContainer"],qg=["iconSuffixContainer"],$g=["textSuffixContainer"],Rb=["textField"],Nb=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Lb=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Fb(o,t){o&1&&ye(0,"span",21)}function Vb(o,t){if(o&1&&(_(0,"label",20),In(1,1),R(2,Fb,1,0,"span",21),f()),o&2){let e=g(2);Q("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Jt("for",e._control.disableAutomaticLabeling?null:e._control.id),d(2),N(!e.hideRequiredMarker&&e._control.required?2:-1)}}function Bb(o,t){if(o&1&&R(0,Vb,3,5,"label",20),o&2){let e=g();N(e._hasFloatingLabel()?0:-1)}}function Ub(o,t){o&1&&ye(0,"div",7)}function zb(o,t){}function Hb(o,t){if(o&1&&bi(0,zb,0,0,"ng-template",13),o&2){g(2);let e=Ci(1);Q("ngTemplateOutlet",e)}}function Gb(o,t){if(o&1&&(_(0,"div",9),R(1,Hb,1,1,null,13),f()),o&2){let e=g();Q("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),d(),N(e._forceDisplayInfixLabel()?-1:1)}}function Wb(o,t){o&1&&(_(0,"div",10,2),In(2,2),f())}function Xb(o,t){o&1&&(_(0,"div",11,3),In(2,3),f())}function qb(o,t){}function $b(o,t){if(o&1&&bi(0,qb,0,0,"ng-template",13),o&2){g();let e=Ci(1);Q("ngTemplateOutlet",e)}}function Yb(o,t){o&1&&(_(0,"div",14,4),In(2,4),f())}function jb(o,t){o&1&&(_(0,"div",15,5),In(2,5),f())}function Kb(o,t){o&1&&ye(0,"div",16)}function Zb(o,t){o&1&&(_(0,"div",18),In(1,6),f())}function Jb(o,t){if(o&1&&(_(0,"mat-hint",22),u(1),f()),o&2){let e=g(2);Q("id",e._hintLabelId),d(),D(e.hintLabel)}}function Qb(o,t){if(o&1&&(_(0,"div",19),R(1,Jb,2,2,"mat-hint",22),In(2,7),ye(3,"div",23),In(4,8),f()),o&2){let e=g();d(),N(e.hintLabel?1:-1)}}var rc=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["mat-label"]]})}return o})(),ey=new Lt("MatError");var ac=(()=>{class o{align="start";id=we(wi).getId("mat-mdc-hint-");static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(n,i){n&2&&(Ee("id",i.id),Jt("align",null),oe("mat-mdc-form-field-hint-end",i.align==="end"))},inputs:{align:"align",id:"id"}})}return o})(),ty=new Lt("MatPrefix");var ny=new Lt("MatSuffix");var e0=new Lt("FloatingLabelParent"),Yg=(()=>{class o{_elementRef=we(_n);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=we(mf);_ngZone=we(Pn);_parent=we(e0);_resizeSubscription=new zn;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return iy(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(n,i){n&2&&oe("mdc-floating-label--float-above",i.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return o})();function iy(o){let t=o;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let n=e.scrollWidth;return e.remove(),n}var jg="mdc-line-ripple--active",oc="mdc-line-ripple--deactivating",Kg=(()=>{class o{_elementRef=we(_n);_cleanupTransitionEnd;constructor(){let e=we(Pn),n=we(xi);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=n.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(oc),e.add(jg)}deactivate(){this._elementRef.nativeElement.classList.add(oc)}_handleTransitionEnd=e=>{let n=this._elementRef.nativeElement.classList,i=n.contains(oc);e.propertyName==="opacity"&&i&&n.remove(jg,oc)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return o})(),Zg=(()=>{class o{_elementRef=we(_n);_ngZone=we(Pn);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,n=e.querySelector(".mdc-floating-label");n?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(n.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>n.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let n=this._notch.nativeElement;!this.open||!e?n.style.width="":n.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(n,i){if(n&1&&yi(Ob,5),n&2){let r;Bt(r=Ut())&&(i._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(n,i){n&2&&oe("mdc-notched-outline--notched",i.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Db,ngContentSelectors:kb,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(n,i){n&1&&(ar(),Te(0,"div",1),v(1,"div",2,0),In(3),b(),Te(4,"div",3))},encapsulation:2,changeDetection:0})}return o})(),ah=(()=>{class o{value=null;stateChanges;id;placeholder;ngControl=null;focused=!1;empty=!1;shouldLabelFloat=!1;required=!1;disabled=!1;errorState=!1;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(n){return new(n||o)};static \u0275dir=Gt({type:o})}return o})();var sh=new Lt("MatFormField"),oy=new Lt("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Jg="fill",ry="auto",Qg="fixed",ay="translateY(-50%)",ms=(()=>{class o{_elementRef=we(_n);_changeDetectorRef=we(Dn);_platform=we(Xr);_idGenerator=we(wi);_ngZone=we(Pn);_defaults=we(oy,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=$a("iconPrefixContainer");_textPrefixContainerSignal=$a("textPrefixContainer");_iconSuffixContainerSignal=$a("iconSuffixContainer");_textSuffixContainerSignal=$a("textSuffixContainer");_prefixSuffixContainers=le(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=jm(rc);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=gf(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||ry}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let n=e||this._defaults?.appearance||Jg;this._appearanceSignal.set(n)}_appearanceSignal=F(Jg);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||Qg}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||Qg}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new yt;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=qr();constructor(){let e=this._defaults,n=we(qi);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Br(()=>this._currentDirection=n.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=le(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let n=this._control,i="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(i+e.controlType),n.controlType&&this._elementRef.nativeElement.classList.add(i+n.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=n.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=n.stateChanges.pipe(Ro([void 0,void 0]),ho(()=>[n.errorState,n.userAriaDescribedBy]),Fm(),ir(([[r,a],[s,l]])=>r!==s||a!==l)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),n.ngControl&&n.ngControl.valueChanges&&(this._valueChanges=n.ngControl.valueChanges.pipe(ni(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ui(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){Km({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=le(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let n=this._control?this._control.ngControl:null;return n&&n[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(s=>s.align==="start"):null,a=this._hintChildren?this._hintChildren.find(s=>s.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let n=this._control.describedByIds,i;if(n){let r=this._describedByIds||e;i=e.concat(n.filter(a=>a&&!r.includes(a)))}else i=e;this._control.setDescribedByIds(i),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,n=this._textPrefixContainer?.nativeElement,i=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,s=n?.getBoundingClientRect().width??0,l=i?.getBoundingClientRect().width??0,c=r?.getBoundingClientRect().width??0,h=this._currentDirection==="rtl"?"-1":"1",p=`${a+s}px`,x=`calc(${h} * (${p} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,M=`var(--mat-mdc-form-field-label-transform, ${ay} translateX(${x}))`,S=a+s+l+c;return[M,S]}_writeOutlinedLabelStyles(e){if(e!==null){let[n,i]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=n),i!==null&&this._notchedOutline?._setMaxWidth(i)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let n=e.getRootNode();return n&&n!==e}return document.documentElement.contains(e)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["mat-form-field"]],contentQueries:function(n,i,r){if(n&1&&(Wm(r,i._labelChild,rc,5),xl(r,ah,5)(r,ty,5)(r,ny,5)(r,ey,5)(r,ac,5)),n&2){Eu();let a;Bt(a=Ut())&&(i._formFieldControl=a.first),Bt(a=Ut())&&(i._prefixChildren=a),Bt(a=Ut())&&(i._suffixChildren=a),Bt(a=Ut())&&(i._errorChildren=a),Bt(a=Ut())&&(i._hintChildren=a)}},viewQuery:function(n,i){if(n&1&&(Xm(i._iconPrefixContainerSignal,Wg,5)(i._textPrefixContainerSignal,Xg,5)(i._iconSuffixContainerSignal,qg,5)(i._textSuffixContainerSignal,$g,5),yi(Rb,5)(Wg,5)(Xg,5)(qg,5)($g,5)(Yg,5)(Zg,5)(Kg,5)),n&2){Eu(4);let r;Bt(r=Ut())&&(i._textField=r.first),Bt(r=Ut())&&(i._iconPrefixContainer=r.first),Bt(r=Ut())&&(i._textPrefixContainer=r.first),Bt(r=Ut())&&(i._iconSuffixContainer=r.first),Bt(r=Ut())&&(i._textSuffixContainer=r.first),Bt(r=Ut())&&(i._floatingLabel=r.first),Bt(r=Ut())&&(i._notchedOutline=r.first),Bt(r=Ut())&&(i._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(n,i){n&2&&oe("mat-mdc-form-field-label-always-float",i._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",i._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",i._hasIconSuffix)("mat-form-field-invalid",i._control.errorState)("mat-form-field-disabled",i._control.disabled)("mat-form-field-autofilled",i._control.autofilled)("mat-form-field-appearance-fill",i.appearance=="fill")("mat-form-field-appearance-outline",i.appearance=="outline")("mat-form-field-hide-placeholder",i._hasFloatingLabel()&&!i._shouldLabelFloat())("mat-primary",i.color!=="accent"&&i.color!=="warn")("mat-accent",i.color==="accent")("mat-warn",i.color==="warn")("ng-untouched",i._shouldForward("untouched"))("ng-touched",i._shouldForward("touched"))("ng-pristine",i._shouldForward("pristine"))("ng-dirty",i._shouldForward("dirty"))("ng-valid",i._shouldForward("valid"))("ng-invalid",i._shouldForward("invalid"))("ng-pending",i._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[On([{provide:sh,useExisting:o},{provide:e0,useExisting:o}])],ngContentSelectors:Lb,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(n,i){if(n&1&&(ar(Nb),bi(0,Bb,1,1,"ng-template",null,0,$m),_(2,"div",6,1),z("click",function(a){return i._control.onContainerClick(a)}),R(4,Ub,1,0,"div",7),_(5,"div",8),R(6,Gb,2,2,"div",9),R(7,Wb,3,0,"div",10),R(8,Xb,3,0,"div",11),_(9,"div",12),R(10,$b,1,1,null,13),In(11),f(),R(12,Yb,3,0,"div",14),R(13,jb,3,0,"div",15),f(),R(14,Kb,1,0,"div",16),f(),_(15,"div",17),R(16,Zb,2,0,"div",18)(17,Qb,5,1,"div",19),f()),n&2){let r;d(2),oe("mdc-text-field--filled",!i._hasOutline())("mdc-text-field--outlined",i._hasOutline())("mdc-text-field--no-label",!i._hasFloatingLabel())("mdc-text-field--disabled",i._control.disabled)("mdc-text-field--invalid",i._control.errorState),d(2),N(!i._hasOutline()&&!i._control.disabled?4:-1),d(2),N(i._hasOutline()?6:-1),d(),N(i._hasIconPrefix?7:-1),d(),N(i._hasTextPrefix?8:-1),d(2),N(!i._hasOutline()||i._forceDisplayInfixLabel()?10:-1),d(2),N(i._hasTextSuffix?12:-1),d(),N(i._hasIconSuffix?13:-1),d(),N(i._hasOutline()?-1:14),d(),oe("mat-mdc-form-field-subscript-dynamic-size",i.subscriptSizing==="dynamic");let a=i._getSubscriptMessageType();d(),N((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[Yg,Zg,Qm,Kg,ac],styles:[`.mdc-text-field {
|
|
display: inline-flex;
|
|
align-items: baseline;
|
|
padding: 0 16px;
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
overflow: hidden;
|
|
will-change: opacity, transform, color;
|
|
border-top-left-radius: 4px;
|
|
border-top-right-radius: 4px;
|
|
border-bottom-right-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
|
|
.mdc-text-field__input {
|
|
width: 100%;
|
|
min-width: 0;
|
|
border: none;
|
|
border-radius: 0;
|
|
background: none;
|
|
padding: 0;
|
|
-moz-appearance: none;
|
|
-webkit-appearance: none;
|
|
height: 28px;
|
|
}
|
|
.mdc-text-field__input::-webkit-calendar-picker-indicator, .mdc-text-field__input::-webkit-search-cancel-button {
|
|
display: none;
|
|
}
|
|
.mdc-text-field__input::-ms-clear {
|
|
display: none;
|
|
}
|
|
.mdc-text-field__input:focus {
|
|
outline: none;
|
|
}
|
|
.mdc-text-field__input:invalid {
|
|
box-shadow: none;
|
|
}
|
|
.mdc-text-field__input::placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field__input::-moz-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field__input::-webkit-input-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field__input:-ms-input-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field--no-label .mdc-text-field__input::placeholder, .mdc-text-field--focused .mdc-text-field__input::placeholder {
|
|
opacity: 1;
|
|
}
|
|
.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder, .mdc-text-field--focused .mdc-text-field__input::-moz-placeholder {
|
|
opacity: 1;
|
|
}
|
|
.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder, .mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder {
|
|
opacity: 1;
|
|
}
|
|
.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder, .mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder {
|
|
opacity: 1;
|
|
}
|
|
.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder {
|
|
opacity: 0;
|
|
}
|
|
.mdc-text-field--outlined .mdc-text-field__input, .mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input {
|
|
height: 100%;
|
|
}
|
|
.mdc-text-field--outlined .mdc-text-field__input {
|
|
display: flex;
|
|
border: none !important;
|
|
background-color: transparent;
|
|
}
|
|
.mdc-text-field--disabled .mdc-text-field__input {
|
|
pointer-events: auto;
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input {
|
|
color: var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));
|
|
caret-color: var(--mat-form-field-filled-caret-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder {
|
|
color: var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder {
|
|
color: var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder {
|
|
color: var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder {
|
|
color: var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input {
|
|
color: var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));
|
|
caret-color: var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder {
|
|
color: var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder {
|
|
color: var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder {
|
|
color: var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder {
|
|
color: var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input {
|
|
caret-color: var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input {
|
|
caret-color: var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input {
|
|
color: var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input {
|
|
color: var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
@media (forced-colors: active) {
|
|
.mdc-text-field--disabled .mdc-text-field__input {
|
|
background-color: Window;
|
|
}
|
|
}
|
|
|
|
.mdc-text-field--filled {
|
|
height: 56px;
|
|
border-bottom-right-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
border-top-left-radius: var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));
|
|
border-top-right-radius: var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) {
|
|
background-color: var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--disabled {
|
|
background-color: var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent));
|
|
}
|
|
|
|
.mdc-text-field--outlined {
|
|
height: 56px;
|
|
overflow: visible;
|
|
padding-right: max(16px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));
|
|
padding-left: max(16px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);
|
|
}
|
|
[dir=rtl] .mdc-text-field--outlined {
|
|
padding-right: max(16px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);
|
|
padding-left: max(16px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));
|
|
}
|
|
|
|
.mdc-floating-label {
|
|
position: absolute;
|
|
left: 0;
|
|
transform-origin: left top;
|
|
line-height: 1.15rem;
|
|
text-align: left;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
cursor: text;
|
|
overflow: hidden;
|
|
will-change: transform;
|
|
}
|
|
[dir=rtl] .mdc-floating-label {
|
|
right: 0;
|
|
left: auto;
|
|
transform-origin: right top;
|
|
text-align: right;
|
|
}
|
|
.mdc-text-field .mdc-floating-label {
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
pointer-events: none;
|
|
}
|
|
.mdc-notched-outline .mdc-floating-label {
|
|
display: inline-block;
|
|
position: relative;
|
|
max-width: 100%;
|
|
}
|
|
.mdc-text-field--outlined .mdc-floating-label {
|
|
left: 4px;
|
|
right: auto;
|
|
}
|
|
[dir=rtl] .mdc-text-field--outlined .mdc-floating-label {
|
|
left: auto;
|
|
right: 4px;
|
|
}
|
|
.mdc-text-field--filled .mdc-floating-label {
|
|
left: 16px;
|
|
right: auto;
|
|
}
|
|
[dir=rtl] .mdc-text-field--filled .mdc-floating-label {
|
|
left: auto;
|
|
right: 16px;
|
|
}
|
|
.mdc-text-field--disabled .mdc-floating-label {
|
|
cursor: default;
|
|
}
|
|
@media (forced-colors: active) {
|
|
.mdc-text-field--disabled .mdc-floating-label {
|
|
z-index: 1;
|
|
}
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label {
|
|
display: none;
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label {
|
|
color: var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container));
|
|
}
|
|
.mdc-text-field--filled .mdc-floating-label {
|
|
font-family: var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));
|
|
font-size: var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));
|
|
font-weight: var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));
|
|
letter-spacing: var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface));
|
|
}
|
|
.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label {
|
|
color: var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container));
|
|
}
|
|
.mdc-text-field--outlined .mdc-floating-label {
|
|
font-family: var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));
|
|
font-size: var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));
|
|
font-weight: var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));
|
|
letter-spacing: var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking));
|
|
}
|
|
|
|
.mdc-floating-label--float-above {
|
|
cursor: auto;
|
|
transform: translateY(-106%) scale(0.75);
|
|
}
|
|
.mdc-text-field--filled .mdc-floating-label--float-above {
|
|
transform: translateY(-106%) scale(0.75);
|
|
}
|
|
.mdc-text-field--outlined .mdc-floating-label--float-above {
|
|
transform: translateY(-37.25px) scale(1);
|
|
font-size: 0.75rem;
|
|
}
|
|
.mdc-notched-outline .mdc-floating-label--float-above {
|
|
text-overflow: clip;
|
|
}
|
|
.mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
max-width: 133.3333333333%;
|
|
}
|
|
.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above, .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
transform: translateY(-34.75px) scale(0.75);
|
|
}
|
|
.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above, .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after {
|
|
margin-left: 1px;
|
|
margin-right: 0;
|
|
content: "*";
|
|
}
|
|
[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after {
|
|
margin-left: 0;
|
|
margin-right: 1px;
|
|
}
|
|
|
|
.mdc-notched-outline {
|
|
display: flex;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
left: 0;
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
max-width: 100%;
|
|
height: 100%;
|
|
text-align: left;
|
|
pointer-events: none;
|
|
}
|
|
[dir=rtl] .mdc-notched-outline {
|
|
text-align: right;
|
|
}
|
|
.mdc-text-field--outlined .mdc-notched-outline {
|
|
z-index: 1;
|
|
}
|
|
|
|
.mat-mdc-notch-piece {
|
|
box-sizing: border-box;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
border: none;
|
|
border-top: 1px solid;
|
|
border-bottom: 1px solid;
|
|
}
|
|
.mdc-text-field--focused .mat-mdc-notch-piece {
|
|
border-width: 2px;
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));
|
|
border-width: var(--mat-form-field-outlined-outline-width, 1px);
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece {
|
|
border-color: var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece {
|
|
border-width: var(--mat-form-field-outlined-focus-outline-width, 2px);
|
|
}
|
|
|
|
.mdc-notched-outline__leading {
|
|
border-left: 1px solid;
|
|
border-right: none;
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
border-top-left-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
border-bottom-left-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
}
|
|
.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading {
|
|
width: max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));
|
|
}
|
|
[dir=rtl] .mdc-notched-outline__leading {
|
|
border-left: none;
|
|
border-right: 1px solid;
|
|
border-bottom-left-radius: 0;
|
|
border-top-left-radius: 0;
|
|
border-top-right-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
border-bottom-right-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
}
|
|
|
|
.mdc-notched-outline__trailing {
|
|
flex-grow: 1;
|
|
border-left: none;
|
|
border-right: 1px solid;
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
border-top-right-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
border-bottom-right-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
}
|
|
[dir=rtl] .mdc-notched-outline__trailing {
|
|
border-left: 1px solid;
|
|
border-right: none;
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
border-top-left-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
border-bottom-left-radius: var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));
|
|
}
|
|
|
|
.mdc-notched-outline__notch {
|
|
flex: 0 0 auto;
|
|
width: auto;
|
|
}
|
|
.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch {
|
|
max-width: min(var(--mat-form-field-notch-max-width, 100%), calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2));
|
|
}
|
|
.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch {
|
|
max-width: min(100%, calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2));
|
|
}
|
|
.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch {
|
|
padding-top: 1px;
|
|
}
|
|
.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch {
|
|
padding-top: 2px;
|
|
}
|
|
.mdc-notched-outline--notched .mdc-notched-outline__notch {
|
|
padding-left: 0;
|
|
padding-right: 8px;
|
|
border-top: none;
|
|
}
|
|
[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch {
|
|
padding-left: 8px;
|
|
padding-right: 0;
|
|
}
|
|
.mdc-notched-outline--no-label .mdc-notched-outline__notch {
|
|
display: none;
|
|
}
|
|
|
|
.mdc-line-ripple::before, .mdc-line-ripple::after {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
border-bottom-style: solid;
|
|
content: "";
|
|
}
|
|
.mdc-line-ripple::before {
|
|
z-index: 1;
|
|
border-bottom-width: var(--mat-form-field-filled-active-indicator-height, 1px);
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before {
|
|
border-bottom-color: var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before {
|
|
border-bottom-color: var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before {
|
|
border-bottom-color: var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before {
|
|
border-bottom-color: var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error));
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before {
|
|
border-bottom-color: var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container));
|
|
}
|
|
.mdc-line-ripple::after {
|
|
transform: scaleX(0);
|
|
opacity: 0;
|
|
z-index: 2;
|
|
}
|
|
.mdc-text-field--filled .mdc-line-ripple::after {
|
|
border-bottom-width: var(--mat-form-field-filled-focus-active-indicator-height, 2px);
|
|
}
|
|
.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after {
|
|
border-bottom-color: var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary));
|
|
}
|
|
.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after {
|
|
border-bottom-color: var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error));
|
|
}
|
|
|
|
.mdc-line-ripple--active::after {
|
|
transform: scaleX(1);
|
|
opacity: 1;
|
|
}
|
|
|
|
.mdc-line-ripple--deactivating::after {
|
|
opacity: 0;
|
|
}
|
|
|
|
.mdc-text-field--disabled {
|
|
pointer-events: none;
|
|
}
|
|
|
|
.mat-mdc-form-field-textarea-control {
|
|
vertical-align: middle;
|
|
resize: vertical;
|
|
box-sizing: border-box;
|
|
height: auto;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: none;
|
|
overflow: auto;
|
|
}
|
|
|
|
.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control {
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
font: inherit;
|
|
letter-spacing: inherit;
|
|
text-decoration: inherit;
|
|
text-transform: inherit;
|
|
border: none;
|
|
}
|
|
|
|
.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label {
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
line-height: normal;
|
|
pointer-events: all;
|
|
will-change: auto;
|
|
}
|
|
|
|
.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label {
|
|
cursor: inherit;
|
|
}
|
|
|
|
.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,
|
|
.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control {
|
|
height: auto;
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color] {
|
|
height: 23px;
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper {
|
|
height: auto;
|
|
flex: auto;
|
|
will-change: auto;
|
|
}
|
|
|
|
.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper {
|
|
padding-left: 0;
|
|
--mat-mdc-form-field-label-offset-x: -16px;
|
|
}
|
|
|
|
.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper {
|
|
padding-right: 0;
|
|
}
|
|
|
|
[dir=rtl] .mat-mdc-text-field-wrapper {
|
|
padding-left: 16px;
|
|
padding-right: 16px;
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper {
|
|
padding-left: 0;
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper {
|
|
padding-right: 0;
|
|
}
|
|
|
|
.mat-form-field-disabled .mdc-text-field__input::placeholder {
|
|
color: var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder {
|
|
color: var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder {
|
|
color: var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder {
|
|
color: var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
|
|
.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder {
|
|
transition-delay: 40ms;
|
|
transition-duration: 110ms;
|
|
opacity: 1;
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label {
|
|
left: auto;
|
|
right: auto;
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input {
|
|
display: inline-block;
|
|
}
|
|
|
|
.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch {
|
|
padding-top: 0;
|
|
}
|
|
|
|
.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch {
|
|
border-left: 1px solid transparent;
|
|
}
|
|
|
|
[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch {
|
|
border-left: none;
|
|
border-right: 1px solid transparent;
|
|
}
|
|
|
|
.mat-mdc-form-field-infix {
|
|
min-height: var(--mat-form-field-container-height, 56px);
|
|
padding-top: var(--mat-form-field-filled-with-label-container-padding-top, 24px);
|
|
padding-bottom: var(--mat-form-field-filled-with-label-container-padding-bottom, 8px);
|
|
}
|
|
.mdc-text-field--outlined .mat-mdc-form-field-infix, .mdc-text-field--no-label .mat-mdc-form-field-infix {
|
|
padding-top: var(--mat-form-field-container-vertical-padding, 16px);
|
|
padding-bottom: var(--mat-form-field-container-vertical-padding, 16px);
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label {
|
|
top: calc(var(--mat-form-field-container-height, 56px) / 2);
|
|
}
|
|
|
|
.mdc-text-field--filled .mat-mdc-floating-label {
|
|
display: var(--mat-form-field-filled-label-display, block);
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1))
|
|
scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));
|
|
transform: var(--mat-mdc-form-field-label-transform);
|
|
}
|
|
|
|
@keyframes _mat-form-field-subscript-animation {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(-5px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
.mat-mdc-form-field-subscript-wrapper {
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
position: relative;
|
|
}
|
|
|
|
.mat-mdc-form-field-hint-wrapper,
|
|
.mat-mdc-form-field-error-wrapper {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
padding: 0 16px;
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
animation: _mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2);
|
|
}
|
|
|
|
.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,
|
|
.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper {
|
|
position: static;
|
|
}
|
|
|
|
.mat-mdc-form-field-bottom-align::before {
|
|
content: "";
|
|
display: inline-block;
|
|
height: 16px;
|
|
}
|
|
|
|
.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before {
|
|
content: unset;
|
|
}
|
|
|
|
.mat-mdc-form-field-hint-end {
|
|
order: 1;
|
|
}
|
|
|
|
.mat-mdc-form-field-hint-wrapper {
|
|
display: flex;
|
|
}
|
|
|
|
.mat-mdc-form-field-hint-spacer {
|
|
flex: 1 0 1em;
|
|
}
|
|
|
|
.mat-mdc-form-field-error {
|
|
display: block;
|
|
color: var(--mat-form-field-error-text-color, var(--mat-sys-error));
|
|
}
|
|
|
|
.mat-mdc-form-field-subscript-wrapper,
|
|
.mat-mdc-form-field-bottom-align::before {
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
font-family: var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));
|
|
line-height: var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));
|
|
font-size: var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));
|
|
letter-spacing: var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));
|
|
font-weight: var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight));
|
|
}
|
|
|
|
.mat-mdc-form-field-focus-overlay {
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
position: absolute;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
background-color: var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface));
|
|
}
|
|
.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay {
|
|
opacity: var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));
|
|
}
|
|
.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay {
|
|
opacity: var(--mat-form-field-focus-state-layer-opacity, 0);
|
|
}
|
|
|
|
select.mat-mdc-form-field-input-control {
|
|
-moz-appearance: none;
|
|
-webkit-appearance: none;
|
|
background-color: transparent;
|
|
display: inline-flex;
|
|
box-sizing: border-box;
|
|
}
|
|
select.mat-mdc-form-field-input-control:not(:disabled) {
|
|
cursor: pointer;
|
|
}
|
|
select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option {
|
|
color: var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10));
|
|
}
|
|
select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled {
|
|
color: var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent));
|
|
}
|
|
|
|
.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after {
|
|
content: "";
|
|
width: 0;
|
|
height: 0;
|
|
border-left: 5px solid transparent;
|
|
border-right: 5px solid transparent;
|
|
border-top: 5px solid;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 50%;
|
|
margin-top: -2.5px;
|
|
pointer-events: none;
|
|
color: var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after {
|
|
right: auto;
|
|
left: 0;
|
|
}
|
|
.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after {
|
|
color: var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary));
|
|
}
|
|
.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after {
|
|
color: var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control {
|
|
padding-right: 15px;
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control {
|
|
padding-right: 0;
|
|
padding-left: 15px;
|
|
}
|
|
|
|
@media (forced-colors: active) {
|
|
.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper {
|
|
outline: solid 1px;
|
|
}
|
|
}
|
|
@media (forced-colors: active) {
|
|
.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper {
|
|
outline-color: GrayText;
|
|
}
|
|
}
|
|
|
|
@media (forced-colors: active) {
|
|
.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper {
|
|
outline: dashed 3px;
|
|
}
|
|
}
|
|
|
|
@media (forced-colors: active) {
|
|
.mat-mdc-form-field.mat-focused .mdc-notched-outline {
|
|
border: dashed 3px;
|
|
}
|
|
}
|
|
|
|
.mat-mdc-form-field-input-control[type=date], .mat-mdc-form-field-input-control[type=datetime], .mat-mdc-form-field-input-control[type=datetime-local], .mat-mdc-form-field-input-control[type=month], .mat-mdc-form-field-input-control[type=week], .mat-mdc-form-field-input-control[type=time] {
|
|
line-height: 1;
|
|
}
|
|
.mat-mdc-form-field-input-control::-webkit-datetime-edit {
|
|
line-height: 1;
|
|
padding: 0;
|
|
margin-bottom: -2px;
|
|
}
|
|
|
|
.mat-mdc-form-field {
|
|
--mat-mdc-form-field-floating-label-scale: 0.75;
|
|
display: inline-flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
text-align: left;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
font-family: var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));
|
|
line-height: var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));
|
|
font-size: var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));
|
|
letter-spacing: var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));
|
|
font-weight: var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight));
|
|
}
|
|
.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above {
|
|
font-size: calc(var(--mat-form-field-outlined-label-text-populated-size) * var(--mat-mdc-form-field-floating-label-scale));
|
|
}
|
|
.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
font-size: var(--mat-form-field-outlined-label-text-populated-size);
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field {
|
|
text-align: right;
|
|
}
|
|
|
|
.mat-mdc-form-field-flex {
|
|
display: inline-flex;
|
|
align-items: baseline;
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
}
|
|
|
|
.mat-mdc-text-field-wrapper {
|
|
width: 100%;
|
|
z-index: 0;
|
|
}
|
|
|
|
.mat-mdc-form-field-icon-prefix,
|
|
.mat-mdc-form-field-icon-suffix {
|
|
align-self: center;
|
|
line-height: 0;
|
|
pointer-events: auto;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
.mat-mdc-form-field-icon-prefix > .mat-icon,
|
|
.mat-mdc-form-field-icon-suffix > .mat-icon {
|
|
padding: 0 12px;
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
.mat-mdc-form-field-icon-prefix {
|
|
color: var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mat-form-field-disabled .mat-mdc-form-field-icon-prefix {
|
|
color: var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
|
|
.mat-mdc-form-field-icon-suffix {
|
|
color: var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mat-form-field-disabled .mat-mdc-form-field-icon-suffix {
|
|
color: var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-form-field-invalid .mat-mdc-form-field-icon-suffix {
|
|
color: var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error));
|
|
}
|
|
.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix {
|
|
color: var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container));
|
|
}
|
|
.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix {
|
|
color: var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error));
|
|
}
|
|
|
|
.mat-mdc-form-field-icon-prefix,
|
|
[dir=rtl] .mat-mdc-form-field-icon-suffix {
|
|
padding: 0 4px 0 0;
|
|
}
|
|
|
|
.mat-mdc-form-field-icon-suffix,
|
|
[dir=rtl] .mat-mdc-form-field-icon-prefix {
|
|
padding: 0 0 0 4px;
|
|
}
|
|
|
|
.mat-mdc-form-field-subscript-wrapper .mat-icon,
|
|
.mat-mdc-form-field label .mat-icon {
|
|
width: 1em;
|
|
height: 1em;
|
|
font-size: inherit;
|
|
}
|
|
|
|
.mat-mdc-form-field-infix {
|
|
flex: auto;
|
|
min-width: 0;
|
|
width: 180px;
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
}
|
|
.mat-mdc-form-field-infix:has(textarea[cols]) {
|
|
width: auto;
|
|
}
|
|
|
|
.mat-mdc-form-field .mdc-notched-outline__notch {
|
|
margin-left: -1px;
|
|
-webkit-clip-path: inset(-9em -999em -9em 1px);
|
|
clip-path: inset(-9em -999em -9em 1px);
|
|
}
|
|
[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch {
|
|
margin-left: 0;
|
|
margin-right: -1px;
|
|
-webkit-clip-path: inset(-9em 1px -9em -999em);
|
|
clip-path: inset(-9em 1px -9em -999em);
|
|
}
|
|
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label {
|
|
transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input {
|
|
transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder {
|
|
transition: opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder {
|
|
transition: opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder {
|
|
transition: opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder {
|
|
transition: opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder, .mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder {
|
|
transition-delay: 40ms;
|
|
transition-duration: 110ms;
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder, .mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder {
|
|
transition-delay: 40ms;
|
|
transition-duration: 110ms;
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder, .mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder {
|
|
transition-delay: 40ms;
|
|
transition-duration: 110ms;
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder, .mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder {
|
|
transition-delay: 40ms;
|
|
transition-duration: 110ms;
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before {
|
|
transition-duration: 75ms;
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after {
|
|
transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
}
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,
|
|
.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper {
|
|
animation-duration: 300ms;
|
|
}
|
|
|
|
.mdc-notched-outline .mdc-floating-label {
|
|
max-width: calc(100% + 1px);
|
|
}
|
|
|
|
.mdc-notched-outline--upgraded .mdc-floating-label--float-above {
|
|
max-width: calc(133.3333333333% + 1px);
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})();var t0=(()=>{class o{_animationsDisabled=qr();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,i){n&2&&oe("mat-pseudo-checkbox-indeterminate",i.state==="indeterminate")("mat-pseudo-checkbox-checked",i.state==="checked")("mat-pseudo-checkbox-disabled",i.disabled)("mat-pseudo-checkbox-minimal",i.appearance==="minimal")("mat-pseudo-checkbox-full",i.appearance==="full")("_mat-animation-noopable",i._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(n,i){},styles:[`.mat-pseudo-checkbox {
|
|
border-radius: 2px;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
box-sizing: border-box;
|
|
position: relative;
|
|
flex-shrink: 0;
|
|
transition: border-color 90ms cubic-bezier(0, 0, 0.2, 0.1), background-color 90ms cubic-bezier(0, 0, 0.2, 0.1);
|
|
}
|
|
.mat-pseudo-checkbox::after {
|
|
position: absolute;
|
|
opacity: 0;
|
|
content: "";
|
|
border-bottom: 2px solid currentColor;
|
|
transition: opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);
|
|
}
|
|
.mat-pseudo-checkbox._mat-animation-noopable {
|
|
transition: none !important;
|
|
animation: none !important;
|
|
}
|
|
.mat-pseudo-checkbox._mat-animation-noopable::after {
|
|
transition: none;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-disabled {
|
|
cursor: default;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-indeterminate::after {
|
|
left: 1px;
|
|
opacity: 1;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-checked::after {
|
|
left: 1px;
|
|
border-left: 2px solid currentColor;
|
|
transform: rotate(-45deg);
|
|
opacity: 1;
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after, .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after {
|
|
color: var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary));
|
|
}
|
|
.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after, .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after {
|
|
color: var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
|
|
.mat-pseudo-checkbox-full {
|
|
border-color: var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));
|
|
border-width: 2px;
|
|
border-style: solid;
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled {
|
|
border-color: var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate {
|
|
background-color: var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));
|
|
border-color: transparent;
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after {
|
|
color: var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary));
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled {
|
|
background-color: var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after {
|
|
color: var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface));
|
|
}
|
|
|
|
.mat-pseudo-checkbox {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after {
|
|
width: 14px;
|
|
height: 6px;
|
|
transform-origin: center;
|
|
top: -4.2426406871px;
|
|
left: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
margin: auto;
|
|
}
|
|
.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after {
|
|
top: 8px;
|
|
width: 16px;
|
|
}
|
|
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after {
|
|
width: 10px;
|
|
height: 4px;
|
|
transform-origin: center;
|
|
top: -2.8284271247px;
|
|
left: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
margin: auto;
|
|
}
|
|
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after {
|
|
top: 6px;
|
|
width: 12px;
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})();var sy=["text"],ly=[[["mat-icon"]],"*"],cy=["mat-icon","*"];function dy(o,t){if(o&1&&ye(0,"mat-pseudo-checkbox",1),o&2){let e=g();Q("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function uy(o,t){if(o&1&&ye(0,"mat-pseudo-checkbox",3),o&2){let e=g();Q("disabled",e.disabled)}}function hy(o,t){if(o&1&&(_(0,"span",4),u(1),f()),o&2){let e=g();d(),me("(",e.group.label,")")}}var ch=new Lt("MAT_OPTION_PARENT_COMPONENT"),dh=new Lt("MatOptgroup");var lh=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},Jr=(()=>{class o{_element=we(_n);_changeDetectorRef=we(Dn);_parent=we(ch,{optional:!0});group=we(dh,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=we(wi).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=F(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new Ft;_text;_stateChanges=new yt;constructor(){let e=we(sr);e.load(sf),e.load(af),this._signalDisableRipple=!!this._parent&&Hm(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,n){let i=this._getHostElement();typeof i.focus=="function"&&i.focus(n)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!No(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new lh(this,e))}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["mat-option"]],viewQuery:function(n,i){if(n&1&&yi(sy,7),n&2){let r;Bt(r=Ut())&&(i._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,i){n&1&&z("click",function(){return i._selectViaInteraction()})("keydown",function(a){return i._handleKeydown(a)}),n&2&&(Ee("id",i.id),Jt("aria-selected",i.selected)("aria-disabled",i.disabled.toString()),oe("mdc-list-item--selected",i.selected)("mat-mdc-option-multiple",i.multiple)("mat-mdc-option-active",i.active)("mdc-list-item--disabled",i.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",$t]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:cy,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(n,i){n&1&&(ar(ly),R(0,dy,1,2,"mat-pseudo-checkbox",1),In(1),_(2,"span",2,0),In(4,1),f(),R(5,uy,1,1,"mat-pseudo-checkbox",3),R(6,hy,2,1,"span",4),ye(7,"div",5)),n&2&&(N(i.multiple?0:-1),d(5),N(!i.multiple&&i.selected&&!i.hideSingleSelectionIndicator?5:-1),d(),N(i.group&&i.group._inert?6:-1),d(),Q("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},dependencies:[t0,_f],styles:[`.mat-mdc-option {
|
|
-webkit-user-select: none;
|
|
user-select: none;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
display: flex;
|
|
position: relative;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
overflow: hidden;
|
|
min-height: 48px;
|
|
padding: 0 16px;
|
|
cursor: pointer;
|
|
-webkit-tap-highlight-color: transparent;
|
|
color: var(--mat-option-label-text-color, var(--mat-sys-on-surface));
|
|
font-family: var(--mat-option-label-text-font, var(--mat-sys-label-large-font));
|
|
line-height: var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));
|
|
font-size: var(--mat-option-label-text-size, var(--mat-sys-body-large-size));
|
|
letter-spacing: var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));
|
|
font-weight: var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight));
|
|
}
|
|
.mat-mdc-option:hover:not(.mdc-list-item--disabled) {
|
|
background-color: var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));
|
|
}
|
|
.mat-mdc-option:focus.mdc-list-item, .mat-mdc-option.mat-mdc-option-active.mdc-list-item {
|
|
background-color: var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));
|
|
outline: 0;
|
|
}
|
|
.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active, .mat-mdc-option-multiple, :focus, :hover) {
|
|
background-color: var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container));
|
|
}
|
|
.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active, .mat-mdc-option-multiple, :focus, :hover) .mdc-list-item__primary-text {
|
|
color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container));
|
|
}
|
|
.mat-mdc-option .mat-pseudo-checkbox {
|
|
--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container));
|
|
}
|
|
.mat-mdc-option.mdc-list-item {
|
|
align-items: center;
|
|
background: transparent;
|
|
}
|
|
.mat-mdc-option.mdc-list-item--disabled {
|
|
cursor: default;
|
|
pointer-events: none;
|
|
}
|
|
.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox, .mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text, .mat-mdc-option.mdc-list-item--disabled > mat-icon {
|
|
opacity: 0.38;
|
|
}
|
|
.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple) {
|
|
padding-left: 32px;
|
|
}
|
|
[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple) {
|
|
padding-left: 16px;
|
|
padding-right: 32px;
|
|
}
|
|
.mat-mdc-option .mat-icon,
|
|
.mat-mdc-option .mat-pseudo-checkbox-full {
|
|
margin-right: 16px;
|
|
flex-shrink: 0;
|
|
}
|
|
[dir=rtl] .mat-mdc-option .mat-icon,
|
|
[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full {
|
|
margin-right: 0;
|
|
margin-left: 16px;
|
|
}
|
|
.mat-mdc-option .mat-pseudo-checkbox-minimal {
|
|
margin-left: 16px;
|
|
flex-shrink: 0;
|
|
}
|
|
[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal {
|
|
margin-right: 16px;
|
|
margin-left: 0;
|
|
}
|
|
.mat-mdc-option .mat-mdc-option-ripple {
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
position: absolute;
|
|
pointer-events: none;
|
|
}
|
|
.mat-mdc-option .mdc-list-item__primary-text {
|
|
white-space: normal;
|
|
font-size: inherit;
|
|
font-weight: inherit;
|
|
letter-spacing: inherit;
|
|
line-height: inherit;
|
|
font-family: inherit;
|
|
text-decoration: inherit;
|
|
text-transform: inherit;
|
|
margin-right: auto;
|
|
}
|
|
[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text {
|
|
margin-right: 0;
|
|
margin-left: auto;
|
|
}
|
|
@media (forced-colors: active) {
|
|
.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 50%;
|
|
right: 16px;
|
|
transform: translateY(-50%);
|
|
width: 10px;
|
|
height: 0;
|
|
border-bottom: solid 10px;
|
|
border-radius: 10px;
|
|
}
|
|
[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after {
|
|
right: auto;
|
|
left: 16px;
|
|
}
|
|
}
|
|
|
|
.mat-mdc-option-multiple {
|
|
--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent);
|
|
}
|
|
|
|
.mat-mdc-option-active .mat-focus-indicator::before {
|
|
content: "";
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})();function n0(o,t,e){if(e.length){let n=t.toArray(),i=e.toArray(),r=0;for(let a=0;a<o+1;a++)n[a].group&&n[a].group===i[r]&&r++;return r}return 0}function i0(o,t,e,n){return o<e?o:o+t>e+n?Math.max(0,o-n+t):e}var o0=(()=>{class o{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static \u0275fac=function(n){return new(n||o)};static \u0275prov=Yn({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var cc=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,n,i,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=n,this._parentForm=i,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,n=this.matcher||this._defaultMatcher,i=this.ngControl?this.ngControl.control:null,r=n?.isErrorState(i,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var dc=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[df,ms,pi]})}return o})();var r0=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[pi]})}return o})();var a0=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[pi]})}return o})();var uh=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[r0,a0,Jr,pi]})}return o})();var xy=["trigger"],by=["panel"],yy=[[["mat-select-trigger"]],"*"],Cy=["mat-select-trigger","*"];function My(o,t){if(o&1&&(_(0,"span",4),u(1),f()),o&2){let e=g();d(),D(e.placeholder)}}function wy(o,t){o&1&&In(0)}function Sy(o,t){if(o&1&&(_(0,"span",11),u(1),f()),o&2){let e=g(2);d(),D(e.triggerValue)}}function Ey(o,t){if(o&1&&(_(0,"span",5),R(1,wy,1,0)(2,Sy,2,1,"span",11),f()),o&2){let e=g();d(),N(e.customTrigger?1:2)}}function Ty(o,t){if(o&1){let e=Z();_(0,"div",12,1),z("keydown",function(i){P(e);let r=g();return A(r._handleKeydown(i))}),In(2,1),f()}if(o&2){let e=g();wn(e.panelClass),oe("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),Jt("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Py=new Lt("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=we(ii);return()=>os(o)}}),Ay=new Lt("MAT_SELECT_CONFIG"),Iy=new Lt("MatSelectTrigger"),hh=class{source;value;constructor(t,e){this.source=t,this.value=e}},c0=(()=>{class o{_viewportRuler=we($i);_changeDetectorRef=we(Dn);_elementRef=we(_n);_dir=we(qi,{optional:!0});_idGenerator=we(wi);_renderer=we(xi);_parentFormField=we(sh,{optional:!0});ngControl=we(cr,{self:!0,optional:!0});_liveAnnouncer=we(uf);_defaultOptions=we(Ay,{optional:!0});_animationsDisabled=qr();_popoverLocation;_initialized=new yt;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let n=this.options.toArray()[e];if(n){let i=this.panel.nativeElement,r=n0(e,this.options,this.optionGroups),a=n._getHostElement();e===0&&r===1?i.scrollTop=0:i.scrollTop=i0(a.offsetTop,a.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new hh(this,e)}_scrollStrategyFactory=we(Py);_panelOpen=!1;_compareWith=(e,n)=>e===n;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new yt;_errorStateTracker;stateChanges=new yt;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=F(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Ul.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Rm(()=>{let e=this.options;return e?e.changes.pipe(Ro(e),Xa(()=>Ui(...e.map(n=>n.onSelectionChange)))):this._initialized.pipe(Xa(()=>this.optionSelectionChanges))});openedChange=new Ft;_openedStream=this.openedChange.pipe(ir(e=>e),ho(()=>{}));_closedStream=this.openedChange.pipe(ir(e=>!e),ho(()=>{}));selectionChange=new Ft;valueChange=new Ft;constructor(){let e=we(o0),n=we(us,{optional:!0}),i=we(rh,{optional:!0}),r=we(new Ym("tabindex"),{optional:!0}),a=we(rs,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new cc(e,this.ngControl,i,n,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this._popoverLocation=a?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new ts(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(ni(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(ni(this._destroy)).subscribe(e=>{e.added.forEach(n=>n.select()),e.removed.forEach(n=>n.deselect())}),this.options.changes.pipe(Ro(null),ni(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),n=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}n&&(this._previousControl!==n.control&&(this._previousControl!==void 0&&n.disabled!==null&&n.disabled!==this.disabled&&(this.disabled=n.disabled),this._previousControl=n.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass))}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(fl(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let n=`${this.id}-panel`;this._trackedModal&&Au(this._trackedModal,"aria-owns",n),pf(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;Au(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{n(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,n=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(n=>n.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let n=e.keyCode,i=n===40||n===38||n===37||n===39,r=n===13||n===32,a=this._keyManager;if(!a.isTyping()&&r&&!No(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let s=this.selected;a.onKeydown(e);let l=this.selected;l&&s!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(e){let n=this._keyManager,i=e.keyCode,r=i===40||i===38,a=n.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(i===13||i===32)&&n.activeItem&&!No(e))e.preventDefault(),n.activeItem._selectViaInteraction();else if(!a&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let s=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(s?l.select():l.deselect())})}else{let s=n.activeItemIndex;n.onKeydown(e),this._multiple&&r&&e.shiftKey&&n.activeItem&&n.activeItemIndex!==s&&n.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!No(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(n=>n.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(n=>this._selectOptionByValue(n)),this._sortValues();else{let n=this._selectOptionByValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let n=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch{return!1}});return n&&this._selectionModel.select(n),n}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Yr?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new hf(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Ui(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(ni(e)).subscribe(n=>{this._onSelect(n.source,n.isUserInput),n.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ui(...this.options.map(n=>n._stateChanges)).pipe(ni(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,n){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),n&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),n&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((n,i)=>this.sortComparator?this.sortComparator(n,i,e):e.indexOf(n)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let n;this.multiple?n=this.selected.map(i=>i.value):n=this.selected?this.selected.value:e,this._value=n,this.valueChange.emit(n),this._onChange(n),this.selectionChange.emit(this._getChangeEvent(n)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let n=0;n<this.options.length;n++)if(!this.options.get(n).disabled){e=n;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,n=e?e+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let n=this._elementRef.nativeElement;e.length?n.setAttribute("aria-describedby",e.join(" ")):n.removeAttribute("aria-describedby")}onContainerClick(e){let n=Mi(e);n&&(n.tagName==="MAT-OPTION"||n.classList.contains("cdk-overlay-backdrop")||n.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=ke({type:o,selectors:[["mat-select"]],contentQueries:function(n,i,r){if(n&1&&xl(r,Iy,5)(r,Jr,5)(r,dh,5),n&2){let a;Bt(a=Ut())&&(i.customTrigger=a.first),Bt(a=Ut())&&(i.options=a),Bt(a=Ut())&&(i.optionGroups=a)}},viewQuery:function(n,i){if(n&1&&yi(xy,5)(by,5)(Vl,5),n&2){let r;Bt(r=Ut())&&(i.trigger=r.first),Bt(r=Ut())&&(i.panel=r.first),Bt(r=Ut())&&(i._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(n,i){n&1&&z("keydown",function(a){return i._handleKeydown(a)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),n&2&&(Jt("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),oe("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",$t],disableRipple:[2,"disableRipple","disableRipple",$t],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Ya(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",$t],placeholder:"placeholder",required:[2,"required","required",$t],multiple:[2,"multiple","multiple",$t],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",$t],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",Ya],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",$t]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[On([{provide:ah,useExisting:o},{provide:ch,useExisting:o}]),Nn],ngContentSelectors:Cy,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(n,i){if(n&1&&(ar(yy),_(0,"div",2,0),z("click",function(){return i.open()}),_(3,"div",3),R(4,My,2,1,"span",4)(5,Ey,3,1,"span",5),f(),_(6,"div",6)(7,"div",7),zi(),_(8,"svg",8),ye(9,"path",9),f()()()(),bi(10,Ty,3,16,"ng-template",10),z("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(a){return i._handleOverlayKeydown(a)})),n&2){let r=Ci(1);d(3),Jt("id",i._valueId),d(),N(i.empty?4:5),d(6),Q("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[Yr,Vl],styles:[`@keyframes _mat-select-enter {
|
|
from {
|
|
opacity: 0;
|
|
transform: scaleY(0.8);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: none;
|
|
}
|
|
}
|
|
@keyframes _mat-select-exit {
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
}
|
|
.mat-mdc-select {
|
|
display: inline-block;
|
|
width: 100%;
|
|
outline: none;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-font-smoothing: antialiased;
|
|
color: var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));
|
|
font-family: var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));
|
|
line-height: var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));
|
|
font-size: var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));
|
|
font-weight: var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));
|
|
letter-spacing: var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking));
|
|
}
|
|
|
|
div.mat-mdc-select-panel {
|
|
box-shadow: var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));
|
|
}
|
|
|
|
.mat-mdc-select-disabled {
|
|
color: var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-mdc-select-disabled .mat-mdc-select-placeholder {
|
|
color: var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
|
|
.mat-mdc-select-trigger {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
}
|
|
.mat-mdc-select-disabled .mat-mdc-select-trigger {
|
|
-webkit-user-select: none;
|
|
user-select: none;
|
|
cursor: default;
|
|
}
|
|
|
|
.mat-mdc-select-value {
|
|
width: 100%;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.mat-mdc-select-value-text {
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.mat-mdc-select-arrow-wrapper {
|
|
height: 24px;
|
|
flex-shrink: 0;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
}
|
|
.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper {
|
|
transform: none;
|
|
}
|
|
|
|
.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,
|
|
.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after {
|
|
color: var(--mat-select-invalid-arrow-color, var(--mat-sys-error));
|
|
}
|
|
|
|
.mat-mdc-select-arrow {
|
|
width: 10px;
|
|
height: 5px;
|
|
position: relative;
|
|
color: var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow {
|
|
color: var(--mat-select-focused-arrow-color, var(--mat-sys-primary));
|
|
}
|
|
.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow {
|
|
color: var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
|
|
}
|
|
.mat-select-open .mat-mdc-select-arrow {
|
|
transform: rotate(180deg);
|
|
}
|
|
.mat-form-field-animations-enabled .mat-mdc-select-arrow {
|
|
transition: transform 80ms linear;
|
|
}
|
|
.mat-mdc-select-arrow svg {
|
|
fill: currentColor;
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
}
|
|
@media (forced-colors: active) {
|
|
.mat-mdc-select-arrow svg {
|
|
fill: CanvasText;
|
|
}
|
|
.mat-mdc-select-disabled .mat-mdc-select-arrow svg {
|
|
fill: GrayText;
|
|
}
|
|
}
|
|
|
|
div.mat-mdc-select-panel {
|
|
width: 100%;
|
|
max-height: 275px;
|
|
outline: 0;
|
|
overflow: auto;
|
|
padding: 8px 0;
|
|
box-sizing: border-box;
|
|
transform-origin: top center;
|
|
border-radius: 0 0 4px 4px;
|
|
position: relative;
|
|
background-color: var(--mat-select-panel-background-color, var(--mat-sys-surface-container));
|
|
}
|
|
.mat-mdc-select-panel-above div.mat-mdc-select-panel {
|
|
border-radius: 4px 4px 0 0;
|
|
transform-origin: bottom center;
|
|
}
|
|
@media (forced-colors: active) {
|
|
div.mat-mdc-select-panel {
|
|
outline: solid 1px;
|
|
}
|
|
}
|
|
|
|
.mat-select-panel-animations-enabled {
|
|
animation: _mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1);
|
|
}
|
|
.mat-select-panel-animations-enabled.mat-select-panel-exit {
|
|
animation: _mat-select-exit 100ms linear;
|
|
}
|
|
|
|
.mat-mdc-select-placeholder {
|
|
transition: color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
color: var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant));
|
|
}
|
|
.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder, ._mat-animation-noopable .mat-mdc-select-placeholder {
|
|
transition: none;
|
|
}
|
|
.mat-form-field-hide-placeholder .mat-mdc-select-placeholder {
|
|
color: transparent;
|
|
-webkit-text-fill-color: transparent;
|
|
transition: none;
|
|
display: block;
|
|
}
|
|
|
|
.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper {
|
|
cursor: pointer;
|
|
}
|
|
.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label {
|
|
max-width: calc(100% - 18px);
|
|
}
|
|
.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above {
|
|
max-width: calc(100% / 0.75 - 24px);
|
|
}
|
|
.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch {
|
|
max-width: calc(100% - 60px);
|
|
}
|
|
.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch {
|
|
max-width: calc(100% - 24px);
|
|
}
|
|
|
|
.mat-mdc-select-min-line:empty::before {
|
|
content: " ";
|
|
white-space: pre;
|
|
width: 1px;
|
|
display: inline-block;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper {
|
|
transform: var(--mat-select-arrow-transform, translateY(-8px));
|
|
}
|
|
`],encapsulation:2,changeDetection:0})}return o})();var d0=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=An({type:o});static \u0275inj=Tn({imports:[Ku,uh,pi,Cl,dc,uh]})}return o})();var Dy=(o,t)=>t.value;function ky(o,t){if(o&1&&(_(0,"mat-option",2),u(1),f()),o&2){let e=t.$implicit;Q("value",e.value),d(),D(e.label)}}var Vo=(()=>{class o{constructor(){this.options=[],this.value=null,this.disabled=!1,this.valueChange=new Ft}onValueChange(e){this.valueChange.emit(e)}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-select"]],inputs:{options:"options",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:4,vars:2,consts:[[1,"overlay-select-field"],[3,"valueChange","value","disabled"],[3,"value"]],template:function(n,i){n&1&&(_(0,"mat-form-field",0)(1,"mat-select",1),z("valueChange",function(a){return i.onValueChange(a)}),ve(2,ky,2,2,"mat-option",2,Dy),f()()),n&2&&(d(),Q("value",i.value)("disabled",i.disabled),d(),xe(i.options))},dependencies:[d0,ms,c0,Jr,dc],styles:["[_nghost-%COMP%]{display:block;min-width:8rem}.overlay-select-field[_ngcontent-%COMP%]{width:100%;--mdc-outlined-text-field-container-shape: 5px;--mat-form-field-container-height: 28px;--mat-form-field-container-vertical-padding: 4px}.overlay-select-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix[_ngcontent-%COMP%]{min-height:unset;padding-top:4px;padding-bottom:4px}.overlay-select-field[_ngcontent-%COMP%] .mat-mdc-form-field-subscript-wrapper{display:none}"],changeDetection:0})}}return o})();var Ry=()=>[],dr=(o,t)=>t.itemTypeId,u0=(o,t)=>t.key,fs=(o,t)=>t.id,Ny=(o,t)=>t.slug;function Ly(o,t){o&1&&ye(0,"div",0),o&2&&Q("innerHTML",t,an)}function Fy(o,t){if(o&1){let e=Z();_(0,"div",1)(1,"button",12),z("click",function(){P(e);let i=g();return A(i.selectDmvLandingOption("test"))}),_(2,"span",13),u(3,"License Testing"),f()(),_(4,"button",12),z("click",function(){P(e);let i=g();return A(i.selectDmvLandingOption("vehreg"))}),_(5,"span",13),u(6,"Vehicle Registration"),f()(),_(7,"button",12),z("click",function(){P(e);let i=g();return A(i.selectDmvLandingOption("renew"))}),_(8,"span",13),u(9,"License Renewal"),f()(),_(10,"button",12),z("click",function(){P(e);let i=g();return A(i.selectDmvLandingOption("vanity"))}),_(11,"span",13),u(12,"Personalized License Plate"),f()(),_(13,"div",14)(14,"button",15),z("click",function(){P(e);let i=g();return A(i.submitDmvLanding())}),u(15,"Continue"),f(),_(16,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(17,"Cancel"),f()()()}if(o&2){let e=g();d(),oe("selected",e.dmvLandingSelection()==="test")("disabled",e.dmvLandingData().hasLicense),Q("disabled",e.dmvLandingData().hasLicense),d(3),oe("selected",e.dmvLandingSelection()==="vehreg")("disabled",!e.dmvLandingData().hasVehicle),Q("disabled",!e.dmvLandingData().hasVehicle),d(3),oe("selected",e.dmvLandingSelection()==="renew")("disabled",!e.dmvLandingData().hasLicense),Q("disabled",!e.dmvLandingData().hasLicense),d(3),oe("selected",e.dmvLandingSelection()==="vanity")("disabled",!e.dmvLandingData().hasVehicle),Q("disabled",!e.dmvLandingData().hasVehicle),d(4),Q("disabled",!e.dmvLandingSelection())}}function Vy(o,t){if(o&1){let e=Z();_(0,"div",2)(1,"div",17)(2,"h3"),u(3,"Department of Motor Vehicles"),f(),_(4,"p"),u(5,"Driver's Knowledge Test"),f()(),_(6,"article",18)(7,"p"),u(8,"Welcome to the Department of Motor Vehicles testing site. This is where the process to obtain your San Andreas driver's license begins."),f(),_(9,"h4"),u(10,"Test Information"),f(),_(11,"ul")(12,"li"),u(13,"A fee of "),_(14,"strong"),u(15,"$50"),f(),u(16," is required."),f(),_(17,"li"),u(18,"You must be at least 16 years old."),f(),_(19,"li"),u(20,"You must answer all questions correctly to pass."),f(),_(21,"li"),u(22,"This test takes around 5 minutes."),f()(),_(23,"h4"),u(24,"Applicants 18+"),f(),_(25,"ul")(26,"li"),u(27,"After passing, you must complete a road test."),f(),_(28,"li"),u(29,"If you fail the road test, the knowledge test must be retaken."),f()(),_(30,"h4"),u(31,"Applicants Under 18"),f(),_(32,"ul")(33,"li"),u(34,"Passing grants a learner's permit."),f(),_(35,"li"),u(36,"Road test becomes available after one week."),f()()(),_(37,"div",14)(38,"button",15),z("click",function(){P(e);let i=g();return A(i.startDmv())}),u(39),f(),_(40,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(41,"Cancel"),f()()()}if(o&2){let e=g();d(38),Q("disabled",e.dmvCountdown()>0),d(),me(" ",e.dmvCountdown()===0?"Start":"Start ("+e.dmvCountdown()+")"," ")}}function By(o,t){if(o&1){let e=Z();_(0,"div",14)(1,"button",15),z("click",function(){P(e);let i=g(2);return A(i.startDmvRoadRules())}),u(2),f(),_(3,"button",16),z("click",function(){P(e);let i=g(2);return A(i.cancelDmv())}),u(4,"Cancel"),f()()}if(o&2){let e=g(2);d(),Q("disabled",e.dmvRoadRulesCountdown()>0),d(),me(" ",e.dmvRoadRulesCountdown()===0?"Continue":"Continue ("+e.dmvRoadRulesCountdown()+")"," ")}}function Uy(o,t){if(o&1&&(_(0,"div",2)(1,"div",17)(2,"h3"),u(3,"Department of Motor Vehicles"),f(),_(4,"p"),u(5,"Road Test Rules"),f()(),_(6,"article",18)(7,"p"),u(8,"You're about to begin your road test. Follow each checkpoint path precisely. Do not skip checkpoints."),f(),_(9,"h4",19),u(10,"Green Zone"),f(),_(11,"ul")(12,"li"),u(13,"Proceed safely within speed limits."),f(),_(14,"li"),u(15,"Do not remain stopped longer than 30 seconds."),f(),_(16,"li"),u(17,"Enter the next zone within 10 seconds."),f()(),_(18,"h4",20),u(19,"Yellow Zone"),f(),_(20,"ul")(21,"li"),u(22,"Come to a complete stop inside the zone."),f(),_(23,"li"),u(24,"Remain stopped for 3 seconds before proceeding."),f()(),_(25,"h4",21),u(26,"Red Zone"),f(),_(27,"ul")(28,"li"),u(29,"Do not enter red zones."),f(),_(30,"li"),u(31,"Repeated violations can fail the test."),f()()(),R(32,By,5,2,"div",14),f()),o&2){let e=g();d(32),N(e.dmvData().reviewing?-1:32)}}function zy(o,t){if(o&1&&(_(0,"p"),u(1),f()),o&2){let e=g(2);d(),me("Your ",e.dmvRegisterData().model," was successfully registered with the San Andreas DMV.")}}function Hy(o,t){if(o&1&&(_(0,"p"),u(1),f()),o&2){let e=g(2);d(),cn("",e.dmvRegisterData().model,", ",e.dmvRegisterData().currPlate," registration renewal was recorded with the San Andreas DMV.")}}function Gy(o,t){if(o&1&&(_(0,"div",23)(1,"span"),u(2,"New License Plate"),f(),_(3,"strong"),u(4),f()()),o&2){let e=g(2);d(4),D(e.dmvRegisterData().newPlate)}}function Wy(o,t){if(o&1&&(_(0,"div",2)(1,"div",17)(2,"h3"),u(3,"Department of Motor Vehicles"),f(),_(4,"p"),u(5,"Vehicle Registration"),f()(),_(6,"article",22),R(7,zy,2,1,"p")(8,Hy,2,2,"p"),_(9,"div",23)(10,"span"),u(11,"Next Renew Date"),f(),_(12,"strong"),u(13),f()(),R(14,Gy,5,1,"div",23),f()()),o&2){let e=g();d(7),N(e.dmvRegisterData().newPlate?7:8),d(6),D(e.dmvRegisterData().renewDay),d(),N(e.dmvRegisterData().newPlate?14:-1)}}function Xy(o,t){o&1&&(_(0,"p",24),u(1,"PASSED"),f())}function qy(o,t){o&1&&(_(0,"p",25),u(1,"FAILED"),f())}function $y(o,t){if(o&1&&(_(0,"li"),u(1),f()),o&2){let e=t.$implicit;d(),D(e)}}function Yy(o,t){if(o&1&&(_(0,"h4"),u(1,"Result Notes"),f(),_(2,"ul"),ve(3,$y,2,1,"li",null,ct),f()),o&2){let e=g(2);d(3),xe(e.dmvExamData().faillist)}}function jy(o,t){if(o&1&&(_(0,"p"),u(1," Relevant date: "),_(2,"strong"),u(3),f()()),o&2){let e=g(2);d(3),D(e.dmvExamData().date)}}function Ky(o,t){if(o&1&&(_(0,"div",2)(1,"div",17)(2,"h3"),u(3,"Department of Motor Vehicles"),f(),_(4,"p"),u(5),f()(),_(6,"article",18),R(7,Xy,2,0,"p",24)(8,qy,2,0,"p",25),_(9,"p")(10,"strong"),u(11),f(),u(12),f(),R(13,Yy,5,0),R(14,jy,4,1,"p"),f()()),o&2){let e=g();d(5),D(e.dmvExamData().type==="knowledge"?"Driver's Knowledge Test":"Driver's Road Test"),d(2),N(e.dmvExamData().passed?7:8),d(4),D(e.dmvExamData().name),d(),cn(", you have ",e.dmvExamData().passed?"passed":"failed"," the San Andreas driver's ",e.dmvExamData().type," test. "),d(),N(e.dmvExamData().faillist.length>0?13:-1),d(),N(e.dmvExamData().date?14:-1)}}function Zy(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectDutyWeapon(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.dutySelectedWeapon()===e.itemTypeId),d(),me(" ",e.name," ")}}function Jy(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectDutyAmmo(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.dutySelectedAmmo()===e.itemTypeId),d(),me(" ",e.name," ")}}function Qy(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(4);return A(r.toggleDutyComponent(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(4);oe("selected",n.dutySelectedComponents().includes(e.itemTypeId)),d(),me(" ",e.name," ")}}function e1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Attachments"),f(),_(3,"div",30),ve(4,Qy,2,3,"button",31,dr),f()()),o&2){let e=g();d(4),xe(e.components)}}function t1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Ammo Type"),f(),_(3,"div",30),ve(4,Jy,2,3,"button",31,dr),f()(),R(6,e1,6,0,"div",29)),o&2){let e=t;d(4),xe(e.ammoType),d(2),N(e.components.length>0?6:-1)}}function n1(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectDutyArmor(i.key))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.dutySelectedArmor()===e.key),d(),me(" ",e.name," ")}}function i1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Armor"),f(),_(3,"div",30),ve(4,n1,2,3,"button",31,u0),f()()),o&2){let e=g(2);d(4),xe(e.dutyData().armorPool)}}function o1(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.toggleDutyEquipment(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit;oe("selected",e.selected),d(),me(" ",e.name," ")}}function r1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Equipment"),f(),_(3,"div",30),ve(4,o1,2,3,"button",31,dr),f()()),o&2){let e=g(2);d(4),xe(e.dutyEquipment())}}function a1(o,t){if(o&1){let e=Z();_(0,"div",3)(1,"section",26)(2,"h4"),u(3,"Unit Assignment"),f(),_(4,"input",27),z("input",function(i){P(e);let r=g();return A(r.dutyCallsign.set((i.target.value||"").toString()))}),f()(),_(5,"section",28)(6,"div",29)(7,"h5"),u(8,"Sidearm"),f(),_(9,"div",30),ve(10,Zy,2,3,"button",31,dr),f()(),R(12,t1,7,1),R(13,i1,6,0,"div",29),R(14,r1,6,0,"div",29),f(),_(15,"div",14)(16,"button",32),z("click",function(){P(e);let i=g();return A(i.submitDuty())}),u(17,"Duty"),f(),_(18,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(19,"Cancel"),f()()()}if(o&2){let e,n=g();d(4),Q("value",n.dutyCallsign())("disabled",n.dutyData().existingDuty),d(6),xe(n.dutyWeaponPool()),d(2),N((e=n.dutySelectedWeaponType())?12:-1,e),d(),N(n.dutyData().armorPool.length>0?13:-1),d(),N(n.dutyEquipment().length>0?14:-1)}}function s1(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectArsenalWeapon(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.arsenalSelectedWeapon()===e.itemTypeId),d(),me(" ",e.name," ")}}function l1(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(4);return A(r.selectArsenalAmmo(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(4);oe("selected",n.arsenalSelectedAmmo()===e.itemTypeId),d(),me(" ",e.name," ")}}function c1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Ammo Type"),f(),_(3,"div",30),ve(4,l1,2,3,"button",31,dr),f()()),o&2){let e=g();d(4),xe(e.ammoType)}}function d1(o,t){if(o&1){let e=Z();_(0,"button",33),z("click",function(){let i=P(e).$implicit,r=g(4);return A(r.toggleArsenalComponent(i.itemTypeId))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(4);oe("selected",n.arsenalSelectedComponents().includes(e.itemTypeId)),d(),me(" ",e.name," ")}}function u1(o,t){if(o&1&&(_(0,"div",29)(1,"h5"),u(2,"Attachments"),f(),_(3,"div",30),ve(4,d1,2,3,"button",31,dr),f()()),o&2){let e=g();d(4),xe(e.components)}}function h1(o,t){if(o&1&&(R(0,c1,6,0,"div",29),R(1,u1,6,0,"div",29)),o&2){let e=t;N(e.ammoType.length>0?0:-1),d(),N(e.components.length>0?1:-1)}}function p1(o,t){if(o&1){let e=Z();_(0,"div",3)(1,"section",28)(2,"div",29)(3,"h5"),u(4,"Weapons"),f(),_(5,"div",30),ve(6,s1,2,3,"button",31,dr),f()(),R(8,h1,2,2),f(),_(9,"div",14)(10,"button",15),z("click",function(){P(e);let i=g();return A(i.submitArsenal())}),u(11,"Withdraw"),f(),_(12,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(13,"Cancel"),f()()()}if(o&2){let e,n=g();d(6),xe(n.arsenalWeaponPool()),d(2),N((e=n.arsenalSelectedWeaponType())?8:-1,e),d(2),Q("disabled",!n.arsenalSelectedWeapon())}}function m1(o,t){if(o&1){let e=Z();_(0,"button",40),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectLoanDownpayment(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.loanSelectedDownpayment()===e),d(),me(" ",e,"% ")}}function f1(o,t){if(o&1){let e=Z();_(0,"button",40),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectLoanRepayment(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.loanSelectedRepayment()===e),d(),D(e)}}function g1(o,t){if(o&1){let e=Z();_(0,"div",4)(1,"section",34)(2,"h4"),u(3,"Loan"),f(),_(4,"div",35)(5,"span"),u(6,"Type"),f(),_(7,"span"),u(8),f(),_(9,"span"),u(10,"Collateral"),f(),_(11,"span"),u(12),f(),_(13,"span"),u(14,"Value"),f(),_(15,"span"),u(16),f()()(),_(17,"section",34)(18,"h4"),u(19,"Down Payment"),f(),_(20,"div",36),ve(21,m1,2,3,"button",37,ct),f()(),_(23,"section",34)(24,"h4"),u(25,"Repayment Period (months)"),f(),_(26,"div",36),ve(27,f1,2,3,"button",37,ct),f()(),_(29,"section",34)(30,"h4"),u(31,"Calculation"),f(),_(32,"div",35)(33,"span"),u(34,"Down Payment"),f(),_(35,"span"),u(36),f(),_(37,"span"),u(38,"Principal"),f(),_(39,"span"),u(40),f(),_(41,"span"),u(42,"Interest"),f(),_(43,"span"),u(44),f(),_(45,"span"),u(46,"Weekly Payment"),f(),_(47,"span"),u(48),f(),_(49,"span"),u(50,"Total Interest"),f(),_(51,"span"),u(52),f(),_(53,"span",38),u(54,"Total To Pay"),f(),_(55,"span",38),u(56),f()()(),_(57,"p",39),u(58,"* Calculation is informational. Final schedule and precise weekly payment are resolved at request time."),f(),_(59,"div",14)(60,"button",32),z("click",function(){P(e);let i=g();return A(i.submitLoan())}),u(61,"Request Loan"),f(),_(62,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(63,"Cancel"),f()()()}if(o&2){let e=g();d(8),D(e.loanData().type),d(4),D(e.loanData().collateral),d(4),D(e.formatMoney(e.loanData().amount)),d(5),xe(e.loanData().downpayment),d(6),xe(e.loanData().repaymentPeriods),d(9),D(e.loanDownpaymentDisplay()),d(4),D(e.loanPrincipalDisplay()),d(4),me("",e.loanData().apr,"%"),d(4),cn("",e.loanWeeklyPaymentDisplay()," x ",e.loanSelectedRepayment()*4),d(4),D(e.formatMoney(e.loanTotalInterest())),d(4),D(e.formatMoney(e.loanTotalPaid()))}}function _1(o,t){o&1&&(_(0,"span"),ye(1,"i",44),f())}function v1(o,t){o&1&&(_(0,"span"),ye(1,"i",45),f())}function x1(o,t){if(o&1&&(_(0,"p"),u(1),f()),o&2){let e=g(2).$implicit;d(),me("All ",e.name," are accepted by this shop.")}}function b1(o,t){if(o&1&&(_(0,"article",48)(1,"span"),u(2),f()()),o&2){let e=t.$implicit;Dt("background-image","url(https://static.southwest-roleplay.com/public/items/"+e.image+")"),d(2),D(e.name)}}function y1(o,t){if(o&1&&(_(0,"div",46),ve(1,b1,3,3,"article",47,ct),f()),o&2){let e=g(2).$implicit;d(),xe(e.items)}}function C1(o,t){if(o&1&&(_(0,"div",43),R(1,x1,2,1,"p")(2,y1,3,0,"div",46),f()),o&2){let e=g().$implicit;d(),N(e.all?1:2)}}function M1(o,t){if(o&1){let e=Z();_(0,"section",41)(1,"button",42),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.togglePawnshopCategory(i.key))}),_(2,"span"),u(3),f(),R(4,_1,2,0,"span")(5,v1,2,0,"span"),f(),R(6,C1,3,1,"div",43),f()}if(o&2){let e=t.$implicit,n=g(2);d(3),D(e.name),d(),N(n.isPawnshopCategoryExpanded(e.key)?5:4),d(2),N(n.isPawnshopCategoryExpanded(e.key)?6:-1)}}function w1(o,t){if(o&1&&(_(0,"div",5)(1,"p"),u(2,"This pawnshop accepts the following goods"),f(),ve(3,M1,7,3,"section",41,u0),f()),o&2){let e=g();d(3),xe(e.pawnshopData().categories)}}function S1(o,t){if(o&1){let e=Z();_(0,"button",62),z("click",function(){P(e);let i=g().$index,r=g(2);return A(r.removePosItem(i))}),u(1,"x"),f()}}function E1(o,t){if(o&1){let e=Z();_(0,"div",54)(1,"label"),u(2),f(),_(3,"div",57)(4,"input",58),z("input",function(i){let r=P(e).$index,a=g(2);return A(a.updatePosItem(r,{name:(i.target.value||"").toString()}))}),f(),_(5,"input",59),z("input",function(i){let r=P(e).$index,a=g(2);return A(a.updatePosItem(r,{amount:(i.target.value||"").toString()}))}),f(),_(6,"input",60),z("input",function(i){let r=P(e).$index,a=g(2);return A(a.updatePosItem(r,{price:(i.target.value||"").toString()}))}),f(),_(7,"overlay-select",51),z("valueChange",function(i){let r=P(e).$index,a=g(2);return A(a.updatePosItem(r,{tax:a.toNumber(i)}))}),f(),R(8,S1,2,0,"button",61),f()()}if(o&2){let e=t.$implicit,n=t.$index,i=g(2);d(2),me("Item #",n+1),d(2),Q("value",e.name),d(),Q("value",e.amount),d(),Q("value",e.price),d(),Q("options",i.posTaxSelectOptions())("value",e.tax),d(),N(n>0?8:-1)}}function T1(o,t){if(o&1){let e=Z();_(0,"div",6)(1,"section",49)(2,"div",50)(3,"label"),u(4,"Bank Account"),f(),_(5,"overlay-select",51),z("valueChange",function(i){P(e);let r=g();return A(r.posBankAccountId.set(r.toNumber(i)))}),f()(),_(6,"div",50)(7,"label"),u(8,"Payment Description"),f(),_(9,"input",52),z("input",function(i){P(e);let r=g();return A(r.posDescription.set((i.target.value||"").toString()))}),f()()(),_(10,"section",53),ve(11,E1,9,7,"div",54,ct),_(13,"button",55),z("click",function(){P(e);let i=g();return A(i.addPosItem())}),u(14,"+ Add Item"),f()(),_(15,"div",14)(16,"button",15),z("click",function(){P(e);let i=g();return A(i.submitPos())}),u(17,"Prompt Payment"),f(),_(18,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDmv())}),u(19,"Cancel"),f(),_(20,"span",56),u(21),f()()()}if(o&2){let e=g();d(5),Q("options",e.posBankAccountSelectOptions())("value",e.posBankAccountId()),d(4),Q("value",e.posDescription()),d(2),xe(e.posItems()),d(5),Q("disabled",!e.isPosValid()),d(5),me("Total: ",e.formatMoney(e.posTotal()),", tax incl.")}}function P1(o,t){if(o&1&&(_(0,"p"),u(1," You're about to submit a report against "),_(2,"strong",66),u(3),f(),u(4," to all online admins with: "),f()),o&2){let e=g(2);d(3),D(e.reportData().reported)}}function A1(o,t){o&1&&(_(0,"p"),u(1,"You're about to submit a report to all online admins with:"),f())}function I1(o,t){if(o&1){let e=Z();_(0,"div",7)(1,"p")(2,"strong",63),u(3,"WARNING:"),f()(),R(4,P1,5,1,"p")(5,A1,2,0,"p"),_(6,"p",64),u(7),f(),_(8,"section",65)(9,"p"),u(10,"Please do not spam your reports. Be patient and an administrator will assist you as soon as possible."),f(),_(11,"p"),u(12,"You should not disrupt or stall roleplay unless admin assistance is being given."),f(),_(13,"p"),u(14,"Be descriptive in your report, especially for teleports/unfreezes/slaps and similar requests."),f()(),_(15,"div",14)(16,"button",32),z("click",function(){P(e);let i=g();return A(i.emitAction("confirm"))}),u(17,"Submit"),f(),_(18,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(19,"Cancel"),f()()()}if(o&2){let e=g();d(4),N(e.reportData().reported?4:5),d(3),D(e.reportData().content)}}function O1(o,t){o&1&&(_(0,"p",67),u(1,"Read the following contract carefully and sign where applicable."),f())}function D1(o,t){if(o&1){let e=Z();_(0,"div",14)(1,"button",32),z("click",function(){P(e);let i=g(2);return A(i.emitAction("confirm"))}),u(2,"Confirm"),f(),_(3,"button",16),z("click",function(){P(e);let i=g(2);return A(i.emitAction("cancel"))}),u(4,"Cancel"),f()()}}function k1(o,t){if(o&1&&(_(0,"div",8),R(1,O1,2,0,"p",67),ye(2,"article",68),R(3,D1,5,0,"div",14),f()),o&2){let e=g();d(),N(e.contractData().toSign?1:-1),d(),Q("innerHTML",e.contractData().html,an),d(),N(e.contractData().toSign?3:-1)}}function R1(o,t){if(o&1&&(_(0,"li"),u(1),f()),o&2){let e=t.$implicit;d(),D(e)}}function N1(o,t){if(o&1&&(u(0," You are eligible for parole from "),_(1,"strong"),u(2),f(),u(3,". ")),o&2){let e=g(2);d(2),D(e.prisonSlipData().parole)}}function L1(o,t){o&1&&u(0," You are not eligible for parole. ")}function F1(o,t){if(o&1){let e=Z();_(0,"article",9)(1,"h3"),u(2,"SAN ANDREAS DEPARTMENT OF CORRECTIONS AND REHABILITATION"),f(),_(3,"h4"),u(4,"Prisoner Information Sheet"),f(),_(5,"p"),u(6),f(),ye(7,"hr"),_(8,"section")(9,"strong"),u(10,"Arresting Officer"),f(),_(11,"p"),u(12),f(),_(13,"p"),u(14),f()(),_(15,"section")(16,"strong"),u(17),f(),_(18,"ul"),ve(19,R1,2,1,"li",null,ct),f()(),_(21,"p"),u(22," You are remanded into custody until "),_(23,"strong"),u(24),f(),u(25,". "),R(26,N1,4,1)(27,L1,1,0),f(),_(28,"div",14)(29,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(30,"Close"),f()()()}if(o&2){let e=g();d(6),me("In the case of The People of San Andreas v. ",e.prisonSlipData().name),d(6),D(e.prisonSlipData().arrestor),d(2),D(e.prisonSlipData().arrestingAgency),d(3),me("Charges (",e.prisonSlipData().charges.length,")"),d(2),xe(e.prisonSlipData().charges),d(5),D(e.prisonSlipData().until),d(2),N(e.prisonSlipData().parole?26:27)}}function V1(o,t){if(o&1&&(_(0,"article",71)(1,"p",72),u(2),f(),_(3,"p",73),u(4),f(),_(5,"p",74),u(6),f()()),o&2){let e=t.$implicit,n=g(2);Dt("background-image",n.getVehicleColorStyle(e.id)),d(2),D(e.name),d(2),me("Code #",e.id),d(2),D(e.price)}}function B1(o,t){if(o&1){let e=Z();_(0,"section",69),ve(1,V1,7,5,"article",70,ct),f(),_(3,"div",14)(4,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(5,"Close"),f()()}if(o&2){let e=g();d(),xe(e.vehicleColors())}}function U1(o,t){if(o&1&&(_(0,"article",71)(1,"p",72),u(2),f(),_(3,"p",73),u(4),f(),_(5,"p",74),u(6),f()()),o&2){let e=t.$implicit,n=g(2);Dt("background-image",n.getVehicleWheelStyle(n.vehicleWheels().type,e.index)),d(2),D(e.name),d(2),cn("Code ",n.vehicleWheels().type,"x",e.index),d(2),D(e.price)}}function z1(o,t){if(o&1){let e=Z();_(0,"section",69),ve(1,U1,7,6,"article",70,ct),f(),_(3,"div",14)(4,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(5,"Close"),f()()}if(o&2){let e=g();d(),xe(e.vehicleWheels().wheels)}}function H1(o,t){if(o&1&&(_(0,"p",78),u(1),f()),o&2){let e=g(2);d(),D(e.menyooError())}}function G1(o,t){if(o&1){let e=Z();_(0,"section",75)(1,"p",76),u(2,"You can import your character's appearance by pasting a Menyoo compatible XML config below."),f(),_(3,"p",76),u(4," Head shape, skin tone, eye color, facial features, and head overlays except make up, blush and lipstick will be applied. Please select the remaining attributes through the character creator. "),f(),_(5,"textarea",77),z("input",function(i){P(e);let r=g();return A(r.menyooConfig.set((i.target.value||"").toString()))}),f(),R(6,H1,2,1,"p",78),f(),_(7,"div",14)(8,"button",15),z("click",function(){P(e);let i=g();return A(i.submitMenyooImport())}),u(9,"Import"),f(),_(10,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelMenyooImport())}),u(11,"Cancel"),f()()}if(o&2){let e=g();d(5),Q("value",e.menyooConfig()),d(),N(e.menyooError()?6:-1),d(2),Q("disabled",!e.menyooConfig().trim())}}function W1(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"h4"),u(2),f(),_(3,"p",11),u(4),f(),_(5,"label",80)(6,"input",81),z("change",function(){P(e);let i=g();return A(i.toggleAcknowledge())}),f(),_(7,"span"),u(8,"I acknowledge and understand this message."),f()()(),_(9,"div",14)(10,"button",15),z("click",function(){P(e);let i=g();return A(i.submitAcknowledge())}),u(11,"Acknowledge"),f()()}if(o&2){let e=g();d(2),D(e.acknowledgeData().author),d(2),D(e.acknowledgeData().content),d(2),Q("checked",e.acknowledgeChecked()),d(4),Q("disabled",!e.acknowledgeChecked())}}function X1(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"h4"),u(2,"Advertisement Preview"),f(),_(3,"p",82),u(4),f(),_(5,"p",11),u(6),f()(),_(7,"div",14)(8,"button",32),z("click",function(){P(e);let i=g();return A(i.submitAdConfirm())}),u(9,"Submit"),f(),_(10,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelAdConfirm())}),u(11,"Cancel"),f()()}if(o&2){let e=g();d(4),D(e.adConfirmData().advert),d(2),me("Cost: ",e.formatMoney(e.adConfirmCost()))}}function q1(o,t){if(o&1){let e=Z();_(0,"section",83)(1,"div",84)(2,"h4"),u(3),f(),_(4,"p",85),u(5),f(),_(6,"p"),u(7),f()()(),_(8,"div",14)(9,"button",32),z("click",function(){P(e);let i=g();return A(i.submitEmployment())}),u(10,"Accept Offer"),f(),_(11,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelEmployment())}),u(12,"Decline"),f()()}if(o&2){let e=g();Dt("background-image","url("+e.employmentData().image+")"),d(3),D(e.employmentData().position),d(2),D(e.employmentData().company),d(2),D(e.employmentData().description)}}function $1(o,t){if(o&1&&(_(0,"small"),u(1),f()),o&2){let e=g().$implicit;d(),me("x",e.amount)}}function Y1(o,t){if(o&1){let e=Z();_(0,"button",88),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectItemSelectorItem(i.id))}),_(1,"span"),u(2),f(),R(3,$1,2,1,"small"),f()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image","url(https://static.southwest-roleplay.com/public/items/"+e.image+")"),oe("active",n.isItemSelectorSelected(e.id)),Q("disabled",n.itemSelectorData().disableSelect),d(2),D(e.name),d(),N(e.amount?3:-1)}}function j1(o,t){if(o&1){let e=Z();_(0,"section",86),ve(1,Y1,4,7,"button",87,fs),f(),_(3,"div",14)(4,"button",15),z("click",function(){P(e);let i=g();return A(i.submitItemSelector())}),u(5),f(),_(6,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelItemSelector())}),u(7),f()()}if(o&2){let e=g();d(),xe(e.itemSelectorData().items),d(3),Q("disabled",e.itemSelectorSelected().length===0),d(),me(" ",e.itemSelectorData().submitLabelMultiSelect&&e.itemSelectorSelected().length>1?e.itemSelectorData().submitLabelMultiSelect:e.itemSelectorData().submitLabel," "),d(2),D(e.itemSelectorData().cancelLabel)}}function K1(o,t){o&1&&ye(0,"div",0),o&2&&Q("innerHTML",t,an)}function Z1(o,t){if(o&1&&(_(0,"p",11),u(1),f()),o&2){let e=g(2);d(),D(e.options().message||e.customData().content||"Proceed with trace?")}}function J1(o,t){if(o&1){let e=Z();_(0,"section",79),R(1,K1,1,1,"div",0)(2,Z1,2,1,"p",11),f(),_(3,"div",14)(4,"button",32),z("click",function(){P(e);let i=g();return A(i.submitTraceContinue())}),u(5,"Continue"),f(),_(6,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(7,"Cancel"),f()()}if(o&2){let e,n=g();d(),N((e=n.htmlContent())?1:2,e)}}function Q1(o,t){if(o&1){let e=Z();_(0,"article",89)(1,"h3"),u(2,"SAN ANDREAS DEPARTMENT OF CORRECTIONS AND REHABILITATION"),f(),_(3,"h4"),u(4,"Parolee Information Sheet"),f(),_(5,"p"),u(6),f(),_(7,"p"),u(8,"You have been released on parole. While on parole, you must comply with orders, avoid further offenses, and abide by state and federal law."),f(),_(9,"p"),u(10," You are considered on parole until "),_(11,"strong"),u(12),f(),u(13,". "),f()(),_(14,"div",14)(15,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(16,"Close"),f()()}if(o&2){let e=g();d(6),me("TO PAROLEE ",e.paroleSlipData().name),d(6),D(e.paroleSlipData().until)}}function eC(o,t){if(o&1&&(_(0,"p")(1,"strong"),u(2),f(),u(3," reported "),_(4,"strong"),u(5),f(),u(6),f()),o&2){let e,n=g(2);d(2),D(n.reportInfoData().reporter),d(3),D((e=n.reportInfoData().reported)==null?null:e.name),d(),me(", ",n.reportInfoData().elapsed,", and said: ")}}function tC(o,t){if(o&1&&(_(0,"p")(1,"strong"),u(2),f(),u(3),f()),o&2){let e=g(2);d(2),D(e.reportInfoData().reporter),d(),me(" reported, ",e.reportInfoData().elapsed,", and said: ")}}function nC(o,t){if(o&1&&(_(0,"p",90),u(1),f()),o&2){let e,n=g(2);d(),me("The reported player is in game under a different character: ",(e=n.reportInfoData().reported)==null?null:e.differentChar,".")}}function iC(o,t){if(o&1&&(_(0,"p",90),u(1),f()),o&2){let e=t.$implicit;d(),D(e)}}function oC(o,t){if(o&1&&ve(0,iC,2,1,"p",90,ct),o&2){let e,n=g(2);xe(((e=n.reportInfoData().reported)==null?null:e.mentions)||Xi(0,Ry))}}function rC(o,t){if(o&1){let e=Z();_(0,"section",79),R(1,eC,7,3,"p")(2,tC,4,2,"p"),_(3,"p",64),u(4),f(),R(5,nC,2,1,"p",90),R(6,oC,2,1),f(),_(7,"div",14)(8,"button",32),z("click",function(){P(e);let i=g();return A(i.reportInfoAction("accept"))}),u(9,"Accept"),f(),_(10,"button",91),z("click",function(){P(e);let i=g();return A(i.reportInfoAction("disregard"))}),u(11,"Disregard"),f(),_(12,"button",16),z("click",function(){P(e);let i=g();return A(i.reportInfoAction("return"))}),u(13,"Return"),f()()}if(o&2){let e,n,i=g();d(),N(i.reportInfoData().reported?1:2),d(3),D(i.reportInfoData().report),d(),N((e=i.reportInfoData().reported)!=null&&e.differentChar?5:-1),d(),N((((n=i.reportInfoData().reported)==null||n.mentions==null?null:n.mentions.length)||0)>0?6:-1)}}function aC(o,t){if(o&1){let e=Z();_(0,"button",94),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectVehicleList(i.id,i.spawned))}),_(1,"span",95),u(2),f(),_(3,"small"),u(4),f()()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image",n.vehicleListStyle(e.model)),oe("selected",n.selectedVehicleId()===e.id)("spawned",e.spawned),Q("disabled",e.spawned),d(2),D(e.name),d(2),D(e.plate)}}function sC(o,t){if(o&1){let e=Z();_(0,"section",92),ve(1,aC,5,9,"button",93,fs),f(),_(3,"div",14)(4,"button",15),z("click",function(){P(e);let i=g();return A(i.submitVehicleList())}),u(5,"Spawn"),f(),_(6,"button",16),z("click",function(){P(e);let i=g();return A(i.emitAction("cancel"))}),u(7,"Close"),f()()}if(o&2){let e=g();d(),xe(e.vehicleListData()),d(3),Q("disabled",!e.selectedVehicleId())}}function lC(o,t){if(o&1&&(_(0,"section",10)(1,"div",96),ye(2,"img",97)(3,"img",98)(4,"img",99)(5,"img",100),f(),_(6,"div",101)(7,"p")(8,"strong"),u(9,"Model:"),f(),u(10),f(),_(11,"p")(12,"strong"),u(13,"Engine:"),f(),u(14),f(),_(15,"p")(16,"strong"),u(17,"Color:"),f(),u(18),f(),_(19,"p")(20,"strong"),u(21,"Wheels:"),f(),u(22),f(),_(23,"p")(24,"strong"),u(25,"Upgrades:"),f(),u(26),f(),_(27,"p")(28,"strong"),u(29,"Created:"),f(),u(30),f(),_(31,"p")(32,"strong"),u(33,"Status:"),f(),u(34),f()()()),o&2){let e=g();d(2),Q("src",e.vehicleOrderPreviewUrl("corner"),Gi),d(),Q("src",e.vehicleOrderPreviewUrl("side"),Gi),d(),Q("src",e.vehicleOrderPreviewUrl("front"),Gi),d(),Q("src",e.vehicleOrderPreviewUrl("rear"),Gi),d(5),me(" ",e.vehicleOrderData().displayModel),d(4),me(" ",e.vehicleOrderData().engine),d(4),me(" ",e.vehicleOrderData().colorName),d(4),me(" ",e.vehicleOrderData().wheelName),d(4),me(" ",e.vehicleOrderData().upgrades),d(4),me(" ",e.vehicleOrderData().created),d(4),me(" ",e.vehicleOrderData().status)}}function cC(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"p",11),u(2,"Choose where to deliver the order to. Delivery can take up to 24 hours."),f(),_(3,"div",50)(4,"label"),u(5,"Property"),f(),_(6,"overlay-select",51),z("valueChange",function(i){P(e);let r=g();return A(r.selectDarknetProperty(r.toNumber(i)))}),f()(),_(7,"div",50)(8,"label"),u(9,"Inventory"),f(),_(10,"overlay-select",51),z("valueChange",function(i){P(e);let r=g();return A(r.selectedDarknetInventoryId.set(r.toNumber(i)))}),f()()(),_(11,"div",14)(12,"button",15),z("click",function(){P(e);let i=g();return A(i.submitDarknetOrder())}),u(13," Confirm and Pay "),f(),_(14,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDarknetOrder())}),u(15,"Cancel"),f()()}if(o&2){let e=g();d(6),Q("options",e.darknetPropertyOptions())("value",e.selectedDarknetPropertyId()),d(4),Q("options",e.darknetInventoryOptions())("value",e.selectedDarknetInventoryId()),d(2),Q("disabled",!e.selectedDarknetPropertyId()||!e.selectedDarknetInventoryId())}}function dC(o,t){if(o&1){let e=Z();_(0,"button",40),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectDeckSuit(i.slug))}),ye(1,"i",106),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.selectedDeckSuit()===e.slug),d(),wn(n.deckSuitIcon(e.icon))}}function uC(o,t){if(o&1){let e=Z();_(0,"button",107),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.addDeckCard(i))}),f()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image",n.deckCardUrl(n.selectedDeckSuit(),e))}}function hC(o,t){if(o&1){let e=Z();_(0,"button",107),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.removeDeckCard(i))}),f()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image",n.deckCardUrl(e.suit,e.rank))}}function pC(o,t){if(o&1){let e=Z();_(0,"section",102)(1,"div",103),ve(2,dC,2,4,"button",37,Ny),f(),_(4,"div",104),ve(5,uC,1,2,"button",105,Ln),f(),_(7,"h5"),u(8,"Your deck"),f(),_(9,"div",104),ve(10,hC,1,2,"button",105,ct),f()(),_(12,"div",14)(13,"button",32),z("click",function(){P(e);let i=g();return A(i.submitDeckCreator())}),u(14,"Confirm"),f(),_(15,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelDeckCreator())}),u(16,"Cancel"),f()()}if(o&2){let e=g();d(2),xe(e.deckCreatorData().suits),d(3),xe(e.deckCreatorData().ranks),d(5),xe(e.deckCards())}}function mC(o,t){if(o&1){let e=Z();_(0,"button",111),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.toggleCookwareIngredient(i.id))}),_(1,"span"),u(2),f()()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image","url(https://static.southwest-roleplay.com/public/items/"+e.image+")"),oe("active",n.cookwareSelectedIngredientIds().includes(e.id)),d(2),D(e.name)}}function fC(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"h4"),u(2,"Select ingredients to cook with"),f(),_(3,"div",108),ve(4,mC,3,5,"button",109,fs),f(),_(6,"div",50)(7,"label"),u(8,"Add water (ml)"),f(),_(9,"input",110),z("input",function(i){P(e);let r=g();return A(r.cookwareWaterMl.set((i.target.value||"").toString()))}),f()()(),_(10,"div",14)(11,"button",15),z("click",function(){P(e);let i=g();return A(i.submitCookware())}),u(12,"Lock In"),f(),_(13,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelCookware())}),u(14,"Cancel"),f()()}if(o&2){let e=g();d(4),xe(e.cookwareData().ingredients),d(5),Q("value",e.cookwareWaterMl()),d(2),Q("disabled",!e.cookwareValid())}}function gC(o,t){if(o&1){let e=Z();_(0,"button",40),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectPillMold(i.id))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.pillPressSelectedMoldId()===e.id),d(),cn(" ",e.name," (",e.capacity,"mg) ")}}function _C(o,t){if(o&1){let e=Z();_(0,"div",113)(1,"label"),u(2),f(),_(3,"input",115),z("input",function(i){let r=P(e).$implicit,a=g(2);return A(a.updatePillIngredientAmount(r.id,(i.target.value||"").toString()))}),f()()}if(o&2){let e=t.$implicit,n=g(2);d(2),D(e.name),d(),Q("value",n.pillPressIngredientAmounts()[e.id])}}function vC(o,t){if(o&1&&(_(0,"p",90),u(1),f()),o&2){let e=g(2);d(),D(e.pillPressError())}}function xC(o,t){if(o&1&&(_(0,"p",114),u(1),f()),o&2){let e=g(2);d(),D(e.pillPressSuccess())}}function bC(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"div",50)(2,"label"),u(3,"Name"),f(),_(4,"input",112),z("input",function(i){P(e);let r=g();return r.pillPressName.set((i.target.value||"").toString()),A(r.validatePillPress())}),f()(),_(5,"h5"),u(6,"Select mold"),f(),_(7,"div",36),ve(8,gC,2,4,"button",37,fs),f(),_(10,"h5"),u(11,"Add ingredients"),f(),ve(12,_C,4,2,"div",113,fs),R(14,vC,2,1,"p",90),R(15,xC,2,1,"p",114),f(),_(16,"div",14)(17,"button",15),z("click",function(){P(e);let i=g();return A(i.submitPillPress())}),u(18),f(),_(19,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelPillPress())}),u(20,"Cancel"),f()()}if(o&2){let e=g();d(4),Q("value",e.pillPressName()),d(4),xe(e.pillPressData().molds),d(4),xe(e.pillPressData().ingredients),d(2),N(e.pillPressError()?14:-1),d(),N(e.pillPressSuccess()?15:-1),d(2),Q("disabled",e.pillPressLoading()),d(),me(" ",e.pillPressLoading()?"Pressing...":"Press"," ")}}function yC(o,t){if(o&1&&(_(0,"p")(1,"strong"),u(2,"Attached Property:"),f(),u(3),f()),o&2){let e=g(2);d(3),me(" ",e.startRentData().attachedProperties)}}function CC(o,t){if(o&1){let e=Z();_(0,"section",79)(1,"h4"),u(2,"Residential Rental Agreement"),f(),_(3,"p")(4,"strong"),u(5,"Landlord:"),f(),u(6),f(),_(7,"p")(8,"strong"),u(9,"Tenant:"),f(),u(10),f(),_(11,"p")(12,"strong"),u(13,"Address:"),f(),u(14),f(),_(15,"p")(16,"strong"),u(17,"Residence Type:"),f(),u(18),f(),_(19,"p")(20,"strong"),u(21,"Monthly Rent:"),f(),u(22),f(),_(23,"p")(24,"strong"),u(25,"Deposit:"),f(),u(26),f(),_(27,"p")(28,"strong"),u(29,"Rent Start:"),f(),u(30),f(),R(31,yC,4,1,"p"),_(32,"label",80)(33,"input",81),z("change",function(){P(e);let i=g();return A(i.toggleStartRentSigned())}),f(),_(34,"span"),u(35,"I sign this rental agreement."),f()()(),_(36,"div",14)(37,"button",15),z("click",function(){P(e);let i=g();return A(i.submitStartRent())}),u(38,"Accept"),f(),_(39,"button",16),z("click",function(){P(e);let i=g();return A(i.cancelStartRent())}),u(40,"Decline"),f()()}if(o&2){let e=g();d(6),me(" ",e.startRentData().landlordName),d(4),me(" ",e.startRentData().tenantName),d(4),me(" ",e.startRentData().address),d(4),me(" ",e.startRentData().residenceType),d(4),me(" ",e.formatMoney(e.startRentData().rent)),d(4),me(" ",e.formatMoney(e.startRentData().deposit)),d(4),me(" ",e.startRentData().rentStart),d(),N(e.startRentData().attachedProperties?31:-1),d(2),Q("checked",e.startRentSigned()),d(4),Q("disabled",!e.startRentSigned())}}function MC(o,t){if(o&1&&(_(0,"p",11),u(1),f()),o&2){let e=g();d(),D(e.options().message)}}function wC(o,t){if(o&1&&(_(0,"p",11),u(1),f()),o&2){let e=g();d(),me("Unsupported custom modal component: ",e.componentName())}}var h0=(()=>{class o{constructor(){this.options=en.required(),this.responded=Qt(),this.componentName=le(()=>(this.options().component??"").trim()),this.customData=le(()=>{let e=this.options().data;return e&&typeof e=="object"?e:{}}),this.reportData=le(()=>{let e=this.customData();return{reported:typeof e.reported=="string"?e.reported:null,content:typeof e.content=="string"?e.content:""}}),this.contractData=le(()=>{let e=this.customData();return{html:typeof e.html=="string"?e.html:"",toSign:e.toSign===!0}}),this.prisonSlipData=le(()=>{let e=this.customData();return{name:typeof e.name=="string"?e.name:"Unknown",arrestor:typeof e.arrestor=="string"?e.arrestor:"Unknown",arrestingAgency:typeof e.arrestingAgency=="string"?e.arrestingAgency:"Unknown",charges:Array.isArray(e.charges)?e.charges.map(n=>String(n)):[],until:typeof e.until=="string"?e.until:"Unknown",parole:typeof e.parole=="string"?e.parole:null}}),this.vehicleColors=le(()=>{let e=this.customData();return(Array.isArray(e.colors)?e.colors:[]).map(i=>{let r=i;return{id:Number(r.id??0),name:String(r.name??"Unknown"),price:String(r.price??"N/A")}})}),this.vehicleWheels=le(()=>{let e=this.customData(),n=Array.isArray(e.wheels)?e.wheels:[];return{type:Number(e.type??0),wheels:n.map(i=>{let r=i;return{index:Number(r.index??0),name:String(r.name??"Unknown"),price:String(r.price??"N/A")}})}}),this.dmvLandingData=le(()=>{let e=this.customData();return{hasVehicle:e.hasVehicle===!0,hasLicense:e.hasLicense===!0}}),this.dmvData=le(()=>({reviewing:this.customData().reviewing===!0})),this.dmvRegisterData=le(()=>{let e=this.customData();return{model:String(e.model??"Unknown Vehicle"),currPlate:String(e.currPlate??""),newPlate:typeof e.newPlate=="string"?e.newPlate:"",renewDay:String(e.renewDay??"Unknown")}}),this.dmvExamData=le(()=>{let e=this.customData();return{name:String(e.name??"Applicant"),adult:e.adult===!0,passed:e.passed===!0,type:String(e.type??"knowledge"),faillist:Array.isArray(e.faillist)?e.faillist.map(n=>String(n)):[],date:typeof e.date=="string"?e.date:null}}),this.dutyData=le(()=>{let e=this.customData();return{existingDuty:e.existingDuty===!0,weaponPool:Array.isArray(e.weaponPool)?e.weaponPool.map(n=>this.normalizeWeapon(n)):[],savedWeaponItemId:Number(e.savedWeaponItemId??0),savedWeaponAmmoId:Number(e.savedWeaponAmmoId??0),savedWeaponComponents:Array.isArray(e.savedWeaponComponents)?e.savedWeaponComponents.map(n=>Number(n)).filter(n=>Number.isFinite(n)):[],equipmentPool:Array.isArray(e.equipmentPool)?e.equipmentPool.map(n=>{let i=n??{};return{itemTypeId:Number(i.itemTypeId??0),name:String(i.name??"Unknown"),selected:i.selected===!0}}):[],armorPool:Array.isArray(e.armorPool)?e.armorPool.map(n=>{let i=n??{};return{key:String(i.key??""),name:String(i.name??"Unknown")}}):[],savedArmorKey:String(e.savedArmorKey??""),callsign:typeof e.callsign=="string"?e.callsign:""}}),this.dutyArsenalData=le(()=>{let e=this.customData();return{weaponPool:Array.isArray(e.weaponPool)?e.weaponPool.map(n=>this.normalizeWeapon(n)):[]}}),this.loanData=le(()=>{let e=this.customData(),n=Array.isArray(e.downpayment)?e.downpayment.map(r=>Number(r)).filter(r=>Number.isFinite(r)):[],i=Array.isArray(e.repaymentPeriods)?e.repaymentPeriods.map(r=>Number(r)).filter(r=>Number.isFinite(r)):[];return{amount:Number(e.amount??0),type:String(e.type??"Loan"),collateral:String(e.collateral??"None"),apr:Number(e.apr??0),downpayment:n,repaymentPeriods:i}}),this.pawnshopData=le(()=>{let e=this.customData();return{categories:Array.isArray(e.categories)?e.categories.map((i,r)=>{let a=i??{},s=Array.isArray(a.items)?a.items.map(l=>{let c=l??{};return{name:String(c.name??"Unknown Item"),image:String(c.image??"")}}):[];return{key:`${String(a.name??"Category")}:${r}`,name:String(a.name??"Category"),all:a.all===!0,items:s}}):[]}}),this.posData=le(()=>{let e=this.customData(),n=Array.isArray(e.bankAccounts)?e.bankAccounts.map(r=>{let a=r??{};return{id:Number(a.id??0),iban:String(a.iban??"Unknown")}}):[],i=Array.isArray(e.taxCategories)?e.taxCategories.map(r=>{let a=r??{};return{id:Number(a.id??0),name:String(a.name??"Tax"),amount:Number(a.amount??0)}}):[];return{bankAccounts:n,taxCategories:i}}),this.acknowledgeData=le(()=>{let e=this.customData();return{author:String(e.author??"Unknown"),content:String(e.content??"")}}),this.adConfirmData=le(()=>{let e=this.customData();return{advert:String(e.advert??""),basePay:Number(e.basePay??0),letterPay:Number(e.letterPay??0)}}),this.employmentData=le(()=>{let e=this.customData();return{position:String(e.position??"Position"),company:String(e.company??"Company"),image:String(e.image??""),description:String(e.description??"")}}),this.itemSelectorData=le(()=>{let e=this.customData(),n=Array.isArray(e.items)?e.items:[];return{disableSelect:e.disableSelect===!0,disableMulti:e.disableMulti===!0,submitLabel:String(e.submitLabel??"Submit"),cancelLabel:String(e.cancelLabel??"Cancel"),submitLabelMultiSelect:String(e.submitLabelMultiSelect??""),items:n.map(i=>{let r=i??{};return{id:Number(r.id??0),name:String(r.name??"Unknown Item"),amount:r.amount!=null?String(r.amount):"",image:String(r.image??"")}})}}),this.paroleSlipData=le(()=>{let e=this.customData();return{name:String(e.name??"Unknown"),until:String(e.until??"Unknown")}}),this.reportInfoData=le(()=>{let e=this.customData(),n=e.reported,i=n&&typeof n=="object"?n:null;return{reporter:String(e.reporter??"Unknown"),report:String(e.report??""),elapsed:String(e.elapsed??""),reported:i?{name:String(i.name??"Unknown"),differentChar:typeof i.different_char=="string"?i.different_char:null,mentions:Array.isArray(i.mentions)?i.mentions.map(r=>String(r)):[]}:null}}),this.vehicleListData=le(()=>{let e=this.customData();return(Array.isArray(e.vehicles)?e.vehicles:[]).map(i=>{let r=i??{},a=Array.isArray(r.hexColors)?r.hexColors:[];return{id:Number(r.id??0),model:String(r.model??""),name:String(r.name??"Unknown Vehicle"),plate:String(r.plate??"UNKNOWN"),spawned:r.spawned===!0,hexColors:[String(a[0]??"#ffffff"),String(a[1]??a[0]??"#ffffff")]}})}),this.vehicleOrderData=le(()=>{let e=this.customData();return{model:String(e.model??""),displayModel:String(e.displayModel??""),engine:String(e.engine??""),color:Number(e.color??0),colorName:String(e.colorName??""),wheelType:Number(e.wheelType??0),wheelIndex:Number(e.wheelIndex??0),wheelName:String(e.wheelName??""),upgrades:String(e.upgrades??""),created:String(e.created??""),status:String(e.status??"")}}),this.darknetOrderData=le(()=>{let e=this.customData();return(Array.isArray(e.properties)?e.properties:[]).map(i=>{let r=i??{},a=Array.isArray(r.inventories)?r.inventories:[];return{id:Number(r.id??0),address:String(r.address??"Unknown"),inventories:a.map(s=>{let l=s??{};return{id:Number(l.id??0),name:String(l.name??"Inventory"),capacity:Number(l.capacity??0),weight:Number(l.weight??0)}})}})}),this.deckCreatorData=le(()=>{let e=this.customData(),n=Array.isArray(e.suits)?e.suits:[],i=Array.isArray(e.ranks)?e.ranks:[];return{suits:n.map(r=>{let a=r??{};return{slug:String(a.slug??""),icon:String(a.icon??"")}}),ranks:i.map(r=>String(r))}}),this.cookwareData=le(()=>{let e=this.customData();return{ingredients:(Array.isArray(e.ingredients)?e.ingredients:[]).map(i=>{let r=i??{};return{id:Number(r.id??0),name:String(r.name??"Ingredient"),image:String(r.image??"")}})}}),this.pillPressData=le(()=>{let e=this.customData(),n=Array.isArray(e.molds)?e.molds:[],i=Array.isArray(e.ingredients)?e.ingredients:[];return{objectId:Number(e.objectId??0),molds:n.map(r=>{let a=r??{},l=(a.type??{}).properties??{};return{id:Number(a.id??0),name:String(a.name??"Mold"),image:String(a.image??""),capacity:Number(l.capacity??0)}}),ingredients:i.map(r=>{let a=r??{};return{id:Number(a.id??0),name:String(a.name??"Ingredient"),image:String(a.image??"")}})}}),this.startRentData=le(()=>{let e=this.customData(),n=e.landlord??{},i=e.tenant??{};return{landlordName:String(n.name??""),tenantName:String(i.name??""),address:String(e.address??""),residenceType:String(e.residenceType??""),rent:Number(e.rent??0),deposit:Number(e.deposit??0),rentStart:String(e.rentStart??""),attachedProperties:String(e.attachedProperties??"")}}),this.dmvLandingSelection=F(null),this.dmvCountdown=F(10),this.dmvRoadRulesCountdown=F(10),this.dutyCallsign=F(""),this.dutySelectedWeapon=F(0),this.dutySelectedAmmo=F(0),this.dutySelectedComponents=F([]),this.dutySelectedArmor=F(""),this.dutyEquipment=F([]),this.arsenalSelectedWeapon=F(0),this.arsenalSelectedAmmo=F(0),this.arsenalSelectedComponents=F([]),this.acknowledgeChecked=F(!1),this.itemSelectorSelected=F([]),this.selectedVehicleId=F(null),this.selectedDarknetPropertyId=F(0),this.selectedDarknetInventoryId=F(0),this.selectedDeckSuit=F(""),this.deckCards=F([]),this.cookwareWaterMl=F(""),this.cookwareSelectedIngredientIds=F([]),this.pillPressName=F(""),this.pillPressSelectedMoldId=F(0),this.pillPressIngredientAmounts=F({}),this.pillPressError=F(""),this.pillPressSuccess=F(""),this.pillPressLoading=F(!1),this.weaponLicenseCountdown=F(10),this.startRentSigned=F(!1),this.menyooConfig=F(""),this.menyooError=F(""),this.loanSelectedDownpayment=F(0),this.loanSelectedRepayment=F(0),this.pawnshopExpanded=F({}),this.posBankAccountId=F(0),this.posDescription=F(""),this.posItems=F([]),this.dmvCountdownTimer=null,this.dmvRoadRulesCountdownTimer=null,this.weaponLicenseCountdownTimer=null,this.onPillPressDone=(e,n)=>{this.pillPressError.set(typeof e=="string"?e:""),this.pillPressSuccess.set(typeof n=="string"?n:""),this.pillPressLoading.set(!1)}}ngOnInit(){this.initializeCustomState(),typeof mp<"u"&&mp?.events?.add&&mp.events.add("pillPress:done",this.onPillPressDone)}ngOnDestroy(){this.clearTimers(),typeof mp<"u"&&mp?.events?.remove&&mp.events.remove("pillPress:done",this.onPillPressDone)}htmlContent(){let e=this.options().html;if(typeof e=="string"&&e.trim().length>0)return e.trim();let n=this.customData().trace;if(typeof n=="string"&&n.trim().length>0)return n.trim();let i=this.customData().content;return typeof i=="string"&&i.trim().length>0?i.trim():null}emitAction(e){this.responded.emit({action:e})}selectDmvLandingOption(e){let n=this.dmvLandingData();if(e==="test"&&n.hasLicense||(e==="vehreg"||e==="vanity")&&!n.hasVehicle||e==="renew"&&!n.hasLicense)return;let i=this.dmvLandingSelection();this.dmvLandingSelection.set(i===e?null:e)}submitDmvLanding(){let e=this.dmvLandingSelection();e&&this.responded.emit({action:"continue",selected:e})}cancelDmv(){this.responded.emit({action:"cancel"})}startDmv(){this.dmvCountdown()>0||this.responded.emit({action:"start"})}startDmvRoadRules(){this.dmvRoadRulesCountdown()>0||this.responded.emit({action:"start"})}dutyWeaponPool(){return this.dutyData().weaponPool}dutySelectedWeaponType(){return this.dutyWeaponPool().find(e=>e.itemTypeId===this.dutySelectedWeapon())??null}selectDutyWeapon(e){if(this.dutySelectedWeapon()===e){this.dutySelectedWeapon.set(0),this.dutySelectedAmmo.set(0),this.dutySelectedComponents.set([]);return}let i=this.dutyWeaponPool().find(r=>r.itemTypeId===e);i&&(this.dutySelectedWeapon.set(e),this.dutySelectedAmmo.set(i.ammoType[0]?.itemTypeId??0),this.dutySelectedComponents.set([]))}selectDutyAmmo(e){this.dutySelectedAmmo.set(e)}toggleDutyComponent(e){let n=this.dutySelectedComponents();this.dutySelectedComponents.set(n.includes(e)?n.filter(i=>i!==e):[...n,e])}selectDutyArmor(e){this.dutySelectedArmor.set(e)}toggleDutyEquipment(e){this.dutyEquipment.set(this.dutyEquipment().map(n=>n.itemTypeId===e?De(he({},n),{selected:!n.selected}):n))}submitDuty(){this.responded.emit({action:"duty",weaponItemId:this.dutySelectedWeapon(),ammoItemId:this.dutySelectedAmmo(),weaponComponents:this.dutySelectedComponents(),armorKey:this.dutySelectedArmor(),equipment:this.dutyEquipment().filter(e=>e.selected).map(e=>e.itemTypeId),callsign:this.dutyCallsign()})}arsenalWeaponPool(){return this.dutyArsenalData().weaponPool}arsenalSelectedWeaponType(){return this.arsenalWeaponPool().find(e=>e.itemTypeId===this.arsenalSelectedWeapon())??null}selectArsenalWeapon(e){if(this.arsenalSelectedWeapon()===e){this.arsenalSelectedWeapon.set(0),this.arsenalSelectedAmmo.set(0),this.arsenalSelectedComponents.set([]);return}let i=this.arsenalWeaponPool().find(r=>r.itemTypeId===e);i&&(this.arsenalSelectedWeapon.set(e),this.arsenalSelectedAmmo.set(i.ammoType[0]?.itemTypeId??0),this.arsenalSelectedComponents.set([]))}selectArsenalAmmo(e){this.arsenalSelectedAmmo.set(e)}toggleArsenalComponent(e){let n=this.arsenalSelectedComponents();this.arsenalSelectedComponents.set(n.includes(e)?n.filter(i=>i!==e):[...n,e])}submitArsenal(){let e=this.arsenalSelectedWeapon();e&&this.responded.emit({action:"withdraw",weaponItemId:e,ammoItemId:this.arsenalSelectedAmmo(),weaponComponents:this.arsenalSelectedComponents()})}selectLoanDownpayment(e){this.loanSelectedDownpayment.set(e)}selectLoanRepayment(e){this.loanSelectedRepayment.set(e)}loanDownpaymentAmount(){let e=this.loanData().amount,n=this.loanSelectedDownpayment();return e*(n/100)}loanDownpaymentDisplay(){return this.loanSelectedDownpayment()?this.formatMoney(this.loanDownpaymentAmount()):" - "}loanPrincipal(){return this.loanData().amount*(1-this.loanSelectedDownpayment()/100)}loanPrincipalDisplay(){return this.loanSelectedDownpayment()?this.formatMoney(this.loanPrincipal()):" - "}loanWeeklyPayment(){let e=this.loanPrincipal(),n=this.loanData().apr/100/52,i=this.loanSelectedRepayment()*4;if(!e||!i||!n)return 0;let r=n*Math.pow(1+n,i),a=Math.pow(1+n,i)-1;return a===0?0:Math.round(e*(r/a))}loanWeeklyPaymentDisplay(){return!this.loanSelectedDownpayment()||!this.loanSelectedRepayment()?" - ":this.formatMoney(this.loanWeeklyPayment())}loanTotalPaid(){return this.loanWeeklyPayment()*this.loanSelectedRepayment()*4}loanTotalInterest(){return this.loanTotalPaid()-this.loanPrincipal()}submitLoan(){this.responded.emit({action:"confirm",downPayment:this.loanSelectedDownpayment(),repayment:this.loanSelectedRepayment()})}togglePawnshopCategory(e){let n=this.pawnshopExpanded();this.pawnshopExpanded.set(De(he({},n),{[e]:!n[e]}))}isPawnshopCategoryExpanded(e){return this.pawnshopExpanded()[e]===!0}posBankAccountOptions(){return this.posData().bankAccounts.map(e=>({value:e.id,label:e.iban}))}posBankAccountSelectOptions(){return[{value:0,label:"Select Bank Account"},...this.posBankAccountOptions()]}posTaxOptions(){return this.posData().taxCategories.map(e=>({value:e.id,label:`${e.name} (${e.amount}%)`}))}posTaxSelectOptions(){return[{value:0,label:"Select Tax"},...this.posTaxOptions()]}addPosItem(){this.posItems.set([...this.posItems(),{name:"",amount:"1",price:"",tax:0}])}removePosItem(e){this.posItems.set(this.posItems().filter((n,i)=>i!==e))}updatePosItem(e,n){this.posItems.set(this.posItems().map((i,r)=>r===e?he(he({},i),n):i))}posTotal(){return Math.round(this.posItems().map(e=>{let n=this.posData().taxCategories.find(r=>r.id===e.tax),i=n?1+n.amount/100:1;return Number(e.price||0)*Number(e.amount||0)*i}).reduce((e,n)=>e+n,0))}isPosValid(){if(!this.posBankAccountId()||!/^[\w ]{1,64}$/.test(this.posDescription()))return!1;for(let e of this.posItems())if(!e.tax||!/^[\w ]{1,64}$/.test(e.name)||!/^[0-9]{1,5}$/.test(e.amount)||!/^[0-9]{1,8}$/.test(e.price)&&Number(e.amount)>0&&Number(e.price)>0)return!1;return!0}submitPos(){this.isPosValid()&&this.responded.emit({action:"confirm",bankAccountId:this.posBankAccountId(),description:this.posDescription(),items:this.posItems().map(e=>({name:e.name,amount:Number(e.amount),price:Number(e.price),tax:e.tax}))})}submitMenyooImport(){this.menyooError.set("");let e=this.parseMenyooXml(this.menyooConfig());if(!e){this.menyooError.set("Failed to parse the config.");return}this.responded.emit({action:"confirm",config:JSON.stringify(e)})}cancelMenyooImport(){this.responded.emit({action:"cancel"})}toggleAcknowledge(){this.acknowledgeChecked.set(!this.acknowledgeChecked())}submitAcknowledge(){this.acknowledgeChecked()&&this.responded.emit({action:"acknowledge"})}adConfirmCost(){let e=this.adConfirmData();return e.basePay+e.advert.length*e.letterPay}submitAdConfirm(){this.responded.emit({action:"confirm"})}cancelAdConfirm(){this.responded.emit({action:"cancel"})}submitEmployment(){this.responded.emit({action:"accept"})}cancelEmployment(){this.responded.emit({action:"decline"})}isItemSelectorSelected(e){return this.itemSelectorSelected().includes(e)}selectItemSelectorItem(e){let n=this.itemSelectorData();if(n.disableSelect)return;if(n.disableMulti){this.itemSelectorSelected.set([e]);return}let i=this.itemSelectorSelected();this.itemSelectorSelected.set(i.includes(e)?i.filter(r=>r!==e):[...i,e])}submitItemSelector(){let e=this.itemSelectorSelected();e.length&&this.responded.emit({action:"submit",selectedIds:e})}cancelItemSelector(){this.responded.emit({action:"cancel"})}submitTraceContinue(){this.responded.emit({action:"continue"})}reportInfoAction(e){this.responded.emit({action:e})}vehicleListStyle(e){return"url()"}selectVehicleList(e,n){n||this.selectedVehicleId.set(e)}submitVehicleList(){let e=this.selectedVehicleId();e&&this.responded.emit({action:"spawn",vehicleId:e})}vehicleOrderPreviewUrl(e){let n=this.vehicleOrderData(),i="url()";return(e==="corner"||e==="side")&&(i+=`_${n.wheelType}_${n.wheelIndex}`),`${i}.jpg`}selectDarknetProperty(e){this.selectedDarknetPropertyId.set(e),this.selectedDarknetInventoryId.set(0)}selectedDarknetProperty(){return this.darknetOrderData().find(e=>e.id===this.selectedDarknetPropertyId())??null}darknetPropertyOptions(){return[{value:0,label:"Select a property"},...this.darknetOrderData().map(e=>({value:e.id,label:e.address}))]}darknetInventoryOptions(){return[{value:0,label:"Select inventory"},...(this.selectedDarknetProperty()?.inventories??[]).map(e=>({value:e.id,label:`${e.name} (${e.weight}/${e.capacity})`}))]}submitDarknetOrder(){let e=this.selectedDarknetPropertyId(),n=this.selectedDarknetInventoryId();!e||!n||this.responded.emit({action:"confirm",propertyId:e,inventoryId:n})}cancelDarknetOrder(){this.responded.emit({action:"cancel"})}selectDeckSuit(e){this.selectedDeckSuit.set(e)}deckSuitIcon(e){return e.replace(/^fa\s+/,"fa-")}addDeckCard(e){let n=this.selectedDeckSuit();n&&this.deckCards.set([...this.deckCards(),{rank:e,suit:n}])}removeDeckCard(e){this.deckCards.set(this.deckCards().filter(n=>n!==e))}deckCardUrl(e,n){return"url()"}submitDeckCreator(){this.responded.emit({action:"confirm",cards:this.deckCards()})}cancelDeckCreator(){this.responded.emit({action:"cancel"})}toggleCookwareIngredient(e){let n=this.cookwareSelectedIngredientIds();this.cookwareSelectedIngredientIds.set(n.includes(e)?n.filter(i=>i!==e):[...n,e])}cookwareValid(){let e=this.cookwareWaterMl();return e&&!/^\d{1,4}$/.test(e)?!1:this.cookwareSelectedIngredientIds().length>0}submitCookware(){this.cookwareValid()&&this.responded.emit({action:"lockin",waterMl:Number(this.cookwareWaterMl()||"0"),ingredientItemIds:this.cookwareSelectedIngredientIds()})}cancelCookware(){this.responded.emit({action:"cancel"})}selectPillMold(e){this.pillPressSelectedMoldId.set(e),this.validatePillPress()}updatePillIngredientAmount(e,n){this.pillPressIngredientAmounts.set(De(he({},this.pillPressIngredientAmounts()),{[e]:n})),this.validatePillPress()}selectedPillMold(){return this.pillPressData().molds.find(e=>e.id===this.pillPressSelectedMoldId())??null}validatePillPress(){this.pillPressSuccess.set("");let e=this.pillPressName();if(!e||e.length<1||e.length>24)return this.pillPressError.set("Name must be between 1 and 24 characters"),!1;let n=this.selectedPillMold();if(!n)return this.pillPressError.set("Select a mold"),!1;let i=0;for(let r of this.pillPressData().ingredients){let a=this.pillPressIngredientAmounts()[r.id]??"";if(a.length>0&&!/^\d+$/.test(a))return this.pillPressError.set(`Invalid amount specified for ${r.name}`),!1;i+=Number(a||0)}return i!==n.capacity?(this.pillPressError.set(`Total amount of ingredients must be ${n.capacity}mg`),!1):(this.pillPressError.set(""),!0)}submitPillPress(){if(!this.validatePillPress())return;let e=this.selectedPillMold();if(!e)return;let n=this.pillPressData().ingredients.map(i=>({itemId:i.id,amount:Number(this.pillPressIngredientAmounts()[i.id]||0)})).filter(i=>i.amount>0);if(!n.length){this.pillPressError.set("No ingredients to add");return}typeof mp<"u"&&mp?.events?.call&&(mp.events.call("callServerEvent","pillPress:press",this.pillPressData().objectId,this.pillPressName(),e.id,JSON.stringify(n)),this.pillPressLoading.set(!0))}cancelPillPress(){this.responded.emit({action:"cancel"})}submitWeaponLicenseAccept(){this.weaponLicenseCountdown()>0||this.responded.emit({action:"accept"})}submitWeaponLicenseDecline(){this.responded.emit({action:"decline"})}submitStartRent(){this.startRentSigned()&&this.responded.emit({action:"accept"})}cancelStartRent(){this.responded.emit({action:"decline"})}toggleStartRentSigned(){this.startRentSigned.set(!this.startRentSigned())}formatMoney(e){return e.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0})}toNumber(e){let n=Number(e??0);return Number.isFinite(n)?n:0}getVehicleColorStyle(e){return"url()"}getVehicleWheelStyle(e,n){return"url()"}initializeCustomState(){let e=this.componentName();if(e==="AcknowledgeMessage"){this.acknowledgeChecked.set(!1);return}if(e==="ItemSelector"){this.itemSelectorSelected.set([]);return}if(e==="VehicleList"){this.selectedVehicleId.set(null);return}if(e==="DarknetOrder"){this.selectedDarknetPropertyId.set(0),this.selectedDarknetInventoryId.set(0);return}if(e==="DeckCreator"){this.deckCards.set([]),this.selectedDeckSuit.set(this.deckCreatorData().suits[0]?.slug??"");return}if(e==="Cookware"){this.cookwareSelectedIngredientIds.set([]),this.cookwareWaterMl.set("");return}if(e==="PillPress"){this.pillPressName.set(""),this.pillPressSelectedMoldId.set(0),this.pillPressIngredientAmounts.set({}),this.pillPressError.set(""),this.pillPressSuccess.set(""),this.pillPressLoading.set(!1);return}if(e==="WeaponLicense"){this.startCountdown("weaponLicense");return}if(e==="StartRent"){this.startRentSigned.set(!1);return}if(e==="DMV"){this.startCountdown("dmv");return}if(e==="DMVRoadRules"){this.dmvData().reviewing||this.startCountdown("roadRules");return}if(e==="Duty"){let n=this.dutyData();this.dutyCallsign.set(n.callsign),this.dutySelectedArmor.set(n.savedArmorKey),this.dutyEquipment.set(n.equipmentPool);let i=n.weaponPool.find(r=>r.itemTypeId===n.savedWeaponItemId);i&&(this.dutySelectedWeapon.set(i.itemTypeId),this.dutySelectedAmmo.set(i.ammoType.find(r=>r.itemTypeId===n.savedWeaponAmmoId)?.itemTypeId??i.ammoType[0]?.itemTypeId??0),this.dutySelectedComponents.set(n.savedWeaponComponents));return}if(e==="DutyArsenal"){this.arsenalSelectedWeapon.set(0),this.arsenalSelectedAmmo.set(0),this.arsenalSelectedComponents.set([]);return}if(e==="Loan"){let n=this.loanData();this.loanSelectedDownpayment.set(n.downpayment[0]??0),this.loanSelectedRepayment.set(n.repaymentPeriods[n.repaymentPeriods.length-1]??0);return}if(e==="MenyooImport"){this.menyooConfig.set(""),this.menyooError.set("");return}if(e==="Pawnshop"){let n={};for(let i of this.pawnshopData().categories)n[i.key]=!1;this.pawnshopExpanded.set(n);return}if(e==="PointOfSale"){let n=this.posBankAccountOptions();n.length===1&&this.posBankAccountId.set(n[0].value),this.posDescription.set(""),this.posItems.set([]),this.addPosItem()}}startCountdown(e){if(e==="dmv"){this.clearDmvTimer(),this.dmvCountdown.set(10),this.dmvCountdownTimer=setInterval(()=>{let n=this.dmvCountdown()-1;this.dmvCountdown.set(Math.max(0,n)),n<=0&&this.clearDmvTimer()},1e3);return}if(e==="roadRules"){this.clearRoadRulesTimer(),this.dmvRoadRulesCountdown.set(10),this.dmvRoadRulesCountdownTimer=setInterval(()=>{let n=this.dmvRoadRulesCountdown()-1;this.dmvRoadRulesCountdown.set(Math.max(0,n)),n<=0&&this.clearRoadRulesTimer()},1e3);return}this.clearWeaponLicenseTimer(),this.weaponLicenseCountdown.set(10),this.weaponLicenseCountdownTimer=setInterval(()=>{let n=this.weaponLicenseCountdown()-1;this.weaponLicenseCountdown.set(Math.max(0,n)),n<=0&&this.clearWeaponLicenseTimer()},1e3)}normalizeWeapon(e){let n=e??{};return{itemTypeId:Number(n.itemTypeId??0),name:String(n.name??"Unknown"),ammoType:Array.isArray(n.ammoType)?n.ammoType.map(i=>{let r=i??{};return{itemTypeId:Number(r.itemTypeId??0),name:String(r.name??"Unknown")}}):[],components:Array.isArray(n.components)?n.components.map(i=>{let r=i??{};return{itemTypeId:Number(r.itemTypeId??0),name:String(r.name??"Unknown"),type:String(r.type??"")}}):[]}}parseMenyooXml(e){try{let i=new DOMParser().parseFromString(e,"text/xml");if(i.querySelector("parsererror"))return null;let r=this.xmlNodeListValues(i,"FacialFeatures > *"),a=this.xmlNodeList(i,"Overlays > *").map((s,l)=>({id:l,index:this.xmlNodeAttrNumber(s,"index",-1)===255?-1:this.xmlNodeAttrNumber(s,"index",-1),opacity:this.xmlNodeAttrNumber(s,"opacity",0),color:this.xmlNodeAttrNumber(s,"colour",0),colorTwo:this.xmlNodeAttrNumber(s,"colourSecondary",0)}));return r.length<20||a.length<11?null:{faceBlendOne:this.xmlNodeNumber(i,"ShapeFatherId"),faceBlendTwo:this.xmlNodeNumber(i,"ShapeMotherId"),faceBlendBias:this.xmlNodeNumber(i,"ShapeVal"),faceBlendThree:this.xmlNodeNumber(i,"ShapeOverrideId"),skinToneThree:this.xmlNodeNumber(i,"ToneOverrideId"),threeMix:this.xmlNodeNumber(i,"OverrideVal"),skinTone:this.xmlNodeNumber(i,"ToneFatherId"),skinToneTwo:this.xmlNodeNumber(i,"ToneMotherId"),skinToneBias:this.xmlNodeNumber(i,"ToneVal"),eyeColor:this.xmlNodeNumber(i,"EyeColour"),noseWidth:r[0],noseHeight:r[1],noseLength:r[2],noseBridge:r[3],noseTip:r[4],noseBridgeShift:r[5],browHeight:r[6],browWidth:r[7],cheekboneHeight:r[8],cheekboneWidth:r[9],cheeksWidth:r[10],eyes:r[11],lips:r[12],jawWidth:r[13],jawHeight:r[14],chinLength:r[15],chinPosition:r[16],chinWidth:r[17],chinShape:r[18],neckWidth:r[19],blemishes:a[0].index,blemishesOpacity:a[0].opacity,facialHair:a[1].index,facialHairOpacity:a[1].opacity,eyebrows:a[2].index,eyebrowsOpacity:a[2].opacity,ageing:a[3].index,ageingOpacity:a[3].opacity,makeup:a[4].index,makeupOpacity:a[4].opacity,makeupColor:[a[4].color,a[4].colorTwo],blush:a[5].index,blushOpacity:a[5].opacity,blushColor:[a[5].color,a[4].colorTwo],complexion:a[6].index,complexionOpacity:a[6].opacity,sunDamage:a[7].index,sunDamageOpacity:a[7].opacity,lipstick:a[8].index,lipstickOpacity:a[8].opacity,lipstickColor:[a[8].color,a[8].colorTwo],moles:a[9].index,molesOpacity:a[9].opacity,chestHair:a[10].index,chestHairOpacity:a[10].opacity}}catch{return null}}xmlNodeList(e,n){return Array.from(e.querySelectorAll(n))}xmlNodeListValues(e,n){return this.xmlNodeList(e,n).map(i=>Number(i.textContent??0))}xmlNodeNumber(e,n){let i=Number(e.querySelector(n)?.textContent??0);return Number.isFinite(i)?i:0}xmlNodeAttrNumber(e,n,i){let r=Number(e.getAttribute(n));return Number.isFinite(r)?r:i}clearTimers(){this.clearDmvTimer(),this.clearRoadRulesTimer(),this.clearWeaponLicenseTimer()}clearDmvTimer(){this.dmvCountdownTimer&&(clearInterval(this.dmvCountdownTimer),this.dmvCountdownTimer=null)}clearRoadRulesTimer(){this.dmvRoadRulesCountdownTimer&&(clearInterval(this.dmvRoadRulesCountdownTimer),this.dmvRoadRulesCountdownTimer=null)}clearWeaponLicenseTimer(){this.weaponLicenseCountdownTimer&&(clearInterval(this.weaponLicenseCountdownTimer),this.weaponLicenseCountdownTimer=null)}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-custom-modal"]],inputs:{options:[1,"options"]},outputs:{responded:"responded"},decls:33,vars:1,consts:[[1,"custom-html",3,"innerHTML"],[1,"dmv-landing-wrap"],[1,"dmv-sheet-wrap"],[1,"duty-wrap"],[1,"loan-wrap"],[1,"pawnshop-wrap","scrollbar-neon"],[1,"pos-wrap"],[1,"report-content-wrap"],[1,"contract-wrap"],[1,"prison-slip"],[1,"vehicle-order-wrap"],[1,"custom-copy"],["type","button",1,"option-card",3,"click","disabled"],[1,"option-title"],[1,"inline-actions"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"secondary",3,"click"],[1,"dmv-banner"],[1,"dmv-sheet","scrollbar-neon"],[1,"green"],[1,"yellow"],[1,"red"],[1,"dmv-sheet"],[1,"dmv-kv"],[1,"result-pass"],[1,"result-fail"],[1,"duty-section"],["type","text","maxlength","20","placeholder","Callsign",1,"duty-input",3,"input","value","disabled"],[1,"duty-section","duty-grid"],[1,"duty-list"],[1,"duty-list-scroll","scrollbar-neon"],["type","button",1,"duty-entry",3,"selected"],["type","button",1,"primary",3,"click"],["type","button",1,"duty-entry",3,"click"],[1,"loan-card"],[1,"loan-grid"],[1,"chips-row"],["type","button",1,"chip",3,"selected"],[1,"strong"],[1,"loan-note"],["type","button",1,"chip",3,"click"],[1,"pawn-category"],["type","button",1,"pawn-head",3,"click"],[1,"pawn-body"],[1,"fa","fa-fw","fa-xs","fa-chevron-down"],[1,"fa","fa-fw","fa-xs","fa-chevron-up"],[1,"pawn-items"],[1,"pawn-item",3,"background-image"],[1,"pawn-item"],[1,"pos-meta"],[1,"field"],[3,"valueChange","options","value"],["type","text","maxlength","64","placeholder","Specify Description",3,"input","value"],[1,"pos-items","scrollbar-neon"],[1,"pos-item","field"],["type","button",1,"add",3,"click"],[1,"total"],[1,"pos-grid"],["type","text","maxlength","64","placeholder","Item Name",3,"input","value"],["type","text","maxlength","5","placeholder","Amt",3,"input","value"],["type","text","maxlength","8","placeholder","Price",3,"input","value"],["type","button",1,"remove"],["type","button",1,"remove",3,"click"],[1,"report-warning"],[1,"report-content"],[1,"report-rules"],[1,"report-reported"],[1,"contract-cta"],[1,"contract-body",3,"innerHTML"],[1,"tile-grid"],[1,"tile-card",3,"background-image"],[1,"tile-card"],[1,"tile-name"],[1,"tile-meta"],[1,"tile-price"],[1,"menyoo-wrap"],[1,"custom-copy","custom-copy-tight"],["placeholder","Paste config here.",1,"menyoo-input","scrollbar-neon",3,"input","value"],[1,"menyoo-error"],[1,"simple-panel"],[1,"checkbox-line"],["type","checkbox",3,"change","checked"],[1,"ad-content"],[1,"employment-panel"],[1,"employment-overlay"],[1,"employment-company"],[1,"item-selector-grid","scrollbar-neon"],["type","button",1,"select-card",3,"active","disabled","background-image"],["type","button",1,"select-card",3,"click","disabled"],[1,"parole-slip"],[1,"warning-note"],["type","button",1,"warn",3,"click"],[1,"card-grid","scrollbar-neon"],["type","button",1,"spawn-card",3,"selected","spawned","disabled","background-image"],["type","button",1,"spawn-card",3,"click","disabled"],[1,"title"],[1,"vehicle-order-preview"],["alt","corner",3,"src"],["alt","side",3,"src"],["alt","front",3,"src"],["alt","rear",3,"src"],[1,"vehicle-order-summary"],[1,"deck-wrap"],[1,"deck-suits"],[1,"deck-cards","scrollbar-neon"],["type","button",1,"deck-card",3,"background-image"],[1,"fa"],["type","button",1,"deck-card",3,"click"],[1,"item-selector-grid"],["type","button",1,"select-card",3,"active","background-image"],["type","text","maxlength","4",3,"input","value"],["type","button",1,"select-card",3,"click"],["type","text","maxlength","24",3,"input","value"],[1,"field","inline-field"],[1,"success-note"],["type","text","maxlength","5","placeholder","Amount (mg)",3,"input","value"]],template:function(n,i){if(n&1&&R(0,Ly,1,1,"div",0)(1,Fy,18,21,"div",1)(2,Vy,42,2,"div",2)(3,Uy,33,1,"div",2)(4,Wy,15,3,"div",2)(5,Ky,15,7,"div",2)(6,a1,20,5,"div",3)(7,p1,14,2,"div",3)(8,g1,64,10,"div",4)(9,w1,5,0,"div",5)(10,T1,22,5,"div",6)(11,I1,20,2,"div",7)(12,k1,4,3,"div",8)(13,F1,31,6,"article",9)(14,B1,6,0)(15,z1,6,0)(16,G1,12,3)(17,W1,12,4)(18,X1,12,2)(19,q1,13,5)(20,j1,8,3)(21,J1,8,1)(22,Q1,17,2)(23,rC,14,4)(24,sC,8,1)(25,lC,35,11,"section",10)(26,cC,16,5)(27,pC,17,0)(28,fC,15,2)(29,bC,21,5)(30,CC,41,10)(31,MC,2,1,"p",11)(32,wC,2,1,"p",11),n&2){let r;N((r=i.htmlContent())?0:i.componentName()==="DMVLanding"?1:i.componentName()==="DMV"?2:i.componentName()==="DMVRoadRules"?3:i.componentName()==="DMVRegister"?4:i.componentName()==="DMVExam"?5:i.componentName()==="Duty"?6:i.componentName()==="DutyArsenal"?7:i.componentName()==="Loan"?8:i.componentName()==="Pawnshop"?9:i.componentName()==="PointOfSale"?10:i.componentName()==="Report"?11:i.componentName()==="Contract"?12:i.componentName()==="PrisonSlip"?13:i.componentName()==="VehicleColors"?14:i.componentName()==="VehicleWheels"?15:i.componentName()==="MenyooImport"?16:i.componentName()==="AcknowledgeMessage"?17:i.componentName()==="AdConfirm"?18:i.componentName()==="Employment"?19:i.componentName()==="ItemSelector"?20:i.componentName()==="Trace"?21:i.componentName()==="ParoleSlip"?22:i.componentName()==="ReportInfo"?23:i.componentName()==="VehicleList"?24:i.componentName()==="VehicleOrder"?25:i.componentName()==="DarknetOrder"?26:i.componentName()==="DeckCreator"?27:i.componentName()==="Cookware"?28:i.componentName()==="PillPress"?29:i.componentName()==="StartRent"?30:i.options().message?31:i.componentName()?32:-1,r)}},dependencies:[tt,Vo],styles:[".custom-copy[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem}.custom-copy-tight[_ngcontent-%COMP%]{padding-top:0;padding-bottom:.45rem}.menyoo-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem .1rem;max-width:34rem}.menyoo-input[_ngcontent-%COMP%]{width:100%;min-height:13rem;max-height:min(46vh,20rem);margin-top:.6rem;border:1px solid rgba(var(--sw-accent-rgb),.28);border-radius:10px;background:#080a0e9e;color:var(--sw-text);padding:.7rem .8rem;resize:vertical;outline:none;box-sizing:border-box}.menyoo-input[_ngcontent-%COMP%]:focus{border-color:rgba(var(--sw-accent-rgb),.58);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.16)}.menyoo-input[_ngcontent-%COMP%]::placeholder{color:#dce4f073}.menyoo-error[_ngcontent-%COMP%]{margin:.55rem 0 0;color:#f07373;font-size:.82rem}.custom-html[_ngcontent-%COMP%]{padding:.85rem .95rem;color:var(--sw-text);word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}.inline-actions[_ngcontent-%COMP%]{display:flex;gap:.6rem;padding:.75rem .95rem .95rem}.inline-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--sw-border);color:var(--sw-text);background:#ffffff0f;border-radius:.4rem;padding:.45rem .8rem;font-size:.85rem;cursor:pointer}.inline-actions[_ngcontent-%COMP%] button.primary[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.52);background:rgba(var(--sw-accent-rgb),.18)}.report-content-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem 0}.report-warning[_ngcontent-%COMP%], .report-reported[_ngcontent-%COMP%]{color:var(--sw-accent)}.report-content[_ngcontent-%COMP%]{background:#0000002e;border:1px solid var(--sw-border);border-radius:.4rem;padding:.65rem}.report-rules[_ngcontent-%COMP%]{border:1px dashed var(--sw-border);border-radius:.4rem;padding:.65rem;background:#0000001f}.contract-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem 0}.contract-cta[_ngcontent-%COMP%]{margin:0 0 .6rem}.contract-body[_ngcontent-%COMP%]{max-height:31.25rem;overflow:auto;border:1px dashed rgba(0,0,0,.35);border-radius:.4rem;background:#fff;color:#111;padding:.9rem}.prison-slip[_ngcontent-%COMP%]{margin:.9rem;padding:.75rem;background:#ffc;color:#111;border:1px solid #222;border-radius:.3rem;font-size:.78rem}.prison-slip[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .prison-slip[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:.2rem 0;text-align:center}.tile-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(9rem,1fr));gap:.4rem;max-height:70vh;overflow-x:hidden;overflow-y:auto;padding:.85rem .95rem 0}.tile-card[_ngcontent-%COMP%]{position:relative;min-height:9rem;background-size:cover;background-position:center;border:1px solid var(--sw-border);border-radius:.35rem;padding:.35rem;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.75)}.tile-name[_ngcontent-%COMP%], .tile-meta[_ngcontent-%COMP%], .tile-price[_ngcontent-%COMP%]{margin:0;font-size:.8rem}.tile-meta[_ngcontent-%COMP%], .tile-price[_ngcontent-%COMP%]{position:absolute;bottom:.3rem}.tile-meta[_ngcontent-%COMP%]{left:.35rem}.tile-price[_ngcontent-%COMP%]{right:.35rem}.dmv-landing-wrap[_ngcontent-%COMP%], .dmv-sheet-wrap[_ngcontent-%COMP%], .duty-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem}.dmv-banner[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:10px;background:linear-gradient(140deg,rgba(var(--sw-accent-rgb),.24),rgba(var(--sw-accent-rgb),.06));padding:.75rem .85rem;margin-bottom:.75rem}.dmv-banner[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .dmv-banner[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.dmv-banner[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:1rem;color:#f2f5fb}.dmv-banner[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:.2rem;color:var(--sw-text-soft);text-transform:uppercase;letter-spacing:.05em;font-size:.74rem}.dmv-sheet[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:10px;background:linear-gradient(160deg,#121419db,#0c0e12d1);padding:.85rem;max-height:min(52vh,29rem);overflow-x:hidden;overflow-y:auto}.dmv-sheet[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:.75rem 0 .35rem;color:#e6ebf4}.dmv-sheet[_ngcontent-%COMP%] h4.green[_ngcontent-%COMP%]{color:#7ad694}.dmv-sheet[_ngcontent-%COMP%] h4.yellow[_ngcontent-%COMP%]{color:#ffd66f}.dmv-sheet[_ngcontent-%COMP%] h4.red[_ngcontent-%COMP%]{color:#f07373}.dmv-sheet[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .dmv-sheet[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .dmv-sheet[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-top:0;color:var(--sw-text)}.dmv-sheet[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{padding-left:1.2rem}.result-pass[_ngcontent-%COMP%], .result-fail[_ngcontent-%COMP%]{font-size:1.7rem;font-weight:700;font-style:italic;letter-spacing:.06em}.result-pass[_ngcontent-%COMP%]{color:#7ad694}.result-fail[_ngcontent-%COMP%]{color:#f07373}.dmv-kv[_ngcontent-%COMP%]{display:grid;gap:.25rem;margin-top:.8rem;border:1px dashed rgba(255,255,255,.2);border-radius:8px;background:#0003;padding:.6rem .7rem}.dmv-kv[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--sw-text-soft);font-size:.76rem;text-transform:uppercase;letter-spacing:.05em}.dmv-kv[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#f2f5fb;font-size:1.02rem}.option-card[_ngcontent-%COMP%]{width:100%;text-align:left;border:1px solid rgba(95,101,114,.5);border-radius:10px;padding:.75rem;background:linear-gradient(180deg,#262a32d6,#1b1e24d6);color:var(--sw-text);margin-bottom:.6rem;transition:border-color .14s ease,background .14s ease,transform .14s ease}.option-card[_ngcontent-%COMP%]:hover:not(.disabled){border-color:rgba(var(--sw-accent-rgb),.48);background:linear-gradient(180deg,#30353eeb,#22262ceb);transform:translateY(-1px)}.option-card.selected[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.64);background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.24),rgba(var(--sw-accent-rgb),.14))}.option-card.disabled[_ngcontent-%COMP%]{opacity:.5}.option-title[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600}.duty-section[_ngcontent-%COMP%]{margin-bottom:.7rem}.duty-section[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .duty-section[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0 0 .45rem;color:#f2f5fb}.duty-input[_ngcontent-%COMP%]{width:100%;border:1px solid rgba(var(--sw-accent-rgb),.24);border-radius:8px;padding:.55rem .65rem;background:#0a0c108f;color:var(--sw-text)}.duty-input[_ngcontent-%COMP%]:focus{outline:none;border-color:rgba(var(--sw-accent-rgb),.48);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.16)}.duty-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}.duty-list[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:10px;background:linear-gradient(160deg,#14161bd6,#0d0f13d1);overflow:hidden}.duty-list[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0;padding:.5rem .6rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid rgba(var(--sw-accent-rgb),.3);background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.2),rgba(var(--sw-accent-rgb),.06));color:var(--sw-text-soft)}.duty-list-scroll[_ngcontent-%COMP%]{max-height:10rem;overflow-x:hidden;overflow-y:auto}.duty-entry[_ngcontent-%COMP%]{width:100%;text-align:left;border:0;background:transparent;color:var(--sw-text);padding:.5rem .6rem;border-top:1px solid rgba(255,255,255,.06);transition:background .13s ease}.duty-entry[_ngcontent-%COMP%]:hover{background:#ffffff0d}.duty-entry.selected[_ngcontent-%COMP%]{background:rgba(var(--sw-accent-rgb),.2);color:#f3f6fc}@media(max-width:900px){.duty-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.loan-wrap[_ngcontent-%COMP%], .pos-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem}.loan-card[_ngcontent-%COMP%]{border:1px dashed rgba(255,255,255,.2);border-radius:10px;background:linear-gradient(160deg,#101217d6,#0a0c10d1);padding:.75rem;margin-bottom:.6rem}.loan-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .5rem;color:#f0f4fb}.loan-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem .75rem;font-family:Courier New,monospace}.loan-grid[_ngcontent-%COMP%] .strong[_ngcontent-%COMP%]{font-weight:700}.chips-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.4rem}.chip[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.14);border-radius:8px;background:#ffffff0a;color:var(--sw-text);padding:.35rem .55rem;min-width:3rem}.chip.selected[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.6);background:rgba(var(--sw-accent-rgb),.2);font-weight:700}.loan-note[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.78rem;color:var(--sw-text-soft)}.pawnshop-wrap[_ngcontent-%COMP%]{padding:.85rem .95rem;max-height:min(72vh,36rem);overflow-y:auto}.pawnshop-wrap[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:0 0 .6rem}.pawn-category[_ngcontent-%COMP%]{margin-bottom:.55rem}.pawn-head[_ngcontent-%COMP%]{width:100%;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:linear-gradient(180deg,#22262ed1,#191c22d1);color:var(--sw-text);padding:.5rem .65rem;display:flex;justify-content:space-between;align-items:center}.pawn-body[_ngcontent-%COMP%]{margin-top:.35rem;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:#0a0c108f;padding:.55rem}.pawn-items[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(6rem,1fr));gap:.45rem}.pawn-item[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:8px;min-height:6rem;background-size:contain;background-position:center;background-repeat:no-repeat;position:relative;background-color:#ffffff08}.pawn-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:absolute;left:.35rem;right:.35rem;bottom:.35rem;font-size:.72rem;text-shadow:0 1px 2px rgba(0,0,0,.7)}.pos-meta[_ngcontent-%COMP%]{display:grid;gap:.75rem}.field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:block;margin-bottom:.25rem;text-transform:uppercase;font-size:.75rem;letter-spacing:.04em;color:var(--sw-text-soft)}.field[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;border:1px solid rgba(var(--sw-accent-rgb),.24);border-radius:8px;background:#0a0c108f;color:var(--sw-text);padding:.45rem .55rem}.field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus{outline:none;border-color:rgba(var(--sw-accent-rgb),.52);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.16)}.pos-items[_ngcontent-%COMP%]{margin-top:.75rem;max-height:min(52vh,24rem);overflow-y:auto;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:#0c0e1285;padding:.65rem}.pos-item[_ngcontent-%COMP%]{margin-bottom:.6rem}.pos-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(8rem,1fr) 4rem 5.5rem 11rem 2rem;gap:.5rem;align-items:center}.remove[_ngcontent-%COMP%]{border:1px solid rgba(240,115,115,.4);border-radius:6px;background:#f073731f;color:#f7a3a3;height:2rem}.add[_ngcontent-%COMP%]{border:1px dashed rgba(var(--sw-accent-rgb),.45);border-radius:8px;background:rgba(var(--sw-accent-rgb),.08);color:#ffd3d8;padding:.45rem .65rem}.total[_ngcontent-%COMP%]{margin-left:auto;display:inline-flex;align-items:center;color:var(--sw-text-soft);font-size:.84rem}@media(max-width:900px){.pos-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.remove[_ngcontent-%COMP%]{width:2.25rem}}.simple-panel[_ngcontent-%COMP%]{padding:.9rem .95rem 0;max-width:40rem}.checkbox-line[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.8rem}.ad-content[_ngcontent-%COMP%]{border:1px solid var(--sw-border);border-radius:.35rem;padding:.65rem;background:#00000029}.employment-panel[_ngcontent-%COMP%]{margin:.9rem .95rem 0;min-height:13rem;border-radius:.45rem;border:1px solid var(--sw-border);background-size:cover;background-position:center;overflow:hidden}.employment-overlay[_ngcontent-%COMP%]{min-height:13rem;padding:.9rem;background:linear-gradient(180deg,#080a0e59,#080a0ed1)}.employment-company[_ngcontent-%COMP%]{color:var(--sw-text-soft);margin-top:-.2rem}.item-selector-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(8rem,1fr));gap:.5rem;max-height:min(50vh,22rem);overflow-y:auto}.select-card[_ngcontent-%COMP%]{border:1px solid var(--sw-border);border-radius:.45rem;min-height:6.4rem;padding:.45rem;color:#fff;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;text-align:left;background-color:#0000002e;background-size:contain;background-position:center;background-repeat:no-repeat}.select-card.active[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.7);background-color:rgba(var(--sw-accent-rgb),.15)}.card-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(13rem,1fr));gap:.6rem;max-height:min(55vh,25rem);overflow-y:auto;padding:.9rem .95rem 0}.spawn-card[_ngcontent-%COMP%]{min-height:7.5rem;border-radius:.45rem;border:1px solid var(--sw-border);padding:.55rem;background-size:cover;background-position:center;text-align:left;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.75)}.spawn-card.selected[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.7);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.25)}.spawn-card.spawned[_ngcontent-%COMP%]{opacity:.75}.spawn-card[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:block;font-weight:700}.vehicle-order-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem 0;display:grid;gap:.7rem;grid-template-columns:1fr}.vehicle-order-preview[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem}.vehicle-order-preview[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;border-radius:.3rem;border:1px solid var(--sw-border)}.vehicle-order-summary[_ngcontent-%COMP%]{border:1px solid var(--sw-border);border-radius:.35rem;background:#00000026;padding:.6rem}.vehicle-order-summary[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.15rem 0}.deck-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem 0}.deck-suits[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-bottom:.55rem}.deck-cards[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.4rem;max-height:13rem;overflow-x:hidden;overflow-y:auto;margin-bottom:.55rem}.deck-card[_ngcontent-%COMP%]{width:100%;aspect-ratio:.71;border:1px solid var(--sw-border);border-radius:.25rem;background-size:cover;background-position:center;background-repeat:no-repeat}.inline-field[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(8rem,1fr) minmax(7rem,10rem);gap:.5rem;align-items:center}.warning-note[_ngcontent-%COMP%]{margin:.45rem 0 0;color:#f1a45f}.success-note[_ngcontent-%COMP%]{margin:.45rem 0 0;color:#86e6a4}.parole-slip[_ngcontent-%COMP%]{margin:.9rem;padding:.75rem;border:1px solid #402828;border-radius:.3rem;background:#fcc;color:#1f1414}.parole-slip[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .parole-slip[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{text-align:center;margin:.2rem 0}.weapon-license-wrap[_ngcontent-%COMP%]{padding:.9rem .95rem 0;max-height:min(54vh,26rem);overflow-x:hidden;overflow-y:auto}.weapon-license-wrap[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:.5rem 0 0;padding-left:1.2rem}.inline-actions[_ngcontent-%COMP%] button.warn[_ngcontent-%COMP%]{border-color:#f0737380;background:#f0737333;color:#ffcbcb}"],changeDetection:0})}}return o})();function SC(o,t){if(o&1&&Te(0,"p",2),o&2){let e=g(2);Ee("innerHTML",e.options().message||"",an)}}function EC(o,t){if(o&1&&(v(0,"p",3),u(1),b()),o&2){let e=g(2);d(),D(e.options().message)}}function TC(o,t){if(o&1&&R(0,SC,1,1,"p",2)(1,EC,2,1,"p",3),o&2){let e=g();N(e.isHtml()?0:1)}}var p0=(()=>{class o{constructor(){this.options=en.required(),this.responded=Qt(),this.isHtml=le(()=>this.options().html===!0),this.buttonLabel=le(()=>this.options().buttonLabel||"Okay")}okay(){this.responded.emit({action:"okay"})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-info-modal"]],inputs:{options:[1,"options"]},outputs:{responded:"responded"},decls:4,vars:2,consts:[[1,"inline-actions"],["type","button",1,"secondary",3,"click"],[1,"modal-copy",3,"innerHTML"],[1,"modal-copy"]],template:function(n,i){n&1&&(R(0,TC,2,1),v(1,"div",0)(2,"button",1),ne("click",function(){return i.okay()}),u(3),b()()),n&2&&(N(i.options().message?0:-1),d(3),D(i.buttonLabel()))},dependencies:[tt],styles:[".modal-copy[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem 0}.inline-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;padding:.85rem .95rem}.inline-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:5rem}"],changeDetection:0})}}return o})();var PC=(o,t)=>t.key;function AC(o,t){if(o&1){let e=Z();v(0,"button",3),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.clickItem(i))}),Te(1,"span",4),v(2,"span",5),u(3),b()()}if(o&2){let e=t.$implicit,n=g(2);oe("disabled",e.disabled===!0),Ee("disabled",e.disabled===!0),d(),Ee("innerHTML",n.getIconHtml(e.icon||"fa fa-question"),an),d(2),D(e.label)}}function IC(o,t){if(o&1&&(v(0,"div",0),ve(1,AC,4,5,"button",2,PC),b()),o&2){let e=g();d(),xe(e.items())}}function OC(o,t){o&1&&(v(0,"p",1),u(1,"No entries available."),b())}var m0=(()=>{class o{constructor(){this.options=en.required(),this.responded=Qt(),this.items=le(()=>{let e=this.options().items;return e?Array.isArray(e)?e.map((n,i)=>{let r=n??{};return{key:String(r.key??r.action??r.id??i),icon:typeof r.icon=="string"?r.icon:void 0,label:String(r.label??r.title??r.name??r.url??"Item"),disabled:r.disabled===!0,raw:r}}):Object.entries(e).map(([n,i])=>{let r=i??{};return{key:n,icon:typeof r.icon=="string"?r.icon:void 0,label:String(r.label??r.title??r.name??n),disabled:r.disabled===!0,raw:r}}):[]})}getIconHtml(e){return`<i class="fa-fw ${e}"></i>`}clickItem(e){e.disabled||this.responded.emit({selected:e.key})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-landing-list-modal"]],inputs:{options:[1,"options"]},outputs:{responded:"responded"},decls:2,vars:1,consts:[[1,"landing-list","scrollbar-neon"],[1,"landing-empty"],["type","button",1,"landing-item",3,"disabled"],["type","button",1,"landing-item",3,"click","disabled"],[1,"icon",3,"innerHTML"],[1,"landing-main"]],template:function(n,i){n&1&&R(0,IC,3,0,"div",0)(1,OC,2,0,"p",1),n&2&&N(i.items().length>0?0:1)},dependencies:[tt],styles:[".landing-list[_ngcontent-%COMP%]{padding:.85rem .95rem;display:grid;gap:.55rem;max-height:min(56vh,32rem);overflow-y:auto;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:linear-gradient(155deg,#1a1d23c7,#121419b8);box-shadow:inset 0 1px #ffffff0f}.landing-item[_ngcontent-%COMP%]{text-align:left;border:1px solid rgba(95,101,114,.4);border-radius:10px;background:linear-gradient(180deg,#272b32d1,#1e2128d1);padding:.625rem;display:flex;align-items:center;gap:.75rem;color:var(--sw-text);transition:background .14s ease,border-color .14s ease,transform .14s ease,box-shadow .14s ease}.landing-item[_ngcontent-%COMP%]:hover{background:linear-gradient(180deg,#323640e6,#242830e6);border-color:#d11b2d85;box-shadow:0 10px 22px #00000042,inset 0 0 0 1px #d11b2d33;transform:translateY(-1px)}.landing-main[_ngcontent-%COMP%]{font-size:.92rem;color:var(--sw-text);font-weight:600;letter-spacing:.01em}.landing-item.disabled[_ngcontent-%COMP%]{opacity:.52;pointer-events:none;filter:grayscale(20%)}.icon[_ngcontent-%COMP%]{color:#ffdbdfe6;min-width:1.2rem;text-align:center}.landing-empty[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem;color:var(--sw-text-soft)}"],changeDetection:0})}}return o})();var DC=(o,t)=>t.id;function kC(o,t){if(o&1){let e=Z();v(0,"button",16),ne("click",function(){let i=P(e).$implicit,r=g().$index,a=g();return A(a.selectCategory(r,i))}),u(1),b()}if(o&2){let e=t.$implicit;oe("selected",e.focused),d(),me(" ",e.name," ")}}function RC(o,t){if(o&1&&(v(0,"div",3)(1,"div",13),u(2,"Category"),b(),v(3,"div",14),ve(4,kC,2,3,"button",15,DC),b()()),o&2){let e=t.$implicit;d(4),xe(e)}}function NC(o,t){o&1&&(v(0,"div",4),Te(1,"i",17),b())}function LC(o,t){if(o&1){let e=Z();v(0,"div",5)(1,"span"),u(2),b(),v(3,"span",18),u(4),b(),v(5,"button",11),ne("click",function(){P(e);let i=g();return A(i.clearSearch())}),u(6,"Clear Search"),b()()}if(o&2){let e=g();d(2),me("Showing ",e.state().itemMetadata.resultsTotal||0," results for"),d(2),me('"',e.state().itemMetadata.searchQuery,'"')}}function FC(o,t){if(o&1&&(v(0,"pre"),u(1),po(2,"json"),b()),o&2){let e=g();d(),D(mo(2,1,e.state().selectedItem))}}function VC(o,t){o&1&&(v(0,"div",4),Te(1,"i",19),b())}function BC(o,t){o&1&&(v(0,"span"),Te(1,"i",20),b())}function UC(o,t){o&1&&(v(0,"span"),Te(1,"i",21),b())}function zC(o,t){if(o&1&&(v(0,"div",4),R(1,BC,2,0,"span")(2,UC,2,0,"span"),b()),o&2){let e=g();d(),N(e.state().loadingItems?1:2)}}function HC(o,t){if(o&1&&(v(0,"th"),u(1),b()),o&2){let e=t.$implicit;d(),D(e)}}function GC(o,t){if(o&1&&Te(0,"td",35),o&2){let e=t.$implicit,n=g().$implicit,i=g(2);Ee("innerHTML",i.displayCell(n,e),an)}}function WC(o,t){if(o&1){let e=Z();v(0,"tr",34),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectItem(i))}),ve(1,GC,1,1,"td",35,ct),b()}if(o&2){let e=t.$implicit,n=g(2);oe("selected",n.state().selectedItem===e),d(),xe(n.state().itemMetadata.keys)}}function XC(o,t){o&1&&(v(0,"div",33),Te(1,"i",20),b())}function qC(o,t){if(o&1){let e=Z();v(0,"div",8)(1,"table",22)(2,"thead")(3,"tr"),ve(4,HC,2,1,"th",null,ct),b()(),v(6,"tbody",23),ve(7,WC,3,2,"tr",24,ct),b()(),v(9,"div",25)(10,"div",26)(11,"button",27),ne("click",function(){P(e);let i=g();return A(i.loadFirstPage())}),Te(12,"i",28),b(),v(13,"button",27),ne("click",function(){P(e);let i=g();return A(i.loadPrevPage())}),Te(14,"i",29),b()(),v(15,"div",30),u(16),b(),v(17,"div",26)(18,"button",27),ne("click",function(){P(e);let i=g();return A(i.loadNextPage())}),Te(19,"i",31),b(),v(20,"button",27),ne("click",function(){P(e);let i=g();return A(i.loadLastPage())}),Te(21,"i",32),b()()(),R(22,XC,2,0,"div",33),b()}if(o&2){let e=g();d(4),xe(e.state().itemMetadata.keys),d(3),xe(e.state().items),d(3),oe("disabled",!e.canPageBackward()),d(),Ee("disabled",!e.canPageBackward()),d(2),Ee("disabled",!e.canPageBackward()),d(3),cn("",e.state().itemMetadata.page||1," / ",e.state().itemMetadata.pages||1),d(),oe("disabled",!e.canPageForward()),d(),Ee("disabled",!e.canPageForward()),d(2),Ee("disabled",!e.canPageForward()),d(2),N(e.state().loadingItems?22:-1)}}function $C(o,t){if(o&1){let e=Z();v(0,"div",12)(1,"input",36),ne("input",function(i){P(e);let r=g();return A(r.updateSearchInput((i.target.value||"").toString()))}),b(),v(2,"button",37),ne("click",function(){P(e);let i=g();return A(i.search())}),u(3,"Search"),b()()}if(o&2){let e=g();d(),Ee("value",e.state().searchInput),d(),Ee("disabled",!e.state().searchInput)}}var f0=(()=>{class o{constructor(){this.options=en.required(),this.responded=Qt(),this.state=F({hasSearch:!1,categories:[],loadingCategories:!1,items:[],itemMetadata:{keys:[]},loadingItems:!1,searchInput:"",autoSelectIds:[]}),this.currentLevel=le(()=>this.state().categories.length-1),this.canPageBackward=le(()=>(this.state().itemMetadata.page??1)>1),this.canPageForward=le(()=>{let e=this.state().itemMetadata.page??1,n=this.state().itemMetadata.pages??1;return e<n}),this.onCategoryEvent=(e,n)=>{let i=this.safeJsonParse(n,[]);this.state.update(r=>{let a=[...r.categories];return a[e]=i,De(he({},r),{categories:a,loadingCategories:!1})}),this.applyAutoSelect(e)},this.onItemsEvent=(e,n)=>{let i=this.safeJsonParse(e,[]),r=this.safeJsonParse(n,{keys:[]});this.state.update(l=>De(he({},l),{items:i,itemMetadata:r,loadingItems:!1}));let a=this.state().autoSelectIds[0];if(a===void 0)return;let s=i.find(l=>Number(l.id)===a);s&&this.state.update(l=>De(he({},l),{selectedItem:s,autoSelectIds:l.autoSelectIds.slice(1)}))}}ngOnInit(){let e=this.options().data??{},n=typeof this.options().model=="string"?this.options().model:typeof e.model=="string"?e.model:"",i=this.options().hasSearch===!0||e.hasSearch===!0,a=(this.options().autoSelectIds??(Array.isArray(e.autoSelectIds)?e.autoSelectIds:[])).map(s=>Number(s)).filter(s=>Number.isFinite(s));this.state.update(s=>De(he({},s),{model:n,hasSearch:i,autoSelectIds:a})),mp.events.add("ldb:category",this.onCategoryEvent),mp.events.add("ldb:items",this.onItemsEvent),this.loadCategories(0)}ngOnDestroy(){mp.events.remove("ldb:category",this.onCategoryEvent),mp.events.remove("ldb:items",this.onItemsEvent)}selectCategory(e,n){if(this.focusCategory(e,n.id),!n.hasItems){this.state.update(i=>De(he({},i),{categories:i.categories.slice(0,e+1),items:[],selectedItem:void 0})),this.loadCategories(e+1,n.id);return}this.loadItems(1)}selectItem(e){this.state.update(n=>De(he({},n),{selectedItem:e}))}loadFirstPage(){this.loadItems(1)}loadPrevPage(){let e=this.state().itemMetadata.page??1;this.loadItems(Math.max(1,e-1))}loadNextPage(){let e=this.state().itemMetadata.page??1,n=this.state().itemMetadata.pages??1;this.loadItems(Math.min(n,e+1))}loadLastPage(){this.loadItems(this.state().itemMetadata.pages??1)}updateSearchInput(e){this.state.update(n=>De(he({},n),{searchInput:e}))}search(){let e=this.state().searchInput.trim();e&&(this.state.update(n=>De(he({},n),{loadingItems:!0,selectedItem:void 0,searchInput:""})),this.callServer("search",e,1))}clearSearch(){this.state.update(i=>De(he({},i),{items:[],selectedItem:void 0,itemMetadata:De(he({},i.itemMetadata),{searchQuery:""})}));let e=this.currentLevel();if(e<0)return;this.state().categories[e]?.find(i=>i.focused)?.hasItems&&this.loadItems(1)}confirm(){this.state().selectedItem&&this.responded.emit({action:"confirm",selected:this.state().selectedItem})}cancel(){this.responded.emit({action:"cancel"})}displayCell(e,n){let i=e[n];return i==null?"":String(i)}applyAutoSelect(e){let n=this.state().autoSelectIds[0];if(n===void 0)return;let i=this.state().categories[e]?.find(r=>r.id===n);i&&(this.state.update(r=>De(he({},r),{autoSelectIds:r.autoSelectIds.slice(1)})),this.selectCategory(e,i))}focusCategory(e,n){this.state.update(i=>{let r=i.categories.map((a,s)=>s!==e?a:a.map(l=>De(he({},l),{focused:l.id===n})));return De(he({},i),{categories:r})})}loadCategories(e,n){this.state.update(i=>De(he({},i),{loadingCategories:!0})),this.callServer("categories",e,n??null)}loadItems(e){let n=this.state();if(n.itemMetadata.searchQuery){this.state.update(a=>De(he({},a),{loadingItems:!0})),this.callServer("search",n.itemMetadata.searchQuery,e);return}let r=(n.categories[this.currentLevel()]??[]).find(a=>a.focused);r&&(this.state.update(a=>De(he({},a),{loadingItems:!0,selectedItem:void 0})),this.callServer("items",JSON.stringify(r),e))}callServer(e,...n){let i=this.state().model;i&&mp.events.call("callServerEvent",`ldb:${i}:${e}`,...n)}safeJsonParse(e,n){try{return JSON.parse(e)}catch{return n}}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-lazy-data-browser-modal"]],inputs:{options:[1,"options"]},outputs:{responded:"responded"},decls:19,vars:6,consts:[[1,"ldb-wrapper"],[1,"panel"],[1,"lists"],[1,"list"],[1,"zero-state"],[1,"search-results"],[1,"preview","scrollbar-neon"],[1,"container"],[1,"item-grid"],[1,"buttons"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"secondary",3,"click"],[1,"search"],[1,"header"],[1,"entries","scrollbar-neon"],["type","button",1,"entry",3,"selected"],["type","button",1,"entry",3,"click"],[1,"fa","fa-fw","fa-spinner-third","fa-spin"],[1,"query"],[1,"fa","fa-fw","fa-file"],[1,"fa","fa-fw","fa-spin","fa-spinner-third"],[1,"fa","fa-fw","fa-bars"],[1,"selectable"],[1,"scrollbar-neon"],[3,"selected"],[1,"footer"],[1,"arrows"],["type","button",1,"icon",3,"click","disabled"],[1,"fa","fa-fw","fa-chevron-double-left"],[1,"fa","fa-fw","fa-chevron-left"],[1,"current-page"],[1,"fa","fa-fw","fa-chevron-right"],[1,"fa","fa-fw","fa-chevron-double-right"],[1,"zero-state","zero-state-ol"],[3,"click"],[3,"innerHTML"],["type","text","placeholder","Search ...","id","searchbox",3,"input","value"],["type","button",1,"secondary",3,"click","disabled"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"div",2),ve(3,RC,6,0,"div",3,ct),R(5,NC,2,0,"div",4),R(6,LC,7,2,"div",5),b(),v(7,"div",6),R(8,FC,3,3,"pre")(9,VC,2,0,"div",4),b()(),v(10,"div",7),R(11,zC,3,1,"div",4)(12,qC,23,11,"div",8),b()(),v(13,"div",9)(14,"button",10),ne("click",function(){return i.confirm()}),u(15,"Select"),b(),v(16,"button",11),ne("click",function(){return i.cancel()}),u(17,"Cancel"),b(),R(18,$C,4,2,"div",12),b()),n&2&&(d(3),xe(i.state().categories),d(2),N(i.state().loadingCategories?5:-1),d(),N(i.state().itemMetadata.searchQuery?6:-1),d(2),N(i.state().selectedItem?8:9),d(3),N(i.state().items.length===0?11:12),d(3),Ee("disabled",!i.state().selectedItem),d(4),N(i.state().hasSearch?18:-1))},dependencies:[tt,bl],styles:[".disabled[_ngcontent-%COMP%]{opacity:.25;pointer-events:none}.ldb-wrapper[_ngcontent-%COMP%]{color:var(--sw-text);display:flex;width:min(75rem,100%);background:linear-gradient(152deg,#1e2127e6,#16181deb);border:1px solid rgba(255,255,255,.1);border-radius:12px;box-shadow:inset 0 1px #ffffff0f;height:39.6875rem;overflow:hidden}.panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;background:linear-gradient(160deg,#23262dad,#16181eb3);justify-content:space-between;overflow:hidden;flex-shrink:0;border-right:1px solid rgba(255,255,255,.08)}.lists[_ngcontent-%COMP%]{flex-shrink:1;flex-grow:1;display:flex;overflow:hidden;min-width:22.5rem;position:relative}.list[_ngcontent-%COMP%]{border-right:.0625rem solid rgba(255,255,255,.08);min-width:11.25rem;display:flex;flex-direction:column;flex-grow:1}.entries[_ngcontent-%COMP%]{overflow:overlay;position:relative}.entry[_ngcontent-%COMP%]{width:100%;text-align:left;border:0;background:transparent;color:var(--sw-text);padding:.625rem;border-bottom:.0625rem solid rgba(255,255,255,.08);transition:background .13s ease,color .13s ease,border-color .13s ease}.entry.selected[_ngcontent-%COMP%]{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.24),rgba(var(--sw-accent-rgb),.14));color:#f4f7fc;border-bottom-color:rgba(var(--sw-accent-rgb),.45)}.entry[_ngcontent-%COMP%]:hover{background:#ffffff0f}.preview[_ngcontent-%COMP%]{flex-shrink:0;background:linear-gradient(160deg,#181a1fdb,#101216d1);height:12.3125rem;border-top:.0625rem solid rgba(255,255,255,.08);overflow:auto}.preview[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;padding:.625rem;font-size:.75rem;white-space:pre-wrap}.header[_ngcontent-%COMP%]{text-align:left;font-weight:500;color:var(--sw-text-soft);border-bottom:.0625rem solid rgba(var(--sw-accent-rgb),.38);text-transform:uppercase;font-size:.875rem;padding:.9375rem 1.25rem;background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.22),rgba(var(--sw-accent-rgb),.07))}.zero-state[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:#fff5}.zero-state-ol[_ngcontent-%COMP%]{background:#0005;position:absolute;top:0;left:0}.search-results[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;background:#121418f0;display:flex;align-items:center;justify-content:center;flex-direction:column}.search-results[_ngcontent-%COMP%] .query[_ngcontent-%COMP%]{margin:1.25rem;font-size:1.2em}.container[_ngcontent-%COMP%]{flex-grow:1;position:relative;display:flex;flex-direction:column;overflow:hidden}.item-grid[_ngcontent-%COMP%]{flex-grow:1;border-right:.0625rem solid rgba(255,255,255,.06);flex-shrink:1;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;position:relative}table[_ngcontent-%COMP%]{overflow:hidden;border-collapse:collapse;display:flex;flex-direction:column}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-left:.9375rem}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child, table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child{padding-right:.9375rem}thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{overflow:hidden;display:flex}thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-align:left;font-weight:500;color:var(--sw-text-soft);border-bottom:.0625rem solid rgba(var(--sw-accent-rgb),.34);text-transform:uppercase;font-size:.875rem;padding:.9375rem 1.25rem;background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.16),rgba(var(--sw-accent-rgb),.04));position:sticky;top:0;display:inline-block}tbody[_ngcontent-%COMP%]{display:block;overflow-y:overlay;min-height:12.5rem}tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:not(:last-child) td[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] tr.selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:.0625rem solid rgba(255,255,255,.08)}tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.625rem 1.25rem;width:max-content}table.selectable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%]{background:#ffffff0f;cursor:pointer}table.selectable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr.selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background:rgba(var(--sw-accent-rgb),.2)!important}.footer[_ngcontent-%COMP%]{background:#0c0e1270;color:var(--sw-text);display:flex;padding:.5rem;align-items:center;font-size:.875rem;justify-content:space-between;border-top:.0625rem solid rgba(255,255,255,.08)}.current-page[_ngcontent-%COMP%]{color:var(--sw-text-soft)}.arrows[_ngcontent-%COMP%]{display:flex;gap:.25rem}.icon[_ngcontent-%COMP%]{width:1.875rem;height:1.5625rem;border-radius:.3125rem;display:flex;justify-content:center;align-items:center;border:0;background:transparent;color:var(--sw-text);transition:background .12s ease,color .12s ease}.icon[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.24);color:#fff}.buttons[_ngcontent-%COMP%]{border-top:.0625rem solid rgba(255,255,255,.08);display:flex;align-items:center;gap:.5rem;padding:.8rem .95rem;background:#0c0e124d}.search[_ngcontent-%COMP%]{margin-left:auto;color:#fff;display:flex;align-items:center;gap:.3125rem}.search[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{outline:none;background:#0e101499;color:var(--sw-text);padding:.5rem .75rem;width:12.5rem;border:.0625rem solid rgba(var(--sw-accent-rgb),.25);border-radius:.1875rem}.search[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus{border-color:rgba(var(--sw-accent-rgb),.5);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.15)}"],changeDetection:0})}}return o})();function YC(o,t){if(o&1&&(v(0,"th"),u(1),b()),o&2){let e=t.$implicit;d(),D(e)}}function jC(o,t){if(o&1&&(v(0,"span"),u(1),b()),o&2){let e=g().$implicit,n=g().$implicit;d(),D(n[e])}}function KC(o,t){if(o&1&&Te(0,"span",6),o&2){let e=g().$implicit,n=g().$implicit,i=g();Ee("innerHTML",i.toHtml(n[e]),an)}}function ZC(o,t){if(o&1&&(v(0,"td"),R(1,jC,2,1,"span"),R(2,KC,1,1,"span",6),b()),o&2){let e=g(2);d(),N(e.options().html?-1:1),d(),N(e.options().html?2:-1)}}function JC(o,t){if(o&1){let e=Z();v(0,"tr",5),ne("click",function(){let i=P(e).$index,r=g();return A(r.selectRow(i))}),ve(1,ZC,3,2,"td",null,ct),b()}if(o&2){let e=t.$index,n=g();oe("selected",(n.options().selectable??!1)&&e===n.selectedIndex()),d(),xe(n.keys())}}var g0=(()=>{class o{constructor(){this.options=en.required(),this.keys=en([]),this.selectedIndex=en(-1),this.rowSelected=Qt(),this.items=le(()=>this.options().items??[])}selectRow(e){(this.options().selectable??!1)&&this.rowSelected.emit(e)}toHtml(e){return e==null?"":String(e)}trackByIndex(e){return e}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-list-modal"]],inputs:{options:[1,"options"],keys:[1,"keys"],selectedIndex:[1,"selectedIndex"]},outputs:{rowSelected:"rowSelected"},decls:11,vars:4,consts:[[1,"list"],[1,"list-table-shell"],[1,"list-table-scroll","scrollbar-neon"],[1,"list-table"],[3,"selected"],[3,"click"],[3,"innerHTML"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"div",2)(3,"table",3)(4,"thead")(5,"tr"),ve(6,YC,2,1,"th",null,ct),b()(),v(8,"tbody"),ve(9,JC,3,2,"tr",4,ct),b()()()()()),n&2&&(d(),oe("selectable",i.options().selectable),d(3),oe("hidden",i.options().hideHead),d(2),xe(i.keys()),d(3),xe(i.items()))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:0}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:.75rem .95rem;width:100%;box-sizing:border-box;min-height:0}.list-table-shell[_ngcontent-%COMP%]{display:flex;flex:1 1 auto;min-height:0;width:100%;border:1px solid rgba(255,255,255,.12);border-radius:12px;overflow:hidden;background:#1113186b;box-shadow:inset 0 1px #ffffff0a}.list-table-scroll[_ngcontent-%COMP%]{flex:1 1 auto;max-height:min(56vh,30rem);overflow-x:hidden;overflow-y:auto;scrollbar-gutter:auto}.list-table[_ngcontent-%COMP%]{width:100%;min-width:100%;border-collapse:collapse;table-layout:fixed;white-space:nowrap}.list-table[_ngcontent-%COMP%] thead.hidden[_ngcontent-%COMP%]{display:none}.list-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .list-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left}.list-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;padding:.68rem .8rem;text-transform:uppercase;letter-spacing:.05em;font-size:.72rem;font-weight:700;color:var(--sw-text-soft);border-bottom:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,#ffffff14,#ffffff05)}.list-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.62rem .8rem;color:var(--sw-text);border-top:1px solid rgba(255,255,255,.06);vertical-align:middle;overflow:hidden;text-overflow:ellipsis}.list-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:first-child td[_ngcontent-%COMP%]{border-top:0}.list-table-shell.selectable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{transition:background .13s ease}.list-table-shell.selectable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{cursor:pointer;background:#ffffff0f}.list-table-shell.selectable[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr.selected[_ngcontent-%COMP%]{background:var(--sw-accent-soft)}.list-table-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:.6rem;background:transparent}.list-table-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:rgba(var(--sw-accent-rgb),.05);border-radius:999px;margin:.3rem 0}.list-table-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:999px;background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.65),rgba(var(--sw-accent-rgb),.42));border:1px solid rgba(var(--sw-accent-rgb),.32)}.list-table-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.88),rgba(var(--sw-accent-rgb),.62))}.list-table-scroll[_ngcontent-%COMP%]{scrollbar-color:rgba(var(--sw-accent-rgb),.7) rgba(var(--sw-accent-rgb),.08);scrollbar-width:thin}"],changeDetection:0})}}return o})();var _0=(o,t)=>t.id;function QC(o,t){o&1&&(_(0,"span",5),ye(1,"i",9),u(2," Processing "),f())}function eM(o,t){o&1&&(_(0,"div",14),ye(1,"i",15),u(2," Recommended"),f())}function tM(o,t){if(o&1){let e=Z();_(0,"button",10),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.selectSpawn(i.id))}),_(1,"div",11)(2,"div",12),u(3),f(),_(4,"div",13),R(5,eM,3,0,"div",14),f()()()}if(o&2){let e=t.$implicit,n=g(2);Dt("background-image","url("+e.image+")"),Q("disabled",n.spawnPending()),d(3),D(e.name),d(2),N(e.recommended?5:-1)}}function nM(o,t){if(o&1&&(_(0,"section",3)(1,"header",4)(2,"h2"),u(3,"Choose Spawn"),f(),R(4,QC,3,0,"span",5),f(),_(5,"p",6),u(6,"Choose your initial spawn point. You can change this later."),f(),_(7,"div",7),ve(8,tM,6,5,"button",8,_0),f()()),o&2){let e=g();oe("disabled",e.spawnPending()),d(4),N(e.spawnPending()?4:-1),d(4),xe(e.spawns())}}function iM(o,t){o&1&&(_(0,"span",5),ye(1,"i",9),u(2," Loading "),f())}function oM(o,t){o&1&&(_(0,"div",27),u(1,"Not created yet"),f())}function rM(o,t){if(o&1&&(_(0,"div",27),u(1),f()),o&2){let e=g().$implicit;d(),me("Last Online: ",e.lastOnline)}}function aM(o,t){o&1&&(_(0,"div",28),u(1,"DEAD"),f())}function sM(o,t){if(o&1&&ye(0,"div",30),o&2){let e=g().$implicit;Dt("background-image","url("+(e.faction==null?null:e.faction.logo)+")")}}function lM(o,t){if(o&1){let e=Z();_(0,"button",24),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.previewCharacter(i))}),_(1,"div",25)(2,"div",26),u(3),f(),R(4,oM,2,0,"div",27)(5,rM,2,1,"div",27),f(),R(6,aM,2,0,"div",28)(7,sM,1,2,"div",29),f()}if(o&2){let e,n=t.$implicit,i=g(2);oe("killed",n.killed)("previewed",((e=i.previewedCharacter())==null?null:e.id)===n.id),Q("disabled",i.characterPending()),d(3),D(n.name),d(),N(n.hasAppearance===!1?4:n.lastOnline?5:-1),d(2),N(n.killed?6:n.faction!=null&&n.faction.logo?7:-1)}}function cM(o,t){o&1&&ye(0,"i",9)}function dM(o,t){o&1&&ye(0,"i",37)}function uM(o,t){if(o&1){let e=Z();_(0,"div",22)(1,"div",31),ye(2,"i",32),u(3),f(),_(4,"div",33)(5,"button",34),z("click",function(){P(e);let i=g(2);return A(i.cancelPreview())}),ye(6,"i",35),u(7," Back "),f(),_(8,"button",36),z("click",function(){P(e);let i=g(2);return A(i.confirmCharacter())}),R(9,cM,1,0,"i",9)(10,dM,1,0,"i",37),u(11," Play "),f()()()}if(o&2){let e=g(2);d(3),me(" ",t.name," "),d(2),Q("disabled",e.characterPending()),d(3),Q("disabled",e.characterPending()),d(),N(e.characterPending()?9:10)}}function hM(o,t){if(o&1&&(_(0,"div",16)(1,"div",17)(2,"h1",18),u(3,"Character Selection"),f(),_(4,"p",19),u(5,"Select character to play with"),f(),R(6,iM,3,0,"span",5),f(),_(7,"div",20),ve(8,lM,8,8,"button",21,_0),f(),R(10,uM,12,4,"div",22),_(11,"div",23),u(12,"To create a new character, head over to the UCP"),ye(13,"br"),u(14,"https://ucp.southwest-roleplay.com"),f()()),o&2){let e,n=g();oe("disabled",n.characterPending()),d(6),N(n.characterPending()?6:-1),d(2),xe(n.characters()),d(2),N((e=n.previewedCharacter())?10:-1,e)}}function pM(o,t){if(o&1){let e=Z();_(0,"div",41)(1,"label",45),u(2,"Username"),f(),_(3,"input",46),Wr("ngModelChange",function(i){P(e);let r=g(2);return Gr(r.username,i)||(r.username=i),A(i)}),z("keydown",function(i){P(e);let r=g(2);return A(r.onKeyDown(i))}),f()(),_(4,"div",41)(5,"label",47),u(6,"Password"),f(),_(7,"input",48),Wr("ngModelChange",function(i){P(e);let r=g(2);return Gr(r.password,i)||(r.password=i),A(i)}),z("keydown",function(i){P(e);let r=g(2);return A(r.onKeyDown(i))}),f()()}if(o&2){let e=g(2);d(3),Hr("ngModel",e.username),Q("disabled",e.loading()),d(4),Hr("ngModel",e.password),Q("disabled",e.loading())}}function mM(o,t){if(o&1){let e=Z();_(0,"div",41)(1,"label",49),u(2,"One-time Password"),f(),_(3,"input",50),Wr("ngModelChange",function(i){P(e);let r=g(2);return Gr(r.otpCode,i)||(r.otpCode=i),A(i)}),z("keydown",function(i){P(e);let r=g(2);return A(r.onKeyDown(i))}),f()()}if(o&2){let e=g(2);d(3),Hr("ngModel",e.otpCode),Q("disabled",e.loading())}}function fM(o,t){if(o&1&&(_(0,"div",42),ye(1,"i",51),u(2),f()),o&2){let e=g(2);d(2),me(" ",e.errorMessage()," ")}}function gM(o,t){o&1&&(ye(0,"span",52),u(1," Logging in... "))}function _M(o,t){o&1&&u(0," Verify OTP ")}function vM(o,t){o&1&&u(0," Login ")}function xM(o,t){if(o&1){let e=Z();_(0,"div",2)(1,"div",38),ye(2,"img",39),f(),_(3,"form",40),z("ngSubmit",function(){P(e);let i=g();return A(i.onSubmit())}),R(4,pM,8,4)(5,mM,4,2,"div",41),R(6,fM,3,1,"div",42),_(7,"button",43),R(8,gM,2,0)(9,_M,1,0)(10,vM,1,0),f()(),_(11,"div",44)(12,"p"),u(13,"southwest-roleplay.com"),f()()()}if(o&2){let e=g();d(4),N(e.otpMode()?5:4),d(2),N(e.errorMessage()?6:-1),d(),Q("disabled",e.loading()),d(),N(e.loading()?8:e.otpMode()?9:10)}}var v0=(()=>{class o{constructor(){this.initialUsername=en(""),this.characters=en([]),this.spawns=en([]),this.submitted=Qt(),this.characterSelected=Qt(),this.spawnSelected=Qt(),this.resetRequested=Qt(),this.previewRequested=Qt(),this.previewCleared=Qt(),this.username=F(""),this.password=F(""),this.loading=F(!1),this.errorMessage=F(""),this.otpMode=F(!1),this.otpCode=F(""),this.characterPending=F(!1),this.spawnPending=F(!1),this.previewedCharacter=F(null),this.lastUsername="",this.lastPassword="",Br(()=>{let e=this.initialUsername().trim();e&&(this.username()||this.username.set(e))}),Br(()=>{this.characters().length>0&&(this.characterPending.set(!1),this.spawnPending.set(!1))}),Br(()=>{this.spawns().length>0&&(this.characterPending.set(!1),this.spawnPending.set(!1))})}onSubmit(){if(this.otpMode()){this.submitOtp();return}let e=this.username().trim(),n=this.password().trim();if(!e||!n){this.errorMessage.set("Username and password are required");return}this.lastUsername=e,this.lastPassword=n,this.errorMessage.set(""),this.loading.set(!0),this.submitted.emit({username:e,password:n}),setTimeout(()=>{this.loading()&&this.loading.set(!1)},3e3)}onKeyDown(e){if(e.key==="Escape"){e.preventDefault(),this.resetRequested.emit();return}e.key==="Enter"&&(e.preventDefault(),this.onSubmit())}onLoginSuccess(){this.loading.set(!1),this.otpMode.set(!1),this.otpCode.set(""),this.errorMessage.set("")}onLoginError(e){if(this.loading.set(!1),this.errorMessage.set(e),this.otpMode()){this.otpCode.set("");return}this.password.set("")}onLoginOtp(e=!1){this.loading.set(!1),this.otpMode.set(!0),this.otpCode.set(""),e?this.errorMessage.set("Invalid OTP code. Please try again."):this.errorMessage.set("Two-factor authentication is enabled. Enter your OTP code to continue.")}resetFromScratch(e=""){this.loading.set(!1),this.errorMessage.set(""),this.otpMode.set(!1),this.otpCode.set(""),this.characterPending.set(!1),this.spawnPending.set(!1),this.password.set(""),this.lastPassword="",this.previewedCharacter()&&(this.previewedCharacter.set(null),this.previewCleared.emit());let n=e.trim();this.username.set(n),this.lastUsername=n}previewCharacter(e){this.characterPending()||this.previewedCharacter()?.id!==e.id&&(this.previewedCharacter.set(e),this.previewRequested.emit(e.id))}confirmCharacter(){let e=this.previewedCharacter();!e||this.characterPending()||(this.characterPending.set(!0),this.characterSelected.emit(e.id))}cancelPreview(){this.characterPending()||(this.previewedCharacter.set(null),this.previewCleared.emit())}selectSpawn(e){this.spawnPending()||(this.spawnPending.set(!0),this.spawnSelected.emit(e))}submitOtp(){let e=this.otpCode().trim();if(!this.lastUsername||!this.lastPassword){this.otpMode.set(!1),this.errorMessage.set("Session expired. Please login again.");return}if(!e){this.errorMessage.set("OTP code is required");return}this.errorMessage.set(""),this.loading.set(!0),this.submitted.emit({username:this.lastUsername,password:this.lastPassword,otp:e}),setTimeout(()=>{this.loading()&&this.loading.set(!1)},3e3)}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-login-modal"]],inputs:{initialUsername:[1,"initialUsername"],characters:[1,"characters"],spawns:[1,"spawns"]},outputs:{submitted:"submitted",characterSelected:"characterSelected",spawnSelected:"spawnSelected",resetRequested:"resetRequested",previewRequested:"previewRequested",previewCleared:"previewCleared"},decls:3,vars:1,consts:[[1,"selection-shell","panel",3,"disabled"],[1,"char-selection",3,"disabled"],[1,"login-container"],[1,"selection-shell","panel"],[1,"selection-header"],[1,"pending-indicator"],[1,"selection-description"],[1,"spawns-grid"],["type","button",1,"spawn-card",3,"background-image","disabled"],[1,"fa","fa-fw","fa-spin","fa-spinner-third"],["type","button",1,"spawn-card",3,"click","disabled"],[1,"spawn-inner"],[1,"spawn-name"],[1,"spawn-bottom"],[1,"spawn-recommended"],[1,"fa-solid","fa-star"],[1,"char-selection"],[1,"char-selection-header"],[1,"char-title"],[1,"char-subtitle"],[1,"characters"],["type","button",1,"character",3,"killed","previewed","disabled"],[1,"char-confirm-bar"],[1,"disclaimer"],["type","button",1,"character",3,"click","disabled"],[1,"char-info"],[1,"name"],[1,"last-online"],["aria-hidden","true",1,"dead-marker"],["aria-hidden","true",1,"faction-logo",3,"background-image"],["aria-hidden","true",1,"faction-logo"],[1,"char-confirm-name"],[1,"fa-solid","fa-user"],[1,"char-confirm-actions"],["type","button",1,"char-confirm-back",3,"click","disabled"],[1,"fa-solid","fa-arrow-left"],["type","button",1,"char-confirm-play",3,"click","disabled"],[1,"fa-solid","fa-play"],[1,"login-header"],["src","https://static.southwest-roleplay.com/public/logo.png","alt","SWRP logo",1,"login-logo"],[1,"login-form",3,"ngSubmit"],[1,"form-group"],[1,"error-message"],["type","submit",1,"login-button",3,"disabled"],[1,"login-footer"],["for","username"],["id","username","type","text","placeholder","Enter your username","name","username","autocomplete","username",3,"ngModelChange","keydown","ngModel","disabled"],["for","password"],["id","password","type","password","placeholder","Enter your password","name","password","autocomplete","current-password",3,"ngModelChange","keydown","ngModel","disabled"],["for","otp"],["id","otp","type","text","inputmode","numeric","maxlength","8","placeholder","Enter OTP code","name","otp","autocomplete","one-time-code",3,"ngModelChange","keydown","ngModel","disabled"],["aria-hidden","true",1,"fa-solid","fa-circle-exclamation"],[1,"spinner"]],template:function(n,i){n&1&&R(0,nM,10,3,"section",0)(1,hM,15,4,"div",1)(2,xM,14,4,"div",2),n&2&&N(i.spawns().length>0?0:i.characters().length>0?1:2)},dependencies:[tt,ic,Hg,Zr,ec,Ng,ps,hs,us],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;pointer-events:auto;color:var(--sw-text)}.login-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:2.4rem;background:linear-gradient(135deg,#1b1d22,#22242c);border:1px solid rgba(209,27,45,.24);border-radius:16px;padding:3rem;width:100%;max-width:23.75rem;margin:0 auto}.login-header[_ngcontent-%COMP%]{text-align:center;display:flex;flex-direction:column;gap:.65rem}.login-header[_ngcontent-%COMP%] .login-logo[_ngcontent-%COMP%]{width:min(18rem,75vw);height:auto;display:block;margin:0 auto;filter:drop-shadow(0 .4rem 1rem rgba(0,0,0,.45))}.login-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:.9rem;color:var(--sw-text-soft);letter-spacing:.12em;text-transform:uppercase;margin:0}.login-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.2rem;width:100%}.selection-shell[_ngcontent-%COMP%]{width:min(94vw,72rem);border:1px solid var(--sw-border, rgba(95, 101, 114, .48));border-radius:14px;background:linear-gradient(160deg,#383c46e6,#202228f2);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:.95rem}.selection-shell.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.72}.selection-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.25rem .2rem .65rem;border-bottom:1px solid rgba(209,27,45,.34)}.selection-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:#f0f3f8;font-weight:700}.selection-description[_ngcontent-%COMP%]{margin:0;padding:.65rem .2rem .85rem;font-size:.8rem;color:var(--sw-text-soft, #a9b0bb)}.pending-indicator[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;font-size:.75rem;letter-spacing:.04em;text-transform:uppercase;color:var(--sw-text-soft, #a9b0bb)}.char-selection[_ngcontent-%COMP%]{width:min(94vw,26rem)}.char-selection.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.72}.char-selection-header[_ngcontent-%COMP%]{margin-bottom:.85rem}.char-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:#fff;line-height:1.2;text-shadow:0 2px 8px rgba(0,0,0,.7)}.char-subtitle[_ngcontent-%COMP%]{margin:.22rem 0 0;font-size:.84rem;color:var(--sw-text-soft, #a9b0bb);text-shadow:0 1px 4px rgba(0,0,0,.6)}.characters[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.28rem;margin-bottom:.75rem}.character[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:space-between;position:relative;overflow:hidden;background:linear-gradient(135deg,#1b1d22eb,#22242ceb);border:1px solid rgba(255,255,255,.07);border-radius:10px;padding:.62rem .75rem;height:4vh;color:var(--sw-text, #d8dde6);text-align:left;cursor:pointer;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:0 4px 16px #00000047,inset 0 1px #ffffff0f;transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease;font-family:inherit}.character[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,#22242cf2,#2a2d37f2);border-color:#ffffff24;box-shadow:0 6px 20px #00000052,inset 0 1px #ffffff14;transform:translateY(-1px)}.character.previewed[_ngcontent-%COMP%]{background:linear-gradient(135deg,#1b1d22f2,#22242cf2);border-color:#d11b2d8c;box-shadow:0 0 1rem #d11b2d2e,0 4px 16px #00000052,inset 0 1px #ffffff14,inset 0 0 0 1px #d11b2d1f}.character.previewed[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{color:#fff}.character[_ngcontent-%COMP%]:disabled{cursor:not-allowed}.char-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.16rem;min-width:0}.name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600;color:#e8edf5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.last-online[_ngcontent-%COMP%]{font-size:.74rem;color:var(--sw-text-soft, #a9b0bb)}.dead-marker[_ngcontent-%COMP%]{flex-shrink:0;min-width:2.8rem;height:2.8rem;margin-left:.75rem;display:inline-flex;align-items:center;justify-content:center;color:#ff9a9a;font-size:.72rem;font-weight:700;letter-spacing:.07em}.faction-logo[_ngcontent-%COMP%]{flex-shrink:0;width:2.8rem;height:2.8rem;background-size:contain;background-repeat:no-repeat;background-position:center;margin-left:.75rem;opacity:.88}.char-confirm-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.75rem;padding:.62rem .75rem;background:linear-gradient(135deg,#1b1d22eb,#22242ceb);border:1px solid rgba(209,27,45,.32);border-radius:10px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:0 4px 16px #00000047,inset 0 1px #ffffff0f;animation:_ngcontent-%COMP%_confirm-bar-in .16s ease both}@keyframes _ngcontent-%COMP%_confirm-bar-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.char-confirm-name[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.88rem;font-weight:600;color:#e8edf5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.char-confirm-name[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{color:#d11b2dcc;flex-shrink:0}.char-confirm-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.char-confirm-back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.45rem .85rem;background:#ffffff0d;border:1px solid rgba(255,255,255,.12);border-radius:7px;font-size:.8rem;font-weight:600;color:var(--sw-text-soft, #a9b0bb);cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease;font-family:inherit}.char-confirm-back[_ngcontent-%COMP%]:hover:not(:disabled){background:#ffffff17;border-color:#ffffff38;color:#e8edf5}.char-confirm-back[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(.97)}.char-confirm-back[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.char-confirm-play[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.45rem 1.1rem;background:linear-gradient(135deg,#d11b2dd1,#e52f41b8);border:1px solid rgba(209,27,45,.52);border-radius:7px;font-size:.8rem;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.06em;cursor:pointer;transition:background .14s ease,border-color .14s ease,box-shadow .14s ease;font-family:inherit}.char-confirm-play[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,#e52f41eb,#f94355d1);border-color:#d11b2db8;box-shadow:0 0 1.2rem #d11b2d61}.char-confirm-play[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(.97)}.char-confirm-play[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.disclaimer[_ngcontent-%COMP%]{font-size:.71rem;color:var(--sw-text-soft, #a9b0bb);line-height:1.55;text-shadow:0 1px 4px rgba(0,0,0,.6);text-align:center}.spawns-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.62rem}.spawn-card[_ngcontent-%COMP%]{width:100%;min-height:10.2rem;background-size:cover;background-repeat:no-repeat;background-position:center;box-shadow:0 8px 18px #00000059;transition:transform .15s ease,border-color .15s ease;border-radius:10px;border:1px solid rgba(255,255,255,.16);color:var(--sw-text, #d8dde6);text-align:left}.spawn-card[_ngcontent-%COMP%]:hover:not(:disabled){transform:translateY(-2px);border-color:#d11b2d9e}.spawn-card[_ngcontent-%COMP%]:disabled{cursor:not-allowed}.spawn-inner[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column}.spawn-name[_ngcontent-%COMP%]{padding:.55rem .65rem;text-shadow:0 0 .3125rem rgba(0,0,0,.8);font-size:.85rem;font-weight:700}.spawn-bottom[_ngcontent-%COMP%]{margin-top:auto;display:flex;align-items:flex-end;justify-content:space-between;gap:.5rem;padding:.55rem .65rem}.spawn-recommended[_ngcontent-%COMP%]{text-shadow:0 0 .3125rem black}.spawn-recommended[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{color:#ffd43b}.spawn-coords[_ngcontent-%COMP%]{background:#090b108f;padding:.25rem .5rem;border-radius:.25rem;font-size:.74rem}@media(max-width:1024px){.spawns-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){[_nghost-%COMP%]{width:100%}.selection-shell[_ngcontent-%COMP%]{width:100%}.spawns-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.form-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-group[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:600;color:var(--sw-text-soft);text-transform:uppercase;letter-spacing:.06em}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{background:#ffffff0a;border:1px solid rgba(209,27,45,.18);border-radius:8px;padding:.82rem 1rem;font-size:.95rem;color:var(--sw-text);font-family:inherit;transition:all .2s ease}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#ffffff3d}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none;background:#ffffff0f;border-color:#d11b2d6b;box-shadow:0 0 1rem #d11b2d2e,inset 0 0 .5rem #d11b2d0f}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.otp-intro[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;background:#d11b2d1a;border:1px solid rgba(209,27,45,.24);border-radius:8px;padding:.75rem .9rem}.otp-intro[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{font-size:1rem;color:#ff8d8d}.otp-intro[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.86rem;color:var(--sw-text-soft)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;background:#d11b2d1f;border:1px solid rgba(209,27,45,.32);border-radius:8px;padding:.75rem 1rem;font-size:.9rem;color:#ff6b6b}.error-message[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{font-size:1.2rem;width:1.2rem;height:1.2rem;display:flex;align-items:center;justify-content:center}.login-button[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dc7,#e52f41ad);border:1px solid rgba(209,27,45,.48);border-radius:8px;padding:.95rem 1.4rem;font-size:.95rem;font-weight:600;color:#fff;text-transform:uppercase;letter-spacing:.08em;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:.6rem;transition:all .3s ease;margin-top:.6rem}.login-button[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.login-button[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,#e52f41e0,#f94355c7);border-color:#d11b2db8;box-shadow:0 0 2rem #d11b2d6b,inset 0 0 1rem #ffffff14}.login-button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(.98)}.login-button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.spinner[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.login-footer[_ngcontent-%COMP%]{font-size:.85rem;color:var(--sw-text-soft);margin-top:.4rem}.login-footer[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}'],changeDetection:0})}}return o})();var bM=(o,t)=>t.key;function yM(o,t){if(o&1&&ye(0,"p",5),o&2){let e=g(2);Q("innerHTML",e.options().message||"",an)}}function CM(o,t){if(o&1&&(_(0,"p",6),u(1),f()),o&2){let e=g(2);d(),D(e.options().message)}}function MM(o,t){if(o&1&&R(0,yM,1,1,"p",5)(1,CM,2,1,"p",6),o&2){let e=g();N(e.isHtmlMessage()?0:1)}}function wM(o,t){if(o&1&&ye(0,"p",11),o&2){let e=g(2).$implicit;Q("innerHTML",e.message||"",an)}}function SM(o,t){if(o&1&&(_(0,"p",12),u(1),f()),o&2){let e=g(2).$implicit;d(),D(e.message)}}function EM(o,t){if(o&1&&R(0,wM,1,1,"p",11)(1,SM,2,1,"p",12),o&2){let e=g(2);N(e.isHtmlMessage()?0:1)}}function TM(o,t){if(o&1&&(_(0,"span",7),u(1),f()),o&2){let e=g().$implicit;d(),D(e.label)}}function PM(o,t){if(o&1&&(_(0,"div",14),u(1),f()),o&2){let e=g(2).$implicit,n=g();d(),D(n.remaining(e))}}function AM(o,t){if(o&1){let e=Z();_(0,"div",8)(1,"input",13),z("input",function(i){P(e);let r=g().$index,a=g();return A(a.onInput(r,(i.target.value||"").toString()))})("blur",function(){P(e);let i=g().$index,r=g();return A(r.onBlur(i))}),f(),R(2,PM,2,1,"div",14),f()}if(o&2){let e=g().$implicit,n=g();d(),oe("invalid",!e.valid&&e.touched),Q("type",(e.type==="text"||!e.type,"text"))("placeholder",e.placeholder||"")("value",e.value),Jt("maxlength",e.maxLength??null),d(),N(n.remaining(e)!==null?2:-1)}}function IM(o,t){if(o&1&&(_(0,"div",14),u(1),f()),o&2){let e=g(2).$implicit,n=g();d(),D(n.remaining(e))}}function OM(o,t){if(o&1){let e=Z();_(0,"div",8)(1,"textarea",15),z("input",function(i){P(e);let r=g().$index,a=g();return A(a.onInput(r,(i.target.value||"").toString()))})("blur",function(){P(e);let i=g().$index,r=g();return A(r.onBlur(i))}),f(),R(2,IM,2,1,"div",14),f()}if(o&2){let e=g().$implicit,n=g();d(),oe("invalid",!e.valid&&e.touched),Q("placeholder",e.placeholder||"")("value",e.value),Jt("maxlength",e.maxLength??null),d(),N(n.remaining(e)!==null?2:-1)}}function DM(o,t){if(o&1){let e=Z();_(0,"overlay-select",16),z("valueChange",function(i){P(e);let r=g().$index,a=g();return A(a.onSelectInput(r,i))}),f()}if(o&2){let e=g().$implicit,n=g();Q("options",n.selectOptions(e))("value",e.value)}}function kM(o,t){if(o&1&&(_(0,"p",17),u(1),f()),o&2){let e=g().$implicit;oe("highlight",!e.valid&&e.touched),d(),D(e.hint)}}function RM(o,t){if(o&1&&(_(0,"div",1),R(1,EM,2,1),R(2,TM,2,1,"span",7),R(3,AM,3,7,"div",8),R(4,OM,3,6,"div",8),R(5,DM,1,2,"overlay-select",9),R(6,kM,2,3,"p",10),f()),o&2){let e=t.$implicit,n=g();d(),N(e.message?1:-1),d(),N(e.label?2:-1),d(),N(n.isTextInput(e)&&!n.shouldUseTextArea(e)?3:-1),d(),N(n.isTextInput(e)&&n.shouldUseTextArea(e)?4:-1),d(),N(n.isSelectInput(e)?5:-1),d(),N(e.hint?6:-1)}}var x0=(()=>{class o{constructor(){this.options=en.required(),this.valuesChanged=Qt(),this.responded=Qt(),this.inputsState=F([]),this.isHtmlMessage=le(()=>this.options().html===!0),this.allValid=le(()=>this.inputsState().every(e=>e.valid)),this.confirmLabel=le(()=>this.options().confirmLabel||"Confirm"),this.cancelLabel=le(()=>this.options().cancelLabel||"Cancel")}ngOnInit(){this.inputsState.set(this.normalizeInputs(this.options().inputs)),this.emitValues()}inputs(){return this.inputsState()}onInput(e,n){this.patchInput(e,{value:n}),this.emitValues()}onBlur(e){this.patchInput(e,{touched:!0})}remaining(e){return!e.maxLength||e.maxLength<=0?null:e.maxLength-e.value.length}shouldUseTextArea(e){return e.big===!0}isTextInput(e){return!e.type||["text","character","faction","company","property"].includes(e.type)}isSelectInput(e){return e.type==="select"}selectOptions(e){return(e.options??[]).map(i=>{if(typeof i=="string")return{value:i,label:i};let r=String(i.label??i.value??"Option");return{value:String(i.value??i.label??""),label:r}})}onSelectInput(e,n){this.onInput(e,String(n??"")),this.onBlur(e)}onKeyDown(e){if(e.key==="Enter"){e.preventDefault(),this.allValid()&&this.confirm();return}e.key==="Escape"&&(e.preventDefault(),this.cancel())}confirm(){if(!this.allValid())return;let e={};for(let n of this.inputsState())e[n.key]=n.value;this.responded.emit({action:"submit",response:e})}cancel(){this.responded.emit({action:"cancel"})}normalizeInputs(e){return e?(Array.isArray(e)?e:Object.entries(e).map(([i,r])=>De(he({},r),{key:i}))).map((i,r)=>{let a=i.key??`field_${r}`,s=i.value??"";return De(he({},i),{key:a,value:s,touched:!1,valid:this.isValueValid(i.pattern,s)})}):[]}patchInput(e,n){let i=this.inputsState().map((r,a)=>{if(a!==e)return r;let s=r.maxLength,l=n.value??r.value,c=typeof s=="number"&&s>0?l.slice(0,s):l,h=De(he(he({},r),n),{value:c});return De(he({},h),{valid:this.isValueValid(h.pattern,h.value)})});this.inputsState.set(i)}emitValues(){let e={};for(let n of this.inputsState())e[n.key]=n.value;this.valuesChanged.emit(e)}isValueValid(e,n){if(!e)return!0;try{return new RegExp(e).test(n)}catch{return!0}}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-multi-input-modal"]],inputs:{options:[1,"options"]},outputs:{valuesChanged:"valuesChanged",responded:"responded"},decls:9,vars:4,consts:[[1,"multi-input-grid",3,"keydown"],[1,"multi-input-row"],[1,"inline-actions"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"secondary",3,"click"],[1,"multi-input-copy",3,"innerHTML"],[1,"multi-input-copy"],[1,"row-label"],[1,"input-group"],[3,"options","value"],[1,"row-hint",3,"highlight"],[1,"row-message",3,"innerHTML"],[1,"row-message"],[3,"input","blur","type","placeholder","value"],[1,"length"],[3,"input","blur","placeholder","value"],[3,"valueChange","options","value"],[1,"row-hint"]],template:function(n,i){n&1&&(R(0,MM,2,1),_(1,"div",0),z("keydown",function(a){return i.onKeyDown(a)}),ve(2,RM,7,6,"div",1,bM),f(),_(4,"div",2)(5,"button",3),z("click",function(){return i.confirm()}),u(6),f(),_(7,"button",4),z("click",function(){return i.cancel()}),u(8),f()()),n&2&&(N(i.options().message?0:-1),d(2),xe(i.inputs()),d(3),Q("disabled",!i.allValid()),d(),D(i.confirmLabel()),d(2),D(i.cancelLabel()))},dependencies:[tt,Vo],styles:[".multi-input-copy[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem 0;color:var(--sw-text)}.multi-input-grid[_ngcontent-%COMP%]{display:grid;gap:.85rem;padding:.85rem .95rem}.multi-input-row[_ngcontent-%COMP%]{display:grid;gap:.3rem;font-size:.8rem}.row-label[_ngcontent-%COMP%]{text-transform:uppercase;opacity:.85;color:var(--sw-text-soft);letter-spacing:.04em}.row-message[_ngcontent-%COMP%]{margin:0;color:var(--sw-text)}.input-group[_ngcontent-%COMP%]{position:relative}.multi-input-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .multi-input-row[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .multi-input-row[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{border:1px solid rgba(var(--sw-accent-rgb),.2);border-radius:8px;padding:.5rem .6rem;background:#0e10148f;color:var(--sw-text);overflow:hidden;word-wrap:break-word;overflow-wrap:break-word;width:100%;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.multi-input-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .multi-input-row[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus, .multi-input-row[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus{outline:none;border-color:rgba(var(--sw-accent-rgb),.5);background:#12151abd;box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.15),0 8px 18px #00000038}.multi-input-row[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:5rem;resize:vertical}.multi-input-row[_ngcontent-%COMP%] input.invalid[_ngcontent-%COMP%], .multi-input-row[_ngcontent-%COMP%] textarea.invalid[_ngcontent-%COMP%]{border-color:#f07373cc;box-shadow:inset 0 0 0 1px #f0737333}.row-hint[_ngcontent-%COMP%]{margin:0;text-align:right;opacity:.7;color:var(--sw-text-soft)}.row-hint.highlight[_ngcontent-%COMP%]{color:var(--sw-bad);opacity:1}.length[_ngcontent-%COMP%]{position:absolute;right:.6rem;top:0;height:100%;display:flex;align-items:center;font-size:.75rem;opacity:.65;color:var(--sw-text-soft);pointer-events:none}.inline-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;padding:.75rem .95rem .85rem;border-top:1px solid rgba(255,255,255,.06);margin-top:.2rem}"],changeDetection:0})}}return o})();var b0=(o,t)=>t.id;function NM(o,t){o&1&&(v(0,"div",1),Te(1,"span",19),b())}function LM(o,t){o&1&&(v(0,"p",5),u(1),b()),o&2&&(d(),D(t))}function FM(o,t){if(o&1&&(v(0,"span"),u(1),b(),v(2,"strong"),u(3),b()),o&2){let e=t.$implicit;d(),D(e.label),d(2),D(e.value)}}function VM(o,t){if(o&1&&(v(0,"div",6),ve(1,FM,4,2,null,null,ct),b()),o&2){let e=g();d(),xe(e.invoiceMetadata())}}function BM(o,t){if(o&1&&(v(0,"tr")(1,"td",21),u(2),b(),v(3,"td",28),u(4),b(),v(5,"td",22),u(6),b(),v(7,"td",23),u(8),b(),v(9,"td",29),u(10),b()()),o&2){let e=t.$implicit,n=t.$index,i=g(2);d(2),D(n+1),d(2),D(e.name),d(2),D(e.amount),d(2),D(i.formatMoney(e.price)),d(2),D(i.formatMoney(i.getLineTotal(e)))}}function UM(o,t){if(o&1&&(v(0,"div",8)(1,"table",20)(2,"thead")(3,"tr")(4,"th",21),u(5,"#"),b(),v(6,"th"),u(7,"Service"),b(),v(8,"th",22),u(9,"Qty"),b(),v(10,"th",23),u(11,"Unit"),b(),v(12,"th",24),u(13,"Total"),b()()()(),v(14,"div",25)(15,"table",26)(16,"tbody"),ve(17,BM,11,5,"tr",null,ct),b()()(),v(19,"div",27)(20,"span"),u(21,"Amount Due"),b(),v(22,"strong"),u(23),b()()()),o&2){let e=g();d(17),xe(e.items()),d(6),D(e.formatMoney(e.total()))}}function zM(o,t){if(o&1){let e=Z();v(0,"button",30),ne("click",function(){P(e);let i=g();return A(i.selectCash())}),v(1,"div",31),Te(2,"i",32),b(),v(3,"div",33)(4,"strong"),u(5,"Cash"),b(),v(6,"span"),u(7,"Pay with cash on hand."),b()()()}if(o&2){let e=g();oe("selected",e.isCashSelected())}}function HM(o,t){if(o&1&&(v(0,"span"),u(1),b()),o&2){let e=t.$implicit;d(),D(e)}}function GM(o,t){if(o&1){let e=Z();v(0,"button",30),ne("click",function(){let i=P(e).$implicit,r=g();return A(r.selectBankAccount(i.id))}),v(1,"div",31),Te(2,"i",34),b(),v(3,"div",33)(4,"strong"),u(5),b(),ve(6,HM,2,1,"span",null,ct),b()()}if(o&2){let e=t.$implicit,n=g();oe("selected",n.isBankSelected(e.id)),d(5),D(n.getAccountTitle(e)),d(),xe(n.getAccountLines(e))}}function WM(o,t){if(o&1&&(v(0,"span"),u(1),b()),o&2){let e=t.$implicit;d(),D(e)}}function XM(o,t){if(o&1){let e=Z();v(0,"button",30),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectBankAccount(i.id))}),v(1,"div",31),Te(2,"i",34),b(),v(3,"div",33)(4,"strong"),u(5),b(),ve(6,WM,2,1,"span",null,ct),b()()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.isBankSelected(e.id)),d(5),D(n.getAccountTitle(e)),d(),xe(n.getAccountLines(e))}}function qM(o,t){if(o&1&&(v(0,"div",37),ve(1,XM,8,3,"button",11,b0),b()),o&2){let e=g(2);d(),xe(e.hiddenBankAccounts())}}function $M(o,t){if(o&1){let e=Z();v(0,"button",35),ne("click",function(){P(e);let i=g();return A(i.toggleMore())}),v(1,"span"),u(2,"More payment methods..."),b(),Te(3,"i",36),b(),R(4,qM,3,0,"div",37)}if(o&2){let e=g();oe("expanded",e.expandedMore()),d(4),N(e.expandedMore()?4:-1)}}function YM(o,t){o&1&&(v(0,"span",14),u(1,"Payment successful."),b())}function jM(o,t){o&1&&(v(0,"span",15),u(1,"Payment failed."),b())}var y0=(()=>{class o{constructor(){this.options=en.required(),this.status=en("idle"),this.responded=Qt(),this.paymentMethod=F(null),this.purchasePending=F(!1),this.expandedMore=F(!1),this.allBankAccounts=le(()=>this.getVisibleBankAccounts()),this.visibleBankAccounts=le(()=>this.allBankAccounts().filter(e=>this.getBankAccountKind(e)==="character")),this.hiddenBankAccounts=le(()=>this.allBankAccounts().filter(e=>{let n=this.getBankAccountKind(e);return n==="company"||n==="faction"})),this.shouldShowMore=le(()=>this.hiddenBankAccounts().length>0),this.items=le(()=>this.options().items??[]),this.total=le(()=>this.items().reduce((e,n)=>e+this.getLineTotal(n),0)),this.sellerName=le(()=>{let e=this.options().seller;return e?typeof e=="string"?e||null:e.name??null:null}),this.invoiceMetadata=le(()=>{let e=this.options().invoiceMetadata;return e?Object.entries(e).map(([n,i])=>this.toInvoiceMetadataEntry(n,i)).filter(n=>n!==null):[]}),this.canPurchase=le(()=>!!this.paymentMethod()&&!this.purchasePending()&&this.status()==="idle"),this.isLoading=le(()=>this.purchasePending()&&this.status()==="idle")}getLineTotal(e){let n=Number(e.price||0),i=Number(e.amount||0),r=Number(e.tax||0),a=n+n*(r/100);return i*a}formatMoney(e){return`$${e.toFixed(2)}`}selectCash(){let e=this.paymentMethod();this.paymentMethod.set(e?.type==="cash"?null:{type:"cash"})}selectBankAccount(e){let n=this.paymentMethod();if(n?.type==="bank"&&n.id===e){this.paymentMethod.set(null);return}this.paymentMethod.set({type:"bank",id:e})}isCashSelected(){return this.paymentMethod()?.type==="cash"}isBankSelected(e){let n=this.paymentMethod();return n?.type==="bank"&&n.id===e}toggleMore(){this.expandedMore.set(!this.expandedMore())}getBankAccountKind(e){let n=(e.kind??e.type??"").toLowerCase();return n.includes("company")?"company":n.includes("faction")?"faction":n.includes("character")||n.includes("personal")?"character":"unknown"}purchase(){let e=this.paymentMethod();e&&(this.purchasePending.set(!0),this.responded.emit({action:"purchase",method:e,clear:!(this.options().waitForConfirmation??!1)}))}cancel(){this.responded.emit({action:"cancel"})}getAccountTitle(e){let n=this.getBankAccountKind(e);return n==="company"?"Business Card":n==="faction"?"Agency Card":"Debit Card"}getAccountLines(e){return[e.holder,e.owner].filter(n=>!!(n&&n.trim()))}getVisibleBankAccounts(){let e=this.options().bankAccounts??[],n=this.options().disableBankAccounts;return n?e.filter(i=>{let r=(i.kind??i.type??"").toLowerCase();return r.includes("company")?!n.company:r.includes("faction")?!n.faction:r.includes("character")||r.includes("personal")?!n.character:!0}):e}toInvoiceMetadataEntry(e,n){if(n==null)return null;if(typeof n=="object"){let i=n.label?.trim()||this.humanizeKey(e),r=n.value;return r==null||r===""?null:{label:i,value:String(r)}}return n===""?null:{label:this.humanizeKey(e),value:String(n)}}humanizeKey(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-payment-modal"]],inputs:{options:[1,"options"],status:[1,"status"]},outputs:{responded:"responded"},decls:34,vars:11,consts:[[1,"payment-modal"],[1,"loading"],[1,"invoice-sheet"],[1,"payment-head"],[1,"invoice-kicker"],[1,"invoice-seller"],[1,"invoice-meta"],[1,"invoice-rule"],[1,"payment-table-wrap"],[1,"payment-options"],[1,"payment-options-head"],["type","button",1,"payment-method",3,"selected"],[1,"payment-foot"],[1,"payment-state","invoice-status"],[1,"status-chip","success"],[1,"status-chip","error"],[1,"payment-actions"],["type","button",1,"pay-button",3,"click","disabled"],["type","button",1,"cancel-button",3,"click","disabled"],[1,"spinner"],[1,"payment-table","payment-table-head"],[1,"line-col"],[1,"text-right","qty-col"],[1,"text-right","unit-col"],[1,"text-right","total-col"],[1,"payment-table-scroll","scrollbar-neon"],[1,"payment-table","payment-table-body"],[1,"invoice-total-row"],[1,"service-col"],[1,"text-right","amount-col","total-col"],["type","button",1,"payment-method",3,"click"],["aria-hidden","true",1,"method-icon"],["aria-hidden","true",1,"fa-solid","fa-money-bill-wave"],[1,"method-copy"],["aria-hidden","true",1,"fa-solid","fa-credit-card"],["type","button",1,"payment-more-toggle",3,"click"],["aria-hidden","true",1,"fa-solid","fa-chevron-down"],[1,"payment-more-section","scrollbar-neon"]],template:function(n,i){if(n&1&&(v(0,"section",0),R(1,NM,2,0,"div",1),v(2,"section",2)(3,"header",3)(4,"div")(5,"p",4),u(6,"Official Invoice"),b(),v(7,"h3"),u(8),b(),R(9,LM,2,1,"p",5),b(),R(10,VM,3,0,"div",6),b(),Te(11,"div",7),R(12,UM,24,1,"div",8),b(),v(13,"section",9)(14,"div",10)(15,"h4"),u(16,"Payment Method"),b(),v(17,"span"),u(18,"Select a payment source."),b()(),R(19,zM,8,2,"button",11),ve(20,GM,8,3,"button",11,b0),R(22,$M,5,3),b(),v(23,"footer",12)(24,"p"),u(25,"Review the charges before submitting payment."),b(),v(26,"div",13),R(27,YM,2,0,"span",14),R(28,jM,2,0,"span",15),b()(),v(29,"div",16)(30,"button",17),ne("click",function(){return i.purchase()}),u(31,"Pay"),b(),v(32,"button",18),ne("click",function(){return i.cancel()}),u(33,"Cancel"),b()()()),n&2){let r;d(),N(i.isLoading()?1:-1),d(7),D(i.options().subject||"Payment Summary"),d(),N((r=i.sellerName())?9:-1,r),d(),N(i.invoiceMetadata().length>0?10:-1),d(2),N(i.items().length>0?12:-1),d(7),N(i.options().cash?19:-1),d(),xe(i.visibleBankAccounts()),d(2),N(i.shouldShowMore()?22:-1),d(5),N(i.status()==="success"?27:-1),d(),N(i.status()==="error"?28:-1),d(2),Ee("disabled",!i.canPurchase()),d(2),Ee("disabled",i.isLoading())}},dependencies:[tt],styles:['.payment-modal[_ngcontent-%COMP%]{position:relative;margin:.95rem;display:grid;gap:.95rem}.invoice-sheet[_ngcontent-%COMP%]{display:grid;grid-template-rows:auto auto minmax(0,1fr);border:1px solid rgba(88,68,43,.15);border-left:4px solid #d11b2d;border-radius:12px;background:linear-gradient(135deg,#f5efe5fa,#e7decdf7);color:#221d17;font-family:"Source Serif 4",Georgia,Cambria,serif;box-shadow:0 8px 32px #00000029,inset 0 1px #fff9;position:relative;max-height:min(49vh,30rem);overflow:hidden}.invoice-sheet[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:linear-gradient(90deg,transparent,rgba(209,27,45,.4),transparent);pointer-events:none}.loading[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;border-radius:16px;background:#f5efe580;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.spinner[_ngcontent-%COMP%]{width:2rem;height:2rem;border:.2rem solid rgba(73,55,35,.2);border-top-color:#8c3028;border-radius:50%;animation:_ngcontent-%COMP%_invoice-spin .8s linear infinite}.payment-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;padding:1rem 1.05rem .85rem}.payment-head[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .invoice-seller[_ngcontent-%COMP%], .invoice-kicker[_ngcontent-%COMP%], .payment-foot[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.payment-head[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:.2rem;font-size:1.05rem;letter-spacing:.01em;color:#16110c;font-weight:700}.invoice-kicker[_ngcontent-%COMP%]{text-transform:uppercase;letter-spacing:.15em;font-size:.65rem;font-weight:800;color:#d11b2d;letter-spacing:.16em}.invoice-seller[_ngcontent-%COMP%]{margin-top:.3rem;font-size:.8rem;color:#5d4b38}.invoice-meta[_ngcontent-%COMP%]{min-width:10rem;display:grid;grid-template-columns:auto auto;gap:.2rem .9rem;align-content:start;font-family:"Source Serif 4",Georgia,Cambria,serif;font-size:.72rem}.invoice-meta[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-transform:uppercase;color:#7b6650}.invoice-meta[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{text-align:right;color:#241912}.invoice-rule[_ngcontent-%COMP%]{height:1px;margin:0 1.05rem;background:linear-gradient(90deg,transparent,rgba(209,27,45,.2),transparent)}.payment-table-wrap[_ngcontent-%COMP%]{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:.7rem 1.05rem .9rem;gap:0}.payment-table-scroll[_ngcontent-%COMP%]{min-height:0;overflow-x:hidden;overflow-y:auto}.payment-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;table-layout:fixed;font-family:"Source Serif 4",Georgia,Cambria,serif}.payment-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .payment-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5rem .4rem;border-top:1px solid rgba(73,55,35,.15)}.payment-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:0;text-transform:uppercase;letter-spacing:.09em;font-size:.7rem;color:#8b745b;font-weight:700}.payment-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#1e1712}.payment-table-head[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:linear-gradient(180deg,#f5efe5fa,#ede5d7fa)}.payment-table-body[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background:transparent}.line-col[_ngcontent-%COMP%]{width:2rem;color:#8b745b}.qty-col[_ngcontent-%COMP%]{width:3.5rem}.unit-col[_ngcontent-%COMP%], .total-col[_ngcontent-%COMP%]{width:6.5rem}.service-col[_ngcontent-%COMP%]{font-family:"Source Serif 4",Georgia,Cambria,serif;font-weight:600}.amount-col[_ngcontent-%COMP%]{font-weight:700}.invoice-total-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.6rem;margin-top:.35rem;padding:.65rem .4rem 0;border-top:2px solid rgba(209,27,45,.25);color:#16110c;font-weight:700}.invoice-total-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:1rem}.text-right[_ngcontent-%COMP%]{text-align:right}.invoice-foot[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:0 1.05rem 1rem;border-top:1px dashed rgba(73,55,35,.22)}.payment-foot[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.9rem 1.05rem 1rem;border-top:1px solid rgba(209,27,45,.1)}.payment-options[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:.7rem;padding:1.1rem 1.05rem 0;border-top:1px solid rgba(209,27,45,.1)}.payment-options-head[_ngcontent-%COMP%]{grid-column:1/-1}.payment-options-head[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .payment-options-head[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin:0}.payment-options-head[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:.85rem;text-transform:uppercase;letter-spacing:.1em;color:var(--sw-text);font-weight:700}.payment-options-head[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;margin-top:.2rem;font-size:.75rem;color:var(--sw-text-soft)}.payment-method[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.8rem;width:100%;border:1.5px solid rgba(255,255,255,.1);border-radius:10px;background:#ffffff14;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);padding:.8rem .9rem;color:var(--sw-text);cursor:pointer;transition:all .24s cubic-bezier(.165,.84,.44,1);position:relative;overflow:hidden;flex-shrink:0;min-height:3.5rem}.payment-method[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(209,27,45,.08),transparent);opacity:0;transition:opacity .24s ease;pointer-events:none}.payment-method[_ngcontent-%COMP%]:hover{border-color:#d11b2d4d;background:#ffffff1f;box-shadow:0 10px 22px #00000024}.payment-method.selected[_ngcontent-%COMP%]{border-color:#d11b2d;background:#d11b2d1f;box-shadow:0 10px 24px #0000002e}.payment-method.selected[_ngcontent-%COMP%]:before{opacity:1}.method-icon[_ngcontent-%COMP%]{min-width:2.8rem;height:2.8rem;display:grid;place-items:center;border-radius:8px;background:#ffffff1f;color:var(--sw-text);transition:all .24s ease;border:1px solid rgba(209,27,45,.1)}.payment-method.selected[_ngcontent-%COMP%] .method-icon[_ngcontent-%COMP%]{background:#d11b2d29;color:#d11b2d;border-color:#d11b2d4d}.method-icon[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;font-size:1.5rem;line-height:1.5rem}.method-copy[_ngcontent-%COMP%]{display:grid;gap:.14rem;text-align:left}.method-copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.82rem}.method-copy[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.74rem;color:var(--sw-text-soft)}.payment-more-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.4rem;width:100%;grid-column:1/-1;border:1.5px solid rgba(209,27,45,.25);border-radius:10px;background:#d11b2d0f;padding:.65rem .85rem;color:#d11b2d;cursor:pointer;transition:all .24s cubic-bezier(.165,.84,.44,1);font-weight:600;font-size:.8rem;letter-spacing:.03em;position:relative;overflow:hidden}.payment-more-toggle[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(209,27,45,.06),transparent);opacity:0;transition:opacity .24s ease;pointer-events:none}.payment-more-toggle[_ngcontent-%COMP%]:hover{border-color:#d11b2d66;background:#d11b2d1a;box-shadow:0 10px 22px #00000024}.payment-more-toggle[_ngcontent-%COMP%]:hover:before{opacity:1}.payment-more-toggle[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{width:1.2rem;height:1.2rem;font-size:1.2rem;line-height:1.2rem;transition:transform .24s cubic-bezier(.165,.84,.44,1)}.payment-more-toggle.expanded[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{transform:rotate(180deg)}.payment-more-section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:max-content;gap:.7rem;padding-top:.7rem;border-top:1px solid rgba(209,27,45,.1);animation:_ngcontent-%COMP%_slideDown .24s cubic-bezier(.165,.84,.44,1);max-height:min(40vh,22rem);overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth;grid-column:1/-1;align-content:start}.payment-foot[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:.74rem;color:var(--sw-text-soft)}.payment-state[_ngcontent-%COMP%], .invoice-status[_ngcontent-%COMP%]{margin:0;padding:0}.status-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .6rem;border-radius:999px;border:1px solid rgba(255,255,255,.16);font-size:.72rem;font-weight:700;letter-spacing:.03em}.status-chip.idle[_ngcontent-%COMP%]{background:#6b564114;color:#5e4a37}.status-chip.success[_ngcontent-%COMP%]{background:#7ad6941f;color:var(--sw-good)}.status-chip.error[_ngcontent-%COMP%]{background:#f073731f;color:var(--sw-bad)}.payment-actions[_ngcontent-%COMP%]{display:flex;gap:.7rem;padding:0 1.05rem 1.05rem}.pay-button[_ngcontent-%COMP%], .cancel-button[_ngcontent-%COMP%]{flex:1 1 0;border-radius:10px;padding:.75rem .85rem;font-weight:700;letter-spacing:.04em;font-size:.85rem;transition:all .2s cubic-bezier(.165,.84,.44,1);position:relative;overflow:hidden}.pay-button[_ngcontent-%COMP%]{border:1px solid #d11b2d;background:linear-gradient(135deg,#d11b2df2,#b41423fa);color:#fff6f2;box-shadow:0 12px 28px #0000003d}.pay-button[_ngcontent-%COMP%]:hover:not(:disabled){box-shadow:0 16px 32px #00000047;transform:translateY(-2px);border-color:#ff2d3d;background:linear-gradient(135deg,#d11b2d,#b41423)}.cancel-button[_ngcontent-%COMP%]{border:1.5px solid rgba(255,255,255,.2);background:#ffffff14;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:var(--sw-text)}.cancel-button[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#ffffff59;background:#ffffff1f}.pay-button[_ngcontent-%COMP%]:disabled, .cancel-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}@keyframes _ngcontent-%COMP%_invoice-spin{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@media(max-width:720px){.payment-head[_ngcontent-%COMP%], .payment-foot[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch}.payment-actions[_ngcontent-%COMP%]{flex-direction:column}.payment-table[_ngcontent-%COMP%]{font-size:.74rem}}'],changeDetection:0})}}return o})();function KM(o,t){if(o&1&&Te(0,"p",7),o&2){let e=g(2);Ee("innerHTML",e.options().message||"",an)}}function ZM(o,t){if(o&1&&(v(0,"p",8),u(1),b()),o&2){let e=g(2);d(),D(e.options().message)}}function JM(o,t){if(o&1&&R(0,KM,1,1,"p",7)(1,ZM,2,1,"p",8),o&2){let e=g();N(e.isHtmlMessage()?0:1)}}function QM(o,t){if(o&1&&(v(0,"p",0),u(1),b()),o&2){let e=g();d(),D(e.options().label)}}function ew(o,t){if(o&1&&(v(0,"p",2),u(1),b()),o&2){let e=g();d(),D(e.remaining())}}function tw(o,t){if(o&1&&(v(0,"p",9),u(1),b()),o&2){let e=g();oe("highlight",!e.isValid()),d(),D(e.options().hint)}}var C0=(()=>{class o{constructor(){this.options=en.required(),this.valueChanged=Qt(),this.responded=Qt(),this.value=F(""),this.isHtmlMessage=le(()=>this.options().html===!0),this.remaining=le(()=>{let e=this.options().maxLength??0;return e>0?e-this.value().length:null}),this.isValid=le(()=>{let e=this.options().pattern;if(!e)return!0;try{return new RegExp(e).test(this.value())}catch{return!0}}),this.placeholder=le(()=>this.options().placeholder||this.options().title||""),this.inputType=le(()=>this.options().inputType||"text"),this.confirmLabel=le(()=>this.options().confirmLabel||"Confirm"),this.cancelLabel=le(()=>this.options().cancelLabel||"Cancel")}ngOnInit(){let e=this.options().value;typeof e=="string"&&(this.value.set(e),this.valueChanged.emit(e))}onInput(e){let n=this.options().maxLength,i=typeof n=="number"&&n>0?e.slice(0,n):e;this.value.set(i),this.valueChanged.emit(i)}onKeyDown(e){if(e.key==="Enter"){e.preventDefault(),this.confirm();return}e.key==="Escape"&&(e.preventDefault(),this.cancel())}confirm(){this.isValid()&&this.responded.emit({action:"confirm",value:this.value()})}cancel(){this.responded.emit({action:"cancel"})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-text-input-modal"]],inputs:{options:[1,"options"]},outputs:{valueChanged:"valueChanged",responded:"responded"},decls:10,vars:13,consts:[[1,"text-input-label"],[1,"text-input-field",3,"input","keydown","type","placeholder","value"],[1,"text-input-remaining"],[1,"text-input-hint",3,"highlight"],[1,"inline-actions"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"secondary",3,"click"],[1,"text-input-copy",3,"innerHTML"],[1,"text-input-copy"],[1,"text-input-hint"]],template:function(n,i){n&1&&(R(0,JM,2,1),R(1,QM,2,1,"p",0),v(2,"input",1),ne("input",function(a){return i.onInput((a.target.value||"").toString())})("keydown",function(a){return i.onKeyDown(a)}),b(),R(3,ew,2,1,"p",2),R(4,tw,2,3,"p",3),v(5,"div",4)(6,"button",5),ne("click",function(){return i.confirm()}),u(7),b(),v(8,"button",6),ne("click",function(){return i.cancel()}),u(9),b()()),n&2&&(N(i.options().message?0:-1),d(),N(i.options().label?1:-1),d(),oe("invalid",!i.isValid()),Ee("type",i.inputType())("placeholder",i.placeholder())("value",i.value()),Jt("maxlength",i.options().maxLength??null),d(),N(i.remaining()!==null?3:-1),d(),N(i.options().hint?4:-1),d(2),Ee("disabled",!i.isValid()),d(),D(i.confirmLabel()),d(2),D(i.cancelLabel()))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;width:100%;overflow-x:hidden}.text-input-copy[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem 0}.text-input-label[_ngcontent-%COMP%]{margin:.5rem .95rem 0;font-size:.8rem;text-transform:uppercase;opacity:.85}.text-input-field[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;box-sizing:border-box;margin:.85rem .95rem;width:calc(100% - 1.9rem);border:1px solid rgba(255,255,255,.2);border-radius:10px;padding:.55rem .65rem;background:#181a1fb8;color:#e4e9f2;overflow-x:auto;overflow-y:hidden;white-space:nowrap;word-wrap:normal;overflow-wrap:normal;scrollbar-width:none}.text-input-field.invalid[_ngcontent-%COMP%]{border-color:#ff6347b3}.text-input-field[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.text-input-remaining[_ngcontent-%COMP%]{margin:-.55rem 1rem 0;text-align:right;opacity:.5;font-size:.75rem}.text-input-hint[_ngcontent-%COMP%]{margin:.3rem .95rem 0;text-align:right;opacity:.6;font-size:.78rem}.text-input-hint.highlight[_ngcontent-%COMP%]{color:tomato;opacity:1}.inline-actions[_ngcontent-%COMP%]{display:flex;gap:.6rem;padding:.8rem .95rem .95rem}.inline-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--sw-border);color:var(--sw-text);background:#ffffff0f;border-radius:.4rem;padding:.45rem .8rem;font-size:.85rem;cursor:pointer}.inline-actions[_ngcontent-%COMP%] button.primary[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.52);background:rgba(var(--sw-accent-rgb),.18)}.inline-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}"],changeDetection:0})}}return o})();var nw=["messageListElement"],iw=["messageListWrapperElement"],ow=["inputElement"];function rw(o,t){o&1&&(_(0,"div",13),ye(1,"i",23),f())}function aw(o,t){o&1&&(_(0,"div",14),ye(1,"i",24),f())}function sw(o,t){o&1&&(_(0,"div",15),ye(1,"i",25),f())}function lw(o,t){o&1&&(_(0,"div",16),ye(1,"i",26),f())}function cw(o,t){o&1&&(_(0,"div",17),ye(1,"i",27),f())}function dw(o,t){o&1&&(_(0,"div",18),ye(1,"i",28),f())}function uw(o,t){o&1&&(_(0,"div",19),ye(1,"i",29),f())}function hw(o,t){o&1&&(_(0,"div",20),ye(1,"i",29),f())}function pw(o,t){o&1&&(_(0,"div",13),ye(1,"i",30),f())}function mw(o,t){if(o&1&&ye(0,"span",21),o&2){let e=g().$implicit;Q("innerHTML",e.timestamp,an)}}function fw(o,t){if(o&1&&(_(0,"div",6),R(1,rw,2,0,"div",13),R(2,aw,2,0,"div",14),R(3,sw,2,0,"div",15),R(4,lw,2,0,"div",16),R(5,cw,2,0,"div",17),R(6,dw,2,0,"div",18),R(7,uw,2,0,"div",19),R(8,hw,2,0,"div",20),R(9,pw,2,0,"div",13),R(10,mw,1,1,"span",21),ye(11,"span",22),f()),o&2){let e=t.$implicit,n=g();d(),N(e.highlight?1:-1),d(),N(e.type==="error"?2:-1),d(),N(e.type==="success"?3:-1),d(),N(e.type==="important"?4:-1),d(),N(e.type==="punishment"?5:-1),d(),N(e.type==="mission"?6:-1),d(),N(e.type==="admin"?7:-1),d(),N(e.type==="admin-crit"?8:-1),d(),N(e.tag==="discord"?9:-1),d(),N(n.timestamp?10:-1),d(),Q("innerHTML",e.content,an)}}var M0=(()=>{class o{static{this.MAX_MESSAGES=200}static{this.DEFAULT_VISIBLE_ROWS=10}constructor(e,n){this.cdr=e,this.sanitizer=n,this.active=!1,this.visible=!0,this.timestamp=!1,this.bbc=!1,this.messages=[],this.chatSize=15,this.spellChecker=!1,this.input="",this.inputCache="",this.maxLength=256,this.historyIndex=0,this.history=[],this.hint="",this.hintFiller="",this.commandNames=["giveweapon","giveclothing"],this.commands=[{name:["item"],params:[{hint:"Slot"},{hint:"Action",overrides:{use:{2:{hint:"Amount",default:null}},give:{2:{hint:"Player"},3:{hint:"Amount"}}}}]},{name:["giveclothing"],params:[{hint:"Wepaon Hash"},{hint:"Ammo",default:"1000"}]}],this.preCommands=[],this.onDocumentClick=i=>{let r=i.target;r instanceof HTMLElement&&r.tagName==="HTML"&&this.active&&(this.activate(!1),window.mp?.events?.call("chatClose"))},this.onWindowKeyDown=i=>{if(this.inputElement.nativeElement===document.activeElement){if(this.isArrowUp(i)){this.up(),i.stopPropagation(),i.preventDefault();return}if(this.isArrowDown(i)){this.down(),i.stopPropagation(),i.preventDefault();return}this.isEnter(i)&&(this.submit(),i.stopPropagation(),i.preventDefault())}},this.onChatActivate=i=>{this.activate(!!i)},this.onChatShow=i=>{this.show(!!i)},this.onChatPush=i=>{this.push(i)},this.onChatClear=()=>{this.clear()},this.onChatMessage=i=>{this.incomingMessage(i)},this.onChatPagesize=i=>{this.setChatSize(i)},this.onChatTimestamp=i=>{this.toggleTimestamp(!!i)},this.onChatOpacityControl=i=>{this.setOpacity(Number(i))},this.onChatScrollDown=()=>{this.scrollDown()},this.onChatToggleBBC=()=>{this.bbc=!this.bbc,this.cdr.markForCheck()},this.onChatHistory=i=>{try{this.history=JSON.parse(i)}catch{this.history=[]}this.historyIndex=0,this.inputCache="",this.cdr.markForCheck()},this.onChatSpellchecker=i=>{this.spellChecker=!!i,this.cdr.markForCheck()},this.onPreCommand=i=>{this.preCommands.push(i)},this.onCommandList=()=>{let i=this.preCommands.join("");this.preCommands=[];try{this.commands=JSON.parse(i);let r=this.commands.flatMap(a=>a.name);this.commandNames=r.sort().map(a=>a.toLowerCase())}catch{this.commands=[],this.commandNames=[]}this.cdr.markForCheck()}}seedBrowserTestMessages(){let e=["\xAB10F441\xBB[Geezer News] Clarke Walker: Hello and welcome to another episode of snippety snips.","\xABCACACA\xBB(( [141] ImperiumXVII: How do I toggle news ))"];setTimeout(()=>{e.forEach(n=>this.push(n))},1e3)}ngAfterViewInit(){this.maxLength=this.inputElement.nativeElement.maxLength;let e=window.mp;e?.events?.add("chat:activate",this.onChatActivate),e?.events?.add("chat:show",this.onChatShow),e?.events?.add("chat:push",this.onChatPush),e?.events?.add("chat:clear",this.onChatClear),e?.events?.add("chat:message",this.onChatMessage),e?.events?.add("chat:pagesize",this.onChatPagesize),e?.events?.add("chat:timestamp",this.onChatTimestamp),e?.events?.add("chat:opacityControl",this.onChatOpacityControl),e?.events?.add("chat:scrollDown",this.onChatScrollDown),e?.events?.add("chat:toggleBBC",this.onChatToggleBBC),e?.events?.add("chat:history",this.onChatHistory),e?.events?.add("chat:spellchecker",this.onChatSpellchecker),e?.events?.add("commandList",this.onCommandList),e?.events?.add("preCommand",this.onPreCommand),typeof e?.invoke!="function"&&this.seedBrowserTestMessages(),e?.events?.call("chat:getHistory"),document.addEventListener("click",this.onDocumentClick),window.addEventListener("keydown",this.onWindowKeyDown),window.chatAPI=window.chatAPI||{},window.chatAPI.activate=this.onChatActivate,window.chatAPI.show=this.onChatShow,window.chatAPI.push=this.onChatPush,window.chatAPI.clear=this.onChatClear}ngOnDestroy(){let e=window.mp;e?.events?.remove("chat:activate",this.onChatActivate),e?.events?.remove("chat:show",this.onChatShow),e?.events?.remove("chat:push",this.onChatPush),e?.events?.remove("chat:clear",this.onChatClear),e?.events?.remove("chat:message",this.onChatMessage),e?.events?.remove("chat:pagesize",this.onChatPagesize),e?.events?.remove("chat:timestamp",this.onChatTimestamp),e?.events?.remove("chat:opacityControl",this.onChatOpacityControl),e?.events?.remove("chat:scrollDown",this.onChatScrollDown),e?.events?.remove("chat:toggleBBC",this.onChatToggleBBC),e?.events?.remove("chat:history",this.onChatHistory),e?.events?.remove("chat:spellchecker",this.onChatSpellchecker),e?.events?.remove("commandList",this.onCommandList),e?.events?.remove("preCommand",this.onPreCommand),document.removeEventListener("click",this.onDocumentClick),window.removeEventListener("keydown",this.onWindowKeyDown)}onTab(e){e.preventDefault(),this.tab()}onInputChange(e){this.input=e,this.historyIndex||(this.inputCache=e),this.refreshHint()}onInputKeyDown(e){if(this.isArrowUp(e)){e.preventDefault(),e.stopPropagation(),this.up();return}if(this.isArrowDown(e)){e.preventDefault(),e.stopPropagation(),this.down();return}this.isEnter(e)&&(e.preventDefault(),e.stopPropagation(),this.submit())}submit(){if(this.input&&this.input.length){let e=window.mp;this.input[0]==="/"?e?.invoke?.("command",this.input.slice(1)):e?.invoke?.("chatMessage",this.input),this.history.push(String(this.input)),e?.events?.call("pushChatHistory",String(this.input)),this.historyIndex=0}this.input="",this.refreshHint(),window.mp?.events?.call("chatClose")}up(){this.history.length&&this.history.length>this.historyIndex&&(this.historyIndex||(this.inputCache=String(this.input)),this.historyIndex++,this.input=this.history[this.history.length-this.historyIndex]??"",this.cdr.markForCheck(),setTimeout(()=>{this.inputElement.nativeElement.selectionStart=this.input.length,this.inputElement.nativeElement.selectionEnd=this.input.length}),this.refreshHint())}down(){this.historyIndex&&(this.historyIndex--,this.historyIndex===0?this.input=String(this.inputCache):this.input=this.history[this.history.length-this.historyIndex]??"",this.cdr.markForCheck(),setTimeout(()=>{this.inputElement.nativeElement.selectionStart=this.input.length,this.inputElement.nativeElement.selectionEnd=this.input.length}),this.refreshHint())}setInput(e){this.input=e,this.refreshHint()}activate(e){this.active=e,window.mp?.events?.call("callServerEvent","chat:isTyping",e),this.cdr.markForCheck(),this.active&&setTimeout(()=>{this.inputElement.nativeElement.focus()})}show(e){this.visible=e,this.cdr.markForCheck()}currentTimestamp(){return new Intl.DateTimeFormat("en-GB",{timeZone:"Europe/London",hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date)}push(e){let n=this.messageListElement.nativeElement,i=n.scrollTop+n.offsetHeight>=n.scrollHeight-5;this.messages.length>=o.MAX_MESSAGES&&this.messages.shift();let r=this.formatMessage(e);this.messages.push({content:this.sanitizer.bypassSecurityTrustHtml(r),timestamp:this.sanitizer.bypassSecurityTrustHtml(`${this.getMessageColor(e)}${this.currentTimestamp()} </span>`),type:"regular",emoji:!1}),this.cdr.markForCheck(),i&&this.scrollDown()}scrollDown(){setTimeout(()=>{let e=this.messageListElement.nativeElement;e.scrollTop=e.scrollHeight},0)}incomingMessage(e){let n=this.messageListElement.nativeElement,i=n.scrollTop+n.offsetHeight>=n.scrollHeight-5;this.messages.length>=o.MAX_MESSAGES&&this.messages.shift();let r;try{r=JSON.parse(e)}catch{return}this.messages.push(De(he({},r),{content:this.sanitizer.bypassSecurityTrustHtml(this.formatMessage(r.content)),timestamp:this.sanitizer.bypassSecurityTrustHtml(`${this.getMessageColor(r.content)}${this.currentTimestamp()} </span>`),emoji:r.emoji})),this.cdr.markForCheck(),i&&this.scrollDown()}clear(){this.messages=[],this.cdr.markForCheck()}setChatSize(e){if(!Number.isFinite(e))return;let n=Math.max(8,Math.round(e)),i=Math.round(n*1.25),r=this.messageListElement.nativeElement;r.style.fontSize=`${n}px`,r.style.lineHeight=`${i}px`,r.style.height=`${i*o.DEFAULT_VISIBLE_ROWS}px`,this.chatSize=n,this.cdr.markForCheck(),this.scrollDown()}toggleTimestamp(e){this.timestamp=e,this.cdr.markForCheck()}setOpacity(e){let i=[0,0,.3,1][e]??1;this.messageListWrapperElement.nativeElement.style.opacity=String(i)}escape(e){return e.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]??n)}formatMessage(e){return this.escape(e).replace(/«([a-f0-9]{6})»/gi,(r,a)=>`<span style="color: #${a}">`).replace(/(?:^|(?<=\s))\/([^\/]+?)\/(?=[\s.]|$)/g,"<i>$1</i>")}getMessageColor(e){if(e[0]!=="\xAB")return"<span>";let n=e.match(/«([a-f0-9]{6})»/gi);return n&&n.length>0?n[0].replace(/«([a-f0-9]{6})»/gi,(i,r)=>`<span style="color: #${r}">`):"<span>"}clearHint(){this.hint="",this.hintFiller=""}refreshHint(){if(!this.input||!this.input.length||this.input[0]!=="/"){this.clearHint();return}let e=this.input.substring(1).split(" "),n=e.shift();if(!n){this.clearHint();return}let i=this.commands.find(r=>r.name.indexOf(n.toLowerCase())!==-1);if(i){let r=[...i.params??[]];this.hintFiller=`${this.input} `;for(let a=0;a<e.length;a++){if(!r[a]||!r[a].overrides)continue;let s=e[a]??"",l=r[a].overrides?.[s];l&&Object.keys(l).forEach(c=>{let h=Number(c),p=l[h];p&&(r[h]=De(he({},r[h]),{hint:p.hint,default:p.default}))})}this.hint=r.slice(e.filter(a=>a).length).map(a=>a.default===void 0?`[${a.hint}]`:a.default===null?`(${a.hint})`:`(${a.hint} <span class="hint-default"> (${a.default})</span>)`).join(" ");return}if(!e.length){let r=this.getCommandAutocomplete(n);if(r){this.hintFiller=`/${r.slice(0,n.length)}`,this.hint=`${r.slice(n.length)}`,this.input===this.input.toUpperCase()&&(this.hintFiller=this.hintFiller.toUpperCase(),this.hint=this.hint.toUpperCase());return}}this.clearHint()}isArrowUp(e){return e.key==="ArrowUp"||e.key==="Up"||e.code==="ArrowUp"||e.keyCode===38}isArrowDown(e){return e.key==="ArrowDown"||e.key==="Down"||e.code==="ArrowDown"||e.keyCode===40}isEnter(e){return e.key==="Enter"||e.code==="Enter"||e.keyCode===13}getCommandAutocomplete(e){return this.commandNames.find(n=>n.slice(0,e.length)===e.toLowerCase())}tab(){if(!this.input.length||this.input[0]!=="/")return;if(this.input.indexOf(" ")===-1){let l=this.getCommandAutocomplete(this.input.slice(1));l&&(this.setInput(`/${l} `),this.clearHint());return}let e=this.input.substring(1).split(" ").filter(l=>l),n=e.shift();if(!n)return;let i=this.commands.find(l=>l.name.indexOf(n.toLowerCase())!==-1);if(!i||e.length>=i.params.length)return;let r=i.params[e.length];if(!r?.default)return;let a=this.input[this.input.length-1]===" "?"":" ",s=i.params.length===e.length+1?"":" ";this.setInput([this.input,a,r.default,s].join("")),this.clearHint()}static{this.\u0275fac=function(n){return new(n||o)(Zt(Dn),Zt(tf))}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-chat"]],viewQuery:function(n,i){if(n&1&&yi(nw,7)(iw,7)(ow,7),n&2){let r;Bt(r=Ut())&&(i.messageListElement=r.first),Bt(r=Ut())&&(i.messageListWrapperElement=r.first),Bt(r=Ut())&&(i.inputElement=r.first)}},decls:16,vars:14,consts:[["messageListWrapperElement",""],["messageListElement",""],["inputElement",""],["id","chat"],[1,"messages-wrapper"],["id","messages"],[1,"message"],["id","inputbox"],["type","text","autocomplete","off","maxlength","256","rows","1",3,"ngModelChange","keydown.tab","keydown","spellcheck","ngModel"],[1,"character-count"],["id","hint"],["id","hintCommand"],["id","hintParams",3,"innerHTML"],[1,"message-icon"],[1,"message-icon","error"],[1,"message-icon","success"],[1,"message-icon","important"],[1,"message-icon","punishment"],[1,"message-icon","mission"],[1,"message-icon","admin"],[1,"message-icon","admin-crit"],[1,"timestamp",3,"innerHTML"],[3,"innerHTML"],[1,"fa-duotone","fa-solid","fa-star-exclamation",2,"--fa-primary-color","#ffffff","--fa-secondary-color","#9918ef","--fa-secondary-opacity","1"],[1,"fa","fa-fw","fa-times"],[1,"fa","fa-fw","fa-check"],[1,"fa","fa-fw","fa-exclamation-triangle"],[1,"fa","fa-fw","fa-gavel"],[1,"fa","fa-fw","fa-briefcase"],[1,"fa","fa-fw","fa-exclamation"],[1,"fa","fa-brands","fa-discord",2,"color","#7289da"]],template:function(n,i){if(n&1){let r=Z();_(0,"div",3)(1,"div",4,0)(3,"div",5,1),ve(5,fw,12,11,"div",6,ct),f()(),_(7,"div",7)(8,"textarea",8,2),Wr("ngModelChange",function(s){return P(r),Gr(i.input,s)||(i.input=s),A(s)}),z("ngModelChange",function(s){return i.onInputChange(s)})("keydown.tab",function(s){return i.onTab(s)})("keydown",function(s){return i.onInputKeyDown(s)}),f(),_(10,"div",9),u(11),f(),_(12,"div",10)(13,"span",11),u(14),f(),ye(15,"span",12),f()()()}n&2&&(d(),oe("black",i.bbc),d(2),oe("visible-scrollbar",i.active)("visible",i.visible),d(2),xe(i.messages),d(2),oe("active",i.active),d(),Q("spellcheck",i.spellChecker),Hr("ngModel",i.input),d(3),cn("",i.input.length,"/",i.maxLength),d(3),D(i.hintFiller),d(),Q("innerHTML",i.hint,an))},dependencies:[tt,ic,Zr,ec,ps,hs],styles:['#chat[_ngcontent-%COMP%]{font-family:Inter,Google Sans,Arial,Helvetica,"Noto Color Emoji",sans-serif!important;margin:.625rem 0 0 .3125rem;height:18.75rem;width:60rem;min-width:46.875rem;position:relative;z-index:1}.messages-wrapper[_ngcontent-%COMP%]{padding:.9375rem .3125rem .625rem;pointer-events:none}.messages-wrapper.black[_ngcontent-%COMP%]{background:#000}#messages[_ngcontent-%COMP%]{list-style-type:none;font-weight:700;color:#fff;text-shadow:-.0625rem -.0625rem 0 rgba(0,0,0,.8),.0625rem -.0625rem 0 rgba(0,0,0,.8),-.0625rem .0625rem 0 rgba(0,0,0,.8),.0625rem .0625rem 0 rgba(0,0,0,.8);overflow-y:hidden;direction:rtl;text-align:left;padding:0 .625rem 0 1.25rem;height:12.5rem;-webkit-user-select:none;user-select:none;visibility:hidden;position:relative;pointer-events:none;line-height:1.25rem;font-size:1rem}#messages[_ngcontent-%COMP%] .message-icon[_ngcontent-%COMP%]{position:absolute;right:calc(100% + .1875rem);top:calc(50% - .5rem);opacity:.75;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;border-radius:50%;font-size:.75rem}#messages[_ngcontent-%COMP%] .message-icon.error[_ngcontent-%COMP%]{background:red}#messages[_ngcontent-%COMP%] .message-icon.punishment[_ngcontent-%COMP%]{background:tomato;font-size:.625rem}#messages[_ngcontent-%COMP%] .message-icon.mission[_ngcontent-%COMP%]{background:#ff0;color:orange;font-size:.625rem}#messages[_ngcontent-%COMP%] .message-icon.success[_ngcontent-%COMP%]{background:green}#messages[_ngcontent-%COMP%] .message-icon.important[_ngcontent-%COMP%]{color:#a00;opacity:1}#messages[_ngcontent-%COMP%] .message-icon.admin[_ngcontent-%COMP%]{background:orange}#messages[_ngcontent-%COMP%] .message-icon.admin-crit[_ngcontent-%COMP%]{background:#ff4500}#messages.visible-scrollbar[_ngcontent-%COMP%]{overflow-y:overlay}#messages.visible[_ngcontent-%COMP%]{visibility:visible}#messages[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{direction:ltr}#messages[_ngcontent-%COMP%] .message[_ngcontent-%COMP%]{position:relative;word-wrap:break-word}#messages[_ngcontent-%COMP%]::-webkit-scrollbar{width:.375rem;background-color:transparent}#messages[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:.625rem;-webkit-box-shadow:inset 0 0 .375rem rgba(0,0,0,.3);background-color:#00000080;float:left}#messages[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{border-radius:.625rem;-webkit-box-shadow:inset 0 0 .375rem rgba(0,0,0,.3);background-color:#000000c2;float:left}#messages[_ngcontent-%COMP%] .timestamp[_ngcontent-%COMP%]{opacity:.5}#inputbox[_ngcontent-%COMP%]{width:100%;background:#000000bf;border-radius:.3125rem;padding:.75rem;height:2.75rem;box-sizing:border-box;margin:.3125rem .9375rem .9375rem;position:relative;display:none}#inputbox.active[_ngcontent-%COMP%]{display:block}#inputbox[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-family:inherit;background:none;border:none;outline:none;color:#fff;width:100%;font-size:1em;padding-right:3.75rem;display:block;height:1.25rem;min-height:1.25rem;max-height:1.25rem;line-height:1.25rem;box-sizing:border-box;overflow-y:hidden;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;white-space:pre;resize:none}#inputbox[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-scrollbar{display:none;width:0;height:0}#inputbox[_ngcontent-%COMP%] .character-count[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.625rem;color:#ffffff8c;font-size:1rem;-webkit-user-select:none;user-select:none}#hint[_ngcontent-%COMP%]{position:absolute;top:.75rem;left:.625rem;color:#fff;pointer-events:none}#hint[_ngcontent-%COMP%] #hintCommand[_ngcontent-%COMP%]{color:transparent}#hint[_ngcontent-%COMP%] #hintParams[_ngcontent-%COMP%]{color:#ffffff8c}#hint[_ngcontent-%COMP%] #hintParams.hint-default[_ngcontent-%COMP%]{color:#ffffff59}'],changeDetection:0})}}return o})();function gw(o,t){if(o&1){let e=Z();v(0,"div",9),u(1,"Face Blend"),b(),v(2,"label")(3,"span"),u(4,"Parent 1"),b(),v(5,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("faceBlendOne",i))}),b(),v(6,"strong"),u(7),b()(),v(8,"label")(9,"span"),u(10,"Parent 2"),b(),v(11,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("faceBlendTwo",i))}),b(),v(12,"strong"),u(13),b()(),v(14,"label")(15,"span"),u(16,"Blend Bias"),b(),v(17,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("faceBlendBias",i))}),b(),v(18,"strong"),u(19),b()(),v(20,"div",9),u(21,"Skin Tone"),b(),v(22,"label")(23,"span"),u(24,"Skin 1"),b(),v(25,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("skinTone",i))}),b(),v(26,"strong"),u(27),b()(),v(28,"label")(29,"span"),u(30,"Skin 2"),b(),v(31,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("skinToneTwo",i))}),b(),v(32,"strong"),u(33),b()(),v(34,"label")(35,"span"),u(36,"Skin Bias"),b(),v(37,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("skinToneBias",i))}),b(),v(38,"strong"),u(39),b()(),v(40,"div",9),u(41,"Third Parent"),b(),v(42,"label")(43,"span"),u(44,"Face Blend 3"),b(),v(45,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("faceBlendThree",i))}),b(),v(46,"strong"),u(47),b()(),v(48,"label")(49,"span"),u(50,"Skin Tone 3"),b(),v(51,"input",10),ne("input",function(i){P(e);let r=g();return A(r.setNumber("skinToneThree",i))}),b(),v(52,"strong"),u(53),b()(),v(54,"label")(55,"span"),u(56,"Third Mix"),b(),v(57,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("threeMix",i))}),b(),v(58,"strong"),u(59),b()()}if(o&2){let e=g();d(5),Ee("value",e.num("faceBlendOne")),d(2),D(e.num("faceBlendOne")),d(4),Ee("value",e.num("faceBlendTwo")),d(2),D(e.num("faceBlendTwo")),d(4),Ee("value",e.num("faceBlendBias")),d(2),D(e.num("faceBlendBias").toFixed(2)),d(6),Ee("value",e.num("skinTone")),d(2),D(e.num("skinTone")),d(4),Ee("value",e.num("skinToneTwo")),d(2),D(e.num("skinToneTwo")),d(4),Ee("value",e.num("skinToneBias")),d(2),D(e.num("skinToneBias").toFixed(2)),d(6),Ee("value",e.num("faceBlendThree")),d(2),D(e.num("faceBlendThree")),d(4),Ee("value",e.num("skinToneThree")),d(2),D(e.num("skinToneThree")),d(4),Ee("value",e.num("threeMix")),d(2),D(e.num("threeMix").toFixed(2))}}function _w(o,t){if(o&1){let e=Z();v(0,"div",9),u(1,"Hair"),b(),v(2,"label")(3,"span"),u(4,"Hair Style"),b(),v(5,"input",12),ne("input",function(i){P(e);let r=g();return A(r.setNumber("hairStyle",i))}),b(),v(6,"strong"),u(7),b()(),v(8,"label")(9,"span"),u(10,"Hair Color"),b(),v(11,"input",13),ne("input",function(i){P(e);let r=g();return A(r.setNumber("hairColor",i))}),b(),v(12,"strong"),u(13),b()(),v(14,"label")(15,"span"),u(16,"Highlight"),b(),v(17,"input",13),ne("input",function(i){P(e);let r=g();return A(r.setNumber("hairHighlight",i))}),b(),v(18,"strong"),u(19),b()()}if(o&2){let e=g();d(5),Ee("value",e.num("hairStyle")),d(2),D(e.num("hairStyle")),d(4),Ee("value",e.num("hairColor")),d(2),D(e.num("hairColor")),d(4),Ee("value",e.num("hairHighlight")),d(2),D(e.num("hairHighlight"))}}function vw(o,t){if(o&1){let e=Z();v(0,"div",9),u(1,"Features"),b(),v(2,"label")(3,"span"),u(4,"Eye Color"),b(),v(5,"input",14),ne("input",function(i){P(e);let r=g();return A(r.setNumber("eyeColor",i))}),b(),v(6,"strong"),u(7),b()(),v(8,"label")(9,"span"),u(10,"Eyebrows"),b(),v(11,"input",15),ne("input",function(i){P(e);let r=g();return A(r.setNumber("eyebrows",i))}),b(),v(12,"strong"),u(13),b()(),v(14,"label")(15,"span"),u(16,"Eyebrow Opacity"),b(),v(17,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("eyebrowsOpacity",i))}),b(),v(18,"strong"),u(19),b()(),v(20,"div",9),u(21,"Facial Hair"),b(),v(22,"label")(23,"span"),u(24,"Facial Hair"),b(),v(25,"input",16),ne("input",function(i){P(e);let r=g();return A(r.setNumber("facialHair",i))}),b(),v(26,"strong"),u(27),b()(),v(28,"label")(29,"span"),u(30,"Facial Hair Opacity"),b(),v(31,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("facialHairOpacity",i))}),b(),v(32,"strong"),u(33),b()(),v(34,"div",9),u(35,"Blemishes & Aging"),b(),v(36,"label")(37,"span"),u(38,"Blemishes"),b(),v(39,"input",17),ne("input",function(i){P(e);let r=g();return A(r.setNumber("blemishes",i))}),b(),v(40,"strong"),u(41),b()(),v(42,"label")(43,"span"),u(44,"Blemish Opacity"),b(),v(45,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("blemishesOpacity",i))}),b(),v(46,"strong"),u(47),b()(),v(48,"label")(49,"span"),u(50,"Ageing"),b(),v(51,"input",18),ne("input",function(i){P(e);let r=g();return A(r.setNumber("ageing",i))}),b(),v(52,"strong"),u(53),b()(),v(54,"label")(55,"span"),u(56,"Ageing Opacity"),b(),v(57,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("ageingOpacity",i))}),b(),v(58,"strong"),u(59),b()(),v(60,"label")(61,"span"),u(62,"Moles"),b(),v(63,"input",19),ne("input",function(i){P(e);let r=g();return A(r.setNumber("moles",i))}),b(),v(64,"strong"),u(65),b()(),v(66,"label")(67,"span"),u(68,"Moles Opacity"),b(),v(69,"input",11),ne("input",function(i){P(e);let r=g();return A(r.setNumber("molesOpacity",i))}),b(),v(70,"strong"),u(71),b()(),v(72,"div",9),u(73,"Outfit"),b(),v(74,"label")(75,"span"),u(76,"Outfit"),b(),v(77,"input",20),ne("input",function(i){P(e);let r=g();return A(r.setNumber("outfit",i))}),b(),v(78,"strong"),u(79),b()()}if(o&2){let e=g();d(5),Ee("value",e.num("eyeColor")),d(2),D(e.num("eyeColor")),d(4),Ee("value",e.num("eyebrows")),d(2),D(e.num("eyebrows")),d(4),Ee("value",e.num("eyebrowsOpacity")),d(2),D(e.num("eyebrowsOpacity").toFixed(2)),d(6),Ee("value",e.num("facialHair")),d(2),D(e.num("facialHair")),d(4),Ee("value",e.num("facialHairOpacity")),d(2),D(e.num("facialHairOpacity").toFixed(2)),d(6),Ee("value",e.num("blemishes")),d(2),D(e.num("blemishes")),d(4),Ee("value",e.num("blemishesOpacity")),d(2),D(e.num("blemishesOpacity").toFixed(2)),d(4),Ee("value",e.num("ageing")),d(2),D(e.num("ageing")),d(4),Ee("value",e.num("ageingOpacity")),d(2),D(e.num("ageingOpacity").toFixed(2)),d(4),Ee("value",e.num("moles")),d(2),D(e.num("moles")),d(4),Ee("value",e.num("molesOpacity")),d(2),D(e.num("molesOpacity").toFixed(2)),d(6),Ee("max",e.outfitMax())("value",e.num("outfit")),d(2),D(e.outfitLabel())}}function xw(o,t){if(o&1&&(v(0,"p",6),u(1),b()),o&2){let e=g();d(),D(e.error())}}var Qr=window.mp,gs={faceBlendOne:0,faceBlendTwo:0,faceBlendBias:.5,skinTone:0,skinToneTwo:0,skinToneBias:.5,faceBlendThree:0,skinToneThree:0,threeMix:0,hairStyle:0,hairColor:0,hairHighlight:0,eyeColor:0,eyebrows:1,eyebrowsOpacity:0,facialHair:1,facialHairOpacity:.5,chestHair:1,chestHairOpacity:.5,blemishes:-1,blemishesOpacity:.25,ageing:-1,ageingOpacity:.25,moles:-1,molesOpacity:.25,complexion:-1,complexionOpacity:.25,sunDamage:-1,sunDamageOpacity:.25,makeup:-1,makeupOpacity:0,makeupColor:[0,0],blush:-1,blushOpacity:0,blushColor:[0,0],lipstick:-1,lipstickOpacity:0,lipstickColor:[0,0],bodyBlemishesOpacity:.25,noseWidth:0,noseHeight:0,noseLength:0,noseBridge:0,noseTip:0,noseBridgeShift:0,browHeight:0,browWidth:0,cheekboneHeight:0,cheekboneWidth:0,jawHeight:0,jawWidth:0,chinLength:0,chinPosition:0,chinWidth:0,chinShape:0,cheeksWidth:0,eyes:0,lips:0,neckWidth:0,outfit:0,description:""},w0=(()=>{class o{constructor(){this.name=F("Unnamed"),this.gender=F(1),this.outfits=F([]),this.saving=F(!1),this.error=F(""),this.state=F(he({},gs)),this.stateJson=F(JSON.stringify(gs,null,2)),this.handlers=[],this.activeTab="face"}ngOnInit(){this.on("characterInit",(e,n,i)=>{if(this.name.set(String(e??"Unnamed")),this.gender.set(Number(n??1)),this.error.set(""),i)try{this.state.set(he(he({},gs),JSON.parse(String(i))))}catch{this.state.set(he({},gs))}else this.state.set(he({},gs));this.refreshState(),this.emitState()}),this.on("outfitNames",e=>{try{this.outfits.set(JSON.parse(String(e)))}catch{this.outfits.set([])}}),this.on("createError",e=>{this.saving.set(!1),this.error.set(String(e??"Failed to save appearance."))}),this.on("creator:saved",()=>{this.saving.set(!1),this.error.set("")}),this.on("creator:import",e=>{try{let n=JSON.parse(String(e));this.state.update(i=>he(he({},i),n)),this.refreshState(),this.emitState()}catch{this.error.set("Unable to import appearance config.")}})}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)Qr.events.remove(e,n)}genderLabel(){return this.gender()?"Male":"Female"}num(e){let n=this.state()[e];return typeof n=="number"?n:0}outfitLabel(){let e=this.num("outfit"),n=this.outfits()[e];return n?`${e}: ${n}`:`${e}`}outfitMax(){return this.outfits().length>0?this.outfits().length-1:0}setNumber(e,n){let i=Number(n.target.value);this.state.update(r=>De(he({},r),{[e]:i})),this.refreshState(),this.emitState(),this.error.set("")}call(e){Qr.events.call(e)}save(){this.saving.set(!0),this.error.set(""),Qr.events.call("callServerEvent","createAppearance",JSON.stringify(this.state()))}importAppearance(){Qr.events.call("callServerEvent","characterCreator:importAppearance")}emitState(){Qr.events.call("characterCreatorStateChange",JSON.stringify(this.state()))}refreshState(){this.stateJson.set(JSON.stringify(this.state(),null,2))}on(e,n){Qr.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-char-creator"]],decls:35,vars:14,consts:[[1,"creator-shell"],[1,"view-actions"],["type","button",3,"click"],[1,"tabs"],[3,"click"],[1,"controls"],[1,"error"],[1,"buttons"],["type","button",1,"primary",3,"click","disabled"],[1,"section-heading"],["type","range","min","0","max","45",3,"input","value"],["type","range","min","0","max","1","step","0.01",3,"input","value"],["type","range","min","0","max","80",3,"input","value"],["type","range","min","0","max","63",3,"input","value"],["type","range","min","0","max","7",3,"input","value"],["type","range","min","0","max","33",3,"input","value"],["type","range","min","0","max","28",3,"input","value"],["type","range","min","-1","max","23",3,"input","value"],["type","range","min","-1","max","14",3,"input","value"],["type","range","min","-1","max","17",3,"input","value"],["type","range","min","0",3,"input","max","value"]],template:function(n,i){n&1&&(v(0,"section",0)(1,"header")(2,"div")(3,"h2"),u(4,"Character Creator"),b(),v(5,"p"),u(6),b()(),v(7,"div",1)(8,"button",2),ne("click",function(){return i.call("characterCreatorViewFace")}),u(9,"Face"),b(),v(10,"button",2),ne("click",function(){return i.call("characterCreatorViewBody")}),u(11,"Body"),b(),v(12,"button",2),ne("click",function(){return i.call("characterCreatorViewFront")}),u(13,"Front"),b(),v(14,"button",2),ne("click",function(){return i.call("characterCreatorViewBack")}),u(15,"Back"),b()()(),v(16,"nav",3)(17,"button",4),ne("click",function(){return i.activeTab="face"}),u(18,"Face"),b(),v(19,"button",4),ne("click",function(){return i.activeTab="hair"}),u(20,"Hair"),b(),v(21,"button",4),ne("click",function(){return i.activeTab="features"}),u(22,"Features"),b()(),v(23,"main")(24,"section",5),R(25,gw,60,18),R(26,_w,20,6),R(27,vw,80,25),b()(),v(28,"footer"),R(29,xw,2,1,"p",6),v(30,"div",7)(31,"button",2),ne("click",function(){return i.importAppearance()}),u(32,"Import"),b(),v(33,"button",8),ne("click",function(){return i.save()}),u(34),b()()()()),n&2&&(d(6),cn("",i.name()," - ",i.genderLabel()),d(11),oe("active",i.activeTab==="face"),d(2),oe("active",i.activeTab==="hair"),d(2),oe("active",i.activeTab==="features"),d(4),N(i.activeTab==="face"?25:-1),d(),N(i.activeTab==="hair"?26:-1),d(),N(i.activeTab==="features"?27:-1),d(2),N(i.error()?29:-1),d(4),Ee("disabled",i.saving()),d(),me(" ",i.saving()?"Saving...":"Save Appearance"," "))},dependencies:[tt],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:grid;place-items:center start;padding-left:2rem}.creator-shell[_ngcontent-%COMP%]{width:min(600px,95vw);border-radius:14px;overflow:hidden;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;text-transform:uppercase;letter-spacing:.08em;font-size:.95rem}p[_ngcontent-%COMP%]{margin:4px 0 0;color:#ffb7bf;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}.view-actions[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.view-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid rgba(95,101,114,.48);background:#ffffff0f;color:#d8dde6;border-radius:9px;padding:.45rem .62rem;cursor:pointer;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.75rem;height:700px}.controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;height:100%;overflow-y:auto;align-content:start}.controls[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.controls[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.controls[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#d11b2d66;border-radius:3px}.section-heading[_ngcontent-%COMP%]{grid-column:1/-1;color:#ffb7bf;font-size:.68rem;text-transform:uppercase;letter-spacing:.1em;padding:4px 0 2px;border-bottom:1px solid rgba(209,27,45,.3);margin-top:4px}label[_ngcontent-%COMP%]{display:grid;gap:6px;background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:.62rem}span[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}strong[_ngcontent-%COMP%]{color:#f0f3f8;font-size:.8rem}input[type=range][_ngcontent-%COMP%]{accent-color:#d11b2d}aside[_ngcontent-%COMP%]{background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:10px;width:100%}h3[_ngcontent-%COMP%]{margin:0 0 8px;color:#d7deef;font-size:.8rem;text-transform:uppercase}pre[_ngcontent-%COMP%]{margin:0;max-height:200px;overflow:auto;background:#0000003d;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:8px;color:#d8dfef;font-size:.72rem}.buttons[_ngcontent-%COMP%]{margin-top:10px;display:flex;gap:8px}.buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid rgba(95,101,114,.48);background:#ffffff14;color:#d8dde6;border-radius:9px;padding:.5rem .7rem;cursor:pointer;font-size:.74rem;text-transform:uppercase;letter-spacing:.06em}.buttons[_ngcontent-%COMP%] button.primary[_ngcontent-%COMP%]{border-color:#d11b2d73;background:#d11b2d2e}.buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{margin-top:8px;color:#ff9f9f;font-size:.8rem}.tabs[_ngcontent-%COMP%]{display:flex;gap:4px;padding:.6rem 1rem 0;border-bottom:1px solid rgba(95,101,114,.3)}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid transparent;background:transparent;color:#a9b0bb;border-radius:8px 8px 0 0;padding:.4rem .85rem;cursor:pointer;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;transition:color .15s,background .15s}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{color:#d8dde6;background:#ffffff0d}.tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#f4f7fc;background:#d11b2d26;border-color:#d11b2d66;border-bottom-color:transparent}footer[_ngcontent-%COMP%]{padding:.75rem 1rem;border-top:1px solid rgba(95,101,114,.3);display:flex;align-items:center;justify-content:flex-end;gap:8px}footer[_ngcontent-%COMP%] .error[_ngcontent-%COMP%]{margin:0;flex:1}@media(max-width:900px){main[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})}}return o})();var s_=0,Qh=1,l_=2;var Qs=1,c_=2,Ia=3,Di=0,$n=1,_i=2,io=0,gr=1,ep=2,tp=3,np=4,d_=5;var qo=100,u_=101,h_=102,p_=103,m_=104,f_=200,g_=201,__=202,v_=203,Vc=204,Bc=205,x_=206,b_=207,y_=208,C_=209,M_=210,w_=211,S_=212,E_=213,T_=214,Uc=0,zc=1,Hc=2,_r=3,Gc=4,Wc=5,Xc=6,qc=7,ip=0,P_=1,A_=2,Ri=0,op=1,rp=2,ap=3,el=4,sp=5,lp=6,cp=7,Bh="attached",I_="detached",Uh=300,jo=301,Sr=302,md=303,fd=304,tl=306,ki=1e3,gi=1001,fa=1002,fn=1003,gd=1004;var Er=1005;var sn=1006,Oa=1007;var Ni=1008;var Qn=1009,dp=1010,up=1011,Da=1012,_d=1013,Li=1014,ui=1015,oo=1016,vd=1017,xd=1018,ka=1020,hp=35902,pp=35899,fp=1021,gp=1022,Bn=1023,Zi=1026,Ko=1027,bd=1028,yd=1029,Zo=1030,Cd=1031;var Md=1033,Tr=33776,nl=33777,Pr=33778,Ar=33779,wd=35840,Sd=35841,Ed=35842,Td=35843,Ra=36196,Pd=37492,Ad=37496,Id=37488,Od=37489,il=37490,Dd=37491,kd=37808,Rd=37809,Nd=37810,Ld=37811,Fd=37812,Vd=37813,Bd=37814,Ud=37815,zd=37816,Hd=37817,Gd=37818,Wd=37819,Xd=37820,qd=37821,$d=36492,Na=36494,La=36495,Yd=36283,jd=36284,ol=36285,Kd=36286;var vr=2300,xr=2301,Fc=2302,zh=2303,Hh=2400,Gh=2401,Wh=2402,O_=2500;var _p=0,rl=1,Fa=2,D_=3200;var Zd=0,k_=1,Io="",dn="srgb",Xn="srgb-linear",Ts="linear",Ht="srgb";var fr=7680;var Xh=519,R_=512,N_=513,L_=514,Jd=515,F_=516,V_=517,Qd=518,B_=519,$c=35044;var vp="300 es",Ai=2e3,ga=2001;function bw(o){for(let t=o.length-1;t>=0;--t)if(o[t]>=65535)return!0;return!1}function yw(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function _a(o){return document.createElementNS("http://www.w3.org/1999/xhtml",o)}function U_(){let o=_a("canvas");return o.style.display="block",o}var S0={},va=null;function Ps(...o){let t="THREE."+o.shift();va?va("log",t,...o):console.log(t,...o)}function z_(o){let t=o[0];if(typeof t=="string"&&t.startsWith("TSL:")){let e=o[1];e&&e.isStackTrace?o[0]+=" "+e.getLocation():o[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return o}function Ke(...o){o=z_(o);let t="THREE."+o.shift();if(va)va("warn",t,...o);else{let e=o[0];e&&e.isStackTrace?console.warn(e.getError(t)):console.warn(t,...o)}}function st(...o){o=z_(o);let t="THREE."+o.shift();if(va)va("error",t,...o);else{let e=o[0];e&&e.isStackTrace?console.error(e.getError(t)):console.error(t,...o)}}function Yc(...o){let t=o.join(" ");t in S0||(S0[t]=!0,Ke(...o))}function H_(o,t,e){return new Promise(function(n,i){function r(){switch(o.clientWaitSync(t,o.SYNC_FLUSH_COMMANDS_BIT,0)){case o.WAIT_FAILED:i();break;case o.TIMEOUT_EXPIRED:setTimeout(r,e);break;default:n()}}setTimeout(r,e)})}var G_={[Uc]:zc,[Hc]:Xc,[Gc]:qc,[_r]:Wc,[zc]:Uc,[Xc]:Hc,[qc]:Gc,[Wc]:_r},Ji=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){let n=this._listeners;return n===void 0?!1:n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){let n=this._listeners;if(n===void 0)return;let i=n[t];if(i!==void 0){let r=i.indexOf(e);r!==-1&&i.splice(r,1)}}dispatchEvent(t){let e=this._listeners;if(e===void 0)return;let n=e[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,t);t.target=null}}},Fn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],E0=1234567,Ss=Math.PI/180,br=180/Math.PI;function Oi(){let o=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Fn[o&255]+Fn[o>>8&255]+Fn[o>>16&255]+Fn[o>>24&255]+"-"+Fn[t&255]+Fn[t>>8&255]+"-"+Fn[t>>16&15|64]+Fn[t>>24&255]+"-"+Fn[e&63|128]+Fn[e>>8&255]+"-"+Fn[e>>16&255]+Fn[e>>24&255]+Fn[n&255]+Fn[n>>8&255]+Fn[n>>16&255]+Fn[n>>24&255]).toLowerCase()}function Pt(o,t,e){return Math.max(t,Math.min(e,o))}function xp(o,t){return(o%t+t)%t}function Cw(o,t,e,n,i){return n+(o-t)*(i-n)/(e-t)}function Mw(o,t,e){return o!==t?(e-o)/(t-o):0}function Es(o,t,e){return(1-e)*o+e*t}function ww(o,t,e,n){return Es(o,t,1-Math.exp(-e*n))}function Sw(o,t=1){return t-Math.abs(xp(o,t*2)-t)}function Ew(o,t,e){return o<=t?0:o>=e?1:(o=(o-t)/(e-t),o*o*(3-2*o))}function Tw(o,t,e){return o<=t?0:o>=e?1:(o=(o-t)/(e-t),o*o*o*(o*(o*6-15)+10))}function Pw(o,t){return o+Math.floor(Math.random()*(t-o+1))}function Aw(o,t){return o+Math.random()*(t-o)}function Iw(o){return o*(.5-Math.random())}function Ow(o){o!==void 0&&(E0=o);let t=E0+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Dw(o){return o*Ss}function kw(o){return o*br}function Rw(o){return(o&o-1)===0&&o!==0}function Nw(o){return Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))}function Lw(o){return Math.pow(2,Math.floor(Math.log(o)/Math.LN2))}function Fw(o,t,e,n,i){let r=Math.cos,a=Math.sin,s=r(e/2),l=a(e/2),c=r((t+n)/2),h=a((t+n)/2),p=r((t-n)/2),m=a((t-n)/2),x=r((n-t)/2),M=a((n-t)/2);switch(i){case"XYX":o.set(s*h,l*p,l*m,s*c);break;case"YZY":o.set(l*m,s*h,l*p,s*c);break;case"ZXZ":o.set(l*p,l*m,s*h,s*c);break;case"XZX":o.set(s*h,l*M,l*x,s*c);break;case"YXY":o.set(l*x,s*h,l*M,s*c);break;case"ZYZ":o.set(l*M,l*x,s*h,s*c);break;default:Ke("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Pi(o,t){switch(t.constructor){case Float32Array:return o;case Uint32Array:return o/4294967295;case Uint16Array:return o/65535;case Uint8Array:return o/255;case Int32Array:return Math.max(o/2147483647,-1);case Int16Array:return Math.max(o/32767,-1);case Int8Array:return Math.max(o/127,-1);default:throw new Error("Invalid component type.")}}function Wt(o,t){switch(t.constructor){case Float32Array:return o;case Uint32Array:return Math.round(o*4294967295);case Uint16Array:return Math.round(o*65535);case Uint8Array:return Math.round(o*255);case Int32Array:return Math.round(o*2147483647);case Int16Array:return Math.round(o*32767);case Int8Array:return Math.round(o*127);default:throw new Error("Invalid component type.")}}var bp={DEG2RAD:Ss,RAD2DEG:br,generateUUID:Oi,clamp:Pt,euclideanModulo:xp,mapLinear:Cw,inverseLerp:Mw,lerp:Es,damp:ww,pingpong:Sw,smoothstep:Ew,smootherstep:Tw,randInt:Pw,randFloat:Aw,randFloatSpread:Iw,seededRandom:Ow,degToRad:Dw,radToDeg:kw,isPowerOfTwo:Rw,ceilPowerOfTwo:Nw,floorPowerOfTwo:Lw,setQuaternionFromProperEuler:Fw,normalize:Wt,denormalize:Pi},At=class o{static{o.prototype.isVector2=!0}constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Pt(this.x,t.x,e.x),this.y=Pt(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Pt(this.x,t,e),this.y=Pt(this.y,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Pt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Pt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},ai=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,a,s){let l=n[i+0],c=n[i+1],h=n[i+2],p=n[i+3],m=r[a+0],x=r[a+1],M=r[a+2],S=r[a+3];if(p!==S||l!==m||c!==x||h!==M){let y=l*m+c*x+h*M+p*S;y<0&&(m=-m,x=-x,M=-M,S=-S,y=-y);let C=1-s;if(y<.9995){let I=Math.acos(y),L=Math.sin(I);C=Math.sin(C*I)/L,s=Math.sin(s*I)/L,l=l*C+m*s,c=c*C+x*s,h=h*C+M*s,p=p*C+S*s}else{l=l*C+m*s,c=c*C+x*s,h=h*C+M*s,p=p*C+S*s;let I=1/Math.sqrt(l*l+c*c+h*h+p*p);l*=I,c*=I,h*=I,p*=I}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=p}static multiplyQuaternionsFlat(t,e,n,i,r,a){let s=n[i],l=n[i+1],c=n[i+2],h=n[i+3],p=r[a],m=r[a+1],x=r[a+2],M=r[a+3];return t[e]=s*M+h*p+l*x-c*m,t[e+1]=l*M+h*m+c*p-s*x,t[e+2]=c*M+h*x+s*m-l*p,t[e+3]=h*M-s*p-l*m-c*x,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,r=t._z,a=t._order,s=Math.cos,l=Math.sin,c=s(n/2),h=s(i/2),p=s(r/2),m=l(n/2),x=l(i/2),M=l(r/2);switch(a){case"XYZ":this._x=m*h*p+c*x*M,this._y=c*x*p-m*h*M,this._z=c*h*M+m*x*p,this._w=c*h*p-m*x*M;break;case"YXZ":this._x=m*h*p+c*x*M,this._y=c*x*p-m*h*M,this._z=c*h*M-m*x*p,this._w=c*h*p+m*x*M;break;case"ZXY":this._x=m*h*p-c*x*M,this._y=c*x*p+m*h*M,this._z=c*h*M+m*x*p,this._w=c*h*p-m*x*M;break;case"ZYX":this._x=m*h*p-c*x*M,this._y=c*x*p+m*h*M,this._z=c*h*M-m*x*p,this._w=c*h*p+m*x*M;break;case"YZX":this._x=m*h*p+c*x*M,this._y=c*x*p+m*h*M,this._z=c*h*M-m*x*p,this._w=c*h*p-m*x*M;break;case"XZY":this._x=m*h*p-c*x*M,this._y=c*x*p-m*h*M,this._z=c*h*M+m*x*p,this._w=c*h*p+m*x*M;break;default:Ke("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],s=e[5],l=e[9],c=e[2],h=e[6],p=e[10],m=n+s+p;if(m>0){let x=.5/Math.sqrt(m+1);this._w=.25/x,this._x=(h-l)*x,this._y=(r-c)*x,this._z=(a-i)*x}else if(n>s&&n>p){let x=2*Math.sqrt(1+n-s-p);this._w=(h-l)/x,this._x=.25*x,this._y=(i+a)/x,this._z=(r+c)/x}else if(s>p){let x=2*Math.sqrt(1+s-n-p);this._w=(r-c)/x,this._x=(i+a)/x,this._y=.25*x,this._z=(l+h)/x}else{let x=2*Math.sqrt(1+p-n-s);this._w=(a-i)/x,this._x=(r+c)/x,this._y=(l+h)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-8?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Pt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,r=t._z,a=t._w,s=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+a*s+i*c-r*l,this._y=i*h+a*l+r*s-n*c,this._z=r*h+a*c+n*l-i*s,this._w=a*h-n*s-i*l-r*c,this._onChangeCallback(),this}slerp(t,e){let n=t._x,i=t._y,r=t._z,a=t._w,s=this.dot(t);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let l=1-e;if(s<.9995){let c=Math.acos(s),h=Math.sin(c);l=Math.sin(l*c)/h,e=Math.sin(e*c)/h,this._x=this._x*l+n*e,this._y=this._y*l+i*e,this._z=this._z*l+r*e,this._w=this._w*l+a*e,this._onChangeCallback()}else this._x=this._x*l+n*e,this._y=this._y*l+i*e,this._z=this._z*l+r*e,this._w=this._w*l+a*e,this.normalize();return this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},j=class o{static{o.prototype.isVector3=!0}constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(T0.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(T0.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,s=t.z,l=t.w,c=2*(a*i-s*n),h=2*(s*e-r*i),p=2*(r*n-a*e);return this.x=e+l*c+a*p-s*h,this.y=n+l*h+s*c-r*p,this.z=i+l*p+r*h-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Pt(this.x,t.x,e.x),this.y=Pt(this.y,t.y,e.y),this.z=Pt(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Pt(this.x,t,e),this.y=Pt(this.y,t,e),this.z=Pt(this.z,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Pt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,r=t.z,a=e.x,s=e.y,l=e.z;return this.x=i*l-r*s,this.y=r*a-n*l,this.z=n*s-i*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return ph.copy(this).projectOnVector(t),this.sub(ph)}reflect(t){return this.sub(ph.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Pt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},ph=new j,T0=new ai,mt=class o{static{o.prototype.isMatrix3=!0}constructor(t,e,n,i,r,a,s,l,c){this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,s,l,c)}set(t,e,n,i,r,a,s,l,c){let h=this.elements;return h[0]=t,h[1]=i,h[2]=s,h[3]=e,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,r=this.elements,a=n[0],s=n[3],l=n[6],c=n[1],h=n[4],p=n[7],m=n[2],x=n[5],M=n[8],S=i[0],y=i[3],C=i[6],I=i[1],L=i[4],k=i[7],H=i[2],V=i[5],G=i[8];return r[0]=a*S+s*I+l*H,r[3]=a*y+s*L+l*V,r[6]=a*C+s*k+l*G,r[1]=c*S+h*I+p*H,r[4]=c*y+h*L+p*V,r[7]=c*C+h*k+p*G,r[2]=m*S+x*I+M*H,r[5]=m*y+x*L+M*V,r[8]=m*C+x*k+M*G,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],l=t[6],c=t[7],h=t[8];return e*a*h-e*s*c-n*r*h+n*s*l+i*r*c-i*a*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],l=t[6],c=t[7],h=t[8],p=h*a-s*c,m=s*l-h*r,x=c*r-a*l,M=e*p+n*m+i*x;if(M===0)return this.set(0,0,0,0,0,0,0,0,0);let S=1/M;return t[0]=p*S,t[1]=(i*c-h*n)*S,t[2]=(s*n-i*a)*S,t[3]=m*S,t[4]=(h*e-i*l)*S,t[5]=(i*r-s*e)*S,t[6]=x*S,t[7]=(n*l-c*e)*S,t[8]=(a*e-n*r)*S,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,a,s){let l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*s)+a+t,-i*c,i*l,-i*(-c*a+l*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(mh.makeScale(t,e)),this}rotate(t){return this.premultiply(mh.makeRotation(-t)),this}translate(t,e){return this.premultiply(mh.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},mh=new mt,P0=new mt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),A0=new mt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Vw(){let o={enabled:!0,workingColorSpace:Xn,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===Ht&&(i.r=Mo(i.r),i.g=Mo(i.g),i.b=Mo(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ht&&(i.r=ma(i.r),i.g=ma(i.g),i.b=ma(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Io?Ts:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return Yc("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),o.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return Yc("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),o.colorSpaceToWorking(i,r)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],n=[.3127,.329];return o.define({[Xn]:{primaries:t,whitePoint:n,transfer:Ts,toXYZ:P0,fromXYZ:A0,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:dn},outputColorSpaceConfig:{drawingBufferColorSpace:dn}},[dn]:{primaries:t,whitePoint:n,transfer:Ht,toXYZ:P0,fromXYZ:A0,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:dn}}}),o}var St=Vw();function Mo(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function ma(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}var ea,jc=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let n;if(t instanceof HTMLCanvasElement)n=t;else{ea===void 0&&(ea=_a("canvas")),ea.width=t.width,ea.height=t.height;let i=ea.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),n=ea}return n.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=_a("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=Mo(r[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Mo(e[n]/255)*255):e[n]=Mo(e[n]);return{data:e,width:t.width,height:t.height}}else return Ke("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Bw=0,xa=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Bw++}),this.uuid=Oi(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):typeof VideoFrame<"u"&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,s=i.length;a<s;a++)i[a].isDataTexture?r.push(fh(i[a].image)):r.push(fh(i[a]))}else r=fh(i);n.url=r}return e||(t.images[this.uuid]=n),n}};function fh(o){return typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&o instanceof ImageBitmap?jc.getDataURL(o):o.data?{data:Array.from(o.data),width:o.width,height:o.height,type:o.data.constructor.name}:(Ke("Texture: Unable to serialize Texture."),{})}var Uw=0,gh=new j,ei=(()=>{class o extends Ji{constructor(e=o.DEFAULT_IMAGE,n=o.DEFAULT_MAPPING,i=gi,r=gi,a=sn,s=Ni,l=Bn,c=Qn,h=o.DEFAULT_ANISOTROPY,p=Io){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Uw++}),this.uuid=Oi(),this.name="",this.source=new xa(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=s,this.anisotropy=h,this.format=l,this.internalFormat=null,this.type=c,this.offset=new At(0,0),this.repeat=new At(1,1),this.center=new At(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new mt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(gh).x}get height(){return this.source.getSize(gh).y}get depth(){return this.source.getSize(gh).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let n in e){let i=e[n];if(i===void 0){Ke(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}let r=this[n];if(r===void 0){Ke(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Uh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ki:e.x=e.x-Math.floor(e.x);break;case gi:e.x=e.x<0?0:1;break;case fa:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ki:e.y=e.y-Math.floor(e.y);break;case gi:e.y=e.y<0?0:1;break;case fa:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}return o.DEFAULT_IMAGE=null,o.DEFAULT_MAPPING=Uh,o.DEFAULT_ANISOTROPY=1,o})(),Yt=class o{static{o.prototype.isVector4=!0}constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r,l=t.elements,c=l[0],h=l[4],p=l[8],m=l[1],x=l[5],M=l[9],S=l[2],y=l[6],C=l[10];if(Math.abs(h-m)<.01&&Math.abs(p-S)<.01&&Math.abs(M-y)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+S)<.1&&Math.abs(M+y)<.1&&Math.abs(c+x+C-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let L=(c+1)/2,k=(x+1)/2,H=(C+1)/2,V=(h+m)/4,G=(p+S)/4,E=(M+y)/4;return L>k&&L>H?L<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(L),i=V/n,r=G/n):k>H?k<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(k),n=V/i,r=E/i):H<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(H),n=G/r,i=E/r),this.set(n,i,r,e),this}let I=Math.sqrt((y-M)*(y-M)+(p-S)*(p-S)+(m-h)*(m-h));return Math.abs(I)<.001&&(I=1),this.x=(y-M)/I,this.y=(p-S)/I,this.z=(m-h)/I,this.w=Math.acos((c+x+C-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Pt(this.x,t.x,e.x),this.y=Pt(this.y,t.y,e.y),this.z=Pt(this.z,t.z,e.z),this.w=Pt(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Pt(this.x,t,e),this.y=Pt(this.y,t,e),this.z=Pt(this.z,t,e),this.w=Pt(this.w,t,e),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Pt(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Kc=class extends Ji{constructor(t=1,e=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:sn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=n.depth,this.scissor=new Yt(0,0,t,e),this.scissorTest=!1,this.viewport=new Yt(0,0,t,e),this.textures=[];let i={width:t,height:e,depth:n.depth},r=new ei(i),a=n.count;for(let s=0;s<a;s++)this.textures[s]=r.clone(),this.textures[s].isRenderTargetTexture=!0,this.textures[s].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(t={}){let e={minFilter:sn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new xa(i)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this.multiview=t.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}},si=class extends Kc{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},As=class extends ei{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=fn,this.minFilter=fn,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}};var Zc=class extends ei{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=fn,this.minFilter=fn,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Ct=class o{static{o.prototype.isMatrix4=!0}constructor(t,e,n,i,r,a,s,l,c,h,p,m,x,M,S,y){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,r,a,s,l,c,h,p,m,x,M,S,y)}set(t,e,n,i,r,a,s,l,c,h,p,m,x,M,S,y){let C=this.elements;return C[0]=t,C[4]=e,C[8]=n,C[12]=i,C[1]=r,C[5]=a,C[9]=s,C[13]=l,C[2]=c,C[6]=h,C[10]=p,C[14]=m,C[3]=x,C[7]=M,C[11]=S,C[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new o().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return this.determinant()===0?(t.set(1,0,0),e.set(0,1,0),n.set(0,0,1),this):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();let e=this.elements,n=t.elements,i=1/ta.setFromMatrixColumn(t,0).length(),r=1/ta.setFromMatrixColumn(t,1).length(),a=1/ta.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),s=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),p=Math.sin(r);if(t.order==="XYZ"){let m=a*h,x=a*p,M=s*h,S=s*p;e[0]=l*h,e[4]=-l*p,e[8]=c,e[1]=x+M*c,e[5]=m-S*c,e[9]=-s*l,e[2]=S-m*c,e[6]=M+x*c,e[10]=a*l}else if(t.order==="YXZ"){let m=l*h,x=l*p,M=c*h,S=c*p;e[0]=m+S*s,e[4]=M*s-x,e[8]=a*c,e[1]=a*p,e[5]=a*h,e[9]=-s,e[2]=x*s-M,e[6]=S+m*s,e[10]=a*l}else if(t.order==="ZXY"){let m=l*h,x=l*p,M=c*h,S=c*p;e[0]=m-S*s,e[4]=-a*p,e[8]=M+x*s,e[1]=x+M*s,e[5]=a*h,e[9]=S-m*s,e[2]=-a*c,e[6]=s,e[10]=a*l}else if(t.order==="ZYX"){let m=a*h,x=a*p,M=s*h,S=s*p;e[0]=l*h,e[4]=M*c-x,e[8]=m*c+S,e[1]=l*p,e[5]=S*c+m,e[9]=x*c-M,e[2]=-c,e[6]=s*l,e[10]=a*l}else if(t.order==="YZX"){let m=a*l,x=a*c,M=s*l,S=s*c;e[0]=l*h,e[4]=S-m*p,e[8]=M*p+x,e[1]=p,e[5]=a*h,e[9]=-s*h,e[2]=-c*h,e[6]=x*p+M,e[10]=m-S*p}else if(t.order==="XZY"){let m=a*l,x=a*c,M=s*l,S=s*c;e[0]=l*h,e[4]=-p,e[8]=c*h,e[1]=m*p+S,e[5]=a*h,e[9]=x*p-M,e[2]=M*p-x,e[6]=s*h,e[10]=S*p+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(zw,t,Hw)}lookAt(t,e,n){let i=this.elements;return oi.subVectors(t,e),oi.lengthSq()===0&&(oi.z=1),oi.normalize(),Bo.crossVectors(n,oi),Bo.lengthSq()===0&&(Math.abs(n.z)===1?oi.x+=1e-4:oi.z+=1e-4,oi.normalize(),Bo.crossVectors(n,oi)),Bo.normalize(),uc.crossVectors(oi,Bo),i[0]=Bo.x,i[4]=uc.x,i[8]=oi.x,i[1]=Bo.y,i[5]=uc.y,i[9]=oi.y,i[2]=Bo.z,i[6]=uc.z,i[10]=oi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,r=this.elements,a=n[0],s=n[4],l=n[8],c=n[12],h=n[1],p=n[5],m=n[9],x=n[13],M=n[2],S=n[6],y=n[10],C=n[14],I=n[3],L=n[7],k=n[11],H=n[15],V=i[0],G=i[4],E=i[8],B=i[12],Y=i[1],U=i[5],ee=i[9],de=i[13],fe=i[2],$=i[6],ae=i[10],J=i[14],Ce=i[3],Se=i[7],Ve=i[11],Ye=i[15];return r[0]=a*V+s*Y+l*fe+c*Ce,r[4]=a*G+s*U+l*$+c*Se,r[8]=a*E+s*ee+l*ae+c*Ve,r[12]=a*B+s*de+l*J+c*Ye,r[1]=h*V+p*Y+m*fe+x*Ce,r[5]=h*G+p*U+m*$+x*Se,r[9]=h*E+p*ee+m*ae+x*Ve,r[13]=h*B+p*de+m*J+x*Ye,r[2]=M*V+S*Y+y*fe+C*Ce,r[6]=M*G+S*U+y*$+C*Se,r[10]=M*E+S*ee+y*ae+C*Ve,r[14]=M*B+S*de+y*J+C*Ye,r[3]=I*V+L*Y+k*fe+H*Ce,r[7]=I*G+L*U+k*$+H*Se,r[11]=I*E+L*ee+k*ae+H*Ve,r[15]=I*B+L*de+k*J+H*Ye,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],s=t[5],l=t[9],c=t[13],h=t[2],p=t[6],m=t[10],x=t[14],M=t[3],S=t[7],y=t[11],C=t[15],I=l*x-c*m,L=s*x-c*p,k=s*m-l*p,H=a*x-c*h,V=a*m-l*h,G=a*p-s*h;return e*(S*I-y*L+C*k)-n*(M*I-y*H+C*V)+i*(M*L-S*H+C*G)-r*(M*k-S*V+y*G)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],l=t[6],c=t[7],h=t[8],p=t[9],m=t[10],x=t[11],M=t[12],S=t[13],y=t[14],C=t[15],I=e*s-n*a,L=e*l-i*a,k=e*c-r*a,H=n*l-i*s,V=n*c-r*s,G=i*c-r*l,E=h*S-p*M,B=h*y-m*M,Y=h*C-x*M,U=p*y-m*S,ee=p*C-x*S,de=m*C-x*y,fe=I*de-L*ee+k*U+H*Y-V*B+G*E;if(fe===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let $=1/fe;return t[0]=(s*de-l*ee+c*U)*$,t[1]=(i*ee-n*de-r*U)*$,t[2]=(S*G-y*V+C*H)*$,t[3]=(m*V-p*G-x*H)*$,t[4]=(l*Y-a*de-c*B)*$,t[5]=(e*de-i*Y+r*B)*$,t[6]=(y*k-M*G-C*L)*$,t[7]=(h*G-m*k+x*L)*$,t[8]=(a*ee-s*Y+c*E)*$,t[9]=(n*Y-e*ee-r*E)*$,t[10]=(M*V-S*k+C*I)*$,t[11]=(p*k-h*V-x*I)*$,t[12]=(s*B-a*U-l*E)*$,t[13]=(e*U-n*B+i*E)*$,t[14]=(S*L-M*H-y*I)*$,t[15]=(h*H-p*L+m*I)*$,this}scale(t){let e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,s=t.y,l=t.z,c=r*a,h=r*s;return this.set(c*a+n,c*s-i*l,c*l+i*s,0,c*s+i*l,h*s+n,h*l-i*a,0,c*l-i*s,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,a){return this.set(1,n,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,r=e._x,a=e._y,s=e._z,l=e._w,c=r+r,h=a+a,p=s+s,m=r*c,x=r*h,M=r*p,S=a*h,y=a*p,C=s*p,I=l*c,L=l*h,k=l*p,H=n.x,V=n.y,G=n.z;return i[0]=(1-(S+C))*H,i[1]=(x+k)*H,i[2]=(M-L)*H,i[3]=0,i[4]=(x-k)*V,i[5]=(1-(m+C))*V,i[6]=(y+I)*V,i[7]=0,i[8]=(M+L)*G,i[9]=(y-I)*G,i[10]=(1-(m+S))*G,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements;t.x=i[12],t.y=i[13],t.z=i[14];let r=this.determinant();if(r===0)return n.set(1,1,1),e.identity(),this;let a=ta.set(i[0],i[1],i[2]).length(),s=ta.set(i[4],i[5],i[6]).length(),l=ta.set(i[8],i[9],i[10]).length();r<0&&(a=-a),Si.copy(this);let c=1/a,h=1/s,p=1/l;return Si.elements[0]*=c,Si.elements[1]*=c,Si.elements[2]*=c,Si.elements[4]*=h,Si.elements[5]*=h,Si.elements[6]*=h,Si.elements[8]*=p,Si.elements[9]*=p,Si.elements[10]*=p,e.setFromRotationMatrix(Si),n.x=a,n.y=s,n.z=l,this}makePerspective(t,e,n,i,r,a,s=Ai,l=!1){let c=this.elements,h=2*r/(e-t),p=2*r/(n-i),m=(e+t)/(e-t),x=(n+i)/(n-i),M,S;if(l)M=r/(a-r),S=a*r/(a-r);else if(s===Ai)M=-(a+r)/(a-r),S=-2*a*r/(a-r);else if(s===ga)M=-a/(a-r),S=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return c[0]=h,c[4]=0,c[8]=m,c[12]=0,c[1]=0,c[5]=p,c[9]=x,c[13]=0,c[2]=0,c[6]=0,c[10]=M,c[14]=S,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,e,n,i,r,a,s=Ai,l=!1){let c=this.elements,h=2/(e-t),p=2/(n-i),m=-(e+t)/(e-t),x=-(n+i)/(n-i),M,S;if(l)M=1/(a-r),S=a/(a-r);else if(s===Ai)M=-2/(a-r),S=-(a+r)/(a-r);else if(s===ga)M=-1/(a-r),S=-r/(a-r);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return c[0]=h,c[4]=0,c[8]=0,c[12]=m,c[1]=0,c[5]=p,c[9]=0,c[13]=x,c[2]=0,c[6]=0,c[10]=M,c[14]=S,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},ta=new j,Si=new Ct,zw=new j(0,0,0),Hw=new j(1,1,1),Bo=new j,uc=new j,oi=new j,I0=new Ct,O0=new ai,ba=(()=>{class o{constructor(e=0,n=0,i=0,r=o.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){let r=e.elements,a=r[0],s=r[4],l=r[8],c=r[1],h=r[5],p=r[9],m=r[2],x=r[6],M=r[10];switch(n){case"XYZ":this._y=Math.asin(Pt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-p,M),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(x,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Pt(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(l,M),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(Pt(x,-1,1)),Math.abs(x)<.9999999?(this._y=Math.atan2(-m,M),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-Pt(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(x,M),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,h));break;case"YZX":this._z=Math.asin(Pt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-p,h),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(l,M));break;case"XZY":this._z=Math.asin(-Pt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(x,h),this._y=Math.atan2(l,a)):(this._x=Math.atan2(-p,M),this._y=0);break;default:Ke("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return I0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(I0,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return O0.setFromEuler(this),this.setFromQuaternion(O0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return o.DEFAULT_ORDER="XYZ",o})(),Is=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},Gw=0,D0=new j,na=new ai,_o=new Ct,hc=new j,_s=new j,Ww=new j,Xw=new ai,k0=new j(1,0,0),R0=new j(0,1,0),N0=new j(0,0,1),L0={type:"added"},qw={type:"removed"},ia={type:"childadded",child:null},_h={type:"childremoved",child:null},En=(()=>{class o extends Ji{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Gw++}),this.uuid=Oi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=o.DEFAULT_UP.clone();let e=new j,n=new ba,i=new ai,r=new j(1,1,1);function a(){i.setFromEuler(n,!1)}function s(){n.setFromQuaternion(i,void 0,!1)}n._onChange(a),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ct},normalMatrix:{value:new mt}}),this.matrix=new Ct,this.matrixWorld=new Ct,this.matrixAutoUpdate=o.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=o.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Is,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return na.setFromAxisAngle(e,n),this.quaternion.multiply(na),this}rotateOnWorldAxis(e,n){return na.setFromAxisAngle(e,n),this.quaternion.premultiply(na),this}rotateX(e){return this.rotateOnAxis(k0,e)}rotateY(e){return this.rotateOnAxis(R0,e)}rotateZ(e){return this.rotateOnAxis(N0,e)}translateOnAxis(e,n){return D0.copy(e).applyQuaternion(this.quaternion),this.position.add(D0.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(k0,e)}translateY(e){return this.translateOnAxis(R0,e)}translateZ(e){return this.translateOnAxis(N0,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_o.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?hc.copy(e):hc.set(e,n,i);let r=this.parent;this.updateWorldMatrix(!0,!1),_s.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_o.lookAt(_s,hc,this.up):_o.lookAt(hc,_s,this.up),this.quaternion.setFromRotationMatrix(_o),r&&(_o.extractRotation(r.matrixWorld),na.setFromRotationMatrix(_o),this.quaternion.premultiply(na.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(st("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(L0),ia.child=e,this.dispatchEvent(ia),ia.child=null):st("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}let n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(qw),_h.child=e,this.dispatchEvent(_h),_h.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_o.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_o.multiply(e.parent.matrixWorld)),e.applyMatrix4(_o),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(L0),ia.child=e,this.dispatchEvent(ia),ia.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){let s=this.children[i].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);let r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_s,e,Ww),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_s,Xw,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){let n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let n=e.x,i=e.y,r=e.z,a=this.matrix.elements;a[12]+=n-a[0]*n-a[4]*i-a[8]*r,a[13]+=i-a[1]*n-a[5]*i-a[9]*r,a[14]+=r-a[2]*n-a[6]*i-a[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){let i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){let r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){let n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(l=>De(he({},l),{boundingBox:l.boundingBox?l.boundingBox.toJSON():void 0,boundingSphere:l.boundingSphere?l.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(l=>he({},l)),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let c=l.shapes;if(Array.isArray(c))for(let h=0,p=c.length;h<p;h++){let m=c[h];a(e.shapes,m)}else a(e.shapes,c)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let c=0,h=this.material.length;c<h;c++)l.push(a(e.materials,this.material[c]));r.material=l}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let l=0;l<this.children.length;l++)r.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let l=0;l<this.animations.length;l++){let c=this.animations[l];r.animations.push(a(e.animations,c))}}if(n){let l=s(e.geometries),c=s(e.materials),h=s(e.textures),p=s(e.images),m=s(e.shapes),x=s(e.skeletons),M=s(e.animations),S=s(e.nodes);l.length>0&&(i.geometries=l),c.length>0&&(i.materials=c),h.length>0&&(i.textures=h),p.length>0&&(i.images=p),m.length>0&&(i.shapes=m),x.length>0&&(i.skeletons=x),M.length>0&&(i.animations=M),S.length>0&&(i.nodes=S)}return i.object=r,i;function s(l){let c=[];for(let h in l){let p=l[h];delete p.metadata,c.push(p)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){let r=e.children[i];this.add(r.clone())}return this}}return o.DEFAULT_UP=new j(0,1,0),o.DEFAULT_MATRIX_AUTO_UPDATE=!0,o.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,o})(),Ii=class extends En{constructor(){super(),this.isGroup=!0,this.type="Group"}},$w={type:"move"},ya=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ii,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ii,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ii,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,a=null,s=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){a=!0;for(let S of t.hand.values()){let y=e.getJointPose(S,n),C=this._getHandJoint(c,S);y!==null&&(C.matrix.fromArray(y.transform.matrix),C.matrix.decompose(C.position,C.rotation,C.scale),C.matrixWorldNeedsUpdate=!0,C.jointRadius=y.radius),C.visible=y!==null}let h=c.joints["index-finger-tip"],p=c.joints["thumb-tip"],m=h.position.distanceTo(p.position),x=.02,M=.005;c.inputState.pinching&&m>x+M?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&m<=x-M&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:t,target:this})));s!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent($w)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new Ii;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},W_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Uo={h:0,s:0,l:0},pc={h:0,s:0,l:0};function vh(o,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?o+(t-o)*6*e:e<1/2?t:e<2/3?o+(t-o)*6*(2/3-e):o}var dt=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=dn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,St.colorSpaceToWorking(this,e),this}setRGB(t,e,n,i=St.workingColorSpace){return this.r=t,this.g=e,this.b=n,St.colorSpaceToWorking(this,i),this}setHSL(t,e,n,i=St.workingColorSpace){if(t=xp(t,1),e=Pt(e,0,1),n=Pt(n,0,1),e===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+e):n+e-n*e,a=2*n-r;this.r=vh(a,r,t+1/3),this.g=vh(a,r,t),this.b=vh(a,r,t-1/3)}return St.colorSpaceToWorking(this,i),this}setStyle(t,e=dn){function n(r){r!==void 0&&parseFloat(r)<1&&Ke("Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:Ke("Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(r,16),e);Ke("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=dn){let n=W_[t.toLowerCase()];return n!==void 0?this.setHex(n,e):Ke("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Mo(t.r),this.g=Mo(t.g),this.b=Mo(t.b),this}copyLinearToSRGB(t){return this.r=ma(t.r),this.g=ma(t.g),this.b=ma(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=dn){return St.workingToColorSpace(Vn.copy(this),t),Math.round(Pt(Vn.r*255,0,255))*65536+Math.round(Pt(Vn.g*255,0,255))*256+Math.round(Pt(Vn.b*255,0,255))}getHexString(t=dn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=St.workingColorSpace){St.workingToColorSpace(Vn.copy(this),e);let n=Vn.r,i=Vn.g,r=Vn.b,a=Math.max(n,i,r),s=Math.min(n,i,r),l,c,h=(s+a)/2;if(s===a)l=0,c=0;else{let p=a-s;switch(c=h<=.5?p/(a+s):p/(2-a-s),a){case n:l=(i-r)/p+(i<r?6:0);break;case i:l=(r-n)/p+2;break;case r:l=(n-i)/p+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=St.workingColorSpace){return St.workingToColorSpace(Vn.copy(this),e),t.r=Vn.r,t.g=Vn.g,t.b=Vn.b,t}getStyle(t=dn){St.workingToColorSpace(Vn.copy(this),t);let e=Vn.r,n=Vn.g,i=Vn.b;return t!==dn?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(Uo),this.setHSL(Uo.h+t,Uo.s+e,Uo.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Uo),t.getHSL(pc);let n=Es(Uo.h,pc.h,e),i=Es(Uo.s,pc.s,e),r=Es(Uo.l,pc.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},Vn=new dt;dt.NAMES=W_;var Os=class extends En{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ba,this.environmentIntensity=1,this.environmentRotation=new ba,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}},Ei=new j,vo=new j,xh=new j,xo=new j,oa=new j,ra=new j,F0=new j,bh=new j,yh=new j,Ch=new j,Mh=new Yt,wh=new Yt,Sh=new Yt,Xo=class o{constructor(t=new j,e=new j,n=new j){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),Ei.subVectors(t,e),i.cross(Ei);let r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Ei.subVectors(i,e),vo.subVectors(n,e),xh.subVectors(t,e);let a=Ei.dot(Ei),s=Ei.dot(vo),l=Ei.dot(xh),c=vo.dot(vo),h=vo.dot(xh),p=a*c-s*s;if(p===0)return r.set(0,0,0),null;let m=1/p,x=(c*l-s*h)*m,M=(a*h-s*l)*m;return r.set(1-x-M,M,x)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,xo)===null?!1:xo.x>=0&&xo.y>=0&&xo.x+xo.y<=1}static getInterpolation(t,e,n,i,r,a,s,l){return this.getBarycoord(t,e,n,i,xo)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,xo.x),l.addScaledVector(a,xo.y),l.addScaledVector(s,xo.z),l)}static getInterpolatedAttribute(t,e,n,i,r,a){return Mh.setScalar(0),wh.setScalar(0),Sh.setScalar(0),Mh.fromBufferAttribute(t,e),wh.fromBufferAttribute(t,n),Sh.fromBufferAttribute(t,i),a.setScalar(0),a.addScaledVector(Mh,r.x),a.addScaledVector(wh,r.y),a.addScaledVector(Sh,r.z),a}static isFrontFacing(t,e,n,i){return Ei.subVectors(n,e),vo.subVectors(t,e),Ei.cross(vo).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Ei.subVectors(this.c,this.b),vo.subVectors(this.a,this.b),Ei.cross(vo).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return o.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return o.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return o.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return o.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return o.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,r=this.c,a,s;oa.subVectors(i,n),ra.subVectors(r,n),bh.subVectors(t,n);let l=oa.dot(bh),c=ra.dot(bh);if(l<=0&&c<=0)return e.copy(n);yh.subVectors(t,i);let h=oa.dot(yh),p=ra.dot(yh);if(h>=0&&p<=h)return e.copy(i);let m=l*p-h*c;if(m<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(n).addScaledVector(oa,a);Ch.subVectors(t,r);let x=oa.dot(Ch),M=ra.dot(Ch);if(M>=0&&x<=M)return e.copy(r);let S=x*c-l*M;if(S<=0&&c>=0&&M<=0)return s=c/(c-M),e.copy(n).addScaledVector(ra,s);let y=h*M-x*p;if(y<=0&&p-h>=0&&x-M>=0)return F0.subVectors(r,i),s=(p-h)/(p-h+(x-M)),e.copy(i).addScaledVector(F0,s);let C=1/(y+S+m);return a=S*C,s=m*C,e.copy(n).addScaledVector(oa,a).addScaledVector(ra,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},li=class{constructor(t=new j(1/0,1/0,1/0),e=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(Ti.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(Ti.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=Ti.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let r=n.getAttribute("position");if(e===!0&&r!==void 0&&t.isInstancedMesh!==!0)for(let a=0,s=r.count;a<s;a++)t.isMesh===!0?t.getVertexPosition(a,Ti):Ti.fromBufferAttribute(r,a),Ti.applyMatrix4(t.matrixWorld),this.expandByPoint(Ti);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),mc.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),mc.copy(n.boundingBox)),mc.applyMatrix4(t.matrixWorld),this.union(mc)}let i=t.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Ti),Ti.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(vs),fc.subVectors(this.max,vs),aa.subVectors(t.a,vs),sa.subVectors(t.b,vs),la.subVectors(t.c,vs),zo.subVectors(sa,aa),Ho.subVectors(la,sa),ur.subVectors(aa,la);let e=[0,-zo.z,zo.y,0,-Ho.z,Ho.y,0,-ur.z,ur.y,zo.z,0,-zo.x,Ho.z,0,-Ho.x,ur.z,0,-ur.x,-zo.y,zo.x,0,-Ho.y,Ho.x,0,-ur.y,ur.x,0];return!Eh(e,aa,sa,la,fc)||(e=[1,0,0,0,1,0,0,0,1],!Eh(e,aa,sa,la,fc))?!1:(gc.crossVectors(zo,Ho),e=[gc.x,gc.y,gc.z],Eh(e,aa,sa,la,fc))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ti).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ti).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(bo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),bo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),bo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),bo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),bo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),bo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),bo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),bo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(bo),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}},bo=[new j,new j,new j,new j,new j,new j,new j,new j],Ti=new j,mc=new li,aa=new j,sa=new j,la=new j,zo=new j,Ho=new j,ur=new j,vs=new j,fc=new j,gc=new j,hr=new j;function Eh(o,t,e,n,i){for(let r=0,a=o.length-3;r<=a;r+=3){hr.fromArray(o,r);let s=i.x*Math.abs(hr.x)+i.y*Math.abs(hr.y)+i.z*Math.abs(hr.z),l=t.dot(hr),c=e.dot(hr),h=n.dot(hr);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>s)return!1}return!0}var vn=new j,_c=new At,Yw=0,bn=class extends Ji{constructor(t,e,n=!1){if(super(),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Yw++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=$c,this.updateRanges=[],this.gpuType=ui,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)_c.fromBufferAttribute(this,e),_c.applyMatrix3(t),this.setXY(e,_c.x,_c.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)vn.fromBufferAttribute(this,e),vn.applyMatrix3(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)vn.fromBufferAttribute(this,e),vn.applyMatrix4(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)vn.fromBufferAttribute(this,e),vn.applyNormalMatrix(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)vn.fromBufferAttribute(this,e),vn.transformDirection(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Pi(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Wt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Pi(e,this.array)),e}setX(t,e){return this.normalized&&(e=Wt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Pi(e,this.array)),e}setY(t,e){return this.normalized&&(e=Wt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Pi(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Wt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Pi(e,this.array)),e}setW(t,e){return this.normalized&&(e=Wt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array),i=Wt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array),i=Wt(i,this.array),r=Wt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==$c&&(t.usage=this.usage),t}dispose(){this.dispatchEvent({type:"dispose"})}};var Ds=class extends bn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var ks=class extends bn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Wn=class extends bn{constructor(t,e,n){super(new Float32Array(t),e,n)}},jw=new li,xs=new j,Th=new j,jn=class{constructor(t=new j,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):jw.setFromPoints(t).getCenter(n);let i=0;for(let r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;xs.subVectors(t,this.center);let e=xs.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(xs,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Th.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(xs.copy(t.center).add(Th)),this.expandByPoint(xs.copy(t.center).sub(Th))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}},Kw=0,fi=new Ct,Ph=new En,ca=new j,ri=new li,bs=new li,Sn=new j,qn=class o extends Ji{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Kw++}),this.uuid=Oi(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(bw(t)?ks:Ds)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let r=new mt().getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return fi.makeRotationFromQuaternion(t),this.applyMatrix4(fi),this}rotateX(t){return fi.makeRotationX(t),this.applyMatrix4(fi),this}rotateY(t){return fi.makeRotationY(t),this.applyMatrix4(fi),this}rotateZ(t){return fi.makeRotationZ(t),this.applyMatrix4(fi),this}translate(t,e,n){return fi.makeTranslation(t,e,n),this.applyMatrix4(fi),this}scale(t,e,n){return fi.makeScale(t,e,n),this.applyMatrix4(fi),this}lookAt(t){return Ph.lookAt(t),Ph.updateMatrix(),this.applyMatrix4(Ph.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ca).negate(),this.translate(ca.x,ca.y,ca.z),this}setFromPoints(t){let e=this.getAttribute("position");if(e===void 0){let n=[];for(let i=0,r=t.length;i<r;i++){let a=t[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Wn(n,3))}else{let n=Math.min(t.length,e.count);for(let i=0;i<n;i++){let r=t[i];e.setXYZ(i,r.x,r.y,r.z||0)}t.length>e.count&&Ke("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new li);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){st("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let r=e[n];ri.setFromBufferAttribute(r),this.morphTargetsRelative?(Sn.addVectors(this.boundingBox.min,ri.min),this.boundingBox.expandByPoint(Sn),Sn.addVectors(this.boundingBox.max,ri.max),this.boundingBox.expandByPoint(Sn)):(this.boundingBox.expandByPoint(ri.min),this.boundingBox.expandByPoint(ri.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&st('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new jn);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){st("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){let n=this.boundingSphere.center;if(ri.setFromBufferAttribute(t),e)for(let r=0,a=e.length;r<a;r++){let s=e[r];bs.setFromBufferAttribute(s),this.morphTargetsRelative?(Sn.addVectors(ri.min,bs.min),ri.expandByPoint(Sn),Sn.addVectors(ri.max,bs.max),ri.expandByPoint(Sn)):(ri.expandByPoint(bs.min),ri.expandByPoint(bs.max))}ri.getCenter(n);let i=0;for(let r=0,a=t.count;r<a;r++)Sn.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(Sn));if(e)for(let r=0,a=e.length;r<a;r++){let s=e[r],l=this.morphTargetsRelative;for(let c=0,h=s.count;c<h;c++)Sn.fromBufferAttribute(s,c),l&&(ca.fromBufferAttribute(t,c),Sn.add(ca)),i=Math.max(i,n.distanceToSquared(Sn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&st('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){st("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,r=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),s=[],l=[];for(let E=0;E<n.count;E++)s[E]=new j,l[E]=new j;let c=new j,h=new j,p=new j,m=new At,x=new At,M=new At,S=new j,y=new j;function C(E,B,Y){c.fromBufferAttribute(n,E),h.fromBufferAttribute(n,B),p.fromBufferAttribute(n,Y),m.fromBufferAttribute(r,E),x.fromBufferAttribute(r,B),M.fromBufferAttribute(r,Y),h.sub(c),p.sub(c),x.sub(m),M.sub(m);let U=1/(x.x*M.y-M.x*x.y);isFinite(U)&&(S.copy(h).multiplyScalar(M.y).addScaledVector(p,-x.y).multiplyScalar(U),y.copy(p).multiplyScalar(x.x).addScaledVector(h,-M.x).multiplyScalar(U),s[E].add(S),s[B].add(S),s[Y].add(S),l[E].add(y),l[B].add(y),l[Y].add(y))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let E=0,B=I.length;E<B;++E){let Y=I[E],U=Y.start,ee=Y.count;for(let de=U,fe=U+ee;de<fe;de+=3)C(t.getX(de+0),t.getX(de+1),t.getX(de+2))}let L=new j,k=new j,H=new j,V=new j;function G(E){H.fromBufferAttribute(i,E),V.copy(H);let B=s[E];L.copy(B),L.sub(H.multiplyScalar(H.dot(B))).normalize(),k.crossVectors(V,B);let U=k.dot(l[E])<0?-1:1;a.setXYZW(E,L.x,L.y,L.z,U)}for(let E=0,B=I.length;E<B;++E){let Y=I[E],U=Y.start,ee=Y.count;for(let de=U,fe=U+ee;de<fe;de+=3)G(t.getX(de+0)),G(t.getX(de+1)),G(t.getX(de+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new bn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let m=0,x=n.count;m<x;m++)n.setXYZ(m,0,0,0);let i=new j,r=new j,a=new j,s=new j,l=new j,c=new j,h=new j,p=new j;if(t)for(let m=0,x=t.count;m<x;m+=3){let M=t.getX(m+0),S=t.getX(m+1),y=t.getX(m+2);i.fromBufferAttribute(e,M),r.fromBufferAttribute(e,S),a.fromBufferAttribute(e,y),h.subVectors(a,r),p.subVectors(i,r),h.cross(p),s.fromBufferAttribute(n,M),l.fromBufferAttribute(n,S),c.fromBufferAttribute(n,y),s.add(h),l.add(h),c.add(h),n.setXYZ(M,s.x,s.y,s.z),n.setXYZ(S,l.x,l.y,l.z),n.setXYZ(y,c.x,c.y,c.z)}else for(let m=0,x=e.count;m<x;m+=3)i.fromBufferAttribute(e,m+0),r.fromBufferAttribute(e,m+1),a.fromBufferAttribute(e,m+2),h.subVectors(a,r),p.subVectors(i,r),h.cross(p),n.setXYZ(m+0,h.x,h.y,h.z),n.setXYZ(m+1,h.x,h.y,h.z),n.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Sn.fromBufferAttribute(t,e),Sn.normalize(),t.setXYZ(e,Sn.x,Sn.y,Sn.z)}toNonIndexed(){function t(s,l){let c=s.array,h=s.itemSize,p=s.normalized,m=new c.constructor(l.length*h),x=0,M=0;for(let S=0,y=l.length;S<y;S++){s.isInterleavedBufferAttribute?x=l[S]*s.data.stride+s.offset:x=l[S]*h;for(let C=0;C<h;C++)m[M++]=c[x++]}return new bn(m,h,p)}if(this.index===null)return Ke("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new o,n=this.index.array,i=this.attributes;for(let s in i){let l=i[s],c=t(l,n);e.setAttribute(s,c)}let r=this.morphAttributes;for(let s in r){let l=[],c=r[s];for(let h=0,p=c.length;h<p;h++){let m=c[h],x=t(m,n);l.push(x)}e.morphAttributes[s]=l}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let s=0,l=a.length;s<l;s++){let c=a[s];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},r=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],h=[];for(let p=0,m=c.length;p<m;p++){let x=c[p];h.push(x.toJSON(t.data))}h.length>0&&(i[l]=h,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return s!==null&&(t.data.boundingSphere=s.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone());let i=t.attributes;for(let c in i){let h=i[c];this.setAttribute(c,h.clone(e))}let r=t.morphAttributes;for(let c in r){let h=[],p=r[c];for(let m=0,x=p.length;m<x;m++)h.push(p[m].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let c=0,h=a.length;c<h;c++){let p=a[c];this.addGroup(p.start,p.count,p.materialIndex)}let s=t.boundingBox;s!==null&&(this.boundingBox=s.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ca=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=$c,this.updateRanges=[],this.version=0,this.uuid=Oi()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Oi()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Oi()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Gn=new j,Ma=class o{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)Gn.fromBufferAttribute(this,e),Gn.applyMatrix4(t),this.setXYZ(e,Gn.x,Gn.y,Gn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Gn.fromBufferAttribute(this,e),Gn.applyNormalMatrix(t),this.setXYZ(e,Gn.x,Gn.y,Gn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Gn.fromBufferAttribute(this,e),Gn.transformDirection(t),this.setXYZ(e,Gn.x,Gn.y,Gn.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Pi(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Wt(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Wt(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Wt(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Wt(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Wt(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Pi(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Pi(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Pi(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Pi(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array),i=Wt(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Wt(e,this.array),n=Wt(n,this.array),i=Wt(i,this.array),r=Wt(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(t===void 0){Ps("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let n=0;n<this.count;n++){let i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return new bn(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new o(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){Ps("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let n=0;n<this.count;n++){let i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)e.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Zw=0,Kn=class extends Ji{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Zw++}),this.uuid=Oi(),this.name="",this.type="Material",this.blending=gr,this.side=Di,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vc,this.blendDst=Bc,this.blendEquation=qo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new dt(0,0,0),this.blendAlpha=0,this.depthFunc=_r,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Xh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fr,this.stencilZFail=fr,this.stencilZPass=fr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){Ke(`Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){Ke(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==gr&&(n.blending=this.blending),this.side!==Di&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Vc&&(n.blendSrc=this.blendSrc),this.blendDst!==Bc&&(n.blendDst=this.blendDst),this.blendEquation!==qo&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==_r&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Xh&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==fr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==fr&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(r){let a=[];for(let s in r){let l=r[s];delete l.metadata,a.push(l)}return a}if(e){let r=i(t.textures),a=i(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}};var yo=new j,Ah=new j,vc=new j,Go=new j,Ih=new j,xc=new j,Oh=new j,yr=class{constructor(t=new j,e=new j(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,yo)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=yo.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(yo.copy(this.origin).addScaledVector(this.direction,e),yo.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Ah.copy(t).add(e).multiplyScalar(.5),vc.copy(e).sub(t).normalize(),Go.copy(this.origin).sub(Ah);let r=t.distanceTo(e)*.5,a=-this.direction.dot(vc),s=Go.dot(this.direction),l=-Go.dot(vc),c=Go.lengthSq(),h=Math.abs(1-a*a),p,m,x,M;if(h>0)if(p=a*l-s,m=a*s-l,M=r*h,p>=0)if(m>=-M)if(m<=M){let S=1/h;p*=S,m*=S,x=p*(p+a*m+2*s)+m*(a*p+m+2*l)+c}else m=r,p=Math.max(0,-(a*m+s)),x=-p*p+m*(m+2*l)+c;else m=-r,p=Math.max(0,-(a*m+s)),x=-p*p+m*(m+2*l)+c;else m<=-M?(p=Math.max(0,-(-a*r+s)),m=p>0?-r:Math.min(Math.max(-r,-l),r),x=-p*p+m*(m+2*l)+c):m<=M?(p=0,m=Math.min(Math.max(-r,-l),r),x=m*(m+2*l)+c):(p=Math.max(0,-(a*r+s)),m=p>0?r:Math.min(Math.max(-r,-l),r),x=-p*p+m*(m+2*l)+c);else m=a>0?-r:r,p=Math.max(0,-(a*m+s)),x=-p*p+m*(m+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(Ah).addScaledVector(vc,m),x}intersectSphere(t,e){yo.subVectors(t.center,this.origin);let n=yo.dot(this.direction),i=yo.dot(yo)-n*n,r=t.radius*t.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,l=n+a;return l<0?null:s<0?this.at(l,e):this.at(s,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,a,s,l,c=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return c>=0?(n=(t.min.x-m.x)*c,i=(t.max.x-m.x)*c):(n=(t.max.x-m.x)*c,i=(t.min.x-m.x)*c),h>=0?(r=(t.min.y-m.y)*h,a=(t.max.y-m.y)*h):(r=(t.max.y-m.y)*h,a=(t.min.y-m.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),p>=0?(s=(t.min.z-m.z)*p,l=(t.max.z-m.z)*p):(s=(t.max.z-m.z)*p,l=(t.min.z-m.z)*p),n>l||s>i)||((s>n||n!==n)&&(n=s),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,yo)!==null}intersectTriangle(t,e,n,i,r){Ih.subVectors(e,t),xc.subVectors(n,t),Oh.crossVectors(Ih,xc);let a=this.direction.dot(Oh),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Go.subVectors(this.origin,t);let l=s*this.direction.dot(xc.crossVectors(Go,xc));if(l<0)return null;let c=s*this.direction.dot(Ih.cross(Go));if(c<0||l+c>a)return null;let h=-s*Go.dot(Oh);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},ci=class extends Kn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new dt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ba,this.combine=ip,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},V0=new Ct,pr=new yr,bc=new jn,B0=new j,yc=new j,Cc=new j,Mc=new j,Dh=new j,wc=new j,U0=new j,Sc=new j,kn=class extends En{constructor(t=new qn,e=new ci){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){let s=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let s=this.morphTargetInfluences;if(r&&s){wc.set(0,0,0);for(let l=0,c=r.length;l<c;l++){let h=s[l],p=r[l];h!==0&&(Dh.fromBufferAttribute(p,t),a?wc.addScaledVector(Dh,h):wc.addScaledVector(Dh.sub(e),h))}e.add(wc)}return e}raycast(t,e){let n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),bc.copy(n.boundingSphere),bc.applyMatrix4(r),pr.copy(t.ray).recast(t.near),!(bc.containsPoint(pr.origin)===!1&&(pr.intersectSphere(bc,B0)===null||pr.origin.distanceToSquared(B0)>(t.far-t.near)**2))&&(V0.copy(r).invert(),pr.copy(t.ray).applyMatrix4(V0),!(n.boundingBox!==null&&pr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,pr)))}_computeIntersections(t,e,n){let i,r=this.geometry,a=this.material,s=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,p=r.attributes.normal,m=r.groups,x=r.drawRange;if(s!==null)if(Array.isArray(a))for(let M=0,S=m.length;M<S;M++){let y=m[M],C=a[y.materialIndex],I=Math.max(y.start,x.start),L=Math.min(s.count,Math.min(y.start+y.count,x.start+x.count));for(let k=I,H=L;k<H;k+=3){let V=s.getX(k),G=s.getX(k+1),E=s.getX(k+2);i=Ec(this,C,t,n,c,h,p,V,G,E),i&&(i.faceIndex=Math.floor(k/3),i.face.materialIndex=y.materialIndex,e.push(i))}}else{let M=Math.max(0,x.start),S=Math.min(s.count,x.start+x.count);for(let y=M,C=S;y<C;y+=3){let I=s.getX(y),L=s.getX(y+1),k=s.getX(y+2);i=Ec(this,a,t,n,c,h,p,I,L,k),i&&(i.faceIndex=Math.floor(y/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let M=0,S=m.length;M<S;M++){let y=m[M],C=a[y.materialIndex],I=Math.max(y.start,x.start),L=Math.min(l.count,Math.min(y.start+y.count,x.start+x.count));for(let k=I,H=L;k<H;k+=3){let V=k,G=k+1,E=k+2;i=Ec(this,C,t,n,c,h,p,V,G,E),i&&(i.faceIndex=Math.floor(k/3),i.face.materialIndex=y.materialIndex,e.push(i))}}else{let M=Math.max(0,x.start),S=Math.min(l.count,x.start+x.count);for(let y=M,C=S;y<C;y+=3){let I=y,L=y+1,k=y+2;i=Ec(this,a,t,n,c,h,p,I,L,k),i&&(i.faceIndex=Math.floor(y/3),e.push(i))}}}};function Jw(o,t,e,n,i,r,a,s){let l;if(t.side===$n?l=n.intersectTriangle(a,r,i,!0,s):l=n.intersectTriangle(i,r,a,t.side===Di,s),l===null)return null;Sc.copy(s),Sc.applyMatrix4(o.matrixWorld);let c=e.ray.origin.distanceTo(Sc);return c<e.near||c>e.far?null:{distance:c,point:Sc.clone(),object:o}}function Ec(o,t,e,n,i,r,a,s,l,c){o.getVertexPosition(s,yc),o.getVertexPosition(l,Cc),o.getVertexPosition(c,Mc);let h=Jw(o,t,e,n,yc,Cc,Mc,U0);if(h){let p=new j;Xo.getBarycoord(U0,yc,Cc,Mc,p),i&&(h.uv=Xo.getInterpolatedAttribute(i,s,l,c,p,new At)),r&&(h.uv1=Xo.getInterpolatedAttribute(r,s,l,c,p,new At)),a&&(h.normal=Xo.getInterpolatedAttribute(a,s,l,c,p,new j),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let m={a:s,b:l,c,normal:new j,materialIndex:0};Xo.getNormal(yc,Cc,Mc,m.normal),h.face=m,h.barycoord=p}return h}var ys=new Yt,z0=new Yt,H0=new Yt,Qw=new Yt,G0=new Ct,Tc=new j,kh=new jn,W0=new Ct,Rh=new yr,Rs=class extends kn{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Bh,this.bindMatrix=new Ct,this.bindMatrixInverse=new Ct,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;this.boundingBox===null&&(this.boundingBox=new li),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Tc),this.boundingBox.expandByPoint(Tc)}computeBoundingSphere(){let t=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new jn),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let n=0;n<e.count;n++)this.getVertexPosition(n,Tc),this.boundingSphere.expandByPoint(Tc)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kh.copy(this.boundingSphere),kh.applyMatrix4(i),t.ray.intersectsSphere(kh)!==!1&&(W0.copy(i).invert(),Rh.copy(t.ray).applyMatrix4(W0),!(this.boundingBox!==null&&Rh.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(t,e,Rh)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new Yt,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);let r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===Bh?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===I_?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ke("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){let n=this.skeleton,i=this.geometry;z0.fromBufferAttribute(i.attributes.skinIndex,t),H0.fromBufferAttribute(i.attributes.skinWeight,t),e.isVector4?(ys.copy(e),e.set(0,0,0,0)):(ys.set(...e,1),e.set(0,0,0)),ys.applyMatrix4(this.bindMatrix);for(let r=0;r<4;r++){let a=H0.getComponent(r);if(a!==0){let s=z0.getComponent(r);G0.multiplyMatrices(n.bones[s].matrixWorld,n.boneInverses[s]),e.addScaledVector(Qw.copy(ys).applyMatrix4(G0),a)}}return e.isVector4&&(e.w=ys.w),e.applyMatrix4(this.bindMatrixInverse)}},wa=class extends En{constructor(){super(),this.isBone=!0,this.type="Bone"}},Sa=class extends ei{constructor(t=null,e=1,n=1,i,r,a,s,l,c=fn,h=fn,p,m){super(null,a,s,l,c,h,i,r,p,m),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},X0=new Ct,eS=new Ct,Ns=class o{constructor(t=[],e=[]){this.uuid=Oi(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),e.length===0)this.calculateInverses();else if(t.length!==e.length){Ke("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Ct)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let n=new Ct;this.bones[t]&&n.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let n=this.bones[t];n&&n.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let n=this.bones[t];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){let t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=t.length;r<a;r++){let s=t[r]?t[r].matrixWorld:eS;X0.multiplyMatrices(s,e[r]),X0.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new o(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=Math.ceil(t/4)*4,t=Math.max(t,4);let e=new Float32Array(t*t*4);e.set(this.boneMatrices);let n=new Sa(e,t,t,Bn,ui);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){let i=this.bones[e];if(i.name===t)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){let r=t.bones[n],a=e[r];a===void 0&&(Ke("Skeleton: No bone found with UUID:",r),a=new wa),this.bones.push(a),this.boneInverses.push(new Ct().fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){let a=e[i];t.bones.push(a.uuid);let s=n[i];t.boneInverses.push(s.toArray())}return t}},$o=class extends bn{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}},da=new Ct,q0=new Ct,Pc=[],$0=new li,tS=new Ct,Cs=new kn,Ms=new jn,Ls=class extends kn{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new $o(new Float32Array(n*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,tS)}computeBoundingBox(){let t=this.geometry,e=this.count;this.boundingBox===null&&(this.boundingBox=new li),t.boundingBox===null&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,da),$0.copy(t.boundingBox).applyMatrix4(da),this.boundingBox.union($0)}computeBoundingSphere(){let t=this.geometry,e=this.count;this.boundingSphere===null&&(this.boundingSphere=new jn),t.boundingSphere===null&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,da),Ms.copy(t.boundingSphere).applyMatrix4(da),this.boundingSphere.union(Ms)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),t.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=t.previousInstanceMatrix.clone()),t.morphTexture!==null&&(this.morphTexture=t.morphTexture.clone()),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return this.instanceColor===null?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,t*3)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,t*16)}getMorphAt(t,e){let n=e.morphTargetInfluences,i=this.morphTexture.source.data.data,r=n.length+1,a=t*r+1;for(let s=0;s<n.length;s++)n[s]=i[a+s]}raycast(t,e){let n=this.matrixWorld,i=this.count;if(Cs.geometry=this.geometry,Cs.material=this.material,Cs.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ms.copy(this.boundingSphere),Ms.applyMatrix4(n),t.ray.intersectsSphere(Ms)!==!1))for(let r=0;r<i;r++){this.getMatrixAt(r,da),q0.multiplyMatrices(n,da),Cs.matrixWorld=q0,Cs.raycast(t,Pc);for(let a=0,s=Pc.length;a<s;a++){let l=Pc[a];l.instanceId=r,l.object=this,e.push(l)}Pc.length=0}}setColorAt(t,e){return this.instanceColor===null&&(this.instanceColor=new $o(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),e.toArray(this.instanceColor.array,t*3),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,t*16),this}setMorphAt(t,e){let n=e.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new Sa(new Float32Array(i*this.count),i,this.count,bd,ui));let r=this.morphTexture.source.data.data,a=0;for(let c=0;c<n.length;c++)a+=n[c];let s=this.geometry.morphTargetsRelative?1:1-a,l=i*t;return r[l]=s,r.set(n,l+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},Nh=new j,nS=new j,iS=new mt,ji=class{constructor(t=new j(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Nh.subVectors(n,e).cross(nS.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,n=!0){let i=t.delta(Nh),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let a=-(t.start.dot(this.normal)+this.constant)/r;return n===!0&&(a<0||a>1)?null:e.copy(t.start).addScaledVector(i,a)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||iS.getNormalMatrix(t),i=this.coplanarPoint(Nh).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},mr=new jn,oS=new At(.5,.5),Ac=new j,Ea=class{constructor(t=new ji,e=new ji,n=new ji,i=new ji,r=new ji,a=new ji){this.planes=[t,e,n,i,r,a]}set(t,e,n,i,r,a){let s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=Ai,n=!1){let i=this.planes,r=t.elements,a=r[0],s=r[1],l=r[2],c=r[3],h=r[4],p=r[5],m=r[6],x=r[7],M=r[8],S=r[9],y=r[10],C=r[11],I=r[12],L=r[13],k=r[14],H=r[15];if(i[0].setComponents(c-a,x-h,C-M,H-I).normalize(),i[1].setComponents(c+a,x+h,C+M,H+I).normalize(),i[2].setComponents(c+s,x+p,C+S,H+L).normalize(),i[3].setComponents(c-s,x-p,C-S,H-L).normalize(),n)i[4].setComponents(l,m,y,k).normalize(),i[5].setComponents(c-l,x-m,C-y,H-k).normalize();else if(i[4].setComponents(c-l,x-m,C-y,H-k).normalize(),e===Ai)i[5].setComponents(c+l,x+m,C+y,H+k).normalize();else if(e===ga)i[5].setComponents(l,m,y,k).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),mr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),mr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(mr)}intersectsSprite(t){mr.center.set(0,0,0);let e=oS.distanceTo(t.center);return mr.radius=.7071067811865476+e,mr.applyMatrix4(t.matrixWorld),this.intersectsSphere(mr)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(Ac.x=i.normal.x>0?t.max.x:t.min.x,Ac.y=i.normal.y>0?t.max.y:t.min.y,Ac.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Ac)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};var Ta=class extends Kn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new dt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},Jc=new j,Qc=new j,Y0=new Ct,ws=new yr,Ic=new jn,Lh=new j,j0=new j,Cr=class extends En{constructor(t=new qn,e=new Ta){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[0];for(let i=1,r=e.count;i<r;i++)Jc.fromBufferAttribute(e,i-1),Qc.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=Jc.distanceTo(Qc);t.setAttribute("lineDistance",new Wn(n,1))}else Ke("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ic.copy(n.boundingSphere),Ic.applyMatrix4(i),Ic.radius+=r,t.ray.intersectsSphere(Ic)===!1)return;Y0.copy(i).invert(),ws.copy(t.ray).applyMatrix4(Y0);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,c=this.isLineSegments?2:1,h=n.index,m=n.attributes.position;if(h!==null){let x=Math.max(0,a.start),M=Math.min(h.count,a.start+a.count);for(let S=x,y=M-1;S<y;S+=c){let C=h.getX(S),I=h.getX(S+1),L=Oc(this,t,ws,l,C,I,S);L&&e.push(L)}if(this.isLineLoop){let S=h.getX(M-1),y=h.getX(x),C=Oc(this,t,ws,l,S,y,M-1);C&&e.push(C)}}else{let x=Math.max(0,a.start),M=Math.min(m.count,a.start+a.count);for(let S=x,y=M-1;S<y;S+=c){let C=Oc(this,t,ws,l,S,S+1,S);C&&e.push(C)}if(this.isLineLoop){let S=Oc(this,t,ws,l,M-1,x,M-1);S&&e.push(S)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){let s=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}};function Oc(o,t,e,n,i,r,a){let s=o.geometry.attributes.position;if(Jc.fromBufferAttribute(s,i),Qc.fromBufferAttribute(s,r),e.distanceSqToSegment(Jc,Qc,Lh,j0)>n)return;Lh.applyMatrix4(o.matrixWorld);let c=t.ray.origin.distanceTo(Lh);if(!(c<t.near||c>t.far))return{distance:c,point:j0.clone().applyMatrix4(o.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:o}}var K0=new j,Z0=new j,Fs=class extends Cr{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let e=t.attributes.position,n=[];for(let i=0,r=e.count;i<r;i+=2)K0.fromBufferAttribute(e,i),Z0.fromBufferAttribute(e,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+K0.distanceTo(Z0);t.setAttribute("lineDistance",new Wn(n,1))}else Ke("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},Vs=class extends Cr{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}},Pa=class extends Kn{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new dt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},J0=new Ct,qh=new yr,Dc=new jn,kc=new j,Bs=class extends En{constructor(t=new qn,e=new Pa){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Dc.copy(n.boundingSphere),Dc.applyMatrix4(i),Dc.radius+=r,t.ray.intersectsSphere(Dc)===!1)return;J0.copy(i).invert(),qh.copy(t.ray).applyMatrix4(J0);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,c=n.index,p=n.attributes.position;if(c!==null){let m=Math.max(0,a.start),x=Math.min(c.count,a.start+a.count);for(let M=m,S=x;M<S;M++){let y=c.getX(M);kc.fromBufferAttribute(p,y),Q0(kc,y,l,i,t,e,this)}}else{let m=Math.max(0,a.start),x=Math.min(p.count,a.start+a.count);for(let M=m,S=x;M<S;M++)kc.fromBufferAttribute(p,M),Q0(kc,M,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){let s=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=r}}}}};function Q0(o,t,e,n,i,r,a){let s=qh.distanceSqToPoint(o);if(s<e){let l=new j;qh.closestPointToPoint(o,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}var ed=class extends ei{constructor(t,e,n,i,r,a,s,l,c,h,p,m){super(null,a,s,l,c,h,i,r,p,m),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}};var Us=class extends ei{constructor(t=[],e=jo,n,i,r,a,s,l,c,h){super(t,e,n,i,r,a,s,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}};var wo=class extends ei{constructor(t,e,n=Li,i,r,a,s=fn,l=fn,c,h=Zi,p=1){if(h!==Zi&&h!==Ko)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");let m={width:t,height:e,depth:p};super(m,i,r,a,s,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new xa(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},td=class extends wo{constructor(t,e=Li,n=jo,i,r,a=fn,s=fn,l,c=Zi){let h={width:t,height:t,depth:1},p=[h,h,h,h,h,h];super(t,t,e,n,i,r,a,s,l,c),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}},zs=class extends ei{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}},Aa=class o extends qn{constructor(t=1,e=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};let s=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);let l=[],c=[],h=[],p=[],m=0,x=0;M("z","y","x",-1,-1,n,e,t,a,r,0),M("z","y","x",1,-1,n,e,-t,a,r,1),M("x","z","y",1,1,t,n,e,i,a,2),M("x","z","y",1,-1,t,n,-e,i,a,3),M("x","y","z",1,-1,t,e,n,i,r,4),M("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new Wn(c,3)),this.setAttribute("normal",new Wn(h,3)),this.setAttribute("uv",new Wn(p,2));function M(S,y,C,I,L,k,H,V,G,E,B){let Y=k/G,U=H/E,ee=k/2,de=H/2,fe=V/2,$=G+1,ae=E+1,J=0,Ce=0,Se=new j;for(let Ve=0;Ve<ae;Ve++){let Ye=Ve*U-de;for(let Ze=0;Ze<$;Ze++){let It=Ze*Y-ee;Se[S]=It*I,Se[y]=Ye*L,Se[C]=fe,c.push(Se.x,Se.y,Se.z),Se[S]=0,Se[y]=0,Se[C]=V>0?1:-1,h.push(Se.x,Se.y,Se.z),p.push(Ze/G),p.push(1-Ve/E),J+=1}}for(let Ve=0;Ve<E;Ve++)for(let Ye=0;Ye<G;Ye++){let Ze=m+Ye+$*Ve,It=m+Ye+$*(Ve+1),ut=m+(Ye+1)+$*(Ve+1),it=m+(Ye+1)+$*Ve;l.push(Ze,It,it),l.push(It,ut,it),Ce+=6}s.addGroup(x,Ce,B),x+=Ce,m+=J}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new o(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};var Hs=class o extends qn{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let r=t/2,a=e/2,s=Math.floor(n),l=Math.floor(i),c=s+1,h=l+1,p=t/s,m=e/l,x=[],M=[],S=[],y=[];for(let C=0;C<h;C++){let I=C*m-a;for(let L=0;L<c;L++){let k=L*p-r;M.push(k,-I,0),S.push(0,0,1),y.push(L/s),y.push(1-C/l)}}for(let C=0;C<l;C++)for(let I=0;I<s;I++){let L=I+c*C,k=I+c*(C+1),H=I+1+c*(C+1),V=I+1+c*C;x.push(L,k,V),x.push(k,H,V)}this.setIndex(x),this.setAttribute("position",new Wn(M,3)),this.setAttribute("normal",new Wn(S,3)),this.setAttribute("uv",new Wn(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new o(t.width,t.height,t.widthSegments,t.heightSegments)}};function Ir(o){let t={};for(let e in o){t[e]={};for(let n in o[e]){let i=o[e][n];if(e_(i))i.isRenderTargetTexture?(Ke("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone();else if(Array.isArray(i))if(e_(i[0])){let r=[];for(let a=0,s=i.length;a<s;a++)r[a]=i[a].clone();t[e][n]=r}else t[e][n]=i.slice();else t[e][n]=i}}return t}function Un(o){let t={};for(let e=0;e<o.length;e++){let n=Ir(o[e]);for(let i in n)t[i]=n[i]}return t}function e_(o){return o&&(o.isColor||o.isMatrix3||o.isMatrix4||o.isVector2||o.isVector3||o.isVector4||o.isTexture||o.isQuaternion)}function rS(o){let t=[];for(let e=0;e<o.length;e++)t.push(o[e].clone());return t}function yp(o){let t=o.getRenderTarget();return t===null?o.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:St.workingColorSpace}var X_={clone:Ir,merge:Un},aS=`void main() {
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
}`,sS=`void main() {
|
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
}`,di=class extends Kn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=aS,this.fragmentShader=sS,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ir(t.uniforms),this.uniformsGroups=rS(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let a=this.uniforms[i].value;a&&a.isTexture?e.uniforms[i]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[i]={type:"m4",value:a.toArray()}:e.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},nd=class extends di{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}},So=class extends Kn{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new dt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Zd,this.normalScale=new At(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ba,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},Zn=class extends So{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new At(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Pt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new dt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new dt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new dt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}};var id=class extends Kn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=D_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},od=class extends Kn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}};function Rc(o,t){return!o||o.constructor===t?o:typeof t.BYTES_PER_ELEMENT=="number"?new t(o):Array.prototype.slice.call(o)}function lS(o){function t(i,r){return o[i]-o[r]}let e=o.length,n=new Array(e);for(let i=0;i!==e;++i)n[i]=i;return n.sort(t),n}function t_(o,t,e){let n=o.length,i=new o.constructor(n);for(let r=0,a=0;a!==n;++r){let s=e[r]*t;for(let l=0;l!==t;++l)i[a++]=o[s+l]}return i}function q_(o,t,e,n){let i=1,r=o[0];for(;r!==void 0&&r[n]===void 0;)r=o[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(t.push(r.time),e.push(...a)),r=o[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(t.push(r.time),a.toArray(e,e.length)),r=o[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(t.push(r.time),e.push(a)),r=o[i++];while(r!==void 0)}var Qi=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];n:{e:{let a;t:{i:if(!(t<i)){for(let s=n+2;;){if(i===void 0){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===s)break;if(r=i,i=e[++n],t<i)break e}a=e.length;break t}if(!(t>=r)){let s=e[1];t<s&&(n=2,r=s);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=e[--n-1],t>=r)break e}a=n,n=0;break t}break n}for(;n<a;){let s=n+a>>>1;t<e[s]?a=s:n=s+1}if(i=e[n],r=e[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let a=0;a!==i;++a)e[a]=n[r+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},rd=class extends Qi{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Hh,endingEnd:Hh}}intervalChanged_(t,e,n){let i=this.parameterPositions,r=t-2,a=t+1,s=i[r],l=i[a];if(s===void 0)switch(this.getSettings_().endingStart){case Gh:r=t,s=2*e-n;break;case Wh:r=i.length-2,s=e+i[r]-i[r+1];break;default:r=t,s=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Gh:a=t,l=2*n-e;break;case Wh:a=1,l=n+i[1]-i[0];break;default:a=t-1,l=e}let c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-s),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(t,e,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=t*s,c=l-s,h=this._offsetPrev,p=this._offsetNext,m=this._weightPrev,x=this._weightNext,M=(n-e)/(i-e),S=M*M,y=S*M,C=-m*y+2*m*S-m*M,I=(1+m)*y+(-1.5-2*m)*S+(-.5+m)*M+1,L=(-1-x)*y+(1.5+x)*S+.5*M,k=x*y-x*S;for(let H=0;H!==s;++H)r[H]=C*a[h+H]+I*a[c+H]+L*a[l+H]+k*a[p+H];return r}},ad=class extends Qi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=t*s,c=l-s,h=(n-e)/(i-e),p=1-h;for(let m=0;m!==s;++m)r[m]=a[c+m]*p+a[l+m]*h;return r}},sd=class extends Qi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},ld=class extends Qi{interpolate_(t,e,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=t*s,c=l-s,h=this.settings||this.DefaultSettings_,p=h.inTangents,m=h.outTangents;if(!p||!m){let S=(n-e)/(i-e),y=1-S;for(let C=0;C!==s;++C)r[C]=a[c+C]*y+a[l+C]*S;return r}let x=s*2,M=t-1;for(let S=0;S!==s;++S){let y=a[c+S],C=a[l+S],I=M*x+S*2,L=m[I],k=m[I+1],H=t*x+S*2,V=p[H],G=p[H+1],E=(n-e)/(i-e),B,Y,U,ee,de;for(let fe=0;fe<8;fe++){B=E*E,Y=B*E,U=1-E,ee=U*U,de=ee*U;let ae=de*e+3*ee*E*L+3*U*B*V+Y*i-n;if(Math.abs(ae)<1e-10)break;let J=3*ee*(L-e)+6*U*E*(V-L)+3*B*(i-V);if(Math.abs(J)<1e-10)break;E=E-ae/J,E=Math.max(0,Math.min(1,E))}r[S]=de*y+3*ee*E*k+3*U*B*G+Y*C}return r}},Jn=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Rc(e,this.TimeBufferType),this.values=Rc(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Rc(t.times,Array),values:Rc(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new sd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new ad(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new rd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new ld(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.settings=this.settings),e}setInterpolation(t){let e;switch(t){case vr:e=this.InterpolantFactoryMethodDiscrete;break;case xr:e=this.InterpolantFactoryMethodLinear;break;case Fc:e=this.InterpolantFactoryMethodSmooth;break;case zh:e=this.InterpolantFactoryMethodBezier;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ke("KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vr;case this.InterpolantFactoryMethodLinear:return xr;case this.InterpolantFactoryMethodSmooth:return Fc;case this.InterpolantFactoryMethodBezier:return zh}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,r=0,a=i-1;for(;r!==i&&n[r]<t;)++r;for(;a!==-1&&n[a]>e;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);let s=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*s,a*s)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(st("KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,r=n.length;r===0&&(st("KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let s=0;s!==r;s++){let l=n[s];if(typeof l=="number"&&isNaN(l)){st("KeyframeTrack: Time is not a valid number.",this,s,l),t=!1;break}if(a!==null&&a>l){st("KeyframeTrack: Out of order keys.",this,s,l,a),t=!1;break}a=l}if(i!==void 0&&yw(i))for(let s=0,l=i.length;s!==l;++s){let c=i[s];if(isNaN(c)){st("KeyframeTrack: Value is not a valid number.",this,s,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Fc,r=t.length-1,a=1;for(let s=1;s<r;++s){let l=!1,c=t[s],h=t[s+1];if(c!==h&&(s!==1||c!==t[0]))if(i)l=!0;else{let p=s*n,m=p-n,x=p+n;for(let M=0;M!==n;++M){let S=e[p+M];if(S!==e[m+M]||S!==e[x+M]){l=!0;break}}}if(l){if(s!==a){t[a]=t[s];let p=s*n,m=a*n;for(let x=0;x!==n;++x)e[m+x]=e[p+x]}++a}}if(r>0){t[a]=t[r];for(let s=r*n,l=a*n,c=0;c!==n;++c)e[l+c]=e[s+c];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Jn.prototype.ValueTypeName="";Jn.prototype.TimeBufferType=Float32Array;Jn.prototype.ValueBufferType=Float32Array;Jn.prototype.DefaultInterpolation=xr;var Eo=class extends Jn{constructor(t,e,n){super(t,e,n)}};Eo.prototype.ValueTypeName="bool";Eo.prototype.ValueBufferType=Array;Eo.prototype.DefaultInterpolation=vr;Eo.prototype.InterpolantFactoryMethodLinear=void 0;Eo.prototype.InterpolantFactoryMethodSmooth=void 0;var Gs=class extends Jn{constructor(t,e,n,i){super(t,e,n,i)}};Gs.prototype.ValueTypeName="color";var eo=class extends Jn{constructor(t,e,n,i){super(t,e,n,i)}};eo.prototype.ValueTypeName="number";var cd=class extends Qi{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(n-e)/(i-e),c=t*s;for(let h=c+s;c!==h;c+=4)ai.slerpFlat(r,0,a,c-s,a,c,l);return r}},to=class extends Jn{constructor(t,e,n,i){super(t,e,n,i)}InterpolantFactoryMethodLinear(t){return new cd(this.times,this.values,this.getValueSize(),t)}};to.prototype.ValueTypeName="quaternion";to.prototype.InterpolantFactoryMethodSmooth=void 0;var To=class extends Jn{constructor(t,e,n){super(t,e,n)}};To.prototype.ValueTypeName="string";To.prototype.ValueBufferType=Array;To.prototype.DefaultInterpolation=vr;To.prototype.InterpolantFactoryMethodLinear=void 0;To.prototype.InterpolantFactoryMethodSmooth=void 0;var no=class extends Jn{constructor(t,e,n,i){super(t,e,n,i)}};no.prototype.ValueTypeName="vector";var Ws=class{constructor(t="",e=-1,n=[],i=O_){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Oi(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],n=t.tracks,i=1/(t.fps||1);for(let a=0,s=n.length;a!==s;++a)e.push(dS(n[a]).scale(i));let r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r.userData=JSON.parse(t.userData||"{}"),r}static toJSON(t){let e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let r=0,a=n.length;r!==a;++r)e.push(Jn.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(t,e,n,i){let r=e.length,a=[];for(let s=0;s<r;s++){let l=[],c=[];l.push((s+r-1)%r,s,(s+1)%r),c.push(0,1,0);let h=lS(l);l=t_(l,1,h),c=t_(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new eo(".morphTargetInfluences["+e[s].name+"]",l,c).scale(1/n))}return new this(t,-1,a)}static findByName(t,e){let n=t;if(!Array.isArray(t)){let i=t;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null}static CreateClipsFromMorphTargetSequences(t,e,n){let i={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,l=t.length;s<l;s++){let c=t[s],h=c.name.match(r);if(h&&h.length>1){let p=h[1],m=i[p];m||(i[p]=m=[]),m.push(c)}}let a=[];for(let s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],e,n));return a}static parseAnimation(t,e){if(Ke("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return st("AnimationClip: No animation in JSONLoader data."),null;let n=function(p,m,x,M,S){if(x.length!==0){let y=[],C=[];q_(x,y,C,M),y.length!==0&&S.push(new p(m,y,C))}},i=[],r=t.name||"default",a=t.fps||30,s=t.blendMode,l=t.length||-1,c=t.hierarchy||[];for(let p=0;p<c.length;p++){let m=c[p].keys;if(!(!m||m.length===0))if(m[0].morphTargets){let x={},M;for(M=0;M<m.length;M++)if(m[M].morphTargets)for(let S=0;S<m[M].morphTargets.length;S++)x[m[M].morphTargets[S]]=-1;for(let S in x){let y=[],C=[];for(let I=0;I!==m[M].morphTargets.length;++I){let L=m[M];y.push(L.time),C.push(L.morphTarget===S?1:0)}i.push(new eo(".morphTargetInfluence["+S+"]",y,C))}l=x.length*a}else{let x=".bones["+e[p].name+"]";n(no,x+".position",m,"pos",i),n(to,x+".quaternion",m,"rot",i),n(no,x+".scale",m,"scl",i)}}return i.length===0?null:new this(r,l,i,s)}resetDuration(){let t=this.tracks,e=0;for(let n=0,i=t.length;n!==i;++n){let r=this.tracks[n];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let n=0;n<this.tracks.length;n++)t.push(this.tracks[n].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}};function cS(o){switch(o.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return eo;case"vector":case"vector2":case"vector3":case"vector4":return no;case"color":return Gs;case"quaternion":return to;case"bool":case"boolean":return Eo;case"string":return To}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+o)}function dS(o){if(o.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=cS(o.type);if(o.times===void 0){let e=[],n=[];q_(o.keys,e,n,"value"),o.times=e,o.values=n}return t.parse!==void 0?t.parse(o):new t(o.name,o.times,o.values,o.interpolation)}var Ki={enabled:!1,files:{},add:function(o,t){this.enabled!==!1&&(n_(o)||(this.files[o]=t))},get:function(o){if(this.enabled!==!1&&!n_(o))return this.files[o]},remove:function(o){delete this.files[o]},clear:function(){this.files={}}};function n_(o){try{let t=o.slice(o.indexOf(":")+1);return new URL(t).protocol==="blob:"}catch{return!1}}var dd=class{constructor(t,e,n){let i=this,r=!1,a=0,s=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this._abortController=null,this.itemStart=function(h){s++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,s),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,s),a===s&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,p){return c.push(h,p),this},this.removeHandler=function(h){let p=c.indexOf(h);return p!==-1&&c.splice(p,2),this},this.getHandler=function(h){for(let p=0,m=c.length;p<m;p+=2){let x=c[p],M=c[p+1];if(x.global&&(x.lastIndex=0),x.test(h))return M}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}},$_=new dd,Jo=(()=>{class o{constructor(e){this.manager=e!==void 0?e:$_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,n){let i=this;return new Promise(function(r,a){i.load(e,r,n,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}return o.DEFAULT_MATERIAL_NAME="__DEFAULT",o})(),Co={},$h=class extends Error{constructor(t,e){super(t),this.response=e}},Mr=class extends Jo{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let r=Ki.get(`file:${t}`);if(r!==void 0){this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0);return}if(Co[t]!==void 0){Co[t].push({onLoad:e,onProgress:n,onError:i});return}Co[t]=[],Co[t].push({onLoad:e,onProgress:n,onError:i});let a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&Ke("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let h=Co[t],p=c.body.getReader(),m=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),x=m?parseInt(m):0,M=x!==0,S=0,y=new ReadableStream({start(C){I();function I(){p.read().then(({done:L,value:k})=>{if(L)C.close();else{S+=k.byteLength;let H=new ProgressEvent("progress",{lengthComputable:M,loaded:S,total:x});for(let V=0,G=h.length;V<G;V++){let E=h[V];E.onProgress&&E.onProgress(H)}C.enqueue(k),I()}},L=>{C.error(L)})}}});return new Response(y)}else throw new $h(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,s));case"json":return c.json();default:if(s==="")return c.text();{let p=/charset="?([^;"\s]*)"?/i.exec(s),m=p&&p[1]?p[1].toLowerCase():void 0,x=new TextDecoder(m);return c.arrayBuffer().then(M=>x.decode(M))}}}).then(c=>{Ki.add(`file:${t}`,c);let h=Co[t];delete Co[t];for(let p=0,m=h.length;p<m;p++){let x=h[p];x.onLoad&&x.onLoad(c)}}).catch(c=>{let h=Co[t];if(h===void 0)throw this.manager.itemError(t),c;delete Co[t];for(let p=0,m=h.length;p<m;p++){let x=h[p];x.onError&&x.onError(c)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}};var Xs=class extends Jo{constructor(t){super(t)}load(t,e,n,i){let r=this,a=[],s=new ed,l=new Mr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(r.withCredentials);let c=0;function h(p){l.load(t[p],function(m){let x=r.parse(m,!0);a[p]={width:x.width,height:x.height,format:x.format,mipmaps:x.mipmaps},c+=1,c===6&&(x.mipmapCount===1&&(s.minFilter=sn),s.image=a,s.format=x.format,s.needsUpdate=!0,e&&e(s))},n,i)}if(Array.isArray(t))for(let p=0,m=t.length;p<m;++p)h(p);else l.load(t,function(p){let m=r.parse(p,!0);if(m.isCubemap){let x=m.mipmaps.length/m.mipmapCount;for(let M=0;M<x;M++){a[M]={mipmaps:[]};for(let S=0;S<m.mipmapCount;S++)a[M].mipmaps.push(m.mipmaps[M*m.mipmapCount+S]),a[M].format=m.format,a[M].width=m.width,a[M].height=m.height}s.image=a}else s.image.width=m.width,s.image.height=m.height,s.mipmaps=m.mipmaps;m.mipmapCount===1&&(s.minFilter=sn),s.format=m.format,s.needsUpdate=!0,e&&e(s)},n,i);return s}},ua=new WeakMap,ud=class extends Jo{constructor(t){super(t)}load(t,e,n,i){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,a=Ki.get(`image:${t}`);if(a!==void 0){if(a.complete===!0)r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0);else{let p=ua.get(a);p===void 0&&(p=[],ua.set(a,p)),p.push({onLoad:e,onError:i})}return a}let s=_a("img");function l(){h(),e&&e(this);let p=ua.get(this)||[];for(let m=0;m<p.length;m++){let x=p[m];x.onLoad&&x.onLoad(this)}ua.delete(this),r.manager.itemEnd(t)}function c(p){h(),i&&i(p),Ki.remove(`image:${t}`);let m=ua.get(this)||[];for(let x=0;x<m.length;x++){let M=m[x];M.onError&&M.onError(p)}ua.delete(this),r.manager.itemError(t),r.manager.itemEnd(t)}function h(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),Ki.add(`image:${t}`,s),r.manager.itemStart(t),s.src=t,s}};var qs=class extends Jo{constructor(t){super(t)}load(t,e,n,i){let r=new ei,a=new ud(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(s){r.image=s,r.needsUpdate=!0,e!==void 0&&e(r)},n,i),r}},wr=class extends En{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new dt(t),this.intensity=e}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}};var Fh=new Ct,i_=new j,o_=new j,$s=class{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new At(512,512),this.mapType=Qn,this.map=null,this.mapPass=null,this.matrix=new Ct,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ea,this._frameExtents=new At(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;i_.setFromMatrixPosition(t.matrixWorld),e.position.copy(i_),o_.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(o_),e.updateMatrixWorld(),Fh.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Fh,e.coordinateSystem,e.reversedDepth),e.coordinateSystem===ga||e.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Fh)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}},Nc=new j,Lc=new ai,Yi=new j,Ys=class extends En{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ct,this.projectionMatrix=new Ct,this.projectionMatrixInverse=new Ct,this.coordinateSystem=Ai,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(Nc,Lc,Yi),Yi.x===1&&Yi.y===1&&Yi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Nc,Lc,Yi.set(1,1,1)).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorld.decompose(Nc,Lc,Yi),Yi.x===1&&Yi.y===1&&Yi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Nc,Lc,Yi.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}},Wo=new j,r_=new At,a_=new At,xn=class extends Ys{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=br*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(Ss*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return br*2*Math.atan(Math.tan(Ss*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Wo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Wo.x,Wo.y).multiplyScalar(-t/Wo.z),Wo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Wo.x,Wo.y).multiplyScalar(-t/Wo.z)}getViewSize(t,e){return this.getViewBounds(t,r_,a_),e.subVectors(a_,r_)}setViewOffset(t,e,n,i,r,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(Ss*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,a=this.view;if(this.view!==null&&this.view.enabled){let l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,e-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}let s=this.filmOffset;s!==0&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Yh=class extends $s{constructor(){super(new xn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,n=br*2*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=t.distance||e.far;(n!==e.fov||i!==e.aspect||r!==e.far)&&(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}},js=class extends wr{constructor(t,e,n=0,i=Math.PI/3,r=0,a=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(En.DEFAULT_UP),this.updateMatrix(),this.target=new En,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new Yh}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}},jh=class extends $s{constructor(){super(new xn(90,1,.5,500)),this.isPointLightShadow=!0}},Ks=class extends wr{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new jh}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}},Yo=class extends Ys{constructor(t=-1,e=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,a=n+t,s=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,s-=h*this.view.offsetY,l=s-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Kh=class extends $s{constructor(){super(new Yo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Po=class extends wr{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(En.DEFAULT_UP),this.updateMatrix(),this.target=new En,this.shadow=new Kh}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}},Zs=class extends wr{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}};var Ao=class{static extractUrlBase(t){let e=t.lastIndexOf("/");return e===-1?"./":t.slice(0,e+1)}static resolveURL(t,e){return typeof t!="string"||t===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}};var Vh=new WeakMap,Js=class extends Jo{constructor(t){super(t),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&Ke("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&Ke("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(t){return this.options=t,this}load(t,e,n,i){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,a=Ki.get(`image-bitmap:${t}`);if(a!==void 0){if(r.manager.itemStart(t),a.then){a.then(c=>{Vh.has(a)===!0?(i&&i(Vh.get(a)),r.manager.itemError(t),r.manager.itemEnd(t)):(e&&e(c),r.manager.itemEnd(t))});return}setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0);return}let s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader,s.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let l=fetch(t,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){Ki.add(`image-bitmap:${t}`,c),e&&e(c),r.manager.itemEnd(t)}).catch(function(c){i&&i(c),Vh.set(l,c),Ki.remove(`image-bitmap:${t}`),r.manager.itemError(t),r.manager.itemEnd(t)});Ki.add(`image-bitmap:${t}`,l),r.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}};var ha=-90,pa=1,hd=class extends En{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new xn(ha,pa,t,e);i.layers=this.layers,this.add(i);let r=new xn(ha,pa,t,e);r.layers=this.layers,this.add(r);let a=new xn(ha,pa,t,e);a.layers=this.layers,this.add(a);let s=new xn(ha,pa,t,e);s.layers=this.layers,this.add(s);let l=new xn(ha,pa,t,e);l.layers=this.layers,this.add(l);let c=new xn(ha,pa,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,r,a,s,l]=e;for(let c of e)this.remove(c);if(t===Ai)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===ga)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,l,c,h]=this.children,p=t.getRenderTarget(),m=t.getActiveCubeFace(),x=t.getActiveMipmapLevel(),M=t.xr.enabled;t.xr.enabled=!1;let S=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let y=!1;t.isWebGLRenderer===!0?y=t.state.buffers.depth.getReversed():y=t.reversedDepthBuffer,t.setRenderTarget(n,0,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,r),t.setRenderTarget(n,1,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,a),t.setRenderTarget(n,2,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,s),t.setRenderTarget(n,3,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,l),t.setRenderTarget(n,4,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,c),n.texture.generateMipmaps=S,t.setRenderTarget(n,5,i),y&&t.autoClear===!1&&t.clearDepth(),t.render(e,h),t.setRenderTarget(p,m,x),t.xr.enabled=M,n.texture.needsPMREMUpdate=!0}},pd=class extends xn{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}};var Cp="\\[\\]\\.:\\/",uS=new RegExp("["+Cp+"]","g"),Mp="[^"+Cp+"]",hS="[^"+Cp.replace("\\.","")+"]",pS=/((?:WC+[\/:])*)/.source.replace("WC",Mp),mS=/(WCOD+)?/.source.replace("WCOD",hS),fS=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Mp),gS=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Mp),_S=new RegExp("^"+pS+mS+fS+gS+"$"),vS=["material","materials","bones","map"],Zh=class{constructor(t,e,n){let i=n||rn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},rn=(()=>{class o{constructor(e,n,i){this.path=n,this.parsedPath=i||o.parseTrackName(n),this.node=o.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new o.Composite(e,n,i):new o(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(uS,"")}static parseTrackName(e){let n=_S.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){let a=i.nodeName.substring(r+1);vS.indexOf(a)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=a)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){let i=function(a){for(let s=0;s<a.length;s++){let l=a[s];if(l.name===n||l.uuid===n)return l;let c=i(l.children);if(c)return c}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[n++]=i[r]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++]}_setValue_array_setNeedsUpdate(e,n){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node,n=this.parsedPath,i=n.objectName,r=n.propertyName,a=n.propertyIndex;if(e||(e=o.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ke("PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let h=n.objectIndex;switch(i){case"materials":if(!e.material){st("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){st("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){st("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===h){h=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){st("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){st("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){st("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(h!==void 0){if(e[h]===void 0){st("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}let s=e[r];if(s===void 0){let h=n.nodeName;st("PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?l=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){st("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){st("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}return o.Composite=Zh,o})();rn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};rn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};rn.prototype.GetterByBindingType=[rn.prototype._getValue_direct,rn.prototype._getValue_array,rn.prototype._getValue_arrayElement,rn.prototype._getValue_toArray];rn.prototype.SetterByBindingTypeAndVersioning=[[rn.prototype._setValue_direct,rn.prototype._setValue_direct_setNeedsUpdate,rn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[rn.prototype._setValue_array,rn.prototype._setValue_array_setNeedsUpdate,rn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[rn.prototype._setValue_arrayElement,rn.prototype._setValue_arrayElement_setNeedsUpdate,rn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[rn.prototype._setValue_fromArray,rn.prototype._setValue_fromArray_setNeedsUpdate,rn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var zN=new Float32Array(1);var Jh=class o{static{o.prototype.isMatrix2=!0}constructor(t,e,n,i){this.elements=[1,0,0,1],t!==void 0&&this.set(t,e,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let n=0;n<4;n++)this.elements[n]=t[n+e];return this}set(t,e,n,i){let r=this.elements;return r[0]=t,r[2]=e,r[1]=n,r[3]=i,this}};function wp(o,t,e,n){let i=xS(n);switch(e){case fp:return o*t;case bd:return o*t/i.components*i.byteLength;case yd:return o*t/i.components*i.byteLength;case Zo:return o*t*2/i.components*i.byteLength;case Cd:return o*t*2/i.components*i.byteLength;case gp:return o*t*3/i.components*i.byteLength;case Bn:return o*t*4/i.components*i.byteLength;case Md:return o*t*4/i.components*i.byteLength;case Tr:case nl:return Math.floor((o+3)/4)*Math.floor((t+3)/4)*8;case Pr:case Ar:return Math.floor((o+3)/4)*Math.floor((t+3)/4)*16;case Sd:case Td:return Math.max(o,16)*Math.max(t,8)/4;case wd:case Ed:return Math.max(o,8)*Math.max(t,8)/2;case Ra:case Pd:case Id:case Od:return Math.floor((o+3)/4)*Math.floor((t+3)/4)*8;case Ad:case il:case Dd:return Math.floor((o+3)/4)*Math.floor((t+3)/4)*16;case kd:return Math.floor((o+3)/4)*Math.floor((t+3)/4)*16;case Rd:return Math.floor((o+4)/5)*Math.floor((t+3)/4)*16;case Nd:return Math.floor((o+4)/5)*Math.floor((t+4)/5)*16;case Ld:return Math.floor((o+5)/6)*Math.floor((t+4)/5)*16;case Fd:return Math.floor((o+5)/6)*Math.floor((t+5)/6)*16;case Vd:return Math.floor((o+7)/8)*Math.floor((t+4)/5)*16;case Bd:return Math.floor((o+7)/8)*Math.floor((t+5)/6)*16;case Ud:return Math.floor((o+7)/8)*Math.floor((t+7)/8)*16;case zd:return Math.floor((o+9)/10)*Math.floor((t+4)/5)*16;case Hd:return Math.floor((o+9)/10)*Math.floor((t+5)/6)*16;case Gd:return Math.floor((o+9)/10)*Math.floor((t+7)/8)*16;case Wd:return Math.floor((o+9)/10)*Math.floor((t+9)/10)*16;case Xd:return Math.floor((o+11)/12)*Math.floor((t+9)/10)*16;case qd:return Math.floor((o+11)/12)*Math.floor((t+11)/12)*16;case $d:case Na:case La:return Math.ceil(o/4)*Math.ceil(t/4)*16;case Yd:case jd:return Math.ceil(o/4)*Math.ceil(t/4)*8;case ol:case Kd:return Math.ceil(o/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function xS(o){switch(o){case Qn:case dp:return{byteLength:1,components:1};case Da:case up:case oo:return{byteLength:2,components:1};case vd:case xd:return{byteLength:2,components:4};case Li:case _d:case ui:return{byteLength:4,components:1};case hp:case pp:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${o}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"184"}}));typeof window<"u"&&(window.__THREE__?Ke("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="184");function gv(){let o=null,t=!1,e=null,n=null;function i(r,a){e(r,a),n=o.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&o!==null&&(n=o.requestAnimationFrame(i),t=!0)},stop:function(){o!==null&&o.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(r){e=r},setContext:function(r){o=r}}}function yS(o){let t=new WeakMap;function e(s,l){let c=s.array,h=s.usage,p=c.byteLength,m=o.createBuffer();o.bindBuffer(l,m),o.bufferData(l,c,h),s.onUploadCallback();let x;if(c instanceof Float32Array)x=o.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)x=o.HALF_FLOAT;else if(c instanceof Uint16Array)s.isFloat16BufferAttribute?x=o.HALF_FLOAT:x=o.UNSIGNED_SHORT;else if(c instanceof Int16Array)x=o.SHORT;else if(c instanceof Uint32Array)x=o.UNSIGNED_INT;else if(c instanceof Int32Array)x=o.INT;else if(c instanceof Int8Array)x=o.BYTE;else if(c instanceof Uint8Array)x=o.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)x=o.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:m,type:x,bytesPerElement:c.BYTES_PER_ELEMENT,version:s.version,size:p}}function n(s,l,c){let h=l.array,p=l.updateRanges;if(o.bindBuffer(c,s),p.length===0)o.bufferSubData(c,0,h);else{p.sort((x,M)=>x.start-M.start);let m=0;for(let x=1;x<p.length;x++){let M=p[m],S=p[x];S.start<=M.start+M.count+1?M.count=Math.max(M.count,S.start+S.count-M.start):(++m,p[m]=S)}p.length=m+1;for(let x=0,M=p.length;x<M;x++){let S=p[x];o.bufferSubData(c,S.start*h.BYTES_PER_ELEMENT,h,S.start,S.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(s){return s.isInterleavedBufferAttribute&&(s=s.data),t.get(s)}function r(s){s.isInterleavedBufferAttribute&&(s=s.data);let l=t.get(s);l&&(o.deleteBuffer(l.buffer),t.delete(s))}function a(s,l){if(s.isInterleavedBufferAttribute&&(s=s.data),s.isGLBufferAttribute){let h=t.get(s);(!h||h.version<s.version)&&t.set(s,{buffer:s.buffer,type:s.type,bytesPerElement:s.elementSize,version:s.version});return}let c=t.get(s);if(c===void 0)t.set(s,e(s,l));else if(c.version<s.version){if(c.size!==s.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,s,l),c.version=s.version}}return{get:i,remove:r,update:a}}var CS=`#ifdef USE_ALPHAHASH
|
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
#endif`,MS=`#ifdef USE_ALPHAHASH
|
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
float hash2D( vec2 value ) {
|
|
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
|
}
|
|
float hash3D( vec3 value ) {
|
|
return hash2D( vec2( hash2D( value.xy ), value.z ) );
|
|
}
|
|
float getAlphaHashThreshold( vec3 position ) {
|
|
float maxDeriv = max(
|
|
length( dFdx( position.xyz ) ),
|
|
length( dFdy( position.xyz ) )
|
|
);
|
|
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
|
|
vec2 pixScales = vec2(
|
|
exp2( floor( log2( pixScale ) ) ),
|
|
exp2( ceil( log2( pixScale ) ) )
|
|
);
|
|
vec2 alpha = vec2(
|
|
hash3D( floor( pixScales.x * position.xyz ) ),
|
|
hash3D( floor( pixScales.y * position.xyz ) )
|
|
);
|
|
float lerpFactor = fract( log2( pixScale ) );
|
|
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
|
|
float a = min( lerpFactor, 1.0 - lerpFactor );
|
|
vec3 cases = vec3(
|
|
x * x / ( 2.0 * a * ( 1.0 - a ) ),
|
|
( x - 0.5 * a ) / ( 1.0 - a ),
|
|
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
|
|
);
|
|
float threshold = ( x < ( 1.0 - a ) )
|
|
? ( ( x < a ) ? cases.x : cases.y )
|
|
: cases.z;
|
|
return clamp( threshold , 1.0e-6, 1.0 );
|
|
}
|
|
#endif`,wS=`#ifdef USE_ALPHAMAP
|
|
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
#endif`,SS=`#ifdef USE_ALPHAMAP
|
|
uniform sampler2D alphaMap;
|
|
#endif`,ES=`#ifdef USE_ALPHATEST
|
|
#ifdef ALPHA_TO_COVERAGE
|
|
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
|
if ( diffuseColor.a == 0.0 ) discard;
|
|
#else
|
|
if ( diffuseColor.a < alphaTest ) discard;
|
|
#endif
|
|
#endif`,TS=`#ifdef USE_ALPHATEST
|
|
uniform float alphaTest;
|
|
#endif`,PS=`#ifdef USE_AOMAP
|
|
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
|
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
|
#if defined( USE_CLEARCOAT )
|
|
clearcoatSpecularIndirect *= ambientOcclusion;
|
|
#endif
|
|
#if defined( USE_SHEEN )
|
|
sheenSpecularIndirect *= ambientOcclusion;
|
|
#endif
|
|
#if defined( USE_ENVMAP ) && defined( STANDARD )
|
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
|
#endif
|
|
#endif`,AS=`#ifdef USE_AOMAP
|
|
uniform sampler2D aoMap;
|
|
uniform float aoMapIntensity;
|
|
#endif`,IS=`#ifdef USE_BATCHING
|
|
#if ! defined( GL_ANGLE_multi_draw )
|
|
#define gl_DrawID _gl_DrawID
|
|
uniform int _gl_DrawID;
|
|
#endif
|
|
uniform highp sampler2D batchingTexture;
|
|
uniform highp usampler2D batchingIdTexture;
|
|
mat4 getBatchingMatrix( const in float i ) {
|
|
int size = textureSize( batchingTexture, 0 ).x;
|
|
int j = int( i ) * 4;
|
|
int x = j % size;
|
|
int y = j / size;
|
|
vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
|
|
vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
|
|
vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
|
|
vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
|
|
return mat4( v1, v2, v3, v4 );
|
|
}
|
|
float getIndirectIndex( const in int i ) {
|
|
int size = textureSize( batchingIdTexture, 0 ).x;
|
|
int x = i % size;
|
|
int y = i / size;
|
|
return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
|
|
}
|
|
#endif
|
|
#ifdef USE_BATCHING_COLOR
|
|
uniform sampler2D batchingColorTexture;
|
|
vec4 getBatchingColor( const in float i ) {
|
|
int size = textureSize( batchingColorTexture, 0 ).x;
|
|
int j = int( i );
|
|
int x = j % size;
|
|
int y = j / size;
|
|
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
|
|
}
|
|
#endif`,OS=`#ifdef USE_BATCHING
|
|
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
|
|
#endif`,DS=`vec3 transformed = vec3( position );
|
|
#ifdef USE_ALPHAHASH
|
|
vPosition = vec3( position );
|
|
#endif`,kS=`vec3 objectNormal = vec3( normal );
|
|
#ifdef USE_TANGENT
|
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
#endif`,RS=`float G_BlinnPhong_Implicit( ) {
|
|
return 0.25;
|
|
}
|
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
|
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
|
|
}
|
|
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
|
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
|
|
float G = G_BlinnPhong_Implicit( );
|
|
float D = D_BlinnPhong( shininess, dotNH );
|
|
return F * ( G * D );
|
|
} // validated`,NS=`#ifdef USE_IRIDESCENCE
|
|
const mat3 XYZ_TO_REC709 = mat3(
|
|
3.2404542, -0.9692660, 0.0556434,
|
|
-1.5371385, 1.8760108, -0.2040259,
|
|
-0.4985314, 0.0415560, 1.0572252
|
|
);
|
|
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
|
|
vec3 sqrtF0 = sqrt( fresnel0 );
|
|
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
|
|
}
|
|
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
|
|
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
|
|
}
|
|
float IorToFresnel0( float transmittedIor, float incidentIor ) {
|
|
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
|
|
}
|
|
vec3 evalSensitivity( float OPD, vec3 shift ) {
|
|
float phase = 2.0 * PI * OPD * 1.0e-9;
|
|
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
|
|
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
|
|
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
|
|
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
|
|
xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
|
|
xyz /= 1.0685e-7;
|
|
vec3 rgb = XYZ_TO_REC709 * xyz;
|
|
return rgb;
|
|
}
|
|
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
|
|
vec3 I;
|
|
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
|
|
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
|
|
float cosTheta2Sq = 1.0 - sinTheta2Sq;
|
|
if ( cosTheta2Sq < 0.0 ) {
|
|
return vec3( 1.0 );
|
|
}
|
|
float cosTheta2 = sqrt( cosTheta2Sq );
|
|
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
|
|
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
|
|
float T121 = 1.0 - R12;
|
|
float phi12 = 0.0;
|
|
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
|
|
float phi21 = PI - phi12;
|
|
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
|
|
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
|
|
vec3 phi23 = vec3( 0.0 );
|
|
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
|
|
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
|
|
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
|
|
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
|
|
vec3 phi = vec3( phi21 ) + phi23;
|
|
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
|
|
vec3 r123 = sqrt( R123 );
|
|
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
|
|
vec3 C0 = R12 + Rs;
|
|
I = C0;
|
|
vec3 Cm = Rs - T121;
|
|
for ( int m = 1; m <= 2; ++ m ) {
|
|
Cm *= r123;
|
|
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
|
|
I += Cm * Sm;
|
|
}
|
|
return max( I, vec3( 0.0 ) );
|
|
}
|
|
#endif`,LS=`#ifdef USE_BUMPMAP
|
|
uniform sampler2D bumpMap;
|
|
uniform float bumpScale;
|
|
vec2 dHdxy_fwd() {
|
|
vec2 dSTdx = dFdx( vBumpMapUv );
|
|
vec2 dSTdy = dFdy( vBumpMapUv );
|
|
float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
|
|
float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
|
|
float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
|
|
return vec2( dBx, dBy );
|
|
}
|
|
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
|
|
vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
|
|
vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
|
|
vec3 vN = surf_norm;
|
|
vec3 R1 = cross( vSigmaY, vN );
|
|
vec3 R2 = cross( vN, vSigmaX );
|
|
float fDet = dot( vSigmaX, R1 ) * faceDirection;
|
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
|
}
|
|
#endif`,FS=`#if NUM_CLIPPING_PLANES > 0
|
|
vec4 plane;
|
|
#ifdef ALPHA_TO_COVERAGE
|
|
float distanceToPlane, distanceGradient;
|
|
float clipOpacity = 1.0;
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
|
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
|
clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
|
if ( clipOpacity == 0.0 ) discard;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
|
float unionClipOpacity = 1.0;
|
|
#pragma unroll_loop_start
|
|
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
|
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
|
unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
|
}
|
|
#pragma unroll_loop_end
|
|
clipOpacity *= 1.0 - unionClipOpacity;
|
|
#endif
|
|
diffuseColor.a *= clipOpacity;
|
|
if ( diffuseColor.a == 0.0 ) discard;
|
|
#else
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
|
bool clipped = true;
|
|
#pragma unroll_loop_start
|
|
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
|
plane = clippingPlanes[ i ];
|
|
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
|
|
}
|
|
#pragma unroll_loop_end
|
|
if ( clipped ) discard;
|
|
#endif
|
|
#endif
|
|
#endif`,VS=`#if NUM_CLIPPING_PLANES > 0
|
|
varying vec3 vClipPosition;
|
|
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
#endif`,BS=`#if NUM_CLIPPING_PLANES > 0
|
|
varying vec3 vClipPosition;
|
|
#endif`,US=`#if NUM_CLIPPING_PLANES > 0
|
|
vClipPosition = - mvPosition.xyz;
|
|
#endif`,zS=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
diffuseColor *= vColor;
|
|
#endif`,HS=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
varying vec4 vColor;
|
|
#endif`,GS=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
varying vec4 vColor;
|
|
#endif`,WS=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
vColor = vec4( 1.0 );
|
|
#endif
|
|
#ifdef USE_COLOR_ALPHA
|
|
vColor *= color;
|
|
#elif defined( USE_COLOR )
|
|
vColor.rgb *= color;
|
|
#endif
|
|
#ifdef USE_INSTANCING_COLOR
|
|
vColor.rgb *= instanceColor.rgb;
|
|
#endif
|
|
#ifdef USE_BATCHING_COLOR
|
|
vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
|
|
#endif`,XS=`#define PI 3.141592653589793
|
|
#define PI2 6.283185307179586
|
|
#define PI_HALF 1.5707963267948966
|
|
#define RECIPROCAL_PI 0.3183098861837907
|
|
#define RECIPROCAL_PI2 0.15915494309189535
|
|
#define EPSILON 1e-6
|
|
#ifndef saturate
|
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
|
#endif
|
|
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
|
|
float pow2( const in float x ) { return x*x; }
|
|
vec3 pow2( const in vec3 x ) { return x*x; }
|
|
float pow3( const in float x ) { return x*x*x; }
|
|
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
|
|
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
|
|
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
|
|
highp float rand( const in vec2 uv ) {
|
|
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
|
|
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
|
|
return fract( sin( sn ) * c );
|
|
}
|
|
#ifdef HIGH_PRECISION
|
|
float precisionSafeLength( vec3 v ) { return length( v ); }
|
|
#else
|
|
float precisionSafeLength( vec3 v ) {
|
|
float maxComponent = max3( abs( v ) );
|
|
return length( v / maxComponent ) * maxComponent;
|
|
}
|
|
#endif
|
|
struct IncidentLight {
|
|
vec3 color;
|
|
vec3 direction;
|
|
bool visible;
|
|
};
|
|
struct ReflectedLight {
|
|
vec3 directDiffuse;
|
|
vec3 directSpecular;
|
|
vec3 indirectDiffuse;
|
|
vec3 indirectSpecular;
|
|
};
|
|
#ifdef USE_ALPHAHASH
|
|
varying vec3 vPosition;
|
|
#endif
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
}
|
|
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
|
|
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
|
|
}
|
|
bool isPerspectiveMatrix( mat4 m ) {
|
|
return m[ 2 ][ 3 ] == - 1.0;
|
|
}
|
|
vec2 equirectUv( in vec3 dir ) {
|
|
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
|
|
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
|
|
return vec2( u, v );
|
|
}
|
|
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
|
|
return RECIPROCAL_PI * diffuseColor;
|
|
}
|
|
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
|
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
|
}
|
|
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
|
} // validated`,qS=`#ifdef ENVMAP_TYPE_CUBE_UV
|
|
#define cubeUV_minMipLevel 4.0
|
|
#define cubeUV_minTileSize 16.0
|
|
float getFace( vec3 direction ) {
|
|
vec3 absDirection = abs( direction );
|
|
float face = - 1.0;
|
|
if ( absDirection.x > absDirection.z ) {
|
|
if ( absDirection.x > absDirection.y )
|
|
face = direction.x > 0.0 ? 0.0 : 3.0;
|
|
else
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
|
} else {
|
|
if ( absDirection.z > absDirection.y )
|
|
face = direction.z > 0.0 ? 2.0 : 5.0;
|
|
else
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
|
}
|
|
return face;
|
|
}
|
|
vec2 getUV( vec3 direction, float face ) {
|
|
vec2 uv;
|
|
if ( face == 0.0 ) {
|
|
uv = vec2( direction.z, direction.y ) / abs( direction.x );
|
|
} else if ( face == 1.0 ) {
|
|
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
|
|
} else if ( face == 2.0 ) {
|
|
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
|
|
} else if ( face == 3.0 ) {
|
|
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
|
|
} else if ( face == 4.0 ) {
|
|
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
|
|
} else {
|
|
uv = vec2( direction.x, direction.y ) / abs( direction.z );
|
|
}
|
|
return 0.5 * ( uv + 1.0 );
|
|
}
|
|
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
|
|
float face = getFace( direction );
|
|
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
|
|
mipInt = max( mipInt, cubeUV_minMipLevel );
|
|
float faceSize = exp2( mipInt );
|
|
highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
|
|
if ( face > 2.0 ) {
|
|
uv.y += faceSize;
|
|
face -= 3.0;
|
|
}
|
|
uv.x += face * faceSize;
|
|
uv.x += filterInt * 3.0 * cubeUV_minTileSize;
|
|
uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
|
|
uv.x *= CUBEUV_TEXEL_WIDTH;
|
|
uv.y *= CUBEUV_TEXEL_HEIGHT;
|
|
#ifdef texture2DGradEXT
|
|
return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
|
|
#else
|
|
return texture2D( envMap, uv ).rgb;
|
|
#endif
|
|
}
|
|
#define cubeUV_r0 1.0
|
|
#define cubeUV_m0 - 2.0
|
|
#define cubeUV_r1 0.8
|
|
#define cubeUV_m1 - 1.0
|
|
#define cubeUV_r4 0.4
|
|
#define cubeUV_m4 2.0
|
|
#define cubeUV_r5 0.305
|
|
#define cubeUV_m5 3.0
|
|
#define cubeUV_r6 0.21
|
|
#define cubeUV_m6 4.0
|
|
float roughnessToMip( float roughness ) {
|
|
float mip = 0.0;
|
|
if ( roughness >= cubeUV_r1 ) {
|
|
mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
|
|
} else if ( roughness >= cubeUV_r4 ) {
|
|
mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
|
|
} else if ( roughness >= cubeUV_r5 ) {
|
|
mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
|
|
} else if ( roughness >= cubeUV_r6 ) {
|
|
mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
|
|
} else {
|
|
mip = - 2.0 * log2( 1.16 * roughness ); }
|
|
return mip;
|
|
}
|
|
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
|
|
float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
|
|
float mipF = fract( mip );
|
|
float mipInt = floor( mip );
|
|
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
|
|
if ( mipF == 0.0 ) {
|
|
return vec4( color0, 1.0 );
|
|
} else {
|
|
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
|
|
return vec4( mix( color0, color1, mipF ), 1.0 );
|
|
}
|
|
}
|
|
#endif`,$S=`vec3 transformedNormal = objectNormal;
|
|
#ifdef USE_TANGENT
|
|
vec3 transformedTangent = objectTangent;
|
|
#endif
|
|
#ifdef USE_BATCHING
|
|
mat3 bm = mat3( batchingMatrix );
|
|
transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
|
|
transformedNormal = bm * transformedNormal;
|
|
#ifdef USE_TANGENT
|
|
transformedTangent = bm * transformedTangent;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_INSTANCING
|
|
mat3 im = mat3( instanceMatrix );
|
|
transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
|
|
transformedNormal = im * transformedNormal;
|
|
#ifdef USE_TANGENT
|
|
transformedTangent = im * transformedTangent;
|
|
#endif
|
|
#endif
|
|
transformedNormal = normalMatrix * transformedNormal;
|
|
#ifdef FLIP_SIDED
|
|
transformedNormal = - transformedNormal;
|
|
#endif
|
|
#ifdef USE_TANGENT
|
|
transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
|
|
#ifdef FLIP_SIDED
|
|
transformedTangent = - transformedTangent;
|
|
#endif
|
|
#endif`,YS=`#ifdef USE_DISPLACEMENTMAP
|
|
uniform sampler2D displacementMap;
|
|
uniform float displacementScale;
|
|
uniform float displacementBias;
|
|
#endif`,jS=`#ifdef USE_DISPLACEMENTMAP
|
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
#endif`,KS=`#ifdef USE_EMISSIVEMAP
|
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
|
|
emissiveColor = sRGBTransferEOTF( emissiveColor );
|
|
#endif
|
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
#endif`,ZS=`#ifdef USE_EMISSIVEMAP
|
|
uniform sampler2D emissiveMap;
|
|
#endif`,JS="gl_FragColor = linearToOutputTexel( gl_FragColor );",QS=`vec4 LinearTransferOETF( in vec4 value ) {
|
|
return value;
|
|
}
|
|
vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
|
|
}
|
|
vec4 sRGBTransferOETF( in vec4 value ) {
|
|
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
|
|
}`,eE=`#ifdef USE_ENVMAP
|
|
#ifdef ENV_WORLDPOS
|
|
vec3 cameraToFrag;
|
|
if ( isOrthographic ) {
|
|
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
|
} else {
|
|
cameraToFrag = normalize( vWorldPosition - cameraPosition );
|
|
}
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
|
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
|
|
#else
|
|
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
|
|
#endif
|
|
#else
|
|
vec3 reflectVec = vReflect;
|
|
#endif
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
vec4 envColor = textureCube( envMap, envMapRotation * reflectVec );
|
|
#ifdef ENVMAP_BLENDING_MULTIPLY
|
|
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
|
|
#elif defined( ENVMAP_BLENDING_MIX )
|
|
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
|
|
#elif defined( ENVMAP_BLENDING_ADD )
|
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
|
#endif
|
|
#endif
|
|
#endif`,tE=`#ifdef USE_ENVMAP
|
|
uniform float envMapIntensity;
|
|
uniform mat3 envMapRotation;
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
uniform samplerCube envMap;
|
|
#else
|
|
uniform sampler2D envMap;
|
|
#endif
|
|
#endif`,nE=`#ifdef USE_ENVMAP
|
|
uniform float reflectivity;
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
#define ENV_WORLDPOS
|
|
#endif
|
|
#ifdef ENV_WORLDPOS
|
|
varying vec3 vWorldPosition;
|
|
uniform float refractionRatio;
|
|
#else
|
|
varying vec3 vReflect;
|
|
#endif
|
|
#endif`,iE=`#ifdef USE_ENVMAP
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
#define ENV_WORLDPOS
|
|
#endif
|
|
#ifdef ENV_WORLDPOS
|
|
|
|
varying vec3 vWorldPosition;
|
|
#else
|
|
varying vec3 vReflect;
|
|
uniform float refractionRatio;
|
|
#endif
|
|
#endif`,oE=`#ifdef USE_ENVMAP
|
|
#ifdef ENV_WORLDPOS
|
|
vWorldPosition = worldPosition.xyz;
|
|
#else
|
|
vec3 cameraToVertex;
|
|
if ( isOrthographic ) {
|
|
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
|
} else {
|
|
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
|
|
}
|
|
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
|
vReflect = reflect( cameraToVertex, worldNormal );
|
|
#else
|
|
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
|
|
#endif
|
|
#endif
|
|
#endif`,rE=`#ifdef USE_FOG
|
|
vFogDepth = - mvPosition.z;
|
|
#endif`,aE=`#ifdef USE_FOG
|
|
varying float vFogDepth;
|
|
#endif`,sE=`#ifdef USE_FOG
|
|
#ifdef FOG_EXP2
|
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
|
|
#else
|
|
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
|
|
#endif
|
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
|
#endif`,lE=`#ifdef USE_FOG
|
|
uniform vec3 fogColor;
|
|
varying float vFogDepth;
|
|
#ifdef FOG_EXP2
|
|
uniform float fogDensity;
|
|
#else
|
|
uniform float fogNear;
|
|
uniform float fogFar;
|
|
#endif
|
|
#endif`,cE=`#ifdef USE_GRADIENTMAP
|
|
uniform sampler2D gradientMap;
|
|
#endif
|
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
float dotNL = dot( normal, lightDirection );
|
|
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
|
|
#ifdef USE_GRADIENTMAP
|
|
return vec3( texture2D( gradientMap, coord ).r );
|
|
#else
|
|
vec2 fw = fwidth( coord ) * 0.5;
|
|
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
|
|
#endif
|
|
}`,dE=`#ifdef USE_LIGHTMAP
|
|
uniform sampler2D lightMap;
|
|
uniform float lightMapIntensity;
|
|
#endif`,uE=`LambertMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;
|
|
material.specularStrength = specularStrength;`,hE=`varying vec3 vViewPosition;
|
|
struct LambertMaterial {
|
|
vec3 diffuseColor;
|
|
float specularStrength;
|
|
};
|
|
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
|
vec3 irradiance = dotNL * directLight.color;
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
}
|
|
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
}
|
|
#define RE_Direct RE_Direct_Lambert
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,pE=`uniform bool receiveShadow;
|
|
uniform vec3 ambientLightColor;
|
|
#if defined( USE_LIGHT_PROBES )
|
|
uniform vec3 lightProbe[ 9 ];
|
|
#endif
|
|
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
|
|
float x = normal.x, y = normal.y, z = normal.z;
|
|
vec3 result = shCoefficients[ 0 ] * 0.886227;
|
|
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
|
|
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
|
|
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
|
|
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
|
|
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
|
|
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
|
|
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
|
|
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
|
|
return result;
|
|
}
|
|
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
|
|
return irradiance;
|
|
}
|
|
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
|
|
vec3 irradiance = ambientLightColor;
|
|
return irradiance;
|
|
}
|
|
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
|
|
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
|
|
if ( cutoffDistance > 0.0 ) {
|
|
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
|
|
}
|
|
return distanceFalloff;
|
|
}
|
|
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
|
|
return smoothstep( coneCosine, penumbraCosine, angleCosine );
|
|
}
|
|
#if NUM_DIR_LIGHTS > 0
|
|
struct DirectionalLight {
|
|
vec3 direction;
|
|
vec3 color;
|
|
};
|
|
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
|
|
void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
|
|
light.color = directionalLight.color;
|
|
light.direction = directionalLight.direction;
|
|
light.visible = true;
|
|
}
|
|
#endif
|
|
#if NUM_POINT_LIGHTS > 0
|
|
struct PointLight {
|
|
vec3 position;
|
|
vec3 color;
|
|
float distance;
|
|
float decay;
|
|
};
|
|
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
|
|
void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
|
|
vec3 lVector = pointLight.position - geometryPosition;
|
|
light.direction = normalize( lVector );
|
|
float lightDistance = length( lVector );
|
|
light.color = pointLight.color;
|
|
light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
|
|
light.visible = ( light.color != vec3( 0.0 ) );
|
|
}
|
|
#endif
|
|
#if NUM_SPOT_LIGHTS > 0
|
|
struct SpotLight {
|
|
vec3 position;
|
|
vec3 direction;
|
|
vec3 color;
|
|
float distance;
|
|
float decay;
|
|
float coneCos;
|
|
float penumbraCos;
|
|
};
|
|
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
|
|
void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
|
|
vec3 lVector = spotLight.position - geometryPosition;
|
|
light.direction = normalize( lVector );
|
|
float angleCos = dot( light.direction, spotLight.direction );
|
|
float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
|
|
if ( spotAttenuation > 0.0 ) {
|
|
float lightDistance = length( lVector );
|
|
light.color = spotLight.color * spotAttenuation;
|
|
light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
|
|
light.visible = ( light.color != vec3( 0.0 ) );
|
|
} else {
|
|
light.color = vec3( 0.0 );
|
|
light.visible = false;
|
|
}
|
|
}
|
|
#endif
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
|
struct RectAreaLight {
|
|
vec3 color;
|
|
vec3 position;
|
|
vec3 halfWidth;
|
|
vec3 halfHeight;
|
|
};
|
|
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
|
|
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
|
|
#endif
|
|
#if NUM_HEMI_LIGHTS > 0
|
|
struct HemisphereLight {
|
|
vec3 direction;
|
|
vec3 skyColor;
|
|
vec3 groundColor;
|
|
};
|
|
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
|
|
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
|
|
float dotNL = dot( normal, hemiLight.direction );
|
|
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
|
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
|
return irradiance;
|
|
}
|
|
#endif
|
|
#include <lightprobes_pars_fragment>`,mE=`#ifdef USE_ENVMAP
|
|
vec3 getIBLIrradiance( const in vec3 normal ) {
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
|
|
return PI * envMapColor.rgb * envMapIntensity;
|
|
#else
|
|
return vec3( 0.0 );
|
|
#endif
|
|
}
|
|
vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
vec3 reflectVec = reflect( - viewDir, normal );
|
|
reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
|
|
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
|
|
return envMapColor.rgb * envMapIntensity;
|
|
#else
|
|
return vec3( 0.0 );
|
|
#endif
|
|
}
|
|
#ifdef USE_ANISOTROPY
|
|
vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
vec3 bentNormal = cross( bitangent, viewDir );
|
|
bentNormal = normalize( cross( bentNormal, bitangent ) );
|
|
bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
|
|
return getIBLRadiance( viewDir, bentNormal, roughness );
|
|
#else
|
|
return vec3( 0.0 );
|
|
#endif
|
|
}
|
|
#endif
|
|
#endif`,fE=`ToonMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;`,gE=`varying vec3 vViewPosition;
|
|
struct ToonMaterial {
|
|
vec3 diffuseColor;
|
|
};
|
|
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
|
vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
}
|
|
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
}
|
|
#define RE_Direct RE_Direct_Toon
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,_E=`BlinnPhongMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;
|
|
material.specularColor = specular;
|
|
material.specularShininess = shininess;
|
|
material.specularStrength = specularStrength;`,vE=`varying vec3 vViewPosition;
|
|
struct BlinnPhongMaterial {
|
|
vec3 diffuseColor;
|
|
vec3 specularColor;
|
|
float specularShininess;
|
|
float specularStrength;
|
|
};
|
|
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
|
vec3 irradiance = dotNL * directLight.color;
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
|
|
}
|
|
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
}
|
|
#define RE_Direct RE_Direct_BlinnPhong
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,xE=`PhysicalMaterial material;
|
|
material.diffuseColor = diffuseColor.rgb;
|
|
material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
|
material.metalness = metalnessFactor;
|
|
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
|
|
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
|
|
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
|
|
material.roughness = min( material.roughness, 1.0 );
|
|
#ifdef IOR
|
|
material.ior = ior;
|
|
#ifdef USE_SPECULAR
|
|
float specularIntensityFactor = specularIntensity;
|
|
vec3 specularColorFactor = specularColor;
|
|
#ifdef USE_SPECULAR_COLORMAP
|
|
specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
|
|
#endif
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
|
specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
|
|
#endif
|
|
material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
|
|
#else
|
|
float specularIntensityFactor = 1.0;
|
|
vec3 specularColorFactor = vec3( 1.0 );
|
|
material.specularF90 = 1.0;
|
|
#endif
|
|
material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
|
|
material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
|
|
#else
|
|
material.specularColor = vec3( 0.04 );
|
|
material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
|
|
material.specularF90 = 1.0;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
material.clearcoat = clearcoat;
|
|
material.clearcoatRoughness = clearcoatRoughness;
|
|
material.clearcoatF0 = vec3( 0.04 );
|
|
material.clearcoatF90 = 1.0;
|
|
#ifdef USE_CLEARCOATMAP
|
|
material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
|
|
#endif
|
|
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
|
|
material.clearcoatRoughness += geometryRoughness;
|
|
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
|
|
#endif
|
|
#ifdef USE_DISPERSION
|
|
material.dispersion = dispersion;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE
|
|
material.iridescence = iridescence;
|
|
material.iridescenceIOR = iridescenceIOR;
|
|
#ifdef USE_IRIDESCENCEMAP
|
|
material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
|
|
#else
|
|
material.iridescenceThickness = iridescenceThicknessMaximum;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
material.sheenColor = sheenColor;
|
|
#ifdef USE_SHEEN_COLORMAP
|
|
material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
|
|
#endif
|
|
material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
|
material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
#ifdef USE_ANISOTROPYMAP
|
|
mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
|
|
vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
|
|
vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
|
|
#else
|
|
vec2 anisotropyV = anisotropyVector;
|
|
#endif
|
|
material.anisotropy = length( anisotropyV );
|
|
if( material.anisotropy == 0.0 ) {
|
|
anisotropyV = vec2( 1.0, 0.0 );
|
|
} else {
|
|
anisotropyV /= material.anisotropy;
|
|
material.anisotropy = saturate( material.anisotropy );
|
|
}
|
|
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
|
|
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
|
|
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
|
|
#endif`,bE=`uniform sampler2D dfgLUT;
|
|
struct PhysicalMaterial {
|
|
vec3 diffuseColor;
|
|
vec3 diffuseContribution;
|
|
vec3 specularColor;
|
|
vec3 specularColorBlended;
|
|
float roughness;
|
|
float metalness;
|
|
float specularF90;
|
|
float dispersion;
|
|
#ifdef USE_CLEARCOAT
|
|
float clearcoat;
|
|
float clearcoatRoughness;
|
|
vec3 clearcoatF0;
|
|
float clearcoatF90;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE
|
|
float iridescence;
|
|
float iridescenceIOR;
|
|
float iridescenceThickness;
|
|
vec3 iridescenceFresnel;
|
|
vec3 iridescenceF0;
|
|
vec3 iridescenceFresnelDielectric;
|
|
vec3 iridescenceFresnelMetallic;
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
vec3 sheenColor;
|
|
float sheenRoughness;
|
|
#endif
|
|
#ifdef IOR
|
|
float ior;
|
|
#endif
|
|
#ifdef USE_TRANSMISSION
|
|
float transmission;
|
|
float transmissionAlpha;
|
|
float thickness;
|
|
float attenuationDistance;
|
|
vec3 attenuationColor;
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
float anisotropy;
|
|
float alphaT;
|
|
vec3 anisotropyT;
|
|
vec3 anisotropyB;
|
|
#endif
|
|
};
|
|
vec3 clearcoatSpecularDirect = vec3( 0.0 );
|
|
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
|
|
vec3 sheenSpecularDirect = vec3( 0.0 );
|
|
vec3 sheenSpecularIndirect = vec3(0.0 );
|
|
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
|
|
float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
|
|
float x2 = x * x;
|
|
float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
|
|
return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
|
|
}
|
|
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
|
|
float a2 = pow2( alpha );
|
|
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
|
|
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
|
|
return 0.5 / max( gv + gl, EPSILON );
|
|
}
|
|
float D_GGX( const in float alpha, const in float dotNH ) {
|
|
float a2 = pow2( alpha );
|
|
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
|
|
return RECIPROCAL_PI * a2 / pow2( denom );
|
|
}
|
|
#ifdef USE_ANISOTROPY
|
|
float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
|
|
float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
|
|
float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
|
|
return 0.5 / max( gv + gl, EPSILON );
|
|
}
|
|
float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
|
|
float a2 = alphaT * alphaB;
|
|
highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
|
|
highp float v2 = dot( v, v );
|
|
float w2 = a2 / v2;
|
|
return RECIPROCAL_PI * a2 * pow2 ( w2 );
|
|
}
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
|
|
vec3 f0 = material.clearcoatF0;
|
|
float f90 = material.clearcoatF90;
|
|
float roughness = material.clearcoatRoughness;
|
|
float alpha = pow2( roughness );
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
|
vec3 F = F_Schlick( f0, f90, dotVH );
|
|
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
|
|
float D = D_GGX( alpha, dotNH );
|
|
return F * ( V * D );
|
|
}
|
|
#endif
|
|
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
|
|
vec3 f0 = material.specularColorBlended;
|
|
float f90 = material.specularF90;
|
|
float roughness = material.roughness;
|
|
float alpha = pow2( roughness );
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
|
vec3 F = F_Schlick( f0, f90, dotVH );
|
|
#ifdef USE_IRIDESCENCE
|
|
F = mix( F, material.iridescenceFresnel, material.iridescence );
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
float dotTL = dot( material.anisotropyT, lightDir );
|
|
float dotTV = dot( material.anisotropyT, viewDir );
|
|
float dotTH = dot( material.anisotropyT, halfDir );
|
|
float dotBL = dot( material.anisotropyB, lightDir );
|
|
float dotBV = dot( material.anisotropyB, viewDir );
|
|
float dotBH = dot( material.anisotropyB, halfDir );
|
|
float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
|
|
float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
|
|
#else
|
|
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
|
|
float D = D_GGX( alpha, dotNH );
|
|
#endif
|
|
return F * ( V * D );
|
|
}
|
|
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
|
|
const float LUT_SIZE = 64.0;
|
|
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
|
|
const float LUT_BIAS = 0.5 / LUT_SIZE;
|
|
float dotNV = saturate( dot( N, V ) );
|
|
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
|
|
uv = uv * LUT_SCALE + LUT_BIAS;
|
|
return uv;
|
|
}
|
|
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
|
|
float l = length( f );
|
|
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
|
|
}
|
|
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
|
|
float x = dot( v1, v2 );
|
|
float y = abs( x );
|
|
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
|
|
float b = 3.4175940 + ( 4.1616724 + y ) * y;
|
|
float v = a / b;
|
|
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
|
|
return cross( v1, v2 ) * theta_sintheta;
|
|
}
|
|
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
|
|
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
|
|
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
|
|
vec3 lightNormal = cross( v1, v2 );
|
|
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
|
|
vec3 T1, T2;
|
|
T1 = normalize( V - N * dot( V, N ) );
|
|
T2 = - cross( N, T1 );
|
|
mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
|
|
vec3 coords[ 4 ];
|
|
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
|
|
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
|
|
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
|
|
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
|
|
coords[ 0 ] = normalize( coords[ 0 ] );
|
|
coords[ 1 ] = normalize( coords[ 1 ] );
|
|
coords[ 2 ] = normalize( coords[ 2 ] );
|
|
coords[ 3 ] = normalize( coords[ 3 ] );
|
|
vec3 vectorFormFactor = vec3( 0.0 );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
|
|
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
|
|
return vec3( result );
|
|
}
|
|
#if defined( USE_SHEEN )
|
|
float D_Charlie( float roughness, float dotNH ) {
|
|
float alpha = pow2( roughness );
|
|
float invAlpha = 1.0 / alpha;
|
|
float cos2h = dotNH * dotNH;
|
|
float sin2h = max( 1.0 - cos2h, 0.0078125 );
|
|
return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
|
|
}
|
|
float V_Neubelt( float dotNV, float dotNL ) {
|
|
return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
|
|
}
|
|
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
|
float D = D_Charlie( sheenRoughness, dotNH );
|
|
float V = V_Neubelt( dotNV, dotNL );
|
|
return sheenColor * ( D * V );
|
|
}
|
|
#endif
|
|
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
float r2 = roughness * roughness;
|
|
float rInv = 1.0 / ( roughness + 0.1 );
|
|
float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
|
|
float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
|
|
float DG = exp( a * dotNV + b );
|
|
return saturate( DG );
|
|
}
|
|
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
|
|
return specularColor * fab.x + specularF90 * fab.y;
|
|
}
|
|
#ifdef USE_IRIDESCENCE
|
|
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
|
|
#else
|
|
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
|
|
#endif
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
|
|
#ifdef USE_IRIDESCENCE
|
|
vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
|
|
#else
|
|
vec3 Fr = specularColor;
|
|
#endif
|
|
vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
|
|
float Ess = fab.x + fab.y;
|
|
float Ems = 1.0 - Ess;
|
|
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
|
|
singleScatter += FssEss;
|
|
multiScatter += Fms * Ems;
|
|
}
|
|
vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
|
|
vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
|
|
vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
|
|
vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
|
|
vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
|
|
float Ess_V = dfgV.x + dfgV.y;
|
|
float Ess_L = dfgL.x + dfgL.y;
|
|
float Ems_V = 1.0 - Ess_V;
|
|
float Ems_L = 1.0 - Ess_L;
|
|
vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
|
|
vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
|
|
float compensationFactor = Ems_V * Ems_L;
|
|
vec3 multiScatter = Fms * compensationFactor;
|
|
return singleScatter + multiScatter;
|
|
}
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
|
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
vec3 normal = geometryNormal;
|
|
vec3 viewDir = geometryViewDir;
|
|
vec3 position = geometryPosition;
|
|
vec3 lightPos = rectAreaLight.position;
|
|
vec3 halfWidth = rectAreaLight.halfWidth;
|
|
vec3 halfHeight = rectAreaLight.halfHeight;
|
|
vec3 lightColor = rectAreaLight.color;
|
|
float roughness = material.roughness;
|
|
vec3 rectCoords[ 4 ];
|
|
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
|
|
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
|
|
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
|
|
vec2 uv = LTC_Uv( normal, viewDir, roughness );
|
|
vec4 t1 = texture2D( ltc_1, uv );
|
|
vec4 t2 = texture2D( ltc_2, uv );
|
|
mat3 mInv = mat3(
|
|
vec3( t1.x, 0, t1.y ),
|
|
vec3( 0, 1, 0 ),
|
|
vec3( t1.z, 0, t1.w )
|
|
);
|
|
vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
|
|
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
|
|
reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
|
|
#ifdef USE_CLEARCOAT
|
|
vec3 Ncc = geometryClearcoatNormal;
|
|
vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
|
|
vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
|
|
vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
|
|
mat3 mInvClearcoat = mat3(
|
|
vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
|
|
vec3( 0, 1, 0 ),
|
|
vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
|
|
);
|
|
vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
|
|
clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
|
|
#endif
|
|
}
|
|
#endif
|
|
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
|
vec3 irradiance = dotNL * directLight.color;
|
|
#ifdef USE_CLEARCOAT
|
|
float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
|
|
vec3 ccIrradiance = dotNLcc * directLight.color;
|
|
clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
|
|
sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
|
|
|
|
float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
|
|
float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
|
|
|
|
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
|
|
|
|
irradiance *= sheenEnergyComp;
|
|
|
|
#endif
|
|
reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
|
|
}
|
|
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
|
|
#ifdef USE_SHEEN
|
|
float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
|
|
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
|
|
diffuse *= sheenEnergyComp;
|
|
#endif
|
|
reflectedLight.indirectDiffuse += diffuse;
|
|
}
|
|
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
|
|
#ifdef USE_CLEARCOAT
|
|
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
|
|
#endif
|
|
vec3 singleScatteringDielectric = vec3( 0.0 );
|
|
vec3 multiScatteringDielectric = vec3( 0.0 );
|
|
vec3 singleScatteringMetallic = vec3( 0.0 );
|
|
vec3 multiScatteringMetallic = vec3( 0.0 );
|
|
#ifdef USE_IRIDESCENCE
|
|
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
|
|
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
|
|
#else
|
|
computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
|
|
computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
|
|
#endif
|
|
vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
|
|
vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
|
|
vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
|
|
vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
|
|
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
|
|
vec3 indirectSpecular = radiance * singleScattering;
|
|
indirectSpecular += multiScattering * cosineWeightedIrradiance;
|
|
vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
|
|
#ifdef USE_SHEEN
|
|
float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
|
|
float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
|
|
indirectSpecular *= sheenEnergyComp;
|
|
indirectDiffuse *= sheenEnergyComp;
|
|
#endif
|
|
reflectedLight.indirectSpecular += indirectSpecular;
|
|
reflectedLight.indirectDiffuse += indirectDiffuse;
|
|
}
|
|
#define RE_Direct RE_Direct_Physical
|
|
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
|
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
|
}`,yE=`
|
|
vec3 geometryPosition = - vViewPosition;
|
|
vec3 geometryNormal = normal;
|
|
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
vec3 geometryClearcoatNormal = vec3( 0.0 );
|
|
#ifdef USE_CLEARCOAT
|
|
geometryClearcoatNormal = clearcoatNormal;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE
|
|
float dotNVi = saturate( dot( normal, geometryViewDir ) );
|
|
if ( material.iridescenceThickness == 0.0 ) {
|
|
material.iridescence = 0.0;
|
|
} else {
|
|
material.iridescence = saturate( material.iridescence );
|
|
}
|
|
if ( material.iridescence > 0.0 ) {
|
|
material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
|
|
material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
|
|
material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
|
|
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
|
|
}
|
|
#endif
|
|
IncidentLight directLight;
|
|
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
PointLight pointLight;
|
|
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
|
|
PointLightShadow pointLightShadow;
|
|
#endif
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
|
|
pointLight = pointLights[ i ];
|
|
getPointLightInfo( pointLight, geometryPosition, directLight );
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
|
|
pointLightShadow = pointLightShadows[ i ];
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
|
|
#endif
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
SpotLight spotLight;
|
|
vec4 spotColor;
|
|
vec3 spotLightCoord;
|
|
bool inSpotLightMap;
|
|
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
|
|
SpotLightShadow spotLightShadow;
|
|
#endif
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
|
|
spotLight = spotLights[ i ];
|
|
getSpotLightInfo( spotLight, geometryPosition, directLight );
|
|
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
|
|
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
|
|
#else
|
|
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
#endif
|
|
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
|
|
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
|
|
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
|
|
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
|
|
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
|
|
#endif
|
|
#undef SPOT_LIGHT_MAP_INDEX
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
spotLightShadow = spotLightShadows[ i ];
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
|
|
#endif
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
|
|
DirectionalLight directionalLight;
|
|
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
|
|
DirectionalLightShadow directionalLightShadow;
|
|
#endif
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
directionalLight = directionalLights[ i ];
|
|
getDirectionalLightInfo( directionalLight, directLight );
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
directionalLightShadow = directionalLightShadows[ i ];
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
#endif
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
|
|
RectAreaLight rectAreaLight;
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
|
|
rectAreaLight = rectAreaLights[ i ];
|
|
RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if defined( RE_IndirectDiffuse )
|
|
vec3 iblIrradiance = vec3( 0.0 );
|
|
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
|
|
#if defined( USE_LIGHT_PROBES )
|
|
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
|
|
#endif
|
|
#if ( NUM_HEMI_LIGHTS > 0 )
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
|
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#ifdef USE_LIGHT_PROBES_GRID
|
|
vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;
|
|
vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix );
|
|
irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );
|
|
#endif
|
|
#endif
|
|
#if defined( RE_IndirectSpecular )
|
|
vec3 radiance = vec3( 0.0 );
|
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
#endif`,CE=`#if defined( RE_IndirectDiffuse )
|
|
#ifdef USE_LIGHTMAP
|
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
|
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
|
|
irradiance += lightMapIrradiance;
|
|
#endif
|
|
#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
|
|
#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
|
|
iblIrradiance += getIBLIrradiance( geometryNormal );
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
|
|
#ifdef USE_ANISOTROPY
|
|
radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
|
|
#else
|
|
radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
|
|
#endif
|
|
#endif`,ME=`#if defined( RE_IndirectDiffuse )
|
|
#if defined( LAMBERT ) || defined( PHONG )
|
|
irradiance += iblIrradiance;
|
|
#endif
|
|
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
#endif
|
|
#if defined( RE_IndirectSpecular )
|
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
#endif`,wE=`#ifdef USE_LIGHT_PROBES_GRID
|
|
uniform highp sampler3D probesSH;
|
|
uniform vec3 probesMin;
|
|
uniform vec3 probesMax;
|
|
uniform vec3 probesResolution;
|
|
vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
|
|
vec3 res = probesResolution;
|
|
vec3 gridRange = probesMax - probesMin;
|
|
vec3 resMinusOne = res - 1.0;
|
|
vec3 probeSpacing = gridRange / resMinusOne;
|
|
vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;
|
|
vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );
|
|
uvw = uvw * resMinusOne / res + 0.5 / res;
|
|
float nz = res.z;
|
|
float paddedSlices = nz + 2.0;
|
|
float atlasDepth = 7.0 * paddedSlices;
|
|
float uvZBase = uvw.z * nz + 1.0;
|
|
vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) );
|
|
vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) );
|
|
vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) );
|
|
vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) );
|
|
vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) );
|
|
vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) );
|
|
vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) );
|
|
vec3 c0 = s0.xyz;
|
|
vec3 c1 = vec3( s0.w, s1.xy );
|
|
vec3 c2 = vec3( s1.zw, s2.x );
|
|
vec3 c3 = s2.yzw;
|
|
vec3 c4 = s3.xyz;
|
|
vec3 c5 = vec3( s3.w, s4.xy );
|
|
vec3 c6 = vec3( s4.zw, s5.x );
|
|
vec3 c7 = s5.yzw;
|
|
vec3 c8 = s6.xyz;
|
|
float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;
|
|
vec3 result = c0 * 0.886227;
|
|
result += c1 * 2.0 * 0.511664 * y;
|
|
result += c2 * 2.0 * 0.511664 * z;
|
|
result += c3 * 2.0 * 0.511664 * x;
|
|
result += c4 * 2.0 * 0.429043 * x * y;
|
|
result += c5 * 2.0 * 0.429043 * y * z;
|
|
result += c6 * ( 0.743125 * z * z - 0.247708 );
|
|
result += c7 * 2.0 * 0.429043 * x * z;
|
|
result += c8 * 0.429043 * ( x * x - y * y );
|
|
return max( result, vec3( 0.0 ) );
|
|
}
|
|
#endif`,SE=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
#endif`,EE=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
uniform float logDepthBufFC;
|
|
varying float vFragDepth;
|
|
varying float vIsPerspective;
|
|
#endif`,TE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
|
varying float vFragDepth;
|
|
varying float vIsPerspective;
|
|
#endif`,PE=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
|
vFragDepth = 1.0 + gl_Position.w;
|
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
#endif`,AE=`#ifdef USE_MAP
|
|
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
|
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
|
#endif
|
|
diffuseColor *= sampledDiffuseColor;
|
|
#endif`,IE=`#ifdef USE_MAP
|
|
uniform sampler2D map;
|
|
#endif`,OE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
#if defined( USE_POINTS_UV )
|
|
vec2 uv = vUv;
|
|
#else
|
|
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_MAP
|
|
diffuseColor *= texture2D( map, uv );
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
|
#endif`,DE=`#if defined( USE_POINTS_UV )
|
|
varying vec2 vUv;
|
|
#else
|
|
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
uniform mat3 uvTransform;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_MAP
|
|
uniform sampler2D map;
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
uniform sampler2D alphaMap;
|
|
#endif`,kE=`float metalnessFactor = metalness;
|
|
#ifdef USE_METALNESSMAP
|
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
|
metalnessFactor *= texelMetalness.b;
|
|
#endif`,RE=`#ifdef USE_METALNESSMAP
|
|
uniform sampler2D metalnessMap;
|
|
#endif`,NE=`#ifdef USE_INSTANCING_MORPH
|
|
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
|
}
|
|
#endif`,LE=`#if defined( USE_MORPHCOLORS )
|
|
vColor *= morphTargetBaseInfluence;
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
#if defined( USE_COLOR_ALPHA )
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
|
|
#elif defined( USE_COLOR )
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
|
|
#endif
|
|
}
|
|
#endif`,FE=`#ifdef USE_MORPHNORMALS
|
|
objectNormal *= morphTargetBaseInfluence;
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
|
|
}
|
|
#endif`,VE=`#ifdef USE_MORPHTARGETS
|
|
#ifndef USE_INSTANCING_MORPH
|
|
uniform float morphTargetBaseInfluence;
|
|
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
#endif
|
|
uniform sampler2DArray morphTargetsTexture;
|
|
uniform ivec2 morphTargetsTextureSize;
|
|
vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
|
|
int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
|
|
int y = texelIndex / morphTargetsTextureSize.x;
|
|
int x = texelIndex - y * morphTargetsTextureSize.x;
|
|
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
|
|
return texelFetch( morphTargetsTexture, morphUV, 0 );
|
|
}
|
|
#endif`,BE=`#ifdef USE_MORPHTARGETS
|
|
transformed *= morphTargetBaseInfluence;
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
|
|
}
|
|
#endif`,UE=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
|
#ifdef FLAT_SHADED
|
|
vec3 fdx = dFdx( vViewPosition );
|
|
vec3 fdy = dFdy( vViewPosition );
|
|
vec3 normal = normalize( cross( fdx, fdy ) );
|
|
#else
|
|
vec3 normal = normalize( vNormal );
|
|
#ifdef DOUBLE_SIDED
|
|
normal *= faceDirection;
|
|
#endif
|
|
#endif
|
|
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
|
|
#ifdef USE_TANGENT
|
|
mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
|
|
#else
|
|
mat3 tbn = getTangentFrame( - vViewPosition, normal,
|
|
#if defined( USE_NORMALMAP )
|
|
vNormalMapUv
|
|
#elif defined( USE_CLEARCOAT_NORMALMAP )
|
|
vClearcoatNormalMapUv
|
|
#else
|
|
vUv
|
|
#endif
|
|
);
|
|
#endif
|
|
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
|
|
tbn[0] *= faceDirection;
|
|
tbn[1] *= faceDirection;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
#ifdef USE_TANGENT
|
|
mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
|
|
#else
|
|
mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
|
|
#endif
|
|
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
|
|
tbn2[0] *= faceDirection;
|
|
tbn2[1] *= faceDirection;
|
|
#endif
|
|
#endif
|
|
vec3 nonPerturbedNormal = normal;`,zE=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
|
#ifdef FLIP_SIDED
|
|
normal = - normal;
|
|
#endif
|
|
#ifdef DOUBLE_SIDED
|
|
normal = normal * faceDirection;
|
|
#endif
|
|
normal = normalize( normalMatrix * normal );
|
|
#elif defined( USE_NORMALMAP_TANGENTSPACE )
|
|
vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
|
#if defined( USE_PACKED_NORMALMAP )
|
|
mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );
|
|
#endif
|
|
mapN.xy *= normalScale;
|
|
normal = normalize( tbn * mapN );
|
|
#elif defined( USE_BUMPMAP )
|
|
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
|
|
#endif`,HE=`#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif`,GE=`#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#ifdef USE_TANGENT
|
|
varying vec3 vTangent;
|
|
varying vec3 vBitangent;
|
|
#endif
|
|
#endif`,WE=`#ifndef FLAT_SHADED
|
|
vNormal = normalize( transformedNormal );
|
|
#ifdef USE_TANGENT
|
|
vTangent = normalize( transformedTangent );
|
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
#endif
|
|
#endif`,XE=`#ifdef USE_NORMALMAP
|
|
uniform sampler2D normalMap;
|
|
uniform vec2 normalScale;
|
|
#endif
|
|
#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
uniform mat3 normalMatrix;
|
|
#endif
|
|
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
|
|
mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
|
|
vec3 q0 = dFdx( eye_pos.xyz );
|
|
vec3 q1 = dFdy( eye_pos.xyz );
|
|
vec2 st0 = dFdx( uv.st );
|
|
vec2 st1 = dFdy( uv.st );
|
|
vec3 N = surf_norm;
|
|
vec3 q1perp = cross( q1, N );
|
|
vec3 q0perp = cross( N, q0 );
|
|
vec3 T = q1perp * st0.x + q0perp * st1.x;
|
|
vec3 B = q1perp * st0.y + q0perp * st1.y;
|
|
float det = max( dot( T, T ), dot( B, B ) );
|
|
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
|
|
return mat3( T * scale, B * scale, N );
|
|
}
|
|
#endif`,qE=`#ifdef USE_CLEARCOAT
|
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
|
#endif`,$E=`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
|
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
|
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
|
|
#endif`,YE=`#ifdef USE_CLEARCOATMAP
|
|
uniform sampler2D clearcoatMap;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
uniform sampler2D clearcoatNormalMap;
|
|
uniform vec2 clearcoatNormalScale;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
uniform sampler2D clearcoatRoughnessMap;
|
|
#endif`,jE=`#ifdef USE_IRIDESCENCEMAP
|
|
uniform sampler2D iridescenceMap;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
uniform sampler2D iridescenceThicknessMap;
|
|
#endif`,KE=`#ifdef OPAQUE
|
|
diffuseColor.a = 1.0;
|
|
#endif
|
|
#ifdef USE_TRANSMISSION
|
|
diffuseColor.a *= material.transmissionAlpha;
|
|
#endif
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,ZE=`vec3 packNormalToRGB( const in vec3 normal ) {
|
|
return normalize( normal ) * 0.5 + 0.5;
|
|
}
|
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
|
return 2.0 * rgb.xyz - 1.0;
|
|
}
|
|
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
|
|
const float Inv255 = 1. / 255.;
|
|
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
|
|
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
|
|
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
|
|
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
|
|
vec4 packDepthToRGBA( const in float v ) {
|
|
if( v <= 0.0 )
|
|
return vec4( 0., 0., 0., 0. );
|
|
if( v >= 1.0 )
|
|
return vec4( 1., 1., 1., 1. );
|
|
float vuf;
|
|
float af = modf( v * PackFactors.a, vuf );
|
|
float bf = modf( vuf * ShiftRight8, vuf );
|
|
float gf = modf( vuf * ShiftRight8, vuf );
|
|
return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
|
|
}
|
|
vec3 packDepthToRGB( const in float v ) {
|
|
if( v <= 0.0 )
|
|
return vec3( 0., 0., 0. );
|
|
if( v >= 1.0 )
|
|
return vec3( 1., 1., 1. );
|
|
float vuf;
|
|
float bf = modf( v * PackFactors.b, vuf );
|
|
float gf = modf( vuf * ShiftRight8, vuf );
|
|
return vec3( vuf * Inv255, gf * PackUpscale, bf );
|
|
}
|
|
vec2 packDepthToRG( const in float v ) {
|
|
if( v <= 0.0 )
|
|
return vec2( 0., 0. );
|
|
if( v >= 1.0 )
|
|
return vec2( 1., 1. );
|
|
float vuf;
|
|
float gf = modf( v * 256., vuf );
|
|
return vec2( vuf * Inv255, gf );
|
|
}
|
|
float unpackRGBAToDepth( const in vec4 v ) {
|
|
return dot( v, UnpackFactors4 );
|
|
}
|
|
float unpackRGBToDepth( const in vec3 v ) {
|
|
return dot( v, UnpackFactors3 );
|
|
}
|
|
float unpackRGToDepth( const in vec2 v ) {
|
|
return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
|
|
}
|
|
vec4 pack2HalfToRGBA( const in vec2 v ) {
|
|
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
|
|
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
|
|
}
|
|
vec2 unpackRGBATo2Half( const in vec4 v ) {
|
|
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
|
|
}
|
|
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
|
|
return ( viewZ + near ) / ( near - far );
|
|
}
|
|
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
|
|
return depth * ( far - near ) - far;
|
|
#else
|
|
return depth * ( near - far ) - near;
|
|
#endif
|
|
}
|
|
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
|
|
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
|
|
}
|
|
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
|
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
return ( near * far ) / ( ( near - far ) * depth - near );
|
|
#else
|
|
return ( near * far ) / ( ( far - near ) * depth - far );
|
|
#endif
|
|
}`,JE=`#ifdef PREMULTIPLIED_ALPHA
|
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
#endif`,QE=`vec4 mvPosition = vec4( transformed, 1.0 );
|
|
#ifdef USE_BATCHING
|
|
mvPosition = batchingMatrix * mvPosition;
|
|
#endif
|
|
#ifdef USE_INSTANCING
|
|
mvPosition = instanceMatrix * mvPosition;
|
|
#endif
|
|
mvPosition = modelViewMatrix * mvPosition;
|
|
gl_Position = projectionMatrix * mvPosition;`,e2=`#ifdef DITHERING
|
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
#endif`,t2=`#ifdef DITHERING
|
|
vec3 dithering( vec3 color ) {
|
|
float grid_position = rand( gl_FragCoord.xy );
|
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
|
return color + dither_shift_RGB;
|
|
}
|
|
#endif`,n2=`float roughnessFactor = roughness;
|
|
#ifdef USE_ROUGHNESSMAP
|
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
|
roughnessFactor *= texelRoughness.g;
|
|
#endif`,i2=`#ifdef USE_ROUGHNESSMAP
|
|
uniform sampler2D roughnessMap;
|
|
#endif`,o2=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_MAPS > 0
|
|
uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
|
|
#endif
|
|
#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#else
|
|
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#endif
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
|
struct DirectionalLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#else
|
|
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#endif
|
|
struct SpotLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#elif defined( SHADOWMAP_TYPE_BASIC )
|
|
uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#endif
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
|
struct PointLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
float shadowCameraNear;
|
|
float shadowCameraFar;
|
|
};
|
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
float interleavedGradientNoise( vec2 position ) {
|
|
return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
|
|
}
|
|
vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
|
|
const float goldenAngle = 2.399963229728653;
|
|
float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
|
|
float theta = float( sampleIndex ) * goldenAngle + phi;
|
|
return vec2( cos( theta ), sin( theta ) ) * r;
|
|
}
|
|
#endif
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
|
|
float shadow = 1.0;
|
|
shadowCoord.xyz /= shadowCoord.w;
|
|
shadowCoord.z += shadowBias;
|
|
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
|
|
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
|
|
if ( frustumTest ) {
|
|
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
|
|
float radius = shadowRadius * texelSize.x;
|
|
float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
|
|
shadow = (
|
|
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
|
|
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
|
|
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
|
|
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
|
|
texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
|
|
) * 0.2;
|
|
}
|
|
return mix( 1.0, shadow, shadowIntensity );
|
|
}
|
|
#elif defined( SHADOWMAP_TYPE_VSM )
|
|
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
|
|
float shadow = 1.0;
|
|
shadowCoord.xyz /= shadowCoord.w;
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
shadowCoord.z -= shadowBias;
|
|
#else
|
|
shadowCoord.z += shadowBias;
|
|
#endif
|
|
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
|
|
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
|
|
if ( frustumTest ) {
|
|
vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
|
|
float mean = distribution.x;
|
|
float variance = distribution.y * distribution.y;
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
float hard_shadow = step( mean, shadowCoord.z );
|
|
#else
|
|
float hard_shadow = step( shadowCoord.z, mean );
|
|
#endif
|
|
|
|
if ( hard_shadow == 1.0 ) {
|
|
shadow = 1.0;
|
|
} else {
|
|
variance = max( variance, 0.0000001 );
|
|
float d = shadowCoord.z - mean;
|
|
float p_max = variance / ( variance + d * d );
|
|
p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
|
|
shadow = max( hard_shadow, p_max );
|
|
}
|
|
}
|
|
return mix( 1.0, shadow, shadowIntensity );
|
|
}
|
|
#else
|
|
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
|
|
float shadow = 1.0;
|
|
shadowCoord.xyz /= shadowCoord.w;
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
shadowCoord.z -= shadowBias;
|
|
#else
|
|
shadowCoord.z += shadowBias;
|
|
#endif
|
|
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
|
|
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
|
|
if ( frustumTest ) {
|
|
float depth = texture2D( shadowMap, shadowCoord.xy ).r;
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
shadow = step( depth, shadowCoord.z );
|
|
#else
|
|
shadow = step( shadowCoord.z, depth );
|
|
#endif
|
|
}
|
|
return mix( 1.0, shadow, shadowIntensity );
|
|
}
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
|
float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
|
|
float shadow = 1.0;
|
|
vec3 lightToPosition = shadowCoord.xyz;
|
|
vec3 bd3D = normalize( lightToPosition );
|
|
vec3 absVec = abs( lightToPosition );
|
|
float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
|
|
if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
|
|
dp -= shadowBias;
|
|
#else
|
|
float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
|
|
dp += shadowBias;
|
|
#endif
|
|
float texelSize = shadowRadius / shadowMapSize.x;
|
|
vec3 absDir = abs( bd3D );
|
|
vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
|
|
tangent = normalize( cross( bd3D, tangent ) );
|
|
vec3 bitangent = cross( bd3D, tangent );
|
|
float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
|
|
vec2 sample0 = vogelDiskSample( 0, 5, phi );
|
|
vec2 sample1 = vogelDiskSample( 1, 5, phi );
|
|
vec2 sample2 = vogelDiskSample( 2, 5, phi );
|
|
vec2 sample3 = vogelDiskSample( 3, 5, phi );
|
|
vec2 sample4 = vogelDiskSample( 4, 5, phi );
|
|
shadow = (
|
|
texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
|
|
texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
|
|
texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
|
|
texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
|
|
texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
|
|
) * 0.2;
|
|
}
|
|
return mix( 1.0, shadow, shadowIntensity );
|
|
}
|
|
#elif defined( SHADOWMAP_TYPE_BASIC )
|
|
float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
|
|
float shadow = 1.0;
|
|
vec3 lightToPosition = shadowCoord.xyz;
|
|
vec3 absVec = abs( lightToPosition );
|
|
float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
|
|
if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
|
|
float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
|
|
dp += shadowBias;
|
|
vec3 bd3D = normalize( lightToPosition );
|
|
float depth = textureCube( shadowMap, bd3D ).r;
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
depth = 1.0 - depth;
|
|
#endif
|
|
shadow = step( dp, depth );
|
|
}
|
|
return mix( 1.0, shadow, shadowIntensity );
|
|
}
|
|
#endif
|
|
#endif
|
|
#endif`,r2=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
|
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
#endif
|
|
#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
|
struct DirectionalLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
struct SpotLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
};
|
|
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
|
struct PointLightShadow {
|
|
float shadowIntensity;
|
|
float shadowBias;
|
|
float shadowNormalBias;
|
|
float shadowRadius;
|
|
vec2 shadowMapSize;
|
|
float shadowCameraNear;
|
|
float shadowCameraFar;
|
|
};
|
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
|
#endif
|
|
#endif`,a2=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
|
|
#ifdef HAS_NORMAL
|
|
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
|
#else
|
|
vec3 shadowWorldNormal = vec3( 0.0 );
|
|
#endif
|
|
vec4 shadowWorldPosition;
|
|
#endif
|
|
#if defined( USE_SHADOWMAP )
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
|
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
|
|
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
|
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
|
|
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_COORDS > 0
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
|
|
shadowWorldPosition = worldPosition;
|
|
#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
|
|
#endif
|
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif`,s2=`float getShadowMask() {
|
|
float shadow = 1.0;
|
|
#ifdef USE_SHADOWMAP
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
DirectionalLightShadow directionalLight;
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
|
directionalLight = directionalLightShadows[ i ];
|
|
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
|
SpotLightShadow spotLight;
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
|
|
spotLight = spotLightShadows[ i ];
|
|
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
|
|
PointLightShadow pointLight;
|
|
#pragma unroll_loop_start
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
|
pointLight = pointLightShadows[ i ];
|
|
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
|
|
}
|
|
#pragma unroll_loop_end
|
|
#endif
|
|
#endif
|
|
return shadow;
|
|
}`,l2=`#ifdef USE_SKINNING
|
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
|
#endif`,c2=`#ifdef USE_SKINNING
|
|
uniform mat4 bindMatrix;
|
|
uniform mat4 bindMatrixInverse;
|
|
uniform highp sampler2D boneTexture;
|
|
mat4 getBoneMatrix( const in float i ) {
|
|
int size = textureSize( boneTexture, 0 ).x;
|
|
int j = int( i ) * 4;
|
|
int x = j % size;
|
|
int y = j / size;
|
|
vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
|
|
vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
|
|
vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
|
|
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
|
|
return mat4( v1, v2, v3, v4 );
|
|
}
|
|
#endif`,d2=`#ifdef USE_SKINNING
|
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
|
vec4 skinned = vec4( 0.0 );
|
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
|
skinned += boneMatY * skinVertex * skinWeight.y;
|
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
#endif`,u2=`#ifdef USE_SKINNING
|
|
mat4 skinMatrix = mat4( 0.0 );
|
|
skinMatrix += skinWeight.x * boneMatX;
|
|
skinMatrix += skinWeight.y * boneMatY;
|
|
skinMatrix += skinWeight.z * boneMatZ;
|
|
skinMatrix += skinWeight.w * boneMatW;
|
|
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
|
|
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
|
|
#ifdef USE_TANGENT
|
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
#endif
|
|
#endif`,h2=`float specularStrength;
|
|
#ifdef USE_SPECULARMAP
|
|
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
|
|
specularStrength = texelSpecular.r;
|
|
#else
|
|
specularStrength = 1.0;
|
|
#endif`,p2=`#ifdef USE_SPECULARMAP
|
|
uniform sampler2D specularMap;
|
|
#endif`,m2=`#if defined( TONE_MAPPING )
|
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
#endif`,f2=`#ifndef saturate
|
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
|
#endif
|
|
uniform float toneMappingExposure;
|
|
vec3 LinearToneMapping( vec3 color ) {
|
|
return saturate( toneMappingExposure * color );
|
|
}
|
|
vec3 ReinhardToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
return saturate( color / ( vec3( 1.0 ) + color ) );
|
|
}
|
|
vec3 CineonToneMapping( vec3 color ) {
|
|
color *= toneMappingExposure;
|
|
color = max( vec3( 0.0 ), color - 0.004 );
|
|
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
|
|
}
|
|
vec3 RRTAndODTFit( vec3 v ) {
|
|
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
|
|
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
|
|
return a / b;
|
|
}
|
|
vec3 ACESFilmicToneMapping( vec3 color ) {
|
|
const mat3 ACESInputMat = mat3(
|
|
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
|
|
vec3( 0.04823, 0.01566, 0.83777 )
|
|
);
|
|
const mat3 ACESOutputMat = mat3(
|
|
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
|
|
vec3( -0.07367, -0.00605, 1.07602 )
|
|
);
|
|
color *= toneMappingExposure / 0.6;
|
|
color = ACESInputMat * color;
|
|
color = RRTAndODTFit( color );
|
|
color = ACESOutputMat * color;
|
|
return saturate( color );
|
|
}
|
|
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
|
|
vec3( 1.6605, - 0.1246, - 0.0182 ),
|
|
vec3( - 0.5876, 1.1329, - 0.1006 ),
|
|
vec3( - 0.0728, - 0.0083, 1.1187 )
|
|
);
|
|
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
|
|
vec3( 0.6274, 0.0691, 0.0164 ),
|
|
vec3( 0.3293, 0.9195, 0.0880 ),
|
|
vec3( 0.0433, 0.0113, 0.8956 )
|
|
);
|
|
vec3 agxDefaultContrastApprox( vec3 x ) {
|
|
vec3 x2 = x * x;
|
|
vec3 x4 = x2 * x2;
|
|
return + 15.5 * x4 * x2
|
|
- 40.14 * x4 * x
|
|
+ 31.96 * x4
|
|
- 6.868 * x2 * x
|
|
+ 0.4298 * x2
|
|
+ 0.1191 * x
|
|
- 0.00232;
|
|
}
|
|
vec3 AgXToneMapping( vec3 color ) {
|
|
const mat3 AgXInsetMatrix = mat3(
|
|
vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
|
|
vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
|
|
vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
|
|
);
|
|
const mat3 AgXOutsetMatrix = mat3(
|
|
vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
|
|
vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
|
|
vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
|
|
);
|
|
const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
|
|
color *= toneMappingExposure;
|
|
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
|
|
color = AgXInsetMatrix * color;
|
|
color = max( color, 1e-10 ); color = log2( color );
|
|
color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
|
|
color = clamp( color, 0.0, 1.0 );
|
|
color = agxDefaultContrastApprox( color );
|
|
color = AgXOutsetMatrix * color;
|
|
color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
|
|
color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
|
|
color = clamp( color, 0.0, 1.0 );
|
|
return color;
|
|
}
|
|
vec3 NeutralToneMapping( vec3 color ) {
|
|
const float StartCompression = 0.8 - 0.04;
|
|
const float Desaturation = 0.15;
|
|
color *= toneMappingExposure;
|
|
float x = min( color.r, min( color.g, color.b ) );
|
|
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
|
|
color -= offset;
|
|
float peak = max( color.r, max( color.g, color.b ) );
|
|
if ( peak < StartCompression ) return color;
|
|
float d = 1. - StartCompression;
|
|
float newPeak = 1. - d * d / ( peak + d - StartCompression );
|
|
color *= newPeak / peak;
|
|
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
|
|
return mix( color, vec3( newPeak ), g );
|
|
}
|
|
vec3 CustomToneMapping( vec3 color ) { return color; }`,g2=`#ifdef USE_TRANSMISSION
|
|
material.transmission = transmission;
|
|
material.transmissionAlpha = 1.0;
|
|
material.thickness = thickness;
|
|
material.attenuationDistance = attenuationDistance;
|
|
material.attenuationColor = attenuationColor;
|
|
#ifdef USE_TRANSMISSIONMAP
|
|
material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
|
|
#endif
|
|
#ifdef USE_THICKNESSMAP
|
|
material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
|
|
#endif
|
|
vec3 pos = vWorldPosition;
|
|
vec3 v = normalize( cameraPosition - pos );
|
|
vec3 n = inverseTransformDirection( normal, viewMatrix );
|
|
vec4 transmitted = getIBLVolumeRefraction(
|
|
n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
|
|
pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
|
|
material.attenuationColor, material.attenuationDistance );
|
|
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
|
|
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
|
|
#endif`,_2=`#ifdef USE_TRANSMISSION
|
|
uniform float transmission;
|
|
uniform float thickness;
|
|
uniform float attenuationDistance;
|
|
uniform vec3 attenuationColor;
|
|
#ifdef USE_TRANSMISSIONMAP
|
|
uniform sampler2D transmissionMap;
|
|
#endif
|
|
#ifdef USE_THICKNESSMAP
|
|
uniform sampler2D thicknessMap;
|
|
#endif
|
|
uniform vec2 transmissionSamplerSize;
|
|
uniform sampler2D transmissionSamplerMap;
|
|
uniform mat4 modelMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
varying vec3 vWorldPosition;
|
|
float w0( float a ) {
|
|
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
|
|
}
|
|
float w1( float a ) {
|
|
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
|
|
}
|
|
float w2( float a ){
|
|
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
|
|
}
|
|
float w3( float a ) {
|
|
return ( 1.0 / 6.0 ) * ( a * a * a );
|
|
}
|
|
float g0( float a ) {
|
|
return w0( a ) + w1( a );
|
|
}
|
|
float g1( float a ) {
|
|
return w2( a ) + w3( a );
|
|
}
|
|
float h0( float a ) {
|
|
return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
|
|
}
|
|
float h1( float a ) {
|
|
return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
|
|
}
|
|
vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
|
|
uv = uv * texelSize.zw + 0.5;
|
|
vec2 iuv = floor( uv );
|
|
vec2 fuv = fract( uv );
|
|
float g0x = g0( fuv.x );
|
|
float g1x = g1( fuv.x );
|
|
float h0x = h0( fuv.x );
|
|
float h1x = h1( fuv.x );
|
|
float h0y = h0( fuv.y );
|
|
float h1y = h1( fuv.y );
|
|
vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
|
|
vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
|
|
vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
|
|
vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
|
|
return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
|
|
g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
|
|
}
|
|
vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
|
|
vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
|
|
vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
|
|
vec2 fLodSizeInv = 1.0 / fLodSize;
|
|
vec2 cLodSizeInv = 1.0 / cLodSize;
|
|
vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
|
|
vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
|
|
return mix( fSample, cSample, fract( lod ) );
|
|
}
|
|
vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
|
|
vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
|
|
vec3 modelScale;
|
|
modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
|
|
modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
|
|
modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
|
|
return normalize( refractionVector ) * thickness * modelScale;
|
|
}
|
|
float applyIorToRoughness( const in float roughness, const in float ior ) {
|
|
return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
|
|
}
|
|
vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
|
|
float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
|
|
return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
|
|
}
|
|
vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
|
|
if ( isinf( attenuationDistance ) ) {
|
|
return vec3( 1.0 );
|
|
} else {
|
|
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
|
|
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
|
|
}
|
|
}
|
|
vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
|
|
const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
|
|
const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
|
|
const in vec3 attenuationColor, const in float attenuationDistance ) {
|
|
vec4 transmittedLight;
|
|
vec3 transmittance;
|
|
#ifdef USE_DISPERSION
|
|
float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
|
|
vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
|
|
for ( int i = 0; i < 3; i ++ ) {
|
|
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
|
|
vec3 refractedRayExit = position + transmissionRay;
|
|
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
|
|
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
|
|
refractionCoords += 1.0;
|
|
refractionCoords /= 2.0;
|
|
vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
|
|
transmittedLight[ i ] = transmissionSample[ i ];
|
|
transmittedLight.a += transmissionSample.a;
|
|
transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
|
|
}
|
|
transmittedLight.a /= 3.0;
|
|
#else
|
|
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
|
|
vec3 refractedRayExit = position + transmissionRay;
|
|
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
|
|
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
|
|
refractionCoords += 1.0;
|
|
refractionCoords /= 2.0;
|
|
transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
|
|
transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
|
|
#endif
|
|
vec3 attenuatedColor = transmittance * transmittedLight.rgb;
|
|
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
|
|
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
|
|
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
|
|
}
|
|
#endif`,v2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
varying vec2 vUv;
|
|
#endif
|
|
#ifdef USE_MAP
|
|
varying vec2 vMapUv;
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
varying vec2 vAlphaMapUv;
|
|
#endif
|
|
#ifdef USE_LIGHTMAP
|
|
varying vec2 vLightMapUv;
|
|
#endif
|
|
#ifdef USE_AOMAP
|
|
varying vec2 vAoMapUv;
|
|
#endif
|
|
#ifdef USE_BUMPMAP
|
|
varying vec2 vBumpMapUv;
|
|
#endif
|
|
#ifdef USE_NORMALMAP
|
|
varying vec2 vNormalMapUv;
|
|
#endif
|
|
#ifdef USE_EMISSIVEMAP
|
|
varying vec2 vEmissiveMapUv;
|
|
#endif
|
|
#ifdef USE_METALNESSMAP
|
|
varying vec2 vMetalnessMapUv;
|
|
#endif
|
|
#ifdef USE_ROUGHNESSMAP
|
|
varying vec2 vRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_ANISOTROPYMAP
|
|
varying vec2 vAnisotropyMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOATMAP
|
|
varying vec2 vClearcoatMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
varying vec2 vClearcoatNormalMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
varying vec2 vClearcoatRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCEMAP
|
|
varying vec2 vIridescenceMapUv;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
varying vec2 vIridescenceThicknessMapUv;
|
|
#endif
|
|
#ifdef USE_SHEEN_COLORMAP
|
|
varying vec2 vSheenColorMapUv;
|
|
#endif
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
|
varying vec2 vSheenRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULARMAP
|
|
varying vec2 vSpecularMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULAR_COLORMAP
|
|
varying vec2 vSpecularColorMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
|
varying vec2 vSpecularIntensityMapUv;
|
|
#endif
|
|
#ifdef USE_TRANSMISSIONMAP
|
|
uniform mat3 transmissionMapTransform;
|
|
varying vec2 vTransmissionMapUv;
|
|
#endif
|
|
#ifdef USE_THICKNESSMAP
|
|
uniform mat3 thicknessMapTransform;
|
|
varying vec2 vThicknessMapUv;
|
|
#endif`,x2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
varying vec2 vUv;
|
|
#endif
|
|
#ifdef USE_MAP
|
|
uniform mat3 mapTransform;
|
|
varying vec2 vMapUv;
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
uniform mat3 alphaMapTransform;
|
|
varying vec2 vAlphaMapUv;
|
|
#endif
|
|
#ifdef USE_LIGHTMAP
|
|
uniform mat3 lightMapTransform;
|
|
varying vec2 vLightMapUv;
|
|
#endif
|
|
#ifdef USE_AOMAP
|
|
uniform mat3 aoMapTransform;
|
|
varying vec2 vAoMapUv;
|
|
#endif
|
|
#ifdef USE_BUMPMAP
|
|
uniform mat3 bumpMapTransform;
|
|
varying vec2 vBumpMapUv;
|
|
#endif
|
|
#ifdef USE_NORMALMAP
|
|
uniform mat3 normalMapTransform;
|
|
varying vec2 vNormalMapUv;
|
|
#endif
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
uniform mat3 displacementMapTransform;
|
|
varying vec2 vDisplacementMapUv;
|
|
#endif
|
|
#ifdef USE_EMISSIVEMAP
|
|
uniform mat3 emissiveMapTransform;
|
|
varying vec2 vEmissiveMapUv;
|
|
#endif
|
|
#ifdef USE_METALNESSMAP
|
|
uniform mat3 metalnessMapTransform;
|
|
varying vec2 vMetalnessMapUv;
|
|
#endif
|
|
#ifdef USE_ROUGHNESSMAP
|
|
uniform mat3 roughnessMapTransform;
|
|
varying vec2 vRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_ANISOTROPYMAP
|
|
uniform mat3 anisotropyMapTransform;
|
|
varying vec2 vAnisotropyMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOATMAP
|
|
uniform mat3 clearcoatMapTransform;
|
|
varying vec2 vClearcoatMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
uniform mat3 clearcoatNormalMapTransform;
|
|
varying vec2 vClearcoatNormalMapUv;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
uniform mat3 clearcoatRoughnessMapTransform;
|
|
varying vec2 vClearcoatRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_SHEEN_COLORMAP
|
|
uniform mat3 sheenColorMapTransform;
|
|
varying vec2 vSheenColorMapUv;
|
|
#endif
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
|
uniform mat3 sheenRoughnessMapTransform;
|
|
varying vec2 vSheenRoughnessMapUv;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCEMAP
|
|
uniform mat3 iridescenceMapTransform;
|
|
varying vec2 vIridescenceMapUv;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
uniform mat3 iridescenceThicknessMapTransform;
|
|
varying vec2 vIridescenceThicknessMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULARMAP
|
|
uniform mat3 specularMapTransform;
|
|
varying vec2 vSpecularMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULAR_COLORMAP
|
|
uniform mat3 specularColorMapTransform;
|
|
varying vec2 vSpecularColorMapUv;
|
|
#endif
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
|
uniform mat3 specularIntensityMapTransform;
|
|
varying vec2 vSpecularIntensityMapUv;
|
|
#endif
|
|
#ifdef USE_TRANSMISSIONMAP
|
|
uniform mat3 transmissionMapTransform;
|
|
varying vec2 vTransmissionMapUv;
|
|
#endif
|
|
#ifdef USE_THICKNESSMAP
|
|
uniform mat3 thicknessMapTransform;
|
|
varying vec2 vThicknessMapUv;
|
|
#endif`,b2=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
vUv = vec3( uv, 1 ).xy;
|
|
#endif
|
|
#ifdef USE_MAP
|
|
vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_ALPHAMAP
|
|
vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_LIGHTMAP
|
|
vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_AOMAP
|
|
vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_BUMPMAP
|
|
vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_NORMALMAP
|
|
vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_EMISSIVEMAP
|
|
vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_METALNESSMAP
|
|
vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_ROUGHNESSMAP
|
|
vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_ANISOTROPYMAP
|
|
vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_CLEARCOATMAP
|
|
vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCEMAP
|
|
vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_SHEEN_COLORMAP
|
|
vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
|
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_SPECULARMAP
|
|
vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_SPECULAR_COLORMAP
|
|
vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
|
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_TRANSMISSIONMAP
|
|
vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
|
|
#endif
|
|
#ifdef USE_THICKNESSMAP
|
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
|
#endif`,y2=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
|
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
|
#ifdef USE_BATCHING
|
|
worldPosition = batchingMatrix * worldPosition;
|
|
#endif
|
|
#ifdef USE_INSTANCING
|
|
worldPosition = instanceMatrix * worldPosition;
|
|
#endif
|
|
worldPosition = modelMatrix * worldPosition;
|
|
#endif`,C2=`varying vec2 vUv;
|
|
uniform mat3 uvTransform;
|
|
void main() {
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
gl_Position = vec4( position.xy, 1.0, 1.0 );
|
|
}`,M2=`uniform sampler2D t2D;
|
|
uniform float backgroundIntensity;
|
|
varying vec2 vUv;
|
|
void main() {
|
|
vec4 texColor = texture2D( t2D, vUv );
|
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
|
|
#endif
|
|
texColor.rgb *= backgroundIntensity;
|
|
gl_FragColor = texColor;
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
}`,w2=`varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
gl_Position.z = gl_Position.w;
|
|
}`,S2=`#ifdef ENVMAP_TYPE_CUBE
|
|
uniform samplerCube envMap;
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
uniform sampler2D envMap;
|
|
#endif
|
|
uniform float backgroundBlurriness;
|
|
uniform float backgroundIntensity;
|
|
uniform mat3 backgroundRotation;
|
|
varying vec3 vWorldDirection;
|
|
#include <cube_uv_reflection_fragment>
|
|
void main() {
|
|
#ifdef ENVMAP_TYPE_CUBE
|
|
vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
|
|
#else
|
|
vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
#endif
|
|
texColor.rgb *= backgroundIntensity;
|
|
gl_FragColor = texColor;
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
}`,E2=`varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
gl_Position.z = gl_Position.w;
|
|
}`,T2=`uniform samplerCube tCube;
|
|
uniform float tFlip;
|
|
uniform float opacity;
|
|
varying vec3 vWorldDirection;
|
|
void main() {
|
|
vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
|
|
gl_FragColor = texColor;
|
|
gl_FragColor.a *= opacity;
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
}`,P2=`#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
varying vec2 vHighPrecisionZW;
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <batching_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <morphinstance_vertex>
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vHighPrecisionZW = gl_Position.zw;
|
|
}`,A2=`#if DEPTH_PACKING == 3200
|
|
uniform float opacity;
|
|
#endif
|
|
#include <common>
|
|
#include <packing>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
varying vec2 vHighPrecisionZW;
|
|
void main() {
|
|
vec4 diffuseColor = vec4( 1.0 );
|
|
#include <clipping_planes_fragment>
|
|
#if DEPTH_PACKING == 3200
|
|
diffuseColor.a = opacity;
|
|
#endif
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
|
|
#else
|
|
float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
|
|
#endif
|
|
#if DEPTH_PACKING == 3200
|
|
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
|
|
#elif DEPTH_PACKING == 3201
|
|
gl_FragColor = packDepthToRGBA( fragCoordZ );
|
|
#elif DEPTH_PACKING == 3202
|
|
gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
|
|
#elif DEPTH_PACKING == 3203
|
|
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
|
|
#endif
|
|
}`,I2=`#define DISTANCE
|
|
varying vec3 vWorldPosition;
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <batching_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <morphinstance_vertex>
|
|
#ifdef USE_DISPLACEMENTMAP
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vWorldPosition = worldPosition.xyz;
|
|
}`,O2=`#define DISTANCE
|
|
uniform vec3 referencePosition;
|
|
uniform float nearDistance;
|
|
uniform float farDistance;
|
|
varying vec3 vWorldPosition;
|
|
#include <common>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main () {
|
|
vec4 diffuseColor = vec4( 1.0 );
|
|
#include <clipping_planes_fragment>
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
float dist = length( vWorldPosition - referencePosition );
|
|
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
|
|
dist = saturate( dist );
|
|
gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
|
|
}`,D2=`varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
}`,k2=`uniform sampler2D tEquirect;
|
|
varying vec3 vWorldDirection;
|
|
#include <common>
|
|
void main() {
|
|
vec3 direction = normalize( vWorldDirection );
|
|
vec2 sampleUV = equirectUv( direction );
|
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
}`,R2=`uniform float scale;
|
|
attribute float lineDistance;
|
|
varying float vLineDistance;
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
vLineDistance = scale * lineDistance;
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
}`,N2=`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
uniform float dashSize;
|
|
uniform float totalSize;
|
|
varying float vLineDistance;
|
|
#include <common>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
|
discard;
|
|
}
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,L2=`#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#endif
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <envmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,F2=`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#ifndef FLAT_SHADED
|
|
varying vec3 vNormal;
|
|
#endif
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <specularmap_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
#ifdef USE_LIGHTMAP
|
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
|
reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
|
|
#else
|
|
reflectedLight.indirectDiffuse += vec3( 1.0 );
|
|
#endif
|
|
#include <aomap_fragment>
|
|
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
|
|
vec3 outgoingLight = reflectedLight.indirectDiffuse;
|
|
#include <envmap_fragment>
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,V2=`#define LAMBERT
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <envmap_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,B2=`#define LAMBERT
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <envmap_physical_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <normal_pars_fragment>
|
|
#include <lights_lambert_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <specularmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_lambert_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
|
|
#include <envmap_fragment>
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,U2=`#define MATCAP
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
}`,z2=`#define MATCAP
|
|
uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
uniform sampler2D matcap;
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <normal_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
vec3 viewDir = normalize( vViewPosition );
|
|
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
|
|
vec3 y = cross( viewDir, x );
|
|
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
|
|
#ifdef USE_MATCAP
|
|
vec4 matcapColor = texture2D( matcap, uv );
|
|
#else
|
|
vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
|
|
#endif
|
|
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,H2=`#define NORMAL
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
varying vec3 vViewPosition;
|
|
#endif
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
vViewPosition = - mvPosition.xyz;
|
|
#endif
|
|
}`,G2=`#define NORMAL
|
|
uniform float opacity;
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
varying vec3 vViewPosition;
|
|
#endif
|
|
#include <uv_pars_fragment>
|
|
#include <normal_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
|
|
#include <clipping_planes_fragment>
|
|
#include <logdepthbuf_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
|
|
#ifdef OPAQUE
|
|
gl_FragColor.a = 1.0;
|
|
#endif
|
|
}`,W2=`#define PHONG
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <envmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <envmap_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,X2=`#define PHONG
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform vec3 specular;
|
|
uniform float shininess;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_pars_fragment>
|
|
#include <envmap_physical_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <normal_pars_fragment>
|
|
#include <lights_phong_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <specularmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <specularmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_phong_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
|
|
#include <envmap_fragment>
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,q2=`#define STANDARD
|
|
varying vec3 vViewPosition;
|
|
#ifdef USE_TRANSMISSION
|
|
varying vec3 vWorldPosition;
|
|
#endif
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
#ifdef USE_TRANSMISSION
|
|
vWorldPosition = worldPosition.xyz;
|
|
#endif
|
|
}`,$2=`#define STANDARD
|
|
#ifdef PHYSICAL
|
|
#define IOR
|
|
#define USE_SPECULAR
|
|
#endif
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform float roughness;
|
|
uniform float metalness;
|
|
uniform float opacity;
|
|
#ifdef IOR
|
|
uniform float ior;
|
|
#endif
|
|
#ifdef USE_SPECULAR
|
|
uniform float specularIntensity;
|
|
uniform vec3 specularColor;
|
|
#ifdef USE_SPECULAR_COLORMAP
|
|
uniform sampler2D specularColorMap;
|
|
#endif
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
|
uniform sampler2D specularIntensityMap;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
uniform float clearcoat;
|
|
uniform float clearcoatRoughness;
|
|
#endif
|
|
#ifdef USE_DISPERSION
|
|
uniform float dispersion;
|
|
#endif
|
|
#ifdef USE_IRIDESCENCE
|
|
uniform float iridescence;
|
|
uniform float iridescenceIOR;
|
|
uniform float iridescenceThicknessMinimum;
|
|
uniform float iridescenceThicknessMaximum;
|
|
#endif
|
|
#ifdef USE_SHEEN
|
|
uniform vec3 sheenColor;
|
|
uniform float sheenRoughness;
|
|
#ifdef USE_SHEEN_COLORMAP
|
|
uniform sampler2D sheenColorMap;
|
|
#endif
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
|
uniform sampler2D sheenRoughnessMap;
|
|
#endif
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
uniform vec2 anisotropyVector;
|
|
#ifdef USE_ANISOTROPYMAP
|
|
uniform sampler2D anisotropyMap;
|
|
#endif
|
|
#endif
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <iridescence_fragment>
|
|
#include <cube_uv_reflection_fragment>
|
|
#include <envmap_common_pars_fragment>
|
|
#include <envmap_physical_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <lights_pars_begin>
|
|
#include <normal_pars_fragment>
|
|
#include <lights_physical_pars_fragment>
|
|
#include <transmission_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <clearcoat_pars_fragment>
|
|
#include <iridescence_pars_fragment>
|
|
#include <roughnessmap_pars_fragment>
|
|
#include <metalnessmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <roughnessmap_fragment>
|
|
#include <metalnessmap_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <clearcoat_normal_fragment_begin>
|
|
#include <clearcoat_normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_physical_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
|
|
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
|
|
#include <transmission_fragment>
|
|
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
|
|
#ifdef USE_SHEEN
|
|
|
|
outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
|
|
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
|
|
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
|
|
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
|
|
#endif
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,Y2=`#define TOON
|
|
varying vec3 vViewPosition;
|
|
#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <uv_pars_vertex>
|
|
#include <displacementmap_pars_vertex>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <normal_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <normal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <displacementmap_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
vViewPosition = - mvPosition.xyz;
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,j2=`#define TOON
|
|
uniform vec3 diffuse;
|
|
uniform vec3 emissive;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <dithering_pars_fragment>
|
|
#include <color_pars_fragment>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <aomap_pars_fragment>
|
|
#include <lightmap_pars_fragment>
|
|
#include <emissivemap_pars_fragment>
|
|
#include <gradientmap_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <normal_pars_fragment>
|
|
#include <lights_toon_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <bumpmap_pars_fragment>
|
|
#include <normalmap_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
|
vec3 totalEmissiveRadiance = emissive;
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <color_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
#include <normal_fragment_begin>
|
|
#include <normal_fragment_maps>
|
|
#include <emissivemap_fragment>
|
|
#include <lights_toon_fragment>
|
|
#include <lights_fragment_begin>
|
|
#include <lights_fragment_maps>
|
|
#include <lights_fragment_end>
|
|
#include <aomap_fragment>
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
#include <dithering_fragment>
|
|
}`,K2=`uniform float size;
|
|
uniform float scale;
|
|
#include <common>
|
|
#include <color_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
#ifdef USE_POINTS_UV
|
|
varying vec2 vUv;
|
|
uniform mat3 uvTransform;
|
|
#endif
|
|
void main() {
|
|
#ifdef USE_POINTS_UV
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
#endif
|
|
#include <color_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphcolor_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <project_vertex>
|
|
gl_PointSize = size;
|
|
#ifdef USE_SIZEATTENUATION
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
|
|
#endif
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <fog_vertex>
|
|
}`,Z2=`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <color_pars_fragment>
|
|
#include <map_particle_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_particle_fragment>
|
|
#include <color_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,J2=`#include <common>
|
|
#include <batching_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <morphtarget_pars_vertex>
|
|
#include <skinning_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <shadowmap_pars_vertex>
|
|
void main() {
|
|
#include <batching_vertex>
|
|
#include <beginnormal_vertex>
|
|
#include <morphinstance_vertex>
|
|
#include <morphnormal_vertex>
|
|
#include <skinbase_vertex>
|
|
#include <skinnormal_vertex>
|
|
#include <defaultnormal_vertex>
|
|
#include <begin_vertex>
|
|
#include <morphtarget_vertex>
|
|
#include <skinning_vertex>
|
|
#include <project_vertex>
|
|
#include <logdepthbuf_vertex>
|
|
#include <worldpos_vertex>
|
|
#include <shadowmap_vertex>
|
|
#include <fog_vertex>
|
|
}`,Q2=`uniform vec3 color;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <fog_pars_fragment>
|
|
#include <bsdfs>
|
|
#include <lights_pars_begin>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <shadowmap_pars_fragment>
|
|
#include <shadowmask_pars_fragment>
|
|
void main() {
|
|
#include <logdepthbuf_fragment>
|
|
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
#include <premultiplied_alpha_fragment>
|
|
}`,eT=`uniform float rotation;
|
|
uniform vec2 center;
|
|
#include <common>
|
|
#include <uv_pars_vertex>
|
|
#include <fog_pars_vertex>
|
|
#include <logdepthbuf_pars_vertex>
|
|
#include <clipping_planes_pars_vertex>
|
|
void main() {
|
|
#include <uv_vertex>
|
|
vec4 mvPosition = modelViewMatrix[ 3 ];
|
|
vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
|
|
#ifndef USE_SIZEATTENUATION
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
if ( isPerspective ) scale *= - mvPosition.z;
|
|
#endif
|
|
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
|
|
vec2 rotatedPosition;
|
|
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
|
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
|
mvPosition.xy += rotatedPosition;
|
|
gl_Position = projectionMatrix * mvPosition;
|
|
#include <logdepthbuf_vertex>
|
|
#include <clipping_planes_vertex>
|
|
#include <fog_vertex>
|
|
}`,tT=`uniform vec3 diffuse;
|
|
uniform float opacity;
|
|
#include <common>
|
|
#include <uv_pars_fragment>
|
|
#include <map_pars_fragment>
|
|
#include <alphamap_pars_fragment>
|
|
#include <alphatest_pars_fragment>
|
|
#include <alphahash_pars_fragment>
|
|
#include <fog_pars_fragment>
|
|
#include <logdepthbuf_pars_fragment>
|
|
#include <clipping_planes_pars_fragment>
|
|
void main() {
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
#include <clipping_planes_fragment>
|
|
vec3 outgoingLight = vec3( 0.0 );
|
|
#include <logdepthbuf_fragment>
|
|
#include <map_fragment>
|
|
#include <alphamap_fragment>
|
|
#include <alphatest_fragment>
|
|
#include <alphahash_fragment>
|
|
outgoingLight = diffuseColor.rgb;
|
|
#include <opaque_fragment>
|
|
#include <tonemapping_fragment>
|
|
#include <colorspace_fragment>
|
|
#include <fog_fragment>
|
|
}`,Mt={alphahash_fragment:CS,alphahash_pars_fragment:MS,alphamap_fragment:wS,alphamap_pars_fragment:SS,alphatest_fragment:ES,alphatest_pars_fragment:TS,aomap_fragment:PS,aomap_pars_fragment:AS,batching_pars_vertex:IS,batching_vertex:OS,begin_vertex:DS,beginnormal_vertex:kS,bsdfs:RS,iridescence_fragment:NS,bumpmap_pars_fragment:LS,clipping_planes_fragment:FS,clipping_planes_pars_fragment:VS,clipping_planes_pars_vertex:BS,clipping_planes_vertex:US,color_fragment:zS,color_pars_fragment:HS,color_pars_vertex:GS,color_vertex:WS,common:XS,cube_uv_reflection_fragment:qS,defaultnormal_vertex:$S,displacementmap_pars_vertex:YS,displacementmap_vertex:jS,emissivemap_fragment:KS,emissivemap_pars_fragment:ZS,colorspace_fragment:JS,colorspace_pars_fragment:QS,envmap_fragment:eE,envmap_common_pars_fragment:tE,envmap_pars_fragment:nE,envmap_pars_vertex:iE,envmap_physical_pars_fragment:mE,envmap_vertex:oE,fog_vertex:rE,fog_pars_vertex:aE,fog_fragment:sE,fog_pars_fragment:lE,gradientmap_pars_fragment:cE,lightmap_pars_fragment:dE,lights_lambert_fragment:uE,lights_lambert_pars_fragment:hE,lights_pars_begin:pE,lights_toon_fragment:fE,lights_toon_pars_fragment:gE,lights_phong_fragment:_E,lights_phong_pars_fragment:vE,lights_physical_fragment:xE,lights_physical_pars_fragment:bE,lights_fragment_begin:yE,lights_fragment_maps:CE,lights_fragment_end:ME,lightprobes_pars_fragment:wE,logdepthbuf_fragment:SE,logdepthbuf_pars_fragment:EE,logdepthbuf_pars_vertex:TE,logdepthbuf_vertex:PE,map_fragment:AE,map_pars_fragment:IE,map_particle_fragment:OE,map_particle_pars_fragment:DE,metalnessmap_fragment:kE,metalnessmap_pars_fragment:RE,morphinstance_vertex:NE,morphcolor_vertex:LE,morphnormal_vertex:FE,morphtarget_pars_vertex:VE,morphtarget_vertex:BE,normal_fragment_begin:UE,normal_fragment_maps:zE,normal_pars_fragment:HE,normal_pars_vertex:GE,normal_vertex:WE,normalmap_pars_fragment:XE,clearcoat_normal_fragment_begin:qE,clearcoat_normal_fragment_maps:$E,clearcoat_pars_fragment:YE,iridescence_pars_fragment:jE,opaque_fragment:KE,packing:ZE,premultiplied_alpha_fragment:JE,project_vertex:QE,dithering_fragment:e2,dithering_pars_fragment:t2,roughnessmap_fragment:n2,roughnessmap_pars_fragment:i2,shadowmap_pars_fragment:o2,shadowmap_pars_vertex:r2,shadowmap_vertex:a2,shadowmask_pars_fragment:s2,skinbase_vertex:l2,skinning_pars_vertex:c2,skinning_vertex:d2,skinnormal_vertex:u2,specularmap_fragment:h2,specularmap_pars_fragment:p2,tonemapping_fragment:m2,tonemapping_pars_fragment:f2,transmission_fragment:g2,transmission_pars_fragment:_2,uv_pars_fragment:v2,uv_pars_vertex:x2,uv_vertex:b2,worldpos_vertex:y2,background_vert:C2,background_frag:M2,backgroundCube_vert:w2,backgroundCube_frag:S2,cube_vert:E2,cube_frag:T2,depth_vert:P2,depth_frag:A2,distance_vert:I2,distance_frag:O2,equirect_vert:D2,equirect_frag:k2,linedashed_vert:R2,linedashed_frag:N2,meshbasic_vert:L2,meshbasic_frag:F2,meshlambert_vert:V2,meshlambert_frag:B2,meshmatcap_vert:U2,meshmatcap_frag:z2,meshnormal_vert:H2,meshnormal_frag:G2,meshphong_vert:W2,meshphong_frag:X2,meshphysical_vert:q2,meshphysical_frag:$2,meshtoon_vert:Y2,meshtoon_frag:j2,points_vert:K2,points_frag:Z2,shadow_vert:J2,shadow_frag:Q2,sprite_vert:eT,sprite_frag:tT},Ue={common:{diffuse:{value:new dt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new mt},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new mt}},envmap:{envMap:{value:null},envMapRotation:{value:new mt},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new mt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new mt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new mt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new mt},normalScale:{value:new At(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new mt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new mt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new mt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new mt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new dt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new j},probesMax:{value:new j},probesResolution:{value:new j}},points:{diffuse:{value:new dt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0},uvTransform:{value:new mt}},sprite:{diffuse:{value:new dt(16777215)},opacity:{value:1},center:{value:new At(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new mt},alphaMap:{value:null},alphaMapTransform:{value:new mt},alphaTest:{value:0}}},ao={basic:{uniforms:Un([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.fog]),vertexShader:Mt.meshbasic_vert,fragmentShader:Mt.meshbasic_frag},lambert:{uniforms:Un([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new dt(0)},envMapIntensity:{value:1}}]),vertexShader:Mt.meshlambert_vert,fragmentShader:Mt.meshlambert_frag},phong:{uniforms:Un([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new dt(0)},specular:{value:new dt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Mt.meshphong_vert,fragmentShader:Mt.meshphong_frag},standard:{uniforms:Un([Ue.common,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.roughnessmap,Ue.metalnessmap,Ue.fog,Ue.lights,{emissive:{value:new dt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag},toon:{uniforms:Un([Ue.common,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.gradientmap,Ue.fog,Ue.lights,{emissive:{value:new dt(0)}}]),vertexShader:Mt.meshtoon_vert,fragmentShader:Mt.meshtoon_frag},matcap:{uniforms:Un([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,{matcap:{value:null}}]),vertexShader:Mt.meshmatcap_vert,fragmentShader:Mt.meshmatcap_frag},points:{uniforms:Un([Ue.points,Ue.fog]),vertexShader:Mt.points_vert,fragmentShader:Mt.points_frag},dashed:{uniforms:Un([Ue.common,Ue.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Mt.linedashed_vert,fragmentShader:Mt.linedashed_frag},depth:{uniforms:Un([Ue.common,Ue.displacementmap]),vertexShader:Mt.depth_vert,fragmentShader:Mt.depth_frag},normal:{uniforms:Un([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,{opacity:{value:1}}]),vertexShader:Mt.meshnormal_vert,fragmentShader:Mt.meshnormal_frag},sprite:{uniforms:Un([Ue.sprite,Ue.fog]),vertexShader:Mt.sprite_vert,fragmentShader:Mt.sprite_frag},background:{uniforms:{uvTransform:{value:new mt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Mt.background_vert,fragmentShader:Mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new mt}},vertexShader:Mt.backgroundCube_vert,fragmentShader:Mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Mt.cube_vert,fragmentShader:Mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Mt.equirect_vert,fragmentShader:Mt.equirect_frag},distance:{uniforms:Un([Ue.common,Ue.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Mt.distance_vert,fragmentShader:Mt.distance_frag},shadow:{uniforms:Un([Ue.lights,Ue.fog,{color:{value:new dt(0)},opacity:{value:1}}]),vertexShader:Mt.shadow_vert,fragmentShader:Mt.shadow_frag}};ao.physical={uniforms:Un([ao.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new mt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new mt},clearcoatNormalScale:{value:new At(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new mt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new mt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new mt},sheen:{value:0},sheenColor:{value:new dt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new mt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new mt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new mt},transmissionSamplerSize:{value:new At},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new mt},attenuationDistance:{value:0},attenuationColor:{value:new dt(0)},specularColor:{value:new dt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new mt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new mt},anisotropyVector:{value:new At},anisotropyMap:{value:null},anisotropyMapTransform:{value:new mt}}]),vertexShader:Mt.meshphysical_vert,fragmentShader:Mt.meshphysical_frag};var eu={r:0,b:0,g:0},nT=new Ct,_v=new mt;_v.set(-1,0,0,0,1,0,0,0,1);function iT(o,t,e,n,i,r){let a=new dt(0),s=i===!0?0:1,l,c,h=null,p=0,m=null;function x(I){let L=I.isScene===!0?I.background:null;if(L&&L.isTexture){let k=I.backgroundBlurriness>0;L=t.get(L,k)}return L}function M(I){let L=!1,k=x(I);k===null?y(a,s):k&&k.isColor&&(y(k,1),L=!0);let H=o.xr.getEnvironmentBlendMode();H==="additive"?e.buffers.color.setClear(0,0,0,1,r):H==="alpha-blend"&&e.buffers.color.setClear(0,0,0,0,r),(o.autoClear||L)&&(e.buffers.depth.setTest(!0),e.buffers.depth.setMask(!0),e.buffers.color.setMask(!0),o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil))}function S(I,L){let k=x(L);k&&(k.isCubeTexture||k.mapping===tl)?(c===void 0&&(c=new kn(new Aa(1,1,1),new di({name:"BackgroundCubeMaterial",uniforms:Ir(ao.backgroundCube.uniforms),vertexShader:ao.backgroundCube.vertexShader,fragmentShader:ao.backgroundCube.fragmentShader,side:$n,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(H,V,G){this.matrixWorld.copyPosition(G.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=k,c.material.uniforms.backgroundBlurriness.value=L.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=L.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(nT.makeRotationFromEuler(L.backgroundRotation)).transpose(),k.isCubeTexture&&k.isRenderTargetTexture===!1&&c.material.uniforms.backgroundRotation.value.premultiply(_v),c.material.toneMapped=St.getTransfer(k.colorSpace)!==Ht,(h!==k||p!==k.version||m!==o.toneMapping)&&(c.material.needsUpdate=!0,h=k,p=k.version,m=o.toneMapping),c.layers.enableAll(),I.unshift(c,c.geometry,c.material,0,0,null)):k&&k.isTexture&&(l===void 0&&(l=new kn(new Hs(2,2),new di({name:"BackgroundMaterial",uniforms:Ir(ao.background.uniforms),vertexShader:ao.background.vertexShader,fragmentShader:ao.background.fragmentShader,side:Di,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=k,l.material.uniforms.backgroundIntensity.value=L.backgroundIntensity,l.material.toneMapped=St.getTransfer(k.colorSpace)!==Ht,k.matrixAutoUpdate===!0&&k.updateMatrix(),l.material.uniforms.uvTransform.value.copy(k.matrix),(h!==k||p!==k.version||m!==o.toneMapping)&&(l.material.needsUpdate=!0,h=k,p=k.version,m=o.toneMapping),l.layers.enableAll(),I.unshift(l,l.geometry,l.material,0,0,null))}function y(I,L){I.getRGB(eu,yp(o)),e.buffers.color.setClear(eu.r,eu.g,eu.b,L,r)}function C(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(I,L=1){a.set(I),s=L,y(a,s)},getClearAlpha:function(){return s},setClearAlpha:function(I){s=I,y(a,s)},render:M,addToRenderList:S,dispose:C}}function oT(o,t){let e=o.getParameter(o.MAX_VERTEX_ATTRIBS),n={},i=m(null),r=i,a=!1;function s(U,ee,de,fe,$){let ae=!1,J=p(U,fe,de,ee);r!==J&&(r=J,c(r.object)),ae=x(U,fe,de,$),ae&&M(U,fe,de,$),$!==null&&t.update($,o.ELEMENT_ARRAY_BUFFER),(ae||a)&&(a=!1,k(U,ee,de,fe),$!==null&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.get($).buffer))}function l(){return o.createVertexArray()}function c(U){return o.bindVertexArray(U)}function h(U){return o.deleteVertexArray(U)}function p(U,ee,de,fe){let $=fe.wireframe===!0,ae=n[ee.id];ae===void 0&&(ae={},n[ee.id]=ae);let J=U.isInstancedMesh===!0?U.id:0,Ce=ae[J];Ce===void 0&&(Ce={},ae[J]=Ce);let Se=Ce[de.id];Se===void 0&&(Se={},Ce[de.id]=Se);let Ve=Se[$];return Ve===void 0&&(Ve=m(l()),Se[$]=Ve),Ve}function m(U){let ee=[],de=[],fe=[];for(let $=0;$<e;$++)ee[$]=0,de[$]=0,fe[$]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:ee,enabledAttributes:de,attributeDivisors:fe,object:U,attributes:{},index:null}}function x(U,ee,de,fe){let $=r.attributes,ae=ee.attributes,J=0,Ce=de.getAttributes();for(let Se in Ce)if(Ce[Se].location>=0){let Ye=$[Se],Ze=ae[Se];if(Ze===void 0&&(Se==="instanceMatrix"&&U.instanceMatrix&&(Ze=U.instanceMatrix),Se==="instanceColor"&&U.instanceColor&&(Ze=U.instanceColor)),Ye===void 0||Ye.attribute!==Ze||Ze&&Ye.data!==Ze.data)return!0;J++}return r.attributesNum!==J||r.index!==fe}function M(U,ee,de,fe){let $={},ae=ee.attributes,J=0,Ce=de.getAttributes();for(let Se in Ce)if(Ce[Se].location>=0){let Ye=ae[Se];Ye===void 0&&(Se==="instanceMatrix"&&U.instanceMatrix&&(Ye=U.instanceMatrix),Se==="instanceColor"&&U.instanceColor&&(Ye=U.instanceColor));let Ze={};Ze.attribute=Ye,Ye&&Ye.data&&(Ze.data=Ye.data),$[Se]=Ze,J++}r.attributes=$,r.attributesNum=J,r.index=fe}function S(){let U=r.newAttributes;for(let ee=0,de=U.length;ee<de;ee++)U[ee]=0}function y(U){C(U,0)}function C(U,ee){let de=r.newAttributes,fe=r.enabledAttributes,$=r.attributeDivisors;de[U]=1,fe[U]===0&&(o.enableVertexAttribArray(U),fe[U]=1),$[U]!==ee&&(o.vertexAttribDivisor(U,ee),$[U]=ee)}function I(){let U=r.newAttributes,ee=r.enabledAttributes;for(let de=0,fe=ee.length;de<fe;de++)ee[de]!==U[de]&&(o.disableVertexAttribArray(de),ee[de]=0)}function L(U,ee,de,fe,$,ae,J){J===!0?o.vertexAttribIPointer(U,ee,de,$,ae):o.vertexAttribPointer(U,ee,de,fe,$,ae)}function k(U,ee,de,fe){S();let $=fe.attributes,ae=de.getAttributes(),J=ee.defaultAttributeValues;for(let Ce in ae){let Se=ae[Ce];if(Se.location>=0){let Ve=$[Ce];if(Ve===void 0&&(Ce==="instanceMatrix"&&U.instanceMatrix&&(Ve=U.instanceMatrix),Ce==="instanceColor"&&U.instanceColor&&(Ve=U.instanceColor)),Ve!==void 0){let Ye=Ve.normalized,Ze=Ve.itemSize,It=t.get(Ve);if(It===void 0)continue;let ut=It.buffer,it=It.type,_e=It.bytesPerElement,Be=it===o.INT||it===o.UNSIGNED_INT||Ve.gpuType===_d;if(Ve.isInterleavedBufferAttribute){let Pe=Ve.data,nt=Pe.stride,ot=Ve.offset;if(Pe.isInstancedInterleavedBuffer){for(let at=0;at<Se.locationSize;at++)C(Se.location+at,Pe.meshPerAttribute);U.isInstancedMesh!==!0&&fe._maxInstanceCount===void 0&&(fe._maxInstanceCount=Pe.meshPerAttribute*Pe.count)}else for(let at=0;at<Se.locationSize;at++)y(Se.location+at);o.bindBuffer(o.ARRAY_BUFFER,ut);for(let at=0;at<Se.locationSize;at++)L(Se.location+at,Ze/Se.locationSize,it,Ye,nt*_e,(ot+Ze/Se.locationSize*at)*_e,Be)}else{if(Ve.isInstancedBufferAttribute){for(let Pe=0;Pe<Se.locationSize;Pe++)C(Se.location+Pe,Ve.meshPerAttribute);U.isInstancedMesh!==!0&&fe._maxInstanceCount===void 0&&(fe._maxInstanceCount=Ve.meshPerAttribute*Ve.count)}else for(let Pe=0;Pe<Se.locationSize;Pe++)y(Se.location+Pe);o.bindBuffer(o.ARRAY_BUFFER,ut);for(let Pe=0;Pe<Se.locationSize;Pe++)L(Se.location+Pe,Ze/Se.locationSize,it,Ye,Ze*_e,Ze/Se.locationSize*Pe*_e,Be)}}else if(J!==void 0){let Ye=J[Ce];if(Ye!==void 0)switch(Ye.length){case 2:o.vertexAttrib2fv(Se.location,Ye);break;case 3:o.vertexAttrib3fv(Se.location,Ye);break;case 4:o.vertexAttrib4fv(Se.location,Ye);break;default:o.vertexAttrib1fv(Se.location,Ye)}}}}I()}function H(){B();for(let U in n){let ee=n[U];for(let de in ee){let fe=ee[de];for(let $ in fe){let ae=fe[$];for(let J in ae)h(ae[J].object),delete ae[J];delete fe[$]}}delete n[U]}}function V(U){if(n[U.id]===void 0)return;let ee=n[U.id];for(let de in ee){let fe=ee[de];for(let $ in fe){let ae=fe[$];for(let J in ae)h(ae[J].object),delete ae[J];delete fe[$]}}delete n[U.id]}function G(U){for(let ee in n){let de=n[ee];for(let fe in de){let $=de[fe];if($[U.id]===void 0)continue;let ae=$[U.id];for(let J in ae)h(ae[J].object),delete ae[J];delete $[U.id]}}}function E(U){for(let ee in n){let de=n[ee],fe=U.isInstancedMesh===!0?U.id:0,$=de[fe];if($!==void 0){for(let ae in $){let J=$[ae];for(let Ce in J)h(J[Ce].object),delete J[Ce];delete $[ae]}delete de[fe],Object.keys(de).length===0&&delete n[ee]}}}function B(){Y(),a=!0,r!==i&&(r=i,c(r.object))}function Y(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:s,reset:B,resetDefaultState:Y,dispose:H,releaseStatesOfGeometry:V,releaseStatesOfObject:E,releaseStatesOfProgram:G,initAttributes:S,enableAttribute:y,disableUnusedAttributes:I}}function rT(o,t,e){let n;function i(l){n=l}function r(l,c){o.drawArrays(n,l,c),e.update(c,n,1)}function a(l,c,h){h!==0&&(o.drawArraysInstanced(n,l,c,h),e.update(c,n,h))}function s(l,c,h){if(h===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,c,0,h);let m=0;for(let x=0;x<h;x++)m+=c[x];e.update(m,n,1)}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=s}function aT(o,t,e,n){let i;function r(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let G=t.get("EXT_texture_filter_anisotropic");i=o.getParameter(G.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(G){return!(G!==Bn&&n.convert(G)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_FORMAT))}function s(G){let E=G===oo&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(G!==Qn&&n.convert(G)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_TYPE)&&G!==ui&&!E)}function l(G){if(G==="highp"){if(o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.HIGH_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision>0)return"highp";G="mediump"}return G==="mediump"&&o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.MEDIUM_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",h=l(c);h!==c&&(Ke("WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);let p=e.logarithmicDepthBuffer===!0,m=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control");e.reversedDepthBuffer===!0&&m===!1&&Ke("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");let x=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS),M=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=o.getParameter(o.MAX_TEXTURE_SIZE),y=o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE),C=o.getParameter(o.MAX_VERTEX_ATTRIBS),I=o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS),L=o.getParameter(o.MAX_VARYING_VECTORS),k=o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS),H=o.getParameter(o.MAX_SAMPLES),V=o.getParameter(o.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:p,reversedDepthBuffer:m,maxTextures:x,maxVertexTextures:M,maxTextureSize:S,maxCubemapSize:y,maxAttributes:C,maxVertexUniforms:I,maxVaryings:L,maxFragmentUniforms:k,maxSamples:H,samples:V}}function sT(o){let t=this,e=null,n=0,i=!1,r=!1,a=new ji,s=new mt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){let x=p.length!==0||m||n!==0||i;return i=m,n=p.length,x},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(p,m){e=h(p,m,0)},this.setState=function(p,m,x){let M=p.clippingPlanes,S=p.clipIntersection,y=p.clipShadows,C=o.get(p);if(!i||M===null||M.length===0||r&&!y)r?h(null):c();else{let I=r?0:n,L=I*4,k=C.clippingState||null;l.value=k,k=h(M,m,L,x);for(let H=0;H!==L;++H)k[H]=e[H];C.clippingState=k,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=I}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(p,m,x,M){let S=p!==null?p.length:0,y=null;if(S!==0){if(y=l.value,M!==!0||y===null){let C=x+S*4,I=m.matrixWorldInverse;s.getNormalMatrix(I),(y===null||y.length<C)&&(y=new Float32Array(C));for(let L=0,k=x;L!==S;++L,k+=4)a.copy(p[L]).applyMatrix4(I,s),a.normal.toArray(y,k),y[k+3]=a.constant}l.value=y,l.needsUpdate=!0}return t.numPlanes=S,t.numIntersection=0,y}}var Qo=4,Y_=[.125,.215,.35,.446,.526,.582],Or=20,lT=256,al=new Yo,j_=new dt,Sp=null,Ep=0,Tp=0,Pp=!1,cT=new j,nu=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,e=0,n=.1,i=100,r={}){let{size:a=256,position:s=cT}=r;Sp=this._renderer.getRenderTarget(),Ep=this._renderer.getActiveCubeFace(),Tp=this._renderer.getActiveMipmapLevel(),Pp=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,n,i,l,s),e>0&&this._blur(l,0,0,e),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=J_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Z_(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodMeshes.length;t++)this._lodMeshes[t].geometry.dispose()}_cleanup(t){this._renderer.setRenderTarget(Sp,Ep,Tp),this._renderer.xr.enabled=Pp,t.scissorTest=!1,Va(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===jo||t.mapping===Sr?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Sp=this._renderer.getRenderTarget(),Ep=this._renderer.getActiveCubeFace(),Tp=this._renderer.getActiveMipmapLevel(),Pp=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:sn,minFilter:sn,generateMipmaps:!1,type:oo,format:Bn,colorSpace:Xn,depthBuffer:!1},i=K_(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=K_(t,e,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=dT(r)),this._blurMaterial=hT(r,t,e),this._ggxMaterial=uT(r,t,e)}return i}_compileMaterial(t){let e=new kn(new qn,t);this._renderer.compile(e,al)}_sceneToCubeUV(t,e,n,i,r){let l=new xn(90,1,e,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,x=p.toneMapping;p.getClearColor(j_),p.toneMapping=Ri,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(i),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new kn(new Aa,new ci({name:"PMREM.Background",side:$n,depthWrite:!1,depthTest:!1})));let S=this._backgroundBox,y=S.material,C=!1,I=t.background;I?I.isColor&&(y.color.copy(I),t.background=null,C=!0):(y.color.copy(j_),C=!0);for(let L=0;L<6;L++){let k=L%3;k===0?(l.up.set(0,c[L],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[L],r.y,r.z)):k===1?(l.up.set(0,0,c[L]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[L],r.z)):(l.up.set(0,c[L],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[L]));let H=this._cubeSize;Va(i,k*H,L>2?H:0,H,H),p.setRenderTarget(i),C&&p.render(S,l),p.render(t,l)}p.toneMapping=x,p.autoClear=m,t.background=I}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===jo||t.mapping===Sr;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=J_()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Z_());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r;let s=r.uniforms;s.envMap.value=t;let l=this._cubeSize;Va(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(a,al)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodMeshes.length;for(let r=1;r<i;r++)this._applyGGXFilter(t,r-1,r);e.autoClear=n}_applyGGXFilter(t,e,n){let i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[n];s.material=a;let l=a.uniforms,c=n/(this._lodMeshes.length-1),h=e/(this._lodMeshes.length-1),p=Math.sqrt(c*c-h*h),m=0+c*1.25,x=p*m,{_lodMax:M}=this,S=this._sizeLods[n],y=3*S*(n>M-Qo?n-M+Qo:0),C=4*(this._cubeSize-S);l.envMap.value=t.texture,l.roughness.value=x,l.mipInt.value=M-e,Va(r,y,C,3*S,2*S),i.setRenderTarget(r),i.render(s,al),l.envMap.value=r.texture,l.roughness.value=0,l.mipInt.value=M-n,Va(t,y,C,3*S,2*S),i.setRenderTarget(t),i.render(s,al)}_blur(t,e,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",r),this._halfBlur(a,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,a,s){let l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&st("blur direction must be either latitudinal or longitudinal!");let h=3,p=this._lodMeshes[i];p.material=c;let m=c.uniforms,x=this._sizeLods[n]-1,M=isFinite(r)?Math.PI/(2*x):2*Math.PI/(2*Or-1),S=r/M,y=isFinite(r)?1+Math.floor(h*S):Or;y>Or&&Ke(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Or}`);let C=[],I=0;for(let G=0;G<Or;++G){let E=G/S,B=Math.exp(-E*E/2);C.push(B),G===0?I+=B:G<y&&(I+=2*B)}for(let G=0;G<C.length;G++)C[G]=C[G]/I;m.envMap.value=t.texture,m.samples.value=y,m.weights.value=C,m.latitudinal.value=a==="latitudinal",s&&(m.poleAxis.value=s);let{_lodMax:L}=this;m.dTheta.value=M,m.mipInt.value=L-n;let k=this._sizeLods[i],H=3*k*(i>L-Qo?i-L+Qo:0),V=4*(this._cubeSize-k);Va(e,H,V,3*k,2*k),l.setRenderTarget(e),l.render(p,al)}};function dT(o){let t=[],e=[],n=[],i=o,r=o-Qo+1+Y_.length;for(let a=0;a<r;a++){let s=Math.pow(2,i);t.push(s);let l=1/s;a>o-Qo?l=Y_[a-o+Qo-1]:a===0&&(l=0),e.push(l);let c=1/(s-2),h=-c,p=1+c,m=[h,h,p,h,p,p,h,h,p,p,h,p],x=6,M=6,S=3,y=2,C=1,I=new Float32Array(S*M*x),L=new Float32Array(y*M*x),k=new Float32Array(C*M*x);for(let V=0;V<x;V++){let G=V%3*2/3-1,E=V>2?0:-1,B=[G,E,0,G+2/3,E,0,G+2/3,E+1,0,G,E,0,G+2/3,E+1,0,G,E+1,0];I.set(B,S*M*V),L.set(m,y*M*V);let Y=[V,V,V,V,V,V];k.set(Y,C*M*V)}let H=new qn;H.setAttribute("position",new bn(I,S)),H.setAttribute("uv",new bn(L,y)),H.setAttribute("faceIndex",new bn(k,C)),n.push(new kn(H,null)),i>Qo&&i--}return{lodMeshes:n,sizeLods:t,sigmas:e}}function K_(o,t,e){let n=new si(o,t,e);return n.texture.mapping=tl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Va(o,t,e,n,i){o.viewport.set(t,e,n,i),o.scissor.set(t,e,n,i)}function uT(o,t,e){return new di({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:lT,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ru(),fragmentShader:`
|
|
|
|
precision highp float;
|
|
precision highp int;
|
|
|
|
varying vec3 vOutputDirection;
|
|
|
|
uniform sampler2D envMap;
|
|
uniform float roughness;
|
|
uniform float mipInt;
|
|
|
|
#define ENVMAP_TYPE_CUBE_UV
|
|
#include <cube_uv_reflection_fragment>
|
|
|
|
#define PI 3.14159265359
|
|
|
|
// Van der Corput radical inverse
|
|
float radicalInverse_VdC(uint bits) {
|
|
bits = (bits << 16u) | (bits >> 16u);
|
|
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
|
|
bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
|
|
bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
|
|
bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
|
|
return float(bits) * 2.3283064365386963e-10; // / 0x100000000
|
|
}
|
|
|
|
// Hammersley sequence
|
|
vec2 hammersley(uint i, uint N) {
|
|
return vec2(float(i) / float(N), radicalInverse_VdC(i));
|
|
}
|
|
|
|
// GGX VNDF importance sampling (Eric Heitz 2018)
|
|
// "Sampling the GGX Distribution of Visible Normals"
|
|
// https://jcgt.org/published/0007/04/01/
|
|
vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
|
|
float alpha = roughness * roughness;
|
|
|
|
// Section 4.1: Orthonormal basis
|
|
vec3 T1 = vec3(1.0, 0.0, 0.0);
|
|
vec3 T2 = cross(V, T1);
|
|
|
|
// Section 4.2: Parameterization of projected area
|
|
float r = sqrt(Xi.x);
|
|
float phi = 2.0 * PI * Xi.y;
|
|
float t1 = r * cos(phi);
|
|
float t2 = r * sin(phi);
|
|
float s = 0.5 * (1.0 + V.z);
|
|
t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
|
|
|
|
// Section 4.3: Reprojection onto hemisphere
|
|
vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
|
|
|
|
// Section 3.4: Transform back to ellipsoid configuration
|
|
return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
|
|
}
|
|
|
|
void main() {
|
|
vec3 N = normalize(vOutputDirection);
|
|
vec3 V = N; // Assume view direction equals normal for pre-filtering
|
|
|
|
vec3 prefilteredColor = vec3(0.0);
|
|
float totalWeight = 0.0;
|
|
|
|
// For very low roughness, just sample the environment directly
|
|
if (roughness < 0.001) {
|
|
gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
|
|
return;
|
|
}
|
|
|
|
// Tangent space basis for VNDF sampling
|
|
vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
vec3 tangent = normalize(cross(up, N));
|
|
vec3 bitangent = cross(N, tangent);
|
|
|
|
for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
|
|
vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
|
|
|
|
// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
|
|
vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
|
|
|
|
// Transform H back to world space
|
|
vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
|
|
vec3 L = normalize(2.0 * dot(V, H) * H - V);
|
|
|
|
float NdotL = max(dot(N, L), 0.0);
|
|
|
|
if(NdotL > 0.0) {
|
|
// Sample environment at fixed mip level
|
|
// VNDF importance sampling handles the distribution filtering
|
|
vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
|
|
|
|
// Weight by NdotL for the split-sum approximation
|
|
// VNDF PDF naturally accounts for the visible microfacet distribution
|
|
prefilteredColor += sampleColor * NdotL;
|
|
totalWeight += NdotL;
|
|
}
|
|
}
|
|
|
|
if (totalWeight > 0.0) {
|
|
prefilteredColor = prefilteredColor / totalWeight;
|
|
}
|
|
|
|
gl_FragColor = vec4(prefilteredColor, 1.0);
|
|
}
|
|
`,blending:io,depthTest:!1,depthWrite:!1})}function hT(o,t,e){let n=new Float32Array(Or),i=new j(0,1,0);return new di({name:"SphericalGaussianBlur",defines:{n:Or,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ru(),fragmentShader:`
|
|
|
|
precision mediump float;
|
|
precision mediump int;
|
|
|
|
varying vec3 vOutputDirection;
|
|
|
|
uniform sampler2D envMap;
|
|
uniform int samples;
|
|
uniform float weights[ n ];
|
|
uniform bool latitudinal;
|
|
uniform float dTheta;
|
|
uniform float mipInt;
|
|
uniform vec3 poleAxis;
|
|
|
|
#define ENVMAP_TYPE_CUBE_UV
|
|
#include <cube_uv_reflection_fragment>
|
|
|
|
vec3 getSample( float theta, vec3 axis ) {
|
|
|
|
float cosTheta = cos( theta );
|
|
// Rodrigues' axis-angle rotation
|
|
vec3 sampleDirection = vOutputDirection * cosTheta
|
|
+ cross( axis, vOutputDirection ) * sin( theta )
|
|
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
|
|
|
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
|
|
|
}
|
|
|
|
void main() {
|
|
|
|
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
|
|
|
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
|
|
|
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
|
|
|
}
|
|
|
|
axis = normalize( axis );
|
|
|
|
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
|
|
|
for ( int i = 1; i < n; i++ ) {
|
|
|
|
if ( i >= samples ) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
float theta = dTheta * float( i );
|
|
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
|
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
|
|
|
}
|
|
|
|
}
|
|
`,blending:io,depthTest:!1,depthWrite:!1})}function Z_(){return new di({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ru(),fragmentShader:`
|
|
|
|
precision mediump float;
|
|
precision mediump int;
|
|
|
|
varying vec3 vOutputDirection;
|
|
|
|
uniform sampler2D envMap;
|
|
|
|
#include <common>
|
|
|
|
void main() {
|
|
|
|
vec3 outputDirection = normalize( vOutputDirection );
|
|
vec2 uv = equirectUv( outputDirection );
|
|
|
|
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
|
|
}
|
|
`,blending:io,depthTest:!1,depthWrite:!1})}function J_(){return new di({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ru(),fragmentShader:`
|
|
|
|
precision mediump float;
|
|
precision mediump int;
|
|
|
|
uniform float flipEnvMap;
|
|
|
|
varying vec3 vOutputDirection;
|
|
|
|
uniform samplerCube envMap;
|
|
|
|
void main() {
|
|
|
|
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
|
|
|
}
|
|
`,blending:io,depthTest:!1,depthWrite:!1})}function ru(){return`
|
|
|
|
precision mediump float;
|
|
precision mediump int;
|
|
|
|
attribute float faceIndex;
|
|
|
|
varying vec3 vOutputDirection;
|
|
|
|
// RH coordinate system; PMREM face-indexing convention
|
|
vec3 getDirection( vec2 uv, float face ) {
|
|
|
|
uv = 2.0 * uv - 1.0;
|
|
|
|
vec3 direction = vec3( uv, 1.0 );
|
|
|
|
if ( face == 0.0 ) {
|
|
|
|
direction = direction.zyx; // ( 1, v, u ) pos x
|
|
|
|
} else if ( face == 1.0 ) {
|
|
|
|
direction = direction.xzy;
|
|
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
|
|
|
} else if ( face == 2.0 ) {
|
|
|
|
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
|
|
|
} else if ( face == 3.0 ) {
|
|
|
|
direction = direction.zyx;
|
|
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
|
|
|
} else if ( face == 4.0 ) {
|
|
|
|
direction = direction.xzy;
|
|
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
|
|
|
} else if ( face == 5.0 ) {
|
|
|
|
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
|
|
|
}
|
|
|
|
return direction;
|
|
|
|
}
|
|
|
|
void main() {
|
|
|
|
vOutputDirection = getDirection( uv, faceIndex );
|
|
gl_Position = vec4( position, 1.0 );
|
|
|
|
}
|
|
`}var iu=class extends si{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Us(i),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
|
|
varying vec3 vWorldDirection;
|
|
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
|
|
}
|
|
|
|
void main() {
|
|
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
|
|
#include <begin_vertex>
|
|
#include <project_vertex>
|
|
|
|
}
|
|
`,fragmentShader:`
|
|
|
|
uniform sampler2D tEquirect;
|
|
|
|
varying vec3 vWorldDirection;
|
|
|
|
#include <common>
|
|
|
|
void main() {
|
|
|
|
vec3 direction = normalize( vWorldDirection );
|
|
|
|
vec2 sampleUV = equirectUv( direction );
|
|
|
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
|
|
}
|
|
`},i=new Aa(5,5,5),r=new di({name:"CubemapFromEquirect",uniforms:Ir(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:$n,blending:io});r.uniforms.tEquirect.value=e;let a=new kn(i,r),s=e.minFilter;return e.minFilter===Ni&&(e.minFilter=sn),new hd(1,10,this).update(t,a),e.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(t,e=!0,n=!0,i=!0){let r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(r)}};function pT(o){let t=new WeakMap,e=new WeakMap,n=null;function i(m,x=!1){return m==null?null:x?a(m):r(m)}function r(m){if(m&&m.isTexture){let x=m.mapping;if(x===md||x===fd)if(t.has(m)){let M=t.get(m).texture;return s(M,m.mapping)}else{let M=m.image;if(M&&M.height>0){let S=new iu(M.height);return S.fromEquirectangularTexture(o,m),t.set(m,S),m.addEventListener("dispose",c),s(S.texture,m.mapping)}else return null}}return m}function a(m){if(m&&m.isTexture){let x=m.mapping,M=x===md||x===fd,S=x===jo||x===Sr;if(M||S){let y=e.get(m),C=y!==void 0?y.texture.pmremVersion:0;if(m.isRenderTargetTexture&&m.pmremVersion!==C)return n===null&&(n=new nu(o)),y=M?n.fromEquirectangular(m,y):n.fromCubemap(m,y),y.texture.pmremVersion=m.pmremVersion,e.set(m,y),y.texture;if(y!==void 0)return y.texture;{let I=m.image;return M&&I&&I.height>0||S&&I&&l(I)?(n===null&&(n=new nu(o)),y=M?n.fromEquirectangular(m):n.fromCubemap(m),y.texture.pmremVersion=m.pmremVersion,e.set(m,y),m.addEventListener("dispose",h),y.texture):null}}}return m}function s(m,x){return x===md?m.mapping=jo:x===fd&&(m.mapping=Sr),m}function l(m){let x=0,M=6;for(let S=0;S<M;S++)m[S]!==void 0&&x++;return x===M}function c(m){let x=m.target;x.removeEventListener("dispose",c);let M=t.get(x);M!==void 0&&(t.delete(x),M.dispose())}function h(m){let x=m.target;x.removeEventListener("dispose",h);let M=e.get(x);M!==void 0&&(e.delete(x),M.dispose())}function p(){t=new WeakMap,e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:p}}function mT(o){let t={};function e(n){if(t[n]!==void 0)return t[n];let i=o.getExtension(n);return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&Yc("WebGLRenderer: "+n+" extension not supported."),i}}}function fT(o,t,e,n){let i={},r=new WeakMap;function a(p){let m=p.target;m.index!==null&&t.remove(m.index);for(let M in m.attributes)t.remove(m.attributes[M]);m.removeEventListener("dispose",a),delete i[m.id];let x=r.get(m);x&&(t.remove(x),r.delete(m)),n.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,e.memory.geometries--}function s(p,m){return i[m.id]===!0||(m.addEventListener("dispose",a),i[m.id]=!0,e.memory.geometries++),m}function l(p){let m=p.attributes;for(let x in m)t.update(m[x],o.ARRAY_BUFFER)}function c(p){let m=[],x=p.index,M=p.attributes.position,S=0;if(M===void 0)return;if(x!==null){let I=x.array;S=x.version;for(let L=0,k=I.length;L<k;L+=3){let H=I[L+0],V=I[L+1],G=I[L+2];m.push(H,V,V,G,G,H)}}else{let I=M.array;S=M.version;for(let L=0,k=I.length/3-1;L<k;L+=3){let H=L+0,V=L+1,G=L+2;m.push(H,V,V,G,G,H)}}let y=new(M.count>=65535?ks:Ds)(m,1);y.version=S;let C=r.get(p);C&&t.remove(C),r.set(p,y)}function h(p){let m=r.get(p);if(m){let x=p.index;x!==null&&m.version<x.version&&c(p)}else c(p);return r.get(p)}return{get:s,update:l,getWireframeAttribute:h}}function gT(o,t,e){let n;function i(p){n=p}let r,a;function s(p){r=p.type,a=p.bytesPerElement}function l(p,m){o.drawElements(n,m,r,p*a),e.update(m,n,1)}function c(p,m,x){x!==0&&(o.drawElementsInstanced(n,m,r,p*a,x),e.update(m,n,x))}function h(p,m,x){if(x===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,m,0,r,p,0,x);let S=0;for(let y=0;y<x;y++)S+=m[y];e.update(S,n,1)}this.setMode=i,this.setIndex=s,this.render=l,this.renderInstances=c,this.renderMultiDraw=h}function _T(o){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,s){switch(e.calls++,a){case o.TRIANGLES:e.triangles+=s*(r/3);break;case o.LINES:e.lines+=s*(r/2);break;case o.LINE_STRIP:e.lines+=s*(r-1);break;case o.LINE_LOOP:e.lines+=s*r;break;case o.POINTS:e.points+=s*r;break;default:st("WebGLInfo: Unknown draw mode:",a);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function vT(o,t,e){let n=new WeakMap,i=new Yt;function r(a,s,l){let c=a.morphTargetInfluences,h=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,p=h!==void 0?h.length:0,m=n.get(s);if(m===void 0||m.count!==p){let Y=function(){E.dispose(),n.delete(s),s.removeEventListener("dispose",Y)};var x=Y;m!==void 0&&m.texture.dispose();let M=s.morphAttributes.position!==void 0,S=s.morphAttributes.normal!==void 0,y=s.morphAttributes.color!==void 0,C=s.morphAttributes.position||[],I=s.morphAttributes.normal||[],L=s.morphAttributes.color||[],k=0;M===!0&&(k=1),S===!0&&(k=2),y===!0&&(k=3);let H=s.attributes.position.count*k,V=1;H>t.maxTextureSize&&(V=Math.ceil(H/t.maxTextureSize),H=t.maxTextureSize);let G=new Float32Array(H*V*4*p),E=new As(G,H,V,p);E.type=ui,E.needsUpdate=!0;let B=k*4;for(let U=0;U<p;U++){let ee=C[U],de=I[U],fe=L[U],$=H*V*4*U;for(let ae=0;ae<ee.count;ae++){let J=ae*B;M===!0&&(i.fromBufferAttribute(ee,ae),G[$+J+0]=i.x,G[$+J+1]=i.y,G[$+J+2]=i.z,G[$+J+3]=0),S===!0&&(i.fromBufferAttribute(de,ae),G[$+J+4]=i.x,G[$+J+5]=i.y,G[$+J+6]=i.z,G[$+J+7]=0),y===!0&&(i.fromBufferAttribute(fe,ae),G[$+J+8]=i.x,G[$+J+9]=i.y,G[$+J+10]=i.z,G[$+J+11]=fe.itemSize===4?i.w:1)}}m={count:p,texture:E,size:new At(H,V)},n.set(s,m),s.addEventListener("dispose",Y)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(o,"morphTexture",a.morphTexture,e);else{let M=0;for(let y=0;y<c.length;y++)M+=c[y];let S=s.morphTargetsRelative?1:1-M;l.getUniforms().setValue(o,"morphTargetBaseInfluence",S),l.getUniforms().setValue(o,"morphTargetInfluences",c)}l.getUniforms().setValue(o,"morphTargetsTexture",m.texture,e),l.getUniforms().setValue(o,"morphTargetsTextureSize",m.size)}return{update:r}}function xT(o,t,e,n,i){let r=new WeakMap;function a(c){let h=i.render.frame,p=c.geometry,m=t.get(c,p);if(r.get(m)!==h&&(t.update(m),r.set(m,h)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),r.get(c)!==h&&(e.update(c.instanceMatrix,o.ARRAY_BUFFER),c.instanceColor!==null&&e.update(c.instanceColor,o.ARRAY_BUFFER),r.set(c,h))),c.isSkinnedMesh){let x=c.skeleton;r.get(x)!==h&&(x.update(),r.set(x,h))}return m}function s(){r=new WeakMap}function l(c){let h=c.target;h.removeEventListener("dispose",l),n.releaseStatesOfObject(h),e.remove(h.instanceMatrix),h.instanceColor!==null&&e.remove(h.instanceColor)}return{update:a,dispose:s}}var bT={[op]:"LINEAR_TONE_MAPPING",[rp]:"REINHARD_TONE_MAPPING",[ap]:"CINEON_TONE_MAPPING",[el]:"ACES_FILMIC_TONE_MAPPING",[lp]:"AGX_TONE_MAPPING",[cp]:"NEUTRAL_TONE_MAPPING",[sp]:"CUSTOM_TONE_MAPPING"};function yT(o,t,e,n,i){let r=new si(t,e,{type:o,depthBuffer:n,stencilBuffer:i,depthTexture:n?new wo(t,e):void 0}),a=new si(t,e,{type:oo,depthBuffer:!1,stencilBuffer:!1}),s=new qn;s.setAttribute("position",new Wn([-1,3,0,-1,-1,0,3,-1,0],3)),s.setAttribute("uv",new Wn([0,2,0,0,2,0],2));let l=new nd({uniforms:{tDiffuse:{value:null}},vertexShader:`
|
|
precision highp float;
|
|
|
|
uniform mat4 modelViewMatrix;
|
|
uniform mat4 projectionMatrix;
|
|
|
|
attribute vec3 position;
|
|
attribute vec2 uv;
|
|
|
|
varying vec2 vUv;
|
|
|
|
void main() {
|
|
vUv = uv;
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
}`,fragmentShader:`
|
|
precision highp float;
|
|
|
|
uniform sampler2D tDiffuse;
|
|
|
|
varying vec2 vUv;
|
|
|
|
#include <tonemapping_pars_fragment>
|
|
#include <colorspace_pars_fragment>
|
|
|
|
void main() {
|
|
gl_FragColor = texture2D( tDiffuse, vUv );
|
|
|
|
#ifdef LINEAR_TONE_MAPPING
|
|
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
|
|
#elif defined( REINHARD_TONE_MAPPING )
|
|
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
|
|
#elif defined( CINEON_TONE_MAPPING )
|
|
gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
|
|
#elif defined( ACES_FILMIC_TONE_MAPPING )
|
|
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
|
|
#elif defined( AGX_TONE_MAPPING )
|
|
gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
|
|
#elif defined( NEUTRAL_TONE_MAPPING )
|
|
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
|
|
#elif defined( CUSTOM_TONE_MAPPING )
|
|
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
|
|
#endif
|
|
|
|
#ifdef SRGB_TRANSFER
|
|
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
#endif
|
|
}`,depthTest:!1,depthWrite:!1}),c=new kn(s,l),h=new Yo(-1,1,1,-1,0,1),p=null,m=null,x=!1,M,S=null,y=[],C=!1;this.setSize=function(I,L){r.setSize(I,L),a.setSize(I,L);for(let k=0;k<y.length;k++){let H=y[k];H.setSize&&H.setSize(I,L)}},this.setEffects=function(I){y=I,C=y.length>0&&y[0].isRenderPass===!0;let L=r.width,k=r.height;for(let H=0;H<y.length;H++){let V=y[H];V.setSize&&V.setSize(L,k)}},this.begin=function(I,L){if(x||I.toneMapping===Ri&&y.length===0)return!1;if(S=L,L!==null){let k=L.width,H=L.height;(r.width!==k||r.height!==H)&&this.setSize(k,H)}return C===!1&&I.setRenderTarget(r),M=I.toneMapping,I.toneMapping=Ri,!0},this.hasRenderPass=function(){return C},this.end=function(I,L){I.toneMapping=M,x=!0;let k=r,H=a;for(let V=0;V<y.length;V++){let G=y[V];if(G.enabled!==!1&&(G.render(I,H,k,L),G.needsSwap!==!1)){let E=k;k=H,H=E}}if(p!==I.outputColorSpace||m!==I.toneMapping){p=I.outputColorSpace,m=I.toneMapping,l.defines={},St.getTransfer(p)===Ht&&(l.defines.SRGB_TRANSFER="");let V=bT[m];V&&(l.defines[V]=""),l.needsUpdate=!0}l.uniforms.tDiffuse.value=k.texture,I.setRenderTarget(S),I.render(c,h),S=null,x=!1},this.isCompositing=function(){return x},this.dispose=function(){r.depthTexture&&r.depthTexture.dispose(),r.dispose(),a.dispose(),s.dispose(),l.dispose()}}var vv=new ei,Op=new wo(1,1),xv=new As,bv=new Zc,yv=new Us,Q_=[],ev=[],tv=new Float32Array(16),nv=new Float32Array(9),iv=new Float32Array(4);function Ua(o,t,e){let n=o[0];if(n<=0||n>0)return o;let i=t*e,r=Q_[i];if(r===void 0&&(r=new Float32Array(i),Q_[i]=r),t!==0){n.toArray(r,0);for(let a=1,s=0;a!==t;++a)s+=e,o[a].toArray(r,s)}return r}function yn(o,t){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(o[e]!==t[e])return!1;return!0}function Cn(o,t){for(let e=0,n=t.length;e<n;e++)o[e]=t[e]}function au(o,t){let e=ev[t];e===void 0&&(e=new Int32Array(t),ev[t]=e);for(let n=0;n!==t;++n)e[n]=o.allocateTextureUnit();return e}function CT(o,t){let e=this.cache;e[0]!==t&&(o.uniform1f(this.addr,t),e[0]=t)}function MT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(o.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(yn(e,t))return;o.uniform2fv(this.addr,t),Cn(e,t)}}function wT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(o.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(o.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(yn(e,t))return;o.uniform3fv(this.addr,t),Cn(e,t)}}function ST(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(o.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(yn(e,t))return;o.uniform4fv(this.addr,t),Cn(e,t)}}function ET(o,t){let e=this.cache,n=t.elements;if(n===void 0){if(yn(e,t))return;o.uniformMatrix2fv(this.addr,!1,t),Cn(e,t)}else{if(yn(e,n))return;iv.set(n),o.uniformMatrix2fv(this.addr,!1,iv),Cn(e,n)}}function TT(o,t){let e=this.cache,n=t.elements;if(n===void 0){if(yn(e,t))return;o.uniformMatrix3fv(this.addr,!1,t),Cn(e,t)}else{if(yn(e,n))return;nv.set(n),o.uniformMatrix3fv(this.addr,!1,nv),Cn(e,n)}}function PT(o,t){let e=this.cache,n=t.elements;if(n===void 0){if(yn(e,t))return;o.uniformMatrix4fv(this.addr,!1,t),Cn(e,t)}else{if(yn(e,n))return;tv.set(n),o.uniformMatrix4fv(this.addr,!1,tv),Cn(e,n)}}function AT(o,t){let e=this.cache;e[0]!==t&&(o.uniform1i(this.addr,t),e[0]=t)}function IT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(o.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(yn(e,t))return;o.uniform2iv(this.addr,t),Cn(e,t)}}function OT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(o.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(yn(e,t))return;o.uniform3iv(this.addr,t),Cn(e,t)}}function DT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(o.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(yn(e,t))return;o.uniform4iv(this.addr,t),Cn(e,t)}}function kT(o,t){let e=this.cache;e[0]!==t&&(o.uniform1ui(this.addr,t),e[0]=t)}function RT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(o.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(yn(e,t))return;o.uniform2uiv(this.addr,t),Cn(e,t)}}function NT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(o.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(yn(e,t))return;o.uniform3uiv(this.addr,t),Cn(e,t)}}function LT(o,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(o.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(yn(e,t))return;o.uniform4uiv(this.addr,t),Cn(e,t)}}function FT(o,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(o.uniform1i(this.addr,i),n[0]=i);let r;this.type===o.SAMPLER_2D_SHADOW?(Op.compareFunction=e.isReversedDepthBuffer()?Qd:Jd,r=Op):r=vv,e.setTexture2D(t||r,i)}function VT(o,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(o.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||bv,i)}function BT(o,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(o.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||yv,i)}function UT(o,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(o.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||xv,i)}function zT(o){switch(o){case 5126:return CT;case 35664:return MT;case 35665:return wT;case 35666:return ST;case 35674:return ET;case 35675:return TT;case 35676:return PT;case 5124:case 35670:return AT;case 35667:case 35671:return IT;case 35668:case 35672:return OT;case 35669:case 35673:return DT;case 5125:return kT;case 36294:return RT;case 36295:return NT;case 36296:return LT;case 35678:case 36198:case 36298:case 36306:case 35682:return FT;case 35679:case 36299:case 36307:return VT;case 35680:case 36300:case 36308:case 36293:return BT;case 36289:case 36303:case 36311:case 36292:return UT}}function HT(o,t){o.uniform1fv(this.addr,t)}function GT(o,t){let e=Ua(t,this.size,2);o.uniform2fv(this.addr,e)}function WT(o,t){let e=Ua(t,this.size,3);o.uniform3fv(this.addr,e)}function XT(o,t){let e=Ua(t,this.size,4);o.uniform4fv(this.addr,e)}function qT(o,t){let e=Ua(t,this.size,4);o.uniformMatrix2fv(this.addr,!1,e)}function $T(o,t){let e=Ua(t,this.size,9);o.uniformMatrix3fv(this.addr,!1,e)}function YT(o,t){let e=Ua(t,this.size,16);o.uniformMatrix4fv(this.addr,!1,e)}function jT(o,t){o.uniform1iv(this.addr,t)}function KT(o,t){o.uniform2iv(this.addr,t)}function ZT(o,t){o.uniform3iv(this.addr,t)}function JT(o,t){o.uniform4iv(this.addr,t)}function QT(o,t){o.uniform1uiv(this.addr,t)}function eP(o,t){o.uniform2uiv(this.addr,t)}function tP(o,t){o.uniform3uiv(this.addr,t)}function nP(o,t){o.uniform4uiv(this.addr,t)}function iP(o,t,e){let n=this.cache,i=t.length,r=au(e,i);yn(n,r)||(o.uniform1iv(this.addr,r),Cn(n,r));let a;this.type===o.SAMPLER_2D_SHADOW?a=Op:a=vv;for(let s=0;s!==i;++s)e.setTexture2D(t[s]||a,r[s])}function oP(o,t,e){let n=this.cache,i=t.length,r=au(e,i);yn(n,r)||(o.uniform1iv(this.addr,r),Cn(n,r));for(let a=0;a!==i;++a)e.setTexture3D(t[a]||bv,r[a])}function rP(o,t,e){let n=this.cache,i=t.length,r=au(e,i);yn(n,r)||(o.uniform1iv(this.addr,r),Cn(n,r));for(let a=0;a!==i;++a)e.setTextureCube(t[a]||yv,r[a])}function aP(o,t,e){let n=this.cache,i=t.length,r=au(e,i);yn(n,r)||(o.uniform1iv(this.addr,r),Cn(n,r));for(let a=0;a!==i;++a)e.setTexture2DArray(t[a]||xv,r[a])}function sP(o){switch(o){case 5126:return HT;case 35664:return GT;case 35665:return WT;case 35666:return XT;case 35674:return qT;case 35675:return $T;case 35676:return YT;case 5124:case 35670:return jT;case 35667:case 35671:return KT;case 35668:case 35672:return ZT;case 35669:case 35673:return JT;case 5125:return QT;case 36294:return eP;case 36295:return tP;case 36296:return nP;case 35678:case 36198:case 36298:case 36306:case 35682:return iP;case 35679:case 36299:case 36307:return oP;case 35680:case 36300:case 36308:case 36293:return rP;case 36289:case 36303:case 36311:case 36292:return aP}}var Dp=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=zT(e.type)}},kp=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=sP(e.type)}},Rp=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let r=0,a=i.length;r!==a;++r){let s=i[r];s.setValue(t,e[s.id],n)}}},Ap=/(\w+)(\])?(\[|\.)?/g;function ov(o,t){o.seq.push(t),o.map[t.id]=t}function lP(o,t,e){let n=o.name,i=n.length;for(Ap.lastIndex=0;;){let r=Ap.exec(n),a=Ap.lastIndex,s=r[1],l=r[2]==="]",c=r[3];if(l&&(s=s|0),c===void 0||c==="["&&a+2===i){ov(e,c===void 0?new Dp(s,o,t):new kp(s,o,t));break}else{let p=e.map[s];p===void 0&&(p=new Rp(s),ov(e,p)),e=p}}}var Ba=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){let s=t.getActiveUniform(e,a),l=t.getUniformLocation(e,s.name);lP(s,l,this)}let i=[],r=[];for(let a of this.seq)a.type===t.SAMPLER_2D_SHADOW||a.type===t.SAMPLER_CUBE_SHADOW||a.type===t.SAMPLER_2D_ARRAY_SHADOW?i.push(a):r.push(a);i.length>0&&(this.seq=i.concat(r))}setValue(t,e,n,i){let r=this.map[e];r!==void 0&&r.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,a=e.length;r!==a;++r){let s=e[r],l=n[s.id];l.needsUpdate!==!1&&s.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,r=t.length;i!==r;++i){let a=t[i];a.id in e&&n.push(a)}return n}};function rv(o,t,e){let n=o.createShader(t);return o.shaderSource(n,e),o.compileShader(n),n}var cP=37297,dP=0;function uP(o,t){let e=o.split(`
|
|
`),n=[],i=Math.max(t-6,0),r=Math.min(t+6,e.length);for(let a=i;a<r;a++){let s=a+1;n.push(`${s===t?">":" "} ${s}: ${e[a]}`)}return n.join(`
|
|
`)}var av=new mt;function hP(o){St._getMatrix(av,St.workingColorSpace,o);let t=`mat3( ${av.elements.map(e=>e.toFixed(4))} )`;switch(St.getTransfer(o)){case Ts:return[t,"LinearTransferOETF"];case Ht:return[t,"sRGBTransferOETF"];default:return Ke("WebGLProgram: Unsupported color space: ",o),[t,"LinearTransferOETF"]}}function sv(o,t,e){let n=o.getShaderParameter(t,o.COMPILE_STATUS),r=(o.getShaderInfoLog(t)||"").trim();if(n&&r==="")return"";let a=/ERROR: 0:(\d+)/.exec(r);if(a){let s=parseInt(a[1]);return e.toUpperCase()+`
|
|
|
|
`+r+`
|
|
|
|
`+uP(o.getShaderSource(t),s)}else return r}function pP(o,t){let e=hP(t);return[`vec4 ${o}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(`
|
|
`)}var mP={[op]:"Linear",[rp]:"Reinhard",[ap]:"Cineon",[el]:"ACESFilmic",[lp]:"AgX",[cp]:"Neutral",[sp]:"Custom"};function fP(o,t){let e=mP[t];return e===void 0?(Ke("WebGLProgram: Unsupported toneMapping:",t),"vec3 "+o+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+o+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}var tu=new j;function gP(){St.getLuminanceCoefficients(tu);let o=tu.x.toFixed(4),t=tu.y.toFixed(4),e=tu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${o}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
|
|
`)}function _P(o){return[o.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",o.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(ll).join(`
|
|
`)}function vP(o){let t=[];for(let e in o){let n=o[e];n!==!1&&t.push("#define "+e+" "+n)}return t.join(`
|
|
`)}function xP(o,t){let e={},n=o.getProgramParameter(t,o.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){let r=o.getActiveAttrib(t,i),a=r.name,s=1;r.type===o.FLOAT_MAT2&&(s=2),r.type===o.FLOAT_MAT3&&(s=3),r.type===o.FLOAT_MAT4&&(s=4),e[a]={type:r.type,location:o.getAttribLocation(t,a),locationSize:s}}return e}function ll(o){return o!==""}function lv(o,t){let e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return o.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,e).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function cv(o,t){return o.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var bP=/^[ \t]*#include +<([\w\d./]+)>/gm;function Np(o){return o.replace(bP,CP)}var yP=new Map;function CP(o,t){let e=Mt[t];if(e===void 0){let n=yP.get(t);if(n!==void 0)e=Mt[n],Ke('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,n);else throw new Error("Can not resolve #include <"+t+">")}return Np(e)}var MP=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function dv(o){return o.replace(MP,wP)}function wP(o,t,e,n){let i="";for(let r=parseInt(t);r<parseInt(e);r++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function uv(o){let t=`precision ${o.precision} float;
|
|
precision ${o.precision} int;
|
|
precision ${o.precision} sampler2D;
|
|
precision ${o.precision} samplerCube;
|
|
precision ${o.precision} sampler3D;
|
|
precision ${o.precision} sampler2DArray;
|
|
precision ${o.precision} sampler2DShadow;
|
|
precision ${o.precision} samplerCubeShadow;
|
|
precision ${o.precision} sampler2DArrayShadow;
|
|
precision ${o.precision} isampler2D;
|
|
precision ${o.precision} isampler3D;
|
|
precision ${o.precision} isamplerCube;
|
|
precision ${o.precision} isampler2DArray;
|
|
precision ${o.precision} usampler2D;
|
|
precision ${o.precision} usampler3D;
|
|
precision ${o.precision} usamplerCube;
|
|
precision ${o.precision} usampler2DArray;
|
|
`;return o.precision==="highp"?t+=`
|
|
#define HIGH_PRECISION`:o.precision==="mediump"?t+=`
|
|
#define MEDIUM_PRECISION`:o.precision==="lowp"&&(t+=`
|
|
#define LOW_PRECISION`),t}var SP={[Qs]:"SHADOWMAP_TYPE_PCF",[Ia]:"SHADOWMAP_TYPE_VSM"};function EP(o){return SP[o.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}var TP={[jo]:"ENVMAP_TYPE_CUBE",[Sr]:"ENVMAP_TYPE_CUBE",[tl]:"ENVMAP_TYPE_CUBE_UV"};function PP(o){return o.envMap===!1?"ENVMAP_TYPE_CUBE":TP[o.envMapMode]||"ENVMAP_TYPE_CUBE"}var AP={[Sr]:"ENVMAP_MODE_REFRACTION"};function IP(o){return o.envMap===!1?"ENVMAP_MODE_REFLECTION":AP[o.envMapMode]||"ENVMAP_MODE_REFLECTION"}var OP={[ip]:"ENVMAP_BLENDING_MULTIPLY",[P_]:"ENVMAP_BLENDING_MIX",[A_]:"ENVMAP_BLENDING_ADD"};function DP(o){return o.envMap===!1?"ENVMAP_BLENDING_NONE":OP[o.combine]||"ENVMAP_BLENDING_NONE"}function kP(o){let t=o.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:n,maxMip:e}}function RP(o,t,e,n){let i=o.getContext(),r=e.defines,a=e.vertexShader,s=e.fragmentShader,l=EP(e),c=PP(e),h=IP(e),p=DP(e),m=kP(e),x=_P(e),M=vP(r),S=i.createProgram(),y,C,I=e.glslVersion?"#version "+e.glslVersion+`
|
|
`:"";e.isRawShaderMaterial?(y=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,M].filter(ll).join(`
|
|
`),y.length>0&&(y+=`
|
|
`),C=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,M].filter(ll).join(`
|
|
`),C.length>0&&(C+=`
|
|
`)):(y=[uv(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,M,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexNormals?"#define HAS_NORMAL":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
`].filter(ll).join(`
|
|
`),C=[uv(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,M,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas||e.batchingColor?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",e.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Ri?"#define TONE_MAPPING":"",e.toneMapping!==Ri?Mt.tonemapping_pars_fragment:"",e.toneMapping!==Ri?fP("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",Mt.colorspace_pars_fragment,pP("linearToOutputTexel",e.outputColorSpace),gP(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
|
|
`].filter(ll).join(`
|
|
`)),a=Np(a),a=lv(a,e),a=cv(a,e),s=Np(s),s=lv(s,e),s=cv(s,e),a=dv(a),s=dv(s),e.isRawShaderMaterial!==!0&&(I=`#version 300 es
|
|
`,y=[x,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
`)+`
|
|
`+y,C=["#define varying in",e.glslVersion===vp?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===vp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
|
|
`)+`
|
|
`+C);let L=I+y+a,k=I+C+s,H=rv(i,i.VERTEX_SHADER,L),V=rv(i,i.FRAGMENT_SHADER,k);i.attachShader(S,H),i.attachShader(S,V),e.index0AttributeName!==void 0?i.bindAttribLocation(S,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(S,0,"position"),i.linkProgram(S);function G(U){if(o.debug.checkShaderErrors){let ee=i.getProgramInfoLog(S)||"",de=i.getShaderInfoLog(H)||"",fe=i.getShaderInfoLog(V)||"",$=ee.trim(),ae=de.trim(),J=fe.trim(),Ce=!0,Se=!0;if(i.getProgramParameter(S,i.LINK_STATUS)===!1)if(Ce=!1,typeof o.debug.onShaderError=="function")o.debug.onShaderError(i,S,H,V);else{let Ve=sv(i,H,"vertex"),Ye=sv(i,V,"fragment");st("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(S,i.VALIDATE_STATUS)+`
|
|
|
|
Material Name: `+U.name+`
|
|
Material Type: `+U.type+`
|
|
|
|
Program Info Log: `+$+`
|
|
`+Ve+`
|
|
`+Ye)}else $!==""?Ke("WebGLProgram: Program Info Log:",$):(ae===""||J==="")&&(Se=!1);Se&&(U.diagnostics={runnable:Ce,programLog:$,vertexShader:{log:ae,prefix:y},fragmentShader:{log:J,prefix:C}})}i.deleteShader(H),i.deleteShader(V),E=new Ba(i,S),B=xP(i,S)}let E;this.getUniforms=function(){return E===void 0&&G(this),E};let B;this.getAttributes=function(){return B===void 0&&G(this),B};let Y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return Y===!1&&(Y=i.getProgramParameter(S,cP)),Y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(S),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=dP++,this.cacheKey=t,this.usedTimes=1,this.program=S,this.vertexShader=H,this.fragmentShader=V,this}var NP=0,Lp=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Fp(t),e.set(t,n)),n}},Fp=class{constructor(t){this.id=NP++,this.code=t,this.usedTimes=0}};function LP(o){return o===Zo||o===il||o===ol}function FP(o,t,e,n,i,r){let a=new Is,s=new Lp,l=new Set,c=[],h=new Map,p=n.logarithmicDepthBuffer,m=n.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function M(E){return l.add(E),E===0?"uv":`uv${E}`}function S(E,B,Y,U,ee,de){let fe=U.fog,$=ee.geometry,ae=E.isMeshStandardMaterial||E.isMeshLambertMaterial||E.isMeshPhongMaterial?U.environment:null,J=E.isMeshStandardMaterial||E.isMeshLambertMaterial&&!E.envMap||E.isMeshPhongMaterial&&!E.envMap,Ce=t.get(E.envMap||ae,J),Se=Ce&&Ce.mapping===tl?Ce.image.height:null,Ve=x[E.type];E.precision!==null&&(m=n.getMaxPrecision(E.precision),m!==E.precision&&Ke("WebGLProgram.getParameters:",E.precision,"not supported, using",m,"instead."));let Ye=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,Ze=Ye!==void 0?Ye.length:0,It=0;$.morphAttributes.position!==void 0&&(It=1),$.morphAttributes.normal!==void 0&&(It=2),$.morphAttributes.color!==void 0&&(It=3);let ut,it,_e,Be;if(Ve){let _t=ao[Ve];ut=_t.vertexShader,it=_t.fragmentShader}else ut=E.vertexShader,it=E.fragmentShader,s.update(E),_e=s.getVertexShaderID(E),Be=s.getFragmentShaderID(E);let Pe=o.getRenderTarget(),nt=o.state.buffers.depth.getReversed(),ot=ee.isInstancedMesh===!0,at=ee.isBatchedMesh===!0,xt=!!E.map,rt=!!E.matcap,ft=!!Ce,Ot=!!E.aoMap,lt=!!E.lightMap,kt=!!E.bumpMap,Tt=!!E.normalMap,Vt=!!E.displacementMap,W=!!E.emissiveMap,on=!!E.metalnessMap,gt=!!E.roughnessMap,zt=E.anisotropy>0,Fe=E.clearcoat>0,tn=E.dispersion>0,O=E.iridescence>0,w=E.sheen>0,K=E.transmission>0,pe=zt&&!!E.anisotropyMap,Me=Fe&&!!E.clearcoatMap,Ae=Fe&&!!E.clearcoatNormalMap,Le=Fe&&!!E.clearcoatRoughnessMap,ce=O&&!!E.iridescenceMap,ge=O&&!!E.iridescenceThicknessMap,Ge=w&&!!E.sheenColorMap,qe=w&&!!E.sheenRoughnessMap,Re=!!E.specularMap,Ie=!!E.specularColorMap,pt=!!E.specularIntensityMap,bt=K&&!!E.transmissionMap,Nt=K&&!!E.thicknessMap,X=!!E.gradientMap,Oe=!!E.alphaMap,ue=E.alphaTest>0,We=!!E.alphaHash,Ne=!!E.extensions,be=Ri;E.toneMapped&&(Pe===null||Pe.isXRRenderTarget===!0)&&(be=o.toneMapping);let Je={shaderID:Ve,shaderType:E.type,shaderName:E.name,vertexShader:ut,fragmentShader:it,defines:E.defines,customVertexShaderID:_e,customFragmentShaderID:Be,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:m,batching:at,batchingColor:at&&ee._colorsTexture!==null,instancing:ot,instancingColor:ot&&ee.instanceColor!==null,instancingMorph:ot&&ee.morphTexture!==null,outputColorSpace:Pe===null?o.outputColorSpace:Pe.isXRRenderTarget===!0?Pe.texture.colorSpace:St.workingColorSpace,alphaToCoverage:!!E.alphaToCoverage,map:xt,matcap:rt,envMap:ft,envMapMode:ft&&Ce.mapping,envMapCubeUVHeight:Se,aoMap:Ot,lightMap:lt,bumpMap:kt,normalMap:Tt,displacementMap:Vt,emissiveMap:W,normalMapObjectSpace:Tt&&E.normalMapType===k_,normalMapTangentSpace:Tt&&E.normalMapType===Zd,packedNormalMap:Tt&&E.normalMapType===Zd&&LP(E.normalMap.format),metalnessMap:on,roughnessMap:gt,anisotropy:zt,anisotropyMap:pe,clearcoat:Fe,clearcoatMap:Me,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Le,dispersion:tn,iridescence:O,iridescenceMap:ce,iridescenceThicknessMap:ge,sheen:w,sheenColorMap:Ge,sheenRoughnessMap:qe,specularMap:Re,specularColorMap:Ie,specularIntensityMap:pt,transmission:K,transmissionMap:bt,thicknessMap:Nt,gradientMap:X,opaque:E.transparent===!1&&E.blending===gr&&E.alphaToCoverage===!1,alphaMap:Oe,alphaTest:ue,alphaHash:We,combine:E.combine,mapUv:xt&&M(E.map.channel),aoMapUv:Ot&&M(E.aoMap.channel),lightMapUv:lt&&M(E.lightMap.channel),bumpMapUv:kt&&M(E.bumpMap.channel),normalMapUv:Tt&&M(E.normalMap.channel),displacementMapUv:Vt&&M(E.displacementMap.channel),emissiveMapUv:W&&M(E.emissiveMap.channel),metalnessMapUv:on&&M(E.metalnessMap.channel),roughnessMapUv:gt&&M(E.roughnessMap.channel),anisotropyMapUv:pe&&M(E.anisotropyMap.channel),clearcoatMapUv:Me&&M(E.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&M(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Le&&M(E.clearcoatRoughnessMap.channel),iridescenceMapUv:ce&&M(E.iridescenceMap.channel),iridescenceThicknessMapUv:ge&&M(E.iridescenceThicknessMap.channel),sheenColorMapUv:Ge&&M(E.sheenColorMap.channel),sheenRoughnessMapUv:qe&&M(E.sheenRoughnessMap.channel),specularMapUv:Re&&M(E.specularMap.channel),specularColorMapUv:Ie&&M(E.specularColorMap.channel),specularIntensityMapUv:pt&&M(E.specularIntensityMap.channel),transmissionMapUv:bt&&M(E.transmissionMap.channel),thicknessMapUv:Nt&&M(E.thicknessMap.channel),alphaMapUv:Oe&&M(E.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Tt||zt),vertexNormals:!!$.attributes.normal,vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:ee.isPoints===!0&&!!$.attributes.uv&&(xt||Oe),fog:!!fe,useFog:E.fog===!0,fogExp2:!!fe&&fe.isFogExp2,flatShading:E.wireframe===!1&&(E.flatShading===!0||$.attributes.normal===void 0&&Tt===!1&&(E.isMeshLambertMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isMeshPhysicalMaterial)),sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:p,reversedDepthBuffer:nt,skinning:ee.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:Ze,morphTextureStride:It,numDirLights:B.directional.length,numPointLights:B.point.length,numSpotLights:B.spot.length,numSpotLightMaps:B.spotLightMap.length,numRectAreaLights:B.rectArea.length,numHemiLights:B.hemi.length,numDirLightShadows:B.directionalShadowMap.length,numPointLightShadows:B.pointShadowMap.length,numSpotLightShadows:B.spotShadowMap.length,numSpotLightShadowsWithMaps:B.numSpotLightShadowsWithMaps,numLightProbes:B.numLightProbes,numLightProbeGrids:de.length,numClippingPlanes:r.numPlanes,numClipIntersection:r.numIntersection,dithering:E.dithering,shadowMapEnabled:o.shadowMap.enabled&&Y.length>0,shadowMapType:o.shadowMap.type,toneMapping:be,decodeVideoTexture:xt&&E.map.isVideoTexture===!0&&St.getTransfer(E.map.colorSpace)===Ht,decodeVideoTextureEmissive:W&&E.emissiveMap.isVideoTexture===!0&&St.getTransfer(E.emissiveMap.colorSpace)===Ht,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===_i,flipSided:E.side===$n,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:Ne&&E.extensions.clipCullDistance===!0&&e.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ne&&E.extensions.multiDraw===!0||at)&&e.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:e.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return Je.vertexUv1s=l.has(1),Je.vertexUv2s=l.has(2),Je.vertexUv3s=l.has(3),l.clear(),Je}function y(E){let B=[];if(E.shaderID?B.push(E.shaderID):(B.push(E.customVertexShaderID),B.push(E.customFragmentShaderID)),E.defines!==void 0)for(let Y in E.defines)B.push(Y),B.push(E.defines[Y]);return E.isRawShaderMaterial===!1&&(C(B,E),I(B,E),B.push(o.outputColorSpace)),B.push(E.customProgramCacheKey),B.join()}function C(E,B){E.push(B.precision),E.push(B.outputColorSpace),E.push(B.envMapMode),E.push(B.envMapCubeUVHeight),E.push(B.mapUv),E.push(B.alphaMapUv),E.push(B.lightMapUv),E.push(B.aoMapUv),E.push(B.bumpMapUv),E.push(B.normalMapUv),E.push(B.displacementMapUv),E.push(B.emissiveMapUv),E.push(B.metalnessMapUv),E.push(B.roughnessMapUv),E.push(B.anisotropyMapUv),E.push(B.clearcoatMapUv),E.push(B.clearcoatNormalMapUv),E.push(B.clearcoatRoughnessMapUv),E.push(B.iridescenceMapUv),E.push(B.iridescenceThicknessMapUv),E.push(B.sheenColorMapUv),E.push(B.sheenRoughnessMapUv),E.push(B.specularMapUv),E.push(B.specularColorMapUv),E.push(B.specularIntensityMapUv),E.push(B.transmissionMapUv),E.push(B.thicknessMapUv),E.push(B.combine),E.push(B.fogExp2),E.push(B.sizeAttenuation),E.push(B.morphTargetsCount),E.push(B.morphAttributeCount),E.push(B.numDirLights),E.push(B.numPointLights),E.push(B.numSpotLights),E.push(B.numSpotLightMaps),E.push(B.numHemiLights),E.push(B.numRectAreaLights),E.push(B.numDirLightShadows),E.push(B.numPointLightShadows),E.push(B.numSpotLightShadows),E.push(B.numSpotLightShadowsWithMaps),E.push(B.numLightProbes),E.push(B.shadowMapType),E.push(B.toneMapping),E.push(B.numClippingPlanes),E.push(B.numClipIntersection),E.push(B.depthPacking)}function I(E,B){a.disableAll(),B.instancing&&a.enable(0),B.instancingColor&&a.enable(1),B.instancingMorph&&a.enable(2),B.matcap&&a.enable(3),B.envMap&&a.enable(4),B.normalMapObjectSpace&&a.enable(5),B.normalMapTangentSpace&&a.enable(6),B.clearcoat&&a.enable(7),B.iridescence&&a.enable(8),B.alphaTest&&a.enable(9),B.vertexColors&&a.enable(10),B.vertexAlphas&&a.enable(11),B.vertexUv1s&&a.enable(12),B.vertexUv2s&&a.enable(13),B.vertexUv3s&&a.enable(14),B.vertexTangents&&a.enable(15),B.anisotropy&&a.enable(16),B.alphaHash&&a.enable(17),B.batching&&a.enable(18),B.dispersion&&a.enable(19),B.batchingColor&&a.enable(20),B.gradientMap&&a.enable(21),B.packedNormalMap&&a.enable(22),B.vertexNormals&&a.enable(23),E.push(a.mask),a.disableAll(),B.fog&&a.enable(0),B.useFog&&a.enable(1),B.flatShading&&a.enable(2),B.logarithmicDepthBuffer&&a.enable(3),B.reversedDepthBuffer&&a.enable(4),B.skinning&&a.enable(5),B.morphTargets&&a.enable(6),B.morphNormals&&a.enable(7),B.morphColors&&a.enable(8),B.premultipliedAlpha&&a.enable(9),B.shadowMapEnabled&&a.enable(10),B.doubleSided&&a.enable(11),B.flipSided&&a.enable(12),B.useDepthPacking&&a.enable(13),B.dithering&&a.enable(14),B.transmission&&a.enable(15),B.sheen&&a.enable(16),B.opaque&&a.enable(17),B.pointsUvs&&a.enable(18),B.decodeVideoTexture&&a.enable(19),B.decodeVideoTextureEmissive&&a.enable(20),B.alphaToCoverage&&a.enable(21),B.numLightProbeGrids>0&&a.enable(22),E.push(a.mask)}function L(E){let B=x[E.type],Y;if(B){let U=ao[B];Y=X_.clone(U.uniforms)}else Y=E.uniforms;return Y}function k(E,B){let Y=h.get(B);return Y!==void 0?++Y.usedTimes:(Y=new RP(o,B,E,i),c.push(Y),h.set(B,Y)),Y}function H(E){if(--E.usedTimes===0){let B=c.indexOf(E);c[B]=c[c.length-1],c.pop(),h.delete(E.cacheKey),E.destroy()}}function V(E){s.remove(E)}function G(){s.dispose()}return{getParameters:S,getProgramCacheKey:y,getUniforms:L,acquireProgram:k,releaseProgram:H,releaseShaderCache:V,programs:c,dispose:G}}function VP(){let o=new WeakMap;function t(a){return o.has(a)}function e(a){let s=o.get(a);return s===void 0&&(s={},o.set(a,s)),s}function n(a){o.delete(a)}function i(a,s,l){o.get(a)[s]=l}function r(){o=new WeakMap}return{has:t,get:e,remove:n,update:i,dispose:r}}function BP(o,t){return o.groupOrder!==t.groupOrder?o.groupOrder-t.groupOrder:o.renderOrder!==t.renderOrder?o.renderOrder-t.renderOrder:o.material.id!==t.material.id?o.material.id-t.material.id:o.materialVariant!==t.materialVariant?o.materialVariant-t.materialVariant:o.z!==t.z?o.z-t.z:o.id-t.id}function hv(o,t){return o.groupOrder!==t.groupOrder?o.groupOrder-t.groupOrder:o.renderOrder!==t.renderOrder?o.renderOrder-t.renderOrder:o.z!==t.z?t.z-o.z:o.id-t.id}function pv(){let o=[],t=0,e=[],n=[],i=[];function r(){t=0,e.length=0,n.length=0,i.length=0}function a(m){let x=0;return m.isInstancedMesh&&(x+=2),m.isSkinnedMesh&&(x+=1),x}function s(m,x,M,S,y,C){let I=o[t];return I===void 0?(I={id:m.id,object:m,geometry:x,material:M,materialVariant:a(m),groupOrder:S,renderOrder:m.renderOrder,z:y,group:C},o[t]=I):(I.id=m.id,I.object=m,I.geometry=x,I.material=M,I.materialVariant=a(m),I.groupOrder=S,I.renderOrder=m.renderOrder,I.z=y,I.group=C),t++,I}function l(m,x,M,S,y,C){let I=s(m,x,M,S,y,C);M.transmission>0?n.push(I):M.transparent===!0?i.push(I):e.push(I)}function c(m,x,M,S,y,C){let I=s(m,x,M,S,y,C);M.transmission>0?n.unshift(I):M.transparent===!0?i.unshift(I):e.unshift(I)}function h(m,x){e.length>1&&e.sort(m||BP),n.length>1&&n.sort(x||hv),i.length>1&&i.sort(x||hv)}function p(){for(let m=t,x=o.length;m<x;m++){let M=o[m];if(M.id===null)break;M.id=null,M.object=null,M.geometry=null,M.material=null,M.group=null}}return{opaque:e,transmissive:n,transparent:i,init:r,push:l,unshift:c,finish:p,sort:h}}function UP(){let o=new WeakMap;function t(n,i){let r=o.get(n),a;return r===void 0?(a=new pv,o.set(n,[a])):i>=r.length?(a=new pv,r.push(a)):a=r[i],a}function e(){o=new WeakMap}return{get:t,dispose:e}}function zP(){let o={};return{get:function(t){if(o[t.id]!==void 0)return o[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new j,color:new dt};break;case"SpotLight":e={position:new j,direction:new j,color:new dt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new j,color:new dt,distance:0,decay:0};break;case"HemisphereLight":e={direction:new j,skyColor:new dt,groundColor:new dt};break;case"RectAreaLight":e={color:new dt,position:new j,halfWidth:new j,halfHeight:new j};break}return o[t.id]=e,e}}}function HP(){let o={};return{get:function(t){if(o[t.id]!==void 0)return o[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new At,shadowCameraNear:1,shadowCameraFar:1e3};break}return o[t.id]=e,e}}}var GP=0;function WP(o,t){return(t.castShadow?2:0)-(o.castShadow?2:0)+(t.map?1:0)-(o.map?1:0)}function XP(o){let t=new zP,e=HP(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new j);let i=new j,r=new Ct,a=new Ct;function s(c){let h=0,p=0,m=0;for(let B=0;B<9;B++)n.probe[B].set(0,0,0);let x=0,M=0,S=0,y=0,C=0,I=0,L=0,k=0,H=0,V=0,G=0;c.sort(WP);for(let B=0,Y=c.length;B<Y;B++){let U=c[B],ee=U.color,de=U.intensity,fe=U.distance,$=null;if(U.shadow&&U.shadow.map&&(U.shadow.map.texture.format===Zo?$=U.shadow.map.texture:$=U.shadow.map.depthTexture||U.shadow.map.texture),U.isAmbientLight)h+=ee.r*de,p+=ee.g*de,m+=ee.b*de;else if(U.isLightProbe){for(let ae=0;ae<9;ae++)n.probe[ae].addScaledVector(U.sh.coefficients[ae],de);G++}else if(U.isDirectionalLight){let ae=t.get(U);if(ae.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){let J=U.shadow,Ce=e.get(U);Ce.shadowIntensity=J.intensity,Ce.shadowBias=J.bias,Ce.shadowNormalBias=J.normalBias,Ce.shadowRadius=J.radius,Ce.shadowMapSize=J.mapSize,n.directionalShadow[x]=Ce,n.directionalShadowMap[x]=$,n.directionalShadowMatrix[x]=U.shadow.matrix,I++}n.directional[x]=ae,x++}else if(U.isSpotLight){let ae=t.get(U);ae.position.setFromMatrixPosition(U.matrixWorld),ae.color.copy(ee).multiplyScalar(de),ae.distance=fe,ae.coneCos=Math.cos(U.angle),ae.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),ae.decay=U.decay,n.spot[S]=ae;let J=U.shadow;if(U.map&&(n.spotLightMap[H]=U.map,H++,J.updateMatrices(U),U.castShadow&&V++),n.spotLightMatrix[S]=J.matrix,U.castShadow){let Ce=e.get(U);Ce.shadowIntensity=J.intensity,Ce.shadowBias=J.bias,Ce.shadowNormalBias=J.normalBias,Ce.shadowRadius=J.radius,Ce.shadowMapSize=J.mapSize,n.spotShadow[S]=Ce,n.spotShadowMap[S]=$,k++}S++}else if(U.isRectAreaLight){let ae=t.get(U);ae.color.copy(ee).multiplyScalar(de),ae.halfWidth.set(U.width*.5,0,0),ae.halfHeight.set(0,U.height*.5,0),n.rectArea[y]=ae,y++}else if(U.isPointLight){let ae=t.get(U);if(ae.color.copy(U.color).multiplyScalar(U.intensity),ae.distance=U.distance,ae.decay=U.decay,U.castShadow){let J=U.shadow,Ce=e.get(U);Ce.shadowIntensity=J.intensity,Ce.shadowBias=J.bias,Ce.shadowNormalBias=J.normalBias,Ce.shadowRadius=J.radius,Ce.shadowMapSize=J.mapSize,Ce.shadowCameraNear=J.camera.near,Ce.shadowCameraFar=J.camera.far,n.pointShadow[M]=Ce,n.pointShadowMap[M]=$,n.pointShadowMatrix[M]=U.shadow.matrix,L++}n.point[M]=ae,M++}else if(U.isHemisphereLight){let ae=t.get(U);ae.skyColor.copy(U.color).multiplyScalar(de),ae.groundColor.copy(U.groundColor).multiplyScalar(de),n.hemi[C]=ae,C++}}y>0&&(o.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ue.LTC_FLOAT_1,n.rectAreaLTC2=Ue.LTC_FLOAT_2):(n.rectAreaLTC1=Ue.LTC_HALF_1,n.rectAreaLTC2=Ue.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=p,n.ambient[2]=m;let E=n.hash;(E.directionalLength!==x||E.pointLength!==M||E.spotLength!==S||E.rectAreaLength!==y||E.hemiLength!==C||E.numDirectionalShadows!==I||E.numPointShadows!==L||E.numSpotShadows!==k||E.numSpotMaps!==H||E.numLightProbes!==G)&&(n.directional.length=x,n.spot.length=S,n.rectArea.length=y,n.point.length=M,n.hemi.length=C,n.directionalShadow.length=I,n.directionalShadowMap.length=I,n.pointShadow.length=L,n.pointShadowMap.length=L,n.spotShadow.length=k,n.spotShadowMap.length=k,n.directionalShadowMatrix.length=I,n.pointShadowMatrix.length=L,n.spotLightMatrix.length=k+H-V,n.spotLightMap.length=H,n.numSpotLightShadowsWithMaps=V,n.numLightProbes=G,E.directionalLength=x,E.pointLength=M,E.spotLength=S,E.rectAreaLength=y,E.hemiLength=C,E.numDirectionalShadows=I,E.numPointShadows=L,E.numSpotShadows=k,E.numSpotMaps=H,E.numLightProbes=G,n.version=GP++)}function l(c,h){let p=0,m=0,x=0,M=0,S=0,y=h.matrixWorldInverse;for(let C=0,I=c.length;C<I;C++){let L=c[C];if(L.isDirectionalLight){let k=n.directional[p];k.direction.setFromMatrixPosition(L.matrixWorld),i.setFromMatrixPosition(L.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(y),p++}else if(L.isSpotLight){let k=n.spot[x];k.position.setFromMatrixPosition(L.matrixWorld),k.position.applyMatrix4(y),k.direction.setFromMatrixPosition(L.matrixWorld),i.setFromMatrixPosition(L.target.matrixWorld),k.direction.sub(i),k.direction.transformDirection(y),x++}else if(L.isRectAreaLight){let k=n.rectArea[M];k.position.setFromMatrixPosition(L.matrixWorld),k.position.applyMatrix4(y),a.identity(),r.copy(L.matrixWorld),r.premultiply(y),a.extractRotation(r),k.halfWidth.set(L.width*.5,0,0),k.halfHeight.set(0,L.height*.5,0),k.halfWidth.applyMatrix4(a),k.halfHeight.applyMatrix4(a),M++}else if(L.isPointLight){let k=n.point[m];k.position.setFromMatrixPosition(L.matrixWorld),k.position.applyMatrix4(y),m++}else if(L.isHemisphereLight){let k=n.hemi[S];k.direction.setFromMatrixPosition(L.matrixWorld),k.direction.transformDirection(y),S++}}}return{setup:s,setupView:l,state:n}}function mv(o){let t=new XP(o),e=[],n=[],i=[];function r(m){p.camera=m,e.length=0,n.length=0,i.length=0}function a(m){e.push(m)}function s(m){n.push(m)}function l(m){i.push(m)}function c(){t.setup(e)}function h(m){t.setupView(e,m)}let p={lightsArray:e,shadowsArray:n,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init:r,state:p,setupLights:c,setupLightsView:h,pushLight:a,pushShadow:s,pushLightProbeGrid:l}}function qP(o){let t=new WeakMap;function e(i,r=0){let a=t.get(i),s;return a===void 0?(s=new mv(o),t.set(i,[s])):r>=a.length?(s=new mv(o),a.push(s)):s=a[r],s}function n(){t=new WeakMap}return{get:e,dispose:n}}var $P=`void main() {
|
|
gl_Position = vec4( position, 1.0 );
|
|
}`,YP=`uniform sampler2D shadow_pass;
|
|
uniform vec2 resolution;
|
|
uniform float radius;
|
|
void main() {
|
|
const float samples = float( VSM_SAMPLES );
|
|
float mean = 0.0;
|
|
float squared_mean = 0.0;
|
|
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
|
|
float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
|
|
for ( float i = 0.0; i < samples; i ++ ) {
|
|
float uvOffset = uvStart + i * uvStride;
|
|
#ifdef HORIZONTAL_PASS
|
|
vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
|
|
mean += distribution.x;
|
|
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
|
|
#else
|
|
float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
|
|
mean += depth;
|
|
squared_mean += depth * depth;
|
|
#endif
|
|
}
|
|
mean = mean / samples;
|
|
squared_mean = squared_mean / samples;
|
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
|
}`,jP=[new j(1,0,0),new j(-1,0,0),new j(0,1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1)],KP=[new j(0,-1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1),new j(0,-1,0),new j(0,-1,0)],fv=new Ct,sl=new j,Ip=new j;function ZP(o,t,e){let n=new Ea,i=new At,r=new At,a=new Yt,s=new id,l=new od,c={},h=e.maxTextureSize,p={[Di]:$n,[$n]:Di,[_i]:_i},m=new di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new At},radius:{value:4}},vertexShader:$P,fragmentShader:YP}),x=m.clone();x.defines.HORIZONTAL_PASS=1;let M=new qn;M.setAttribute("position",new bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let S=new kn(M,m),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Qs;let C=this.type;this.render=function(V,G,E){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||V.length===0)return;this.type===c_&&(Ke("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Qs);let B=o.getRenderTarget(),Y=o.getActiveCubeFace(),U=o.getActiveMipmapLevel(),ee=o.state;ee.setBlending(io),ee.buffers.depth.getReversed()===!0?ee.buffers.color.setClear(0,0,0,0):ee.buffers.color.setClear(1,1,1,1),ee.buffers.depth.setTest(!0),ee.setScissorTest(!1);let de=C!==this.type;de&&G.traverse(function(fe){fe.material&&(Array.isArray(fe.material)?fe.material.forEach($=>$.needsUpdate=!0):fe.material.needsUpdate=!0)});for(let fe=0,$=V.length;fe<$;fe++){let ae=V[fe],J=ae.shadow;if(J===void 0){Ke("WebGLShadowMap:",ae,"has no shadow.");continue}if(J.autoUpdate===!1&&J.needsUpdate===!1)continue;i.copy(J.mapSize);let Ce=J.getFrameExtents();i.multiply(Ce),r.copy(J.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/Ce.x),i.x=r.x*Ce.x,J.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/Ce.y),i.y=r.y*Ce.y,J.mapSize.y=r.y));let Se=o.state.buffers.depth.getReversed();if(J.camera._reversedDepth=Se,J.map===null||de===!0){if(J.map!==null&&(J.map.depthTexture!==null&&(J.map.depthTexture.dispose(),J.map.depthTexture=null),J.map.dispose()),this.type===Ia){if(ae.isPointLight){Ke("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}J.map=new si(i.x,i.y,{format:Zo,type:oo,minFilter:sn,magFilter:sn,generateMipmaps:!1}),J.map.texture.name=ae.name+".shadowMap",J.map.depthTexture=new wo(i.x,i.y,ui),J.map.depthTexture.name=ae.name+".shadowMapDepth",J.map.depthTexture.format=Zi,J.map.depthTexture.compareFunction=null,J.map.depthTexture.minFilter=fn,J.map.depthTexture.magFilter=fn}else ae.isPointLight?(J.map=new iu(i.x),J.map.depthTexture=new td(i.x,Li)):(J.map=new si(i.x,i.y),J.map.depthTexture=new wo(i.x,i.y,Li)),J.map.depthTexture.name=ae.name+".shadowMap",J.map.depthTexture.format=Zi,this.type===Qs?(J.map.depthTexture.compareFunction=Se?Qd:Jd,J.map.depthTexture.minFilter=sn,J.map.depthTexture.magFilter=sn):(J.map.depthTexture.compareFunction=null,J.map.depthTexture.minFilter=fn,J.map.depthTexture.magFilter=fn);J.camera.updateProjectionMatrix()}let Ve=J.map.isWebGLCubeRenderTarget?6:1;for(let Ye=0;Ye<Ve;Ye++){if(J.map.isWebGLCubeRenderTarget)o.setRenderTarget(J.map,Ye),o.clear();else{Ye===0&&(o.setRenderTarget(J.map),o.clear());let Ze=J.getViewport(Ye);a.set(r.x*Ze.x,r.y*Ze.y,r.x*Ze.z,r.y*Ze.w),ee.viewport(a)}if(ae.isPointLight){let Ze=J.camera,It=J.matrix,ut=ae.distance||Ze.far;ut!==Ze.far&&(Ze.far=ut,Ze.updateProjectionMatrix()),sl.setFromMatrixPosition(ae.matrixWorld),Ze.position.copy(sl),Ip.copy(Ze.position),Ip.add(jP[Ye]),Ze.up.copy(KP[Ye]),Ze.lookAt(Ip),Ze.updateMatrixWorld(),It.makeTranslation(-sl.x,-sl.y,-sl.z),fv.multiplyMatrices(Ze.projectionMatrix,Ze.matrixWorldInverse),J._frustum.setFromProjectionMatrix(fv,Ze.coordinateSystem,Ze.reversedDepth)}else J.updateMatrices(ae);n=J.getFrustum(),k(G,E,J.camera,ae,this.type)}J.isPointLightShadow!==!0&&this.type===Ia&&I(J,E),J.needsUpdate=!1}C=this.type,y.needsUpdate=!1,o.setRenderTarget(B,Y,U)};function I(V,G){let E=t.update(S);m.defines.VSM_SAMPLES!==V.blurSamples&&(m.defines.VSM_SAMPLES=V.blurSamples,x.defines.VSM_SAMPLES=V.blurSamples,m.needsUpdate=!0,x.needsUpdate=!0),V.mapPass===null&&(V.mapPass=new si(i.x,i.y,{format:Zo,type:oo})),m.uniforms.shadow_pass.value=V.map.depthTexture,m.uniforms.resolution.value=V.mapSize,m.uniforms.radius.value=V.radius,o.setRenderTarget(V.mapPass),o.clear(),o.renderBufferDirect(G,null,E,m,S,null),x.uniforms.shadow_pass.value=V.mapPass.texture,x.uniforms.resolution.value=V.mapSize,x.uniforms.radius.value=V.radius,o.setRenderTarget(V.map),o.clear(),o.renderBufferDirect(G,null,E,x,S,null)}function L(V,G,E,B){let Y=null,U=E.isPointLight===!0?V.customDistanceMaterial:V.customDepthMaterial;if(U!==void 0)Y=U;else if(Y=E.isPointLight===!0?l:s,o.localClippingEnabled&&G.clipShadows===!0&&Array.isArray(G.clippingPlanes)&&G.clippingPlanes.length!==0||G.displacementMap&&G.displacementScale!==0||G.alphaMap&&G.alphaTest>0||G.map&&G.alphaTest>0||G.alphaToCoverage===!0){let ee=Y.uuid,de=G.uuid,fe=c[ee];fe===void 0&&(fe={},c[ee]=fe);let $=fe[de];$===void 0&&($=Y.clone(),fe[de]=$,G.addEventListener("dispose",H)),Y=$}if(Y.visible=G.visible,Y.wireframe=G.wireframe,B===Ia?Y.side=G.shadowSide!==null?G.shadowSide:G.side:Y.side=G.shadowSide!==null?G.shadowSide:p[G.side],Y.alphaMap=G.alphaMap,Y.alphaTest=G.alphaToCoverage===!0?.5:G.alphaTest,Y.map=G.map,Y.clipShadows=G.clipShadows,Y.clippingPlanes=G.clippingPlanes,Y.clipIntersection=G.clipIntersection,Y.displacementMap=G.displacementMap,Y.displacementScale=G.displacementScale,Y.displacementBias=G.displacementBias,Y.wireframeLinewidth=G.wireframeLinewidth,Y.linewidth=G.linewidth,E.isPointLight===!0&&Y.isMeshDistanceMaterial===!0){let ee=o.properties.get(Y);ee.light=E}return Y}function k(V,G,E,B,Y){if(V.visible===!1)return;if(V.layers.test(G.layers)&&(V.isMesh||V.isLine||V.isPoints)&&(V.castShadow||V.receiveShadow&&Y===Ia)&&(!V.frustumCulled||n.intersectsObject(V))){V.modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,V.matrixWorld);let de=t.update(V),fe=V.material;if(Array.isArray(fe)){let $=de.groups;for(let ae=0,J=$.length;ae<J;ae++){let Ce=$[ae],Se=fe[Ce.materialIndex];if(Se&&Se.visible){let Ve=L(V,Se,B,Y);V.onBeforeShadow(o,V,G,E,de,Ve,Ce),o.renderBufferDirect(E,null,de,Ve,V,Ce),V.onAfterShadow(o,V,G,E,de,Ve,Ce)}}}else if(fe.visible){let $=L(V,fe,B,Y);V.onBeforeShadow(o,V,G,E,de,$,null),o.renderBufferDirect(E,null,de,$,V,null),V.onAfterShadow(o,V,G,E,de,$,null)}}let ee=V.children;for(let de=0,fe=ee.length;de<fe;de++)k(ee[de],G,E,B,Y)}function H(V){V.target.removeEventListener("dispose",H);for(let E in c){let B=c[E],Y=V.target.uuid;Y in B&&(B[Y].dispose(),delete B[Y])}}}function JP(o,t){function e(){let X=!1,Oe=new Yt,ue=null,We=new Yt(0,0,0,0);return{setMask:function(Ne){ue!==Ne&&!X&&(o.colorMask(Ne,Ne,Ne,Ne),ue=Ne)},setLocked:function(Ne){X=Ne},setClear:function(Ne,be,Je,_t,un){un===!0&&(Ne*=_t,be*=_t,Je*=_t),Oe.set(Ne,be,Je,_t),We.equals(Oe)===!1&&(o.clearColor(Ne,be,Je,_t),We.copy(Oe))},reset:function(){X=!1,ue=null,We.set(-1,0,0,0)}}}function n(){let X=!1,Oe=!1,ue=null,We=null,Ne=null;return{setReversed:function(be){if(Oe!==be){let Je=t.get("EXT_clip_control");be?Je.clipControlEXT(Je.LOWER_LEFT_EXT,Je.ZERO_TO_ONE_EXT):Je.clipControlEXT(Je.LOWER_LEFT_EXT,Je.NEGATIVE_ONE_TO_ONE_EXT),Oe=be;let _t=Ne;Ne=null,this.setClear(_t)}},getReversed:function(){return Oe},setTest:function(be){be?Pe(o.DEPTH_TEST):nt(o.DEPTH_TEST)},setMask:function(be){ue!==be&&!X&&(o.depthMask(be),ue=be)},setFunc:function(be){if(Oe&&(be=G_[be]),We!==be){switch(be){case Uc:o.depthFunc(o.NEVER);break;case zc:o.depthFunc(o.ALWAYS);break;case Hc:o.depthFunc(o.LESS);break;case _r:o.depthFunc(o.LEQUAL);break;case Gc:o.depthFunc(o.EQUAL);break;case Wc:o.depthFunc(o.GEQUAL);break;case Xc:o.depthFunc(o.GREATER);break;case qc:o.depthFunc(o.NOTEQUAL);break;default:o.depthFunc(o.LEQUAL)}We=be}},setLocked:function(be){X=be},setClear:function(be){Ne!==be&&(Ne=be,Oe&&(be=1-be),o.clearDepth(be))},reset:function(){X=!1,ue=null,We=null,Ne=null,Oe=!1}}}function i(){let X=!1,Oe=null,ue=null,We=null,Ne=null,be=null,Je=null,_t=null,un=null;return{setTest:function(Xt){X||(Xt?Pe(o.STENCIL_TEST):nt(o.STENCIL_TEST))},setMask:function(Xt){Oe!==Xt&&!X&&(o.stencilMask(Xt),Oe=Xt)},setFunc:function(Xt,uo,Vi){(ue!==Xt||We!==uo||Ne!==Vi)&&(o.stencilFunc(Xt,uo,Vi),ue=Xt,We=uo,Ne=Vi)},setOp:function(Xt,uo,Vi){(be!==Xt||Je!==uo||_t!==Vi)&&(o.stencilOp(Xt,uo,Vi),be=Xt,Je=uo,_t=Vi)},setLocked:function(Xt){X=Xt},setClear:function(Xt){un!==Xt&&(o.clearStencil(Xt),un=Xt)},reset:function(){X=!1,Oe=null,ue=null,We=null,Ne=null,be=null,Je=null,_t=null,un=null}}}let r=new e,a=new n,s=new i,l=new WeakMap,c=new WeakMap,h={},p={},m={},x=new WeakMap,M=[],S=null,y=!1,C=null,I=null,L=null,k=null,H=null,V=null,G=null,E=new dt(0,0,0),B=0,Y=!1,U=null,ee=null,de=null,fe=null,$=null,ae=o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS),J=!1,Ce=0,Se=o.getParameter(o.VERSION);Se.indexOf("WebGL")!==-1?(Ce=parseFloat(/^WebGL (\d)/.exec(Se)[1]),J=Ce>=1):Se.indexOf("OpenGL ES")!==-1&&(Ce=parseFloat(/^OpenGL ES (\d)/.exec(Se)[1]),J=Ce>=2);let Ve=null,Ye={},Ze=o.getParameter(o.SCISSOR_BOX),It=o.getParameter(o.VIEWPORT),ut=new Yt().fromArray(Ze),it=new Yt().fromArray(It);function _e(X,Oe,ue,We){let Ne=new Uint8Array(4),be=o.createTexture();o.bindTexture(X,be),o.texParameteri(X,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(X,o.TEXTURE_MAG_FILTER,o.NEAREST);for(let Je=0;Je<ue;Je++)X===o.TEXTURE_3D||X===o.TEXTURE_2D_ARRAY?o.texImage3D(Oe,0,o.RGBA,1,1,We,0,o.RGBA,o.UNSIGNED_BYTE,Ne):o.texImage2D(Oe+Je,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,Ne);return be}let Be={};Be[o.TEXTURE_2D]=_e(o.TEXTURE_2D,o.TEXTURE_2D,1),Be[o.TEXTURE_CUBE_MAP]=_e(o.TEXTURE_CUBE_MAP,o.TEXTURE_CUBE_MAP_POSITIVE_X,6),Be[o.TEXTURE_2D_ARRAY]=_e(o.TEXTURE_2D_ARRAY,o.TEXTURE_2D_ARRAY,1,1),Be[o.TEXTURE_3D]=_e(o.TEXTURE_3D,o.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),s.setClear(0),Pe(o.DEPTH_TEST),a.setFunc(_r),kt(!1),Tt(Qh),Pe(o.CULL_FACE),Ot(io);function Pe(X){h[X]!==!0&&(o.enable(X),h[X]=!0)}function nt(X){h[X]!==!1&&(o.disable(X),h[X]=!1)}function ot(X,Oe){return m[X]!==Oe?(o.bindFramebuffer(X,Oe),m[X]=Oe,X===o.DRAW_FRAMEBUFFER&&(m[o.FRAMEBUFFER]=Oe),X===o.FRAMEBUFFER&&(m[o.DRAW_FRAMEBUFFER]=Oe),!0):!1}function at(X,Oe){let ue=M,We=!1;if(X){ue=x.get(Oe),ue===void 0&&(ue=[],x.set(Oe,ue));let Ne=X.textures;if(ue.length!==Ne.length||ue[0]!==o.COLOR_ATTACHMENT0){for(let be=0,Je=Ne.length;be<Je;be++)ue[be]=o.COLOR_ATTACHMENT0+be;ue.length=Ne.length,We=!0}}else ue[0]!==o.BACK&&(ue[0]=o.BACK,We=!0);We&&o.drawBuffers(ue)}function xt(X){return S!==X?(o.useProgram(X),S=X,!0):!1}let rt={[qo]:o.FUNC_ADD,[u_]:o.FUNC_SUBTRACT,[h_]:o.FUNC_REVERSE_SUBTRACT};rt[p_]=o.MIN,rt[m_]=o.MAX;let ft={[f_]:o.ZERO,[g_]:o.ONE,[__]:o.SRC_COLOR,[Vc]:o.SRC_ALPHA,[M_]:o.SRC_ALPHA_SATURATE,[y_]:o.DST_COLOR,[x_]:o.DST_ALPHA,[v_]:o.ONE_MINUS_SRC_COLOR,[Bc]:o.ONE_MINUS_SRC_ALPHA,[C_]:o.ONE_MINUS_DST_COLOR,[b_]:o.ONE_MINUS_DST_ALPHA,[w_]:o.CONSTANT_COLOR,[S_]:o.ONE_MINUS_CONSTANT_COLOR,[E_]:o.CONSTANT_ALPHA,[T_]:o.ONE_MINUS_CONSTANT_ALPHA};function Ot(X,Oe,ue,We,Ne,be,Je,_t,un,Xt){if(X===io){y===!0&&(nt(o.BLEND),y=!1);return}if(y===!1&&(Pe(o.BLEND),y=!0),X!==d_){if(X!==C||Xt!==Y){if((I!==qo||H!==qo)&&(o.blendEquation(o.FUNC_ADD),I=qo,H=qo),Xt)switch(X){case gr:o.blendFuncSeparate(o.ONE,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case ep:o.blendFunc(o.ONE,o.ONE);break;case tp:o.blendFuncSeparate(o.ZERO,o.ONE_MINUS_SRC_COLOR,o.ZERO,o.ONE);break;case np:o.blendFuncSeparate(o.DST_COLOR,o.ONE_MINUS_SRC_ALPHA,o.ZERO,o.ONE);break;default:st("WebGLState: Invalid blending: ",X);break}else switch(X){case gr:o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case ep:o.blendFuncSeparate(o.SRC_ALPHA,o.ONE,o.ONE,o.ONE);break;case tp:st("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case np:st("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:st("WebGLState: Invalid blending: ",X);break}L=null,k=null,V=null,G=null,E.set(0,0,0),B=0,C=X,Y=Xt}return}Ne=Ne||Oe,be=be||ue,Je=Je||We,(Oe!==I||Ne!==H)&&(o.blendEquationSeparate(rt[Oe],rt[Ne]),I=Oe,H=Ne),(ue!==L||We!==k||be!==V||Je!==G)&&(o.blendFuncSeparate(ft[ue],ft[We],ft[be],ft[Je]),L=ue,k=We,V=be,G=Je),(_t.equals(E)===!1||un!==B)&&(o.blendColor(_t.r,_t.g,_t.b,un),E.copy(_t),B=un),C=X,Y=!1}function lt(X,Oe){X.side===_i?nt(o.CULL_FACE):Pe(o.CULL_FACE);let ue=X.side===$n;Oe&&(ue=!ue),kt(ue),X.blending===gr&&X.transparent===!1?Ot(io):Ot(X.blending,X.blendEquation,X.blendSrc,X.blendDst,X.blendEquationAlpha,X.blendSrcAlpha,X.blendDstAlpha,X.blendColor,X.blendAlpha,X.premultipliedAlpha),a.setFunc(X.depthFunc),a.setTest(X.depthTest),a.setMask(X.depthWrite),r.setMask(X.colorWrite);let We=X.stencilWrite;s.setTest(We),We&&(s.setMask(X.stencilWriteMask),s.setFunc(X.stencilFunc,X.stencilRef,X.stencilFuncMask),s.setOp(X.stencilFail,X.stencilZFail,X.stencilZPass)),W(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),X.alphaToCoverage===!0?Pe(o.SAMPLE_ALPHA_TO_COVERAGE):nt(o.SAMPLE_ALPHA_TO_COVERAGE)}function kt(X){U!==X&&(X?o.frontFace(o.CW):o.frontFace(o.CCW),U=X)}function Tt(X){X!==s_?(Pe(o.CULL_FACE),X!==ee&&(X===Qh?o.cullFace(o.BACK):X===l_?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK))):nt(o.CULL_FACE),ee=X}function Vt(X){X!==de&&(J&&o.lineWidth(X),de=X)}function W(X,Oe,ue){X?(Pe(o.POLYGON_OFFSET_FILL),(fe!==Oe||$!==ue)&&(fe=Oe,$=ue,a.getReversed()&&(Oe=-Oe),o.polygonOffset(Oe,ue))):nt(o.POLYGON_OFFSET_FILL)}function on(X){X?Pe(o.SCISSOR_TEST):nt(o.SCISSOR_TEST)}function gt(X){X===void 0&&(X=o.TEXTURE0+ae-1),Ve!==X&&(o.activeTexture(X),Ve=X)}function zt(X,Oe,ue){ue===void 0&&(Ve===null?ue=o.TEXTURE0+ae-1:ue=Ve);let We=Ye[ue];We===void 0&&(We={type:void 0,texture:void 0},Ye[ue]=We),(We.type!==X||We.texture!==Oe)&&(Ve!==ue&&(o.activeTexture(ue),Ve=ue),o.bindTexture(X,Oe||Be[X]),We.type=X,We.texture=Oe)}function Fe(){let X=Ye[Ve];X!==void 0&&X.type!==void 0&&(o.bindTexture(X.type,null),X.type=void 0,X.texture=void 0)}function tn(){try{o.compressedTexImage2D(...arguments)}catch(X){st("WebGLState:",X)}}function O(){try{o.compressedTexImage3D(...arguments)}catch(X){st("WebGLState:",X)}}function w(){try{o.texSubImage2D(...arguments)}catch(X){st("WebGLState:",X)}}function K(){try{o.texSubImage3D(...arguments)}catch(X){st("WebGLState:",X)}}function pe(){try{o.compressedTexSubImage2D(...arguments)}catch(X){st("WebGLState:",X)}}function Me(){try{o.compressedTexSubImage3D(...arguments)}catch(X){st("WebGLState:",X)}}function Ae(){try{o.texStorage2D(...arguments)}catch(X){st("WebGLState:",X)}}function Le(){try{o.texStorage3D(...arguments)}catch(X){st("WebGLState:",X)}}function ce(){try{o.texImage2D(...arguments)}catch(X){st("WebGLState:",X)}}function ge(){try{o.texImage3D(...arguments)}catch(X){st("WebGLState:",X)}}function Ge(X){return p[X]!==void 0?p[X]:o.getParameter(X)}function qe(X,Oe){p[X]!==Oe&&(o.pixelStorei(X,Oe),p[X]=Oe)}function Re(X){ut.equals(X)===!1&&(o.scissor(X.x,X.y,X.z,X.w),ut.copy(X))}function Ie(X){it.equals(X)===!1&&(o.viewport(X.x,X.y,X.z,X.w),it.copy(X))}function pt(X,Oe){let ue=c.get(Oe);ue===void 0&&(ue=new WeakMap,c.set(Oe,ue));let We=ue.get(X);We===void 0&&(We=o.getUniformBlockIndex(Oe,X.name),ue.set(X,We))}function bt(X,Oe){let We=c.get(Oe).get(X);l.get(Oe)!==We&&(o.uniformBlockBinding(Oe,We,X.__bindingPointIndex),l.set(Oe,We))}function Nt(){o.disable(o.BLEND),o.disable(o.CULL_FACE),o.disable(o.DEPTH_TEST),o.disable(o.POLYGON_OFFSET_FILL),o.disable(o.SCISSOR_TEST),o.disable(o.STENCIL_TEST),o.disable(o.SAMPLE_ALPHA_TO_COVERAGE),o.blendEquation(o.FUNC_ADD),o.blendFunc(o.ONE,o.ZERO),o.blendFuncSeparate(o.ONE,o.ZERO,o.ONE,o.ZERO),o.blendColor(0,0,0,0),o.colorMask(!0,!0,!0,!0),o.clearColor(0,0,0,0),o.depthMask(!0),o.depthFunc(o.LESS),a.setReversed(!1),o.clearDepth(1),o.stencilMask(4294967295),o.stencilFunc(o.ALWAYS,0,4294967295),o.stencilOp(o.KEEP,o.KEEP,o.KEEP),o.clearStencil(0),o.cullFace(o.BACK),o.frontFace(o.CCW),o.polygonOffset(0,0),o.activeTexture(o.TEXTURE0),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.useProgram(null),o.lineWidth(1),o.scissor(0,0,o.canvas.width,o.canvas.height),o.viewport(0,0,o.canvas.width,o.canvas.height),o.pixelStorei(o.PACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL),o.pixelStorei(o.PACK_ROW_LENGTH,0),o.pixelStorei(o.PACK_SKIP_PIXELS,0),o.pixelStorei(o.PACK_SKIP_ROWS,0),o.pixelStorei(o.UNPACK_ROW_LENGTH,0),o.pixelStorei(o.UNPACK_IMAGE_HEIGHT,0),o.pixelStorei(o.UNPACK_SKIP_PIXELS,0),o.pixelStorei(o.UNPACK_SKIP_ROWS,0),o.pixelStorei(o.UNPACK_SKIP_IMAGES,0),h={},p={},Ve=null,Ye={},m={},x=new WeakMap,M=[],S=null,y=!1,C=null,I=null,L=null,k=null,H=null,V=null,G=null,E=new dt(0,0,0),B=0,Y=!1,U=null,ee=null,de=null,fe=null,$=null,ut.set(0,0,o.canvas.width,o.canvas.height),it.set(0,0,o.canvas.width,o.canvas.height),r.reset(),a.reset(),s.reset()}return{buffers:{color:r,depth:a,stencil:s},enable:Pe,disable:nt,bindFramebuffer:ot,drawBuffers:at,useProgram:xt,setBlending:Ot,setMaterial:lt,setFlipSided:kt,setCullFace:Tt,setLineWidth:Vt,setPolygonOffset:W,setScissorTest:on,activeTexture:gt,bindTexture:zt,unbindTexture:Fe,compressedTexImage2D:tn,compressedTexImage3D:O,texImage2D:ce,texImage3D:ge,pixelStorei:qe,getParameter:Ge,updateUBOMapping:pt,uniformBlockBinding:bt,texStorage2D:Ae,texStorage3D:Le,texSubImage2D:w,texSubImage3D:K,compressedTexSubImage2D:pe,compressedTexSubImage3D:Me,scissor:Re,viewport:Ie,reset:Nt}}function QP(o,t,e,n,i,r,a){let s=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new At,h=new WeakMap,p=new Set,m,x=new WeakMap,M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(O,w){return M?new OffscreenCanvas(O,w):_a("canvas")}function y(O,w,K){let pe=1,Me=tn(O);if((Me.width>K||Me.height>K)&&(pe=K/Math.max(Me.width,Me.height)),pe<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){let Ae=Math.floor(pe*Me.width),Le=Math.floor(pe*Me.height);m===void 0&&(m=S(Ae,Le));let ce=w?S(Ae,Le):m;return ce.width=Ae,ce.height=Le,ce.getContext("2d").drawImage(O,0,0,Ae,Le),Ke("WebGLRenderer: Texture has been resized from ("+Me.width+"x"+Me.height+") to ("+Ae+"x"+Le+")."),ce}else return"data"in O&&Ke("WebGLRenderer: Image in DataTexture is too big ("+Me.width+"x"+Me.height+")."),O;return O}function C(O){return O.generateMipmaps}function I(O){o.generateMipmap(O)}function L(O){return O.isWebGLCubeRenderTarget?o.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?o.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?o.TEXTURE_2D_ARRAY:o.TEXTURE_2D}function k(O,w,K,pe,Me,Ae=!1){if(O!==null){if(o[O]!==void 0)return o[O];Ke("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let Le;pe&&(Le=t.get("EXT_texture_norm16"),Le||Ke("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let ce=w;if(w===o.RED&&(K===o.FLOAT&&(ce=o.R32F),K===o.HALF_FLOAT&&(ce=o.R16F),K===o.UNSIGNED_BYTE&&(ce=o.R8),K===o.UNSIGNED_SHORT&&Le&&(ce=Le.R16_EXT),K===o.SHORT&&Le&&(ce=Le.R16_SNORM_EXT)),w===o.RED_INTEGER&&(K===o.UNSIGNED_BYTE&&(ce=o.R8UI),K===o.UNSIGNED_SHORT&&(ce=o.R16UI),K===o.UNSIGNED_INT&&(ce=o.R32UI),K===o.BYTE&&(ce=o.R8I),K===o.SHORT&&(ce=o.R16I),K===o.INT&&(ce=o.R32I)),w===o.RG&&(K===o.FLOAT&&(ce=o.RG32F),K===o.HALF_FLOAT&&(ce=o.RG16F),K===o.UNSIGNED_BYTE&&(ce=o.RG8),K===o.UNSIGNED_SHORT&&Le&&(ce=Le.RG16_EXT),K===o.SHORT&&Le&&(ce=Le.RG16_SNORM_EXT)),w===o.RG_INTEGER&&(K===o.UNSIGNED_BYTE&&(ce=o.RG8UI),K===o.UNSIGNED_SHORT&&(ce=o.RG16UI),K===o.UNSIGNED_INT&&(ce=o.RG32UI),K===o.BYTE&&(ce=o.RG8I),K===o.SHORT&&(ce=o.RG16I),K===o.INT&&(ce=o.RG32I)),w===o.RGB_INTEGER&&(K===o.UNSIGNED_BYTE&&(ce=o.RGB8UI),K===o.UNSIGNED_SHORT&&(ce=o.RGB16UI),K===o.UNSIGNED_INT&&(ce=o.RGB32UI),K===o.BYTE&&(ce=o.RGB8I),K===o.SHORT&&(ce=o.RGB16I),K===o.INT&&(ce=o.RGB32I)),w===o.RGBA_INTEGER&&(K===o.UNSIGNED_BYTE&&(ce=o.RGBA8UI),K===o.UNSIGNED_SHORT&&(ce=o.RGBA16UI),K===o.UNSIGNED_INT&&(ce=o.RGBA32UI),K===o.BYTE&&(ce=o.RGBA8I),K===o.SHORT&&(ce=o.RGBA16I),K===o.INT&&(ce=o.RGBA32I)),w===o.RGB&&(K===o.UNSIGNED_SHORT&&Le&&(ce=Le.RGB16_EXT),K===o.SHORT&&Le&&(ce=Le.RGB16_SNORM_EXT),K===o.UNSIGNED_INT_5_9_9_9_REV&&(ce=o.RGB9_E5),K===o.UNSIGNED_INT_10F_11F_11F_REV&&(ce=o.R11F_G11F_B10F)),w===o.RGBA){let ge=Ae?Ts:St.getTransfer(Me);K===o.FLOAT&&(ce=o.RGBA32F),K===o.HALF_FLOAT&&(ce=o.RGBA16F),K===o.UNSIGNED_BYTE&&(ce=ge===Ht?o.SRGB8_ALPHA8:o.RGBA8),K===o.UNSIGNED_SHORT&&Le&&(ce=Le.RGBA16_EXT),K===o.SHORT&&Le&&(ce=Le.RGBA16_SNORM_EXT),K===o.UNSIGNED_SHORT_4_4_4_4&&(ce=o.RGBA4),K===o.UNSIGNED_SHORT_5_5_5_1&&(ce=o.RGB5_A1)}return(ce===o.R16F||ce===o.R32F||ce===o.RG16F||ce===o.RG32F||ce===o.RGBA16F||ce===o.RGBA32F)&&t.get("EXT_color_buffer_float"),ce}function H(O,w){let K;return O?w===null||w===Li||w===ka?K=o.DEPTH24_STENCIL8:w===ui?K=o.DEPTH32F_STENCIL8:w===Da&&(K=o.DEPTH24_STENCIL8,Ke("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===Li||w===ka?K=o.DEPTH_COMPONENT24:w===ui?K=o.DEPTH_COMPONENT32F:w===Da&&(K=o.DEPTH_COMPONENT16),K}function V(O,w){return C(O)===!0||O.isFramebufferTexture&&O.minFilter!==fn&&O.minFilter!==sn?Math.log2(Math.max(w.width,w.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?w.mipmaps.length:1}function G(O){let w=O.target;w.removeEventListener("dispose",G),B(w),w.isVideoTexture&&h.delete(w),w.isHTMLTexture&&p.delete(w)}function E(O){let w=O.target;w.removeEventListener("dispose",E),U(w)}function B(O){let w=n.get(O);if(w.__webglInit===void 0)return;let K=O.source,pe=x.get(K);if(pe){let Me=pe[w.__cacheKey];Me.usedTimes--,Me.usedTimes===0&&Y(O),Object.keys(pe).length===0&&x.delete(K)}n.remove(O)}function Y(O){let w=n.get(O);o.deleteTexture(w.__webglTexture);let K=O.source,pe=x.get(K);delete pe[w.__cacheKey],a.memory.textures--}function U(O){let w=n.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),n.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(w.__webglFramebuffer[pe]))for(let Me=0;Me<w.__webglFramebuffer[pe].length;Me++)o.deleteFramebuffer(w.__webglFramebuffer[pe][Me]);else o.deleteFramebuffer(w.__webglFramebuffer[pe]);w.__webglDepthbuffer&&o.deleteRenderbuffer(w.__webglDepthbuffer[pe])}else{if(Array.isArray(w.__webglFramebuffer))for(let pe=0;pe<w.__webglFramebuffer.length;pe++)o.deleteFramebuffer(w.__webglFramebuffer[pe]);else o.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&o.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&o.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let pe=0;pe<w.__webglColorRenderbuffer.length;pe++)w.__webglColorRenderbuffer[pe]&&o.deleteRenderbuffer(w.__webglColorRenderbuffer[pe]);w.__webglDepthRenderbuffer&&o.deleteRenderbuffer(w.__webglDepthRenderbuffer)}let K=O.textures;for(let pe=0,Me=K.length;pe<Me;pe++){let Ae=n.get(K[pe]);Ae.__webglTexture&&(o.deleteTexture(Ae.__webglTexture),a.memory.textures--),n.remove(K[pe])}n.remove(O)}let ee=0;function de(){ee=0}function fe(){return ee}function $(O){ee=O}function ae(){let O=ee;return O>=i.maxTextures&&Ke("WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+i.maxTextures),ee+=1,O}function J(O){let w=[];return w.push(O.wrapS),w.push(O.wrapT),w.push(O.wrapR||0),w.push(O.magFilter),w.push(O.minFilter),w.push(O.anisotropy),w.push(O.internalFormat),w.push(O.format),w.push(O.type),w.push(O.generateMipmaps),w.push(O.premultiplyAlpha),w.push(O.flipY),w.push(O.unpackAlignment),w.push(O.colorSpace),w.join()}function Ce(O,w){let K=n.get(O);if(O.isVideoTexture&&zt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&K.__version!==O.version){let pe=O.image;if(pe===null)Ke("WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)Ke("WebGLRenderer: Texture marked for update but image is incomplete");else{nt(K,O,w);return}}else O.isExternalTexture&&(K.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(o.TEXTURE_2D,K.__webglTexture,o.TEXTURE0+w)}function Se(O,w){let K=n.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&K.__version!==O.version){nt(K,O,w);return}else O.isExternalTexture&&(K.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(o.TEXTURE_2D_ARRAY,K.__webglTexture,o.TEXTURE0+w)}function Ve(O,w){let K=n.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&K.__version!==O.version){nt(K,O,w);return}e.bindTexture(o.TEXTURE_3D,K.__webglTexture,o.TEXTURE0+w)}function Ye(O,w){let K=n.get(O);if(O.isCubeDepthTexture!==!0&&O.version>0&&K.__version!==O.version){ot(K,O,w);return}e.bindTexture(o.TEXTURE_CUBE_MAP,K.__webglTexture,o.TEXTURE0+w)}let Ze={[ki]:o.REPEAT,[gi]:o.CLAMP_TO_EDGE,[fa]:o.MIRRORED_REPEAT},It={[fn]:o.NEAREST,[gd]:o.NEAREST_MIPMAP_NEAREST,[Er]:o.NEAREST_MIPMAP_LINEAR,[sn]:o.LINEAR,[Oa]:o.LINEAR_MIPMAP_NEAREST,[Ni]:o.LINEAR_MIPMAP_LINEAR},ut={[R_]:o.NEVER,[B_]:o.ALWAYS,[N_]:o.LESS,[Jd]:o.LEQUAL,[L_]:o.EQUAL,[Qd]:o.GEQUAL,[F_]:o.GREATER,[V_]:o.NOTEQUAL};function it(O,w){if(w.type===ui&&t.has("OES_texture_float_linear")===!1&&(w.magFilter===sn||w.magFilter===Oa||w.magFilter===Er||w.magFilter===Ni||w.minFilter===sn||w.minFilter===Oa||w.minFilter===Er||w.minFilter===Ni)&&Ke("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o.texParameteri(O,o.TEXTURE_WRAP_S,Ze[w.wrapS]),o.texParameteri(O,o.TEXTURE_WRAP_T,Ze[w.wrapT]),(O===o.TEXTURE_3D||O===o.TEXTURE_2D_ARRAY)&&o.texParameteri(O,o.TEXTURE_WRAP_R,Ze[w.wrapR]),o.texParameteri(O,o.TEXTURE_MAG_FILTER,It[w.magFilter]),o.texParameteri(O,o.TEXTURE_MIN_FILTER,It[w.minFilter]),w.compareFunction&&(o.texParameteri(O,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(O,o.TEXTURE_COMPARE_FUNC,ut[w.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===fn||w.minFilter!==Er&&w.minFilter!==Ni||w.type===ui&&t.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||n.get(w).__currentAnisotropy){let K=t.get("EXT_texture_filter_anisotropic");o.texParameterf(O,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy}}}function _e(O,w){let K=!1;O.__webglInit===void 0&&(O.__webglInit=!0,w.addEventListener("dispose",G));let pe=w.source,Me=x.get(pe);Me===void 0&&(Me={},x.set(pe,Me));let Ae=J(w);if(Ae!==O.__cacheKey){Me[Ae]===void 0&&(Me[Ae]={texture:o.createTexture(),usedTimes:0},a.memory.textures++,K=!0),Me[Ae].usedTimes++;let Le=Me[O.__cacheKey];Le!==void 0&&(Me[O.__cacheKey].usedTimes--,Le.usedTimes===0&&Y(w)),O.__cacheKey=Ae,O.__webglTexture=Me[Ae].texture}return K}function Be(O,w,K){return Math.floor(Math.floor(O/K)/w)}function Pe(O,w,K,pe){let Ae=O.updateRanges;if(Ae.length===0)e.texSubImage2D(o.TEXTURE_2D,0,0,0,w.width,w.height,K,pe,w.data);else{Ae.sort((qe,Re)=>qe.start-Re.start);let Le=0;for(let qe=1;qe<Ae.length;qe++){let Re=Ae[Le],Ie=Ae[qe],pt=Re.start+Re.count,bt=Be(Ie.start,w.width,4),Nt=Be(Re.start,w.width,4);Ie.start<=pt+1&&bt===Nt&&Be(Ie.start+Ie.count-1,w.width,4)===bt?Re.count=Math.max(Re.count,Ie.start+Ie.count-Re.start):(++Le,Ae[Le]=Ie)}Ae.length=Le+1;let ce=e.getParameter(o.UNPACK_ROW_LENGTH),ge=e.getParameter(o.UNPACK_SKIP_PIXELS),Ge=e.getParameter(o.UNPACK_SKIP_ROWS);e.pixelStorei(o.UNPACK_ROW_LENGTH,w.width);for(let qe=0,Re=Ae.length;qe<Re;qe++){let Ie=Ae[qe],pt=Math.floor(Ie.start/4),bt=Math.ceil(Ie.count/4),Nt=pt%w.width,X=Math.floor(pt/w.width),Oe=bt,ue=1;e.pixelStorei(o.UNPACK_SKIP_PIXELS,Nt),e.pixelStorei(o.UNPACK_SKIP_ROWS,X),e.texSubImage2D(o.TEXTURE_2D,0,Nt,X,Oe,ue,K,pe,w.data)}O.clearUpdateRanges(),e.pixelStorei(o.UNPACK_ROW_LENGTH,ce),e.pixelStorei(o.UNPACK_SKIP_PIXELS,ge),e.pixelStorei(o.UNPACK_SKIP_ROWS,Ge)}}function nt(O,w,K){let pe=o.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(pe=o.TEXTURE_2D_ARRAY),w.isData3DTexture&&(pe=o.TEXTURE_3D);let Me=_e(O,w),Ae=w.source;e.bindTexture(pe,O.__webglTexture,o.TEXTURE0+K);let Le=n.get(Ae);if(Ae.version!==Le.__version||Me===!0){if(e.activeTexture(o.TEXTURE0+K),(typeof ImageBitmap<"u"&&w.image instanceof ImageBitmap)===!1){let ue=St.getPrimaries(St.workingColorSpace),We=w.colorSpace===Io?null:St.getPrimaries(w.colorSpace),Ne=w.colorSpace===Io||ue===We?o.NONE:o.BROWSER_DEFAULT_WEBGL;e.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ne)}e.pixelStorei(o.UNPACK_ALIGNMENT,w.unpackAlignment);let ge=y(w.image,!1,i.maxTextureSize);ge=Fe(w,ge);let Ge=r.convert(w.format,w.colorSpace),qe=r.convert(w.type),Re=k(w.internalFormat,Ge,qe,w.normalized,w.colorSpace,w.isVideoTexture);it(pe,w);let Ie,pt=w.mipmaps,bt=w.isVideoTexture!==!0,Nt=Le.__version===void 0||Me===!0,X=Ae.dataReady,Oe=V(w,ge);if(w.isDepthTexture)Re=H(w.format===Ko,w.type),Nt&&(bt?e.texStorage2D(o.TEXTURE_2D,1,Re,ge.width,ge.height):e.texImage2D(o.TEXTURE_2D,0,Re,ge.width,ge.height,0,Ge,qe,null));else if(w.isDataTexture)if(pt.length>0){bt&&Nt&&e.texStorage2D(o.TEXTURE_2D,Oe,Re,pt[0].width,pt[0].height);for(let ue=0,We=pt.length;ue<We;ue++)Ie=pt[ue],bt?X&&e.texSubImage2D(o.TEXTURE_2D,ue,0,0,Ie.width,Ie.height,Ge,qe,Ie.data):e.texImage2D(o.TEXTURE_2D,ue,Re,Ie.width,Ie.height,0,Ge,qe,Ie.data);w.generateMipmaps=!1}else bt?(Nt&&e.texStorage2D(o.TEXTURE_2D,Oe,Re,ge.width,ge.height),X&&Pe(w,ge,Ge,qe)):e.texImage2D(o.TEXTURE_2D,0,Re,ge.width,ge.height,0,Ge,qe,ge.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){bt&&Nt&&e.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Re,pt[0].width,pt[0].height,ge.depth);for(let ue=0,We=pt.length;ue<We;ue++)if(Ie=pt[ue],w.format!==Bn)if(Ge!==null)if(bt){if(X)if(w.layerUpdates.size>0){let Ne=wp(Ie.width,Ie.height,w.format,w.type);for(let be of w.layerUpdates){let Je=Ie.data.subarray(be*Ne/Ie.data.BYTES_PER_ELEMENT,(be+1)*Ne/Ie.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ue,0,0,be,Ie.width,Ie.height,1,Ge,Je)}w.clearLayerUpdates()}else e.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ue,0,0,0,Ie.width,Ie.height,ge.depth,Ge,Ie.data)}else e.compressedTexImage3D(o.TEXTURE_2D_ARRAY,ue,Re,Ie.width,Ie.height,ge.depth,0,Ie.data,0,0);else Ke("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else bt?X&&e.texSubImage3D(o.TEXTURE_2D_ARRAY,ue,0,0,0,Ie.width,Ie.height,ge.depth,Ge,qe,Ie.data):e.texImage3D(o.TEXTURE_2D_ARRAY,ue,Re,Ie.width,Ie.height,ge.depth,0,Ge,qe,Ie.data)}else{bt&&Nt&&e.texStorage2D(o.TEXTURE_2D,Oe,Re,pt[0].width,pt[0].height);for(let ue=0,We=pt.length;ue<We;ue++)Ie=pt[ue],w.format!==Bn?Ge!==null?bt?X&&e.compressedTexSubImage2D(o.TEXTURE_2D,ue,0,0,Ie.width,Ie.height,Ge,Ie.data):e.compressedTexImage2D(o.TEXTURE_2D,ue,Re,Ie.width,Ie.height,0,Ie.data):Ke("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):bt?X&&e.texSubImage2D(o.TEXTURE_2D,ue,0,0,Ie.width,Ie.height,Ge,qe,Ie.data):e.texImage2D(o.TEXTURE_2D,ue,Re,Ie.width,Ie.height,0,Ge,qe,Ie.data)}else if(w.isDataArrayTexture)if(bt){if(Nt&&e.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Re,ge.width,ge.height,ge.depth),X)if(w.layerUpdates.size>0){let ue=wp(ge.width,ge.height,w.format,w.type);for(let We of w.layerUpdates){let Ne=ge.data.subarray(We*ue/ge.data.BYTES_PER_ELEMENT,(We+1)*ue/ge.data.BYTES_PER_ELEMENT);e.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,We,ge.width,ge.height,1,Ge,qe,Ne)}w.clearLayerUpdates()}else e.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,0,ge.width,ge.height,ge.depth,Ge,qe,ge.data)}else e.texImage3D(o.TEXTURE_2D_ARRAY,0,Re,ge.width,ge.height,ge.depth,0,Ge,qe,ge.data);else if(w.isData3DTexture)bt?(Nt&&e.texStorage3D(o.TEXTURE_3D,Oe,Re,ge.width,ge.height,ge.depth),X&&e.texSubImage3D(o.TEXTURE_3D,0,0,0,0,ge.width,ge.height,ge.depth,Ge,qe,ge.data)):e.texImage3D(o.TEXTURE_3D,0,Re,ge.width,ge.height,ge.depth,0,Ge,qe,ge.data);else if(w.isFramebufferTexture){if(Nt)if(bt)e.texStorage2D(o.TEXTURE_2D,Oe,Re,ge.width,ge.height);else{let ue=ge.width,We=ge.height;for(let Ne=0;Ne<Oe;Ne++)e.texImage2D(o.TEXTURE_2D,Ne,Re,ue,We,0,Ge,qe,null),ue>>=1,We>>=1}}else if(w.isHTMLTexture){if("texElementImage2D"in o){let ue=o.canvas;if(ue.hasAttribute("layoutsubtree")||ue.setAttribute("layoutsubtree","true"),ge.parentNode!==ue){ue.appendChild(ge),p.add(w),ue.onpaint=_t=>{let un=_t.changedElements;for(let Xt of p)un.includes(Xt.image)&&(Xt.needsUpdate=!0)},ue.requestPaint();return}let We=0,Ne=o.RGBA,be=o.RGBA,Je=o.UNSIGNED_BYTE;o.texElementImage2D(o.TEXTURE_2D,We,Ne,be,Je,ge),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE)}}else if(pt.length>0){if(bt&&Nt){let ue=tn(pt[0]);e.texStorage2D(o.TEXTURE_2D,Oe,Re,ue.width,ue.height)}for(let ue=0,We=pt.length;ue<We;ue++)Ie=pt[ue],bt?X&&e.texSubImage2D(o.TEXTURE_2D,ue,0,0,Ge,qe,Ie):e.texImage2D(o.TEXTURE_2D,ue,Re,Ge,qe,Ie);w.generateMipmaps=!1}else if(bt){if(Nt){let ue=tn(ge);e.texStorage2D(o.TEXTURE_2D,Oe,Re,ue.width,ue.height)}X&&e.texSubImage2D(o.TEXTURE_2D,0,0,0,Ge,qe,ge)}else e.texImage2D(o.TEXTURE_2D,0,Re,Ge,qe,ge);C(w)&&I(pe),Le.__version=Ae.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function ot(O,w,K){if(w.image.length!==6)return;let pe=_e(O,w),Me=w.source;e.bindTexture(o.TEXTURE_CUBE_MAP,O.__webglTexture,o.TEXTURE0+K);let Ae=n.get(Me);if(Me.version!==Ae.__version||pe===!0){e.activeTexture(o.TEXTURE0+K);let Le=St.getPrimaries(St.workingColorSpace),ce=w.colorSpace===Io?null:St.getPrimaries(w.colorSpace),ge=w.colorSpace===Io||Le===ce?o.NONE:o.BROWSER_DEFAULT_WEBGL;e.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(o.UNPACK_ALIGNMENT,w.unpackAlignment),e.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,ge);let Ge=w.isCompressedTexture||w.image[0].isCompressedTexture,qe=w.image[0]&&w.image[0].isDataTexture,Re=[];for(let be=0;be<6;be++)!Ge&&!qe?Re[be]=y(w.image[be],!0,i.maxCubemapSize):Re[be]=qe?w.image[be].image:w.image[be],Re[be]=Fe(w,Re[be]);let Ie=Re[0],pt=r.convert(w.format,w.colorSpace),bt=r.convert(w.type),Nt=k(w.internalFormat,pt,bt,w.normalized,w.colorSpace),X=w.isVideoTexture!==!0,Oe=Ae.__version===void 0||pe===!0,ue=Me.dataReady,We=V(w,Ie);it(o.TEXTURE_CUBE_MAP,w);let Ne;if(Ge){X&&Oe&&e.texStorage2D(o.TEXTURE_CUBE_MAP,We,Nt,Ie.width,Ie.height);for(let be=0;be<6;be++){Ne=Re[be].mipmaps;for(let Je=0;Je<Ne.length;Je++){let _t=Ne[Je];w.format!==Bn?pt!==null?X?ue&&e.compressedTexSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je,0,0,_t.width,_t.height,pt,_t.data):e.compressedTexImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je,Nt,_t.width,_t.height,0,_t.data):Ke("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):X?ue&&e.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je,0,0,_t.width,_t.height,pt,bt,_t.data):e.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je,Nt,_t.width,_t.height,0,pt,bt,_t.data)}}}else{if(Ne=w.mipmaps,X&&Oe){Ne.length>0&&We++;let be=tn(Re[0]);e.texStorage2D(o.TEXTURE_CUBE_MAP,We,Nt,be.width,be.height)}for(let be=0;be<6;be++)if(qe){X?ue&&e.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,0,0,Re[be].width,Re[be].height,pt,bt,Re[be].data):e.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,Nt,Re[be].width,Re[be].height,0,pt,bt,Re[be].data);for(let Je=0;Je<Ne.length;Je++){let un=Ne[Je].image[be].image;X?ue&&e.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je+1,0,0,un.width,un.height,pt,bt,un.data):e.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je+1,Nt,un.width,un.height,0,pt,bt,un.data)}}else{X?ue&&e.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,0,0,pt,bt,Re[be]):e.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,0,Nt,pt,bt,Re[be]);for(let Je=0;Je<Ne.length;Je++){let _t=Ne[Je];X?ue&&e.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je+1,0,0,pt,bt,_t.image[be]):e.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+be,Je+1,Nt,pt,bt,_t.image[be])}}}C(w)&&I(o.TEXTURE_CUBE_MAP),Ae.__version=Me.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function at(O,w,K,pe,Me,Ae){let Le=r.convert(K.format,K.colorSpace),ce=r.convert(K.type),ge=k(K.internalFormat,Le,ce,K.normalized,K.colorSpace),Ge=n.get(w),qe=n.get(K);if(qe.__renderTarget=w,!Ge.__hasExternalTextures){let Re=Math.max(1,w.width>>Ae),Ie=Math.max(1,w.height>>Ae);Me===o.TEXTURE_3D||Me===o.TEXTURE_2D_ARRAY?e.texImage3D(Me,Ae,ge,Re,Ie,w.depth,0,Le,ce,null):e.texImage2D(Me,Ae,ge,Re,Ie,0,Le,ce,null)}e.bindFramebuffer(o.FRAMEBUFFER,O),gt(w)?s.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,pe,Me,qe.__webglTexture,0,on(w)):(Me===o.TEXTURE_2D||Me>=o.TEXTURE_CUBE_MAP_POSITIVE_X&&Me<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&o.framebufferTexture2D(o.FRAMEBUFFER,pe,Me,qe.__webglTexture,Ae),e.bindFramebuffer(o.FRAMEBUFFER,null)}function xt(O,w,K){if(o.bindRenderbuffer(o.RENDERBUFFER,O),w.depthBuffer){let pe=w.depthTexture,Me=pe&&pe.isDepthTexture?pe.type:null,Ae=H(w.stencilBuffer,Me),Le=w.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;gt(w)?s.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,on(w),Ae,w.width,w.height):K?o.renderbufferStorageMultisample(o.RENDERBUFFER,on(w),Ae,w.width,w.height):o.renderbufferStorage(o.RENDERBUFFER,Ae,w.width,w.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,Le,o.RENDERBUFFER,O)}else{let pe=w.textures;for(let Me=0;Me<pe.length;Me++){let Ae=pe[Me],Le=r.convert(Ae.format,Ae.colorSpace),ce=r.convert(Ae.type),ge=k(Ae.internalFormat,Le,ce,Ae.normalized,Ae.colorSpace);gt(w)?s.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,on(w),ge,w.width,w.height):K?o.renderbufferStorageMultisample(o.RENDERBUFFER,on(w),ge,w.width,w.height):o.renderbufferStorage(o.RENDERBUFFER,ge,w.width,w.height)}}o.bindRenderbuffer(o.RENDERBUFFER,null)}function rt(O,w,K){let pe=w.isWebGLCubeRenderTarget===!0;if(e.bindFramebuffer(o.FRAMEBUFFER,O),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let Me=n.get(w.depthTexture);if(Me.__renderTarget=w,(!Me.__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),pe){if(Me.__webglInit===void 0&&(Me.__webglInit=!0,w.depthTexture.addEventListener("dispose",G)),Me.__webglTexture===void 0){Me.__webglTexture=o.createTexture(),e.bindTexture(o.TEXTURE_CUBE_MAP,Me.__webglTexture),it(o.TEXTURE_CUBE_MAP,w.depthTexture);let Ge=r.convert(w.depthTexture.format),qe=r.convert(w.depthTexture.type),Re;w.depthTexture.format===Zi?Re=o.DEPTH_COMPONENT24:w.depthTexture.format===Ko&&(Re=o.DEPTH24_STENCIL8);for(let Ie=0;Ie<6;Ie++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0,Re,w.width,w.height,0,Ge,qe,null)}}else Ce(w.depthTexture,0);let Ae=Me.__webglTexture,Le=on(w),ce=pe?o.TEXTURE_CUBE_MAP_POSITIVE_X+K:o.TEXTURE_2D,ge=w.depthTexture.format===Ko?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;if(w.depthTexture.format===Zi)gt(w)?s.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,ge,ce,Ae,0,Le):o.framebufferTexture2D(o.FRAMEBUFFER,ge,ce,Ae,0);else if(w.depthTexture.format===Ko)gt(w)?s.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,ge,ce,Ae,0,Le):o.framebufferTexture2D(o.FRAMEBUFFER,ge,ce,Ae,0);else throw new Error("Unknown depthTexture format")}function ft(O){let w=n.get(O),K=O.isWebGLCubeRenderTarget===!0;if(w.__boundDepthTexture!==O.depthTexture){let pe=O.depthTexture;if(w.__depthDisposeCallback&&w.__depthDisposeCallback(),pe){let Me=()=>{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,pe.removeEventListener("dispose",Me)};pe.addEventListener("dispose",Me),w.__depthDisposeCallback=Me}w.__boundDepthTexture=pe}if(O.depthTexture&&!w.__autoAllocateDepthBuffer)if(K)for(let pe=0;pe<6;pe++)rt(w.__webglFramebuffer[pe],O,pe);else{let pe=O.texture.mipmaps;pe&&pe.length>0?rt(w.__webglFramebuffer[0],O,0):rt(w.__webglFramebuffer,O,0)}else if(K){w.__webglDepthbuffer=[];for(let pe=0;pe<6;pe++)if(e.bindFramebuffer(o.FRAMEBUFFER,w.__webglFramebuffer[pe]),w.__webglDepthbuffer[pe]===void 0)w.__webglDepthbuffer[pe]=o.createRenderbuffer(),xt(w.__webglDepthbuffer[pe],O,!1);else{let Me=O.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Ae=w.__webglDepthbuffer[pe];o.bindRenderbuffer(o.RENDERBUFFER,Ae),o.framebufferRenderbuffer(o.FRAMEBUFFER,Me,o.RENDERBUFFER,Ae)}}else{let pe=O.texture.mipmaps;if(pe&&pe.length>0?e.bindFramebuffer(o.FRAMEBUFFER,w.__webglFramebuffer[0]):e.bindFramebuffer(o.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=o.createRenderbuffer(),xt(w.__webglDepthbuffer,O,!1);else{let Me=O.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Ae=w.__webglDepthbuffer;o.bindRenderbuffer(o.RENDERBUFFER,Ae),o.framebufferRenderbuffer(o.FRAMEBUFFER,Me,o.RENDERBUFFER,Ae)}}e.bindFramebuffer(o.FRAMEBUFFER,null)}function Ot(O,w,K){let pe=n.get(O);w!==void 0&&at(pe.__webglFramebuffer,O,O.texture,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,0),K!==void 0&&ft(O)}function lt(O){let w=O.texture,K=n.get(O),pe=n.get(w);O.addEventListener("dispose",E);let Me=O.textures,Ae=O.isWebGLCubeRenderTarget===!0,Le=Me.length>1;if(Le||(pe.__webglTexture===void 0&&(pe.__webglTexture=o.createTexture()),pe.__version=w.version,a.memory.textures++),Ae){K.__webglFramebuffer=[];for(let ce=0;ce<6;ce++)if(w.mipmaps&&w.mipmaps.length>0){K.__webglFramebuffer[ce]=[];for(let ge=0;ge<w.mipmaps.length;ge++)K.__webglFramebuffer[ce][ge]=o.createFramebuffer()}else K.__webglFramebuffer[ce]=o.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){K.__webglFramebuffer=[];for(let ce=0;ce<w.mipmaps.length;ce++)K.__webglFramebuffer[ce]=o.createFramebuffer()}else K.__webglFramebuffer=o.createFramebuffer();if(Le)for(let ce=0,ge=Me.length;ce<ge;ce++){let Ge=n.get(Me[ce]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=o.createTexture(),a.memory.textures++)}if(O.samples>0&>(O)===!1){K.__webglMultisampledFramebuffer=o.createFramebuffer(),K.__webglColorRenderbuffer=[],e.bindFramebuffer(o.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let ce=0;ce<Me.length;ce++){let ge=Me[ce];K.__webglColorRenderbuffer[ce]=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,K.__webglColorRenderbuffer[ce]);let Ge=r.convert(ge.format,ge.colorSpace),qe=r.convert(ge.type),Re=k(ge.internalFormat,Ge,qe,ge.normalized,ge.colorSpace,O.isXRRenderTarget===!0),Ie=on(O);o.renderbufferStorageMultisample(o.RENDERBUFFER,Ie,Re,O.width,O.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+ce,o.RENDERBUFFER,K.__webglColorRenderbuffer[ce])}o.bindRenderbuffer(o.RENDERBUFFER,null),O.depthBuffer&&(K.__webglDepthRenderbuffer=o.createRenderbuffer(),xt(K.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(o.FRAMEBUFFER,null)}}if(Ae){e.bindTexture(o.TEXTURE_CUBE_MAP,pe.__webglTexture),it(o.TEXTURE_CUBE_MAP,w);for(let ce=0;ce<6;ce++)if(w.mipmaps&&w.mipmaps.length>0)for(let ge=0;ge<w.mipmaps.length;ge++)at(K.__webglFramebuffer[ce][ge],O,w,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+ce,ge);else at(K.__webglFramebuffer[ce],O,w,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0);C(w)&&I(o.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Le){for(let ce=0,ge=Me.length;ce<ge;ce++){let Ge=Me[ce],qe=n.get(Ge),Re=o.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Re=O.isWebGL3DRenderTarget?o.TEXTURE_3D:o.TEXTURE_2D_ARRAY),e.bindTexture(Re,qe.__webglTexture),it(Re,Ge),at(K.__webglFramebuffer,O,Ge,o.COLOR_ATTACHMENT0+ce,Re,0),C(Ge)&&I(Re)}e.unbindTexture()}else{let ce=o.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(ce=O.isWebGL3DRenderTarget?o.TEXTURE_3D:o.TEXTURE_2D_ARRAY),e.bindTexture(ce,pe.__webglTexture),it(ce,w),w.mipmaps&&w.mipmaps.length>0)for(let ge=0;ge<w.mipmaps.length;ge++)at(K.__webglFramebuffer[ge],O,w,o.COLOR_ATTACHMENT0,ce,ge);else at(K.__webglFramebuffer,O,w,o.COLOR_ATTACHMENT0,ce,0);C(w)&&I(ce),e.unbindTexture()}O.depthBuffer&&ft(O)}function kt(O){let w=O.textures;for(let K=0,pe=w.length;K<pe;K++){let Me=w[K];if(C(Me)){let Ae=L(O),Le=n.get(Me).__webglTexture;e.bindTexture(Ae,Le),I(Ae),e.unbindTexture()}}}let Tt=[],Vt=[];function W(O){if(O.samples>0){if(gt(O)===!1){let w=O.textures,K=O.width,pe=O.height,Me=o.COLOR_BUFFER_BIT,Ae=O.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Le=n.get(O),ce=w.length>1;if(ce)for(let Ge=0;Ge<w.length;Ge++)e.bindFramebuffer(o.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Ge,o.RENDERBUFFER,null),e.bindFramebuffer(o.FRAMEBUFFER,Le.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Ge,o.TEXTURE_2D,null,0);e.bindFramebuffer(o.READ_FRAMEBUFFER,Le.__webglMultisampledFramebuffer);let ge=O.texture.mipmaps;ge&&ge.length>0?e.bindFramebuffer(o.DRAW_FRAMEBUFFER,Le.__webglFramebuffer[0]):e.bindFramebuffer(o.DRAW_FRAMEBUFFER,Le.__webglFramebuffer);for(let Ge=0;Ge<w.length;Ge++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(Me|=o.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(Me|=o.STENCIL_BUFFER_BIT)),ce){o.framebufferRenderbuffer(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,Le.__webglColorRenderbuffer[Ge]);let qe=n.get(w[Ge]).__webglTexture;o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,qe,0)}o.blitFramebuffer(0,0,K,pe,0,0,K,pe,Me,o.NEAREST),l===!0&&(Tt.length=0,Vt.length=0,Tt.push(o.COLOR_ATTACHMENT0+Ge),O.depthBuffer&&O.resolveDepthBuffer===!1&&(Tt.push(Ae),Vt.push(Ae),o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,Vt)),o.invalidateFramebuffer(o.READ_FRAMEBUFFER,Tt))}if(e.bindFramebuffer(o.READ_FRAMEBUFFER,null),e.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),ce)for(let Ge=0;Ge<w.length;Ge++){e.bindFramebuffer(o.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Ge,o.RENDERBUFFER,Le.__webglColorRenderbuffer[Ge]);let qe=n.get(w[Ge]).__webglTexture;e.bindFramebuffer(o.FRAMEBUFFER,Le.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Ge,o.TEXTURE_2D,qe,0)}e.bindFramebuffer(o.DRAW_FRAMEBUFFER,Le.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&l){let w=O.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,[w])}}}function on(O){return Math.min(i.maxSamples,O.samples)}function gt(O){let w=n.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function zt(O){let w=a.render.frame;h.get(O)!==w&&(h.set(O,w),O.update())}function Fe(O,w){let K=O.colorSpace,pe=O.format,Me=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||K!==Xn&&K!==Io&&(St.getTransfer(K)===Ht?(pe!==Bn||Me!==Qn)&&Ke("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):st("WebGLTextures: Unsupported texture color space:",K)),w}function tn(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(c.width=O.naturalWidth||O.width,c.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(c.width=O.displayWidth,c.height=O.displayHeight):(c.width=O.width,c.height=O.height),c}this.allocateTextureUnit=ae,this.resetTextureUnits=de,this.getTextureUnits=fe,this.setTextureUnits=$,this.setTexture2D=Ce,this.setTexture2DArray=Se,this.setTexture3D=Ve,this.setTextureCube=Ye,this.rebindTextures=Ot,this.setupRenderTarget=lt,this.updateRenderTargetMipmap=kt,this.updateMultisampleRenderTarget=W,this.setupDepthRenderbuffer=ft,this.setupFrameBufferTexture=at,this.useMultisampledRTT=gt,this.isReversedDepthBuffer=function(){return e.buffers.depth.getReversed()}}function eA(o,t){function e(n,i=Io){let r,a=St.getTransfer(i);if(n===Qn)return o.UNSIGNED_BYTE;if(n===vd)return o.UNSIGNED_SHORT_4_4_4_4;if(n===xd)return o.UNSIGNED_SHORT_5_5_5_1;if(n===hp)return o.UNSIGNED_INT_5_9_9_9_REV;if(n===pp)return o.UNSIGNED_INT_10F_11F_11F_REV;if(n===dp)return o.BYTE;if(n===up)return o.SHORT;if(n===Da)return o.UNSIGNED_SHORT;if(n===_d)return o.INT;if(n===Li)return o.UNSIGNED_INT;if(n===ui)return o.FLOAT;if(n===oo)return o.HALF_FLOAT;if(n===fp)return o.ALPHA;if(n===gp)return o.RGB;if(n===Bn)return o.RGBA;if(n===Zi)return o.DEPTH_COMPONENT;if(n===Ko)return o.DEPTH_STENCIL;if(n===bd)return o.RED;if(n===yd)return o.RED_INTEGER;if(n===Zo)return o.RG;if(n===Cd)return o.RG_INTEGER;if(n===Md)return o.RGBA_INTEGER;if(n===Tr||n===nl||n===Pr||n===Ar)if(a===Ht)if(r=t.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===Tr)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===nl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Pr)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ar)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=t.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===Tr)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===nl)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Pr)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ar)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===wd||n===Sd||n===Ed||n===Td)if(r=t.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===wd)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Sd)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ed)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Td)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Ra||n===Pd||n===Ad||n===Id||n===Od||n===il||n===Dd)if(r=t.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Ra||n===Pd)return a===Ht?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Ad)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC;if(n===Id)return r.COMPRESSED_R11_EAC;if(n===Od)return r.COMPRESSED_SIGNED_R11_EAC;if(n===il)return r.COMPRESSED_RG11_EAC;if(n===Dd)return r.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===kd||n===Rd||n===Nd||n===Ld||n===Fd||n===Vd||n===Bd||n===Ud||n===zd||n===Hd||n===Gd||n===Wd||n===Xd||n===qd)if(r=t.get("WEBGL_compressed_texture_astc"),r!==null){if(n===kd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Rd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Nd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Ld)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Fd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Vd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Bd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ud)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===zd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Hd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Gd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Wd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Xd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===qd)return a===Ht?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$d||n===Na||n===La)if(r=t.get("EXT_texture_compression_bptc"),r!==null){if(n===$d)return a===Ht?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Na)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===La)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Yd||n===jd||n===ol||n===Kd)if(r=t.get("EXT_texture_compression_rgtc"),r!==null){if(n===Yd)return r.COMPRESSED_RED_RGTC1_EXT;if(n===jd)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ol)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Kd)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===ka?o.UNSIGNED_INT_24_8:o[n]!==void 0?o[n]:null}return{convert:e}}var tA=`
|
|
void main() {
|
|
|
|
gl_Position = vec4( position, 1.0 );
|
|
|
|
}`,nA=`
|
|
uniform sampler2DArray depthColor;
|
|
uniform float depthWidth;
|
|
uniform float depthHeight;
|
|
|
|
void main() {
|
|
|
|
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
|
|
|
|
if ( coord.x >= 1.0 ) {
|
|
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
|
|
|
|
} else {
|
|
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
|
|
|
|
}
|
|
|
|
}`,Vp=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){let n=new zs(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){let e=t.cameras[0].viewport,n=new di({vertexShader:tA,fragmentShader:nA,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new kn(new Hs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Bp=class extends Ji{constructor(t,e){super();let n=this,i=null,r=1,a=null,s="local-floor",l=1,c=null,h=null,p=null,m=null,x=null,M=null,S=typeof XRWebGLBinding<"u",y=new Vp,C={},I=e.getContextAttributes(),L=null,k=null,H=[],V=[],G=new At,E=null,B=new xn;B.viewport=new Yt;let Y=new xn;Y.viewport=new Yt;let U=[B,Y],ee=new pd,de=null,fe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(_e){let Be=H[_e];return Be===void 0&&(Be=new ya,H[_e]=Be),Be.getTargetRaySpace()},this.getControllerGrip=function(_e){let Be=H[_e];return Be===void 0&&(Be=new ya,H[_e]=Be),Be.getGripSpace()},this.getHand=function(_e){let Be=H[_e];return Be===void 0&&(Be=new ya,H[_e]=Be),Be.getHandSpace()};function $(_e){let Be=V.indexOf(_e.inputSource);if(Be===-1)return;let Pe=H[Be];Pe!==void 0&&(Pe.update(_e.inputSource,_e.frame,c||a),Pe.dispatchEvent({type:_e.type,data:_e.inputSource}))}function ae(){i.removeEventListener("select",$),i.removeEventListener("selectstart",$),i.removeEventListener("selectend",$),i.removeEventListener("squeeze",$),i.removeEventListener("squeezestart",$),i.removeEventListener("squeezeend",$),i.removeEventListener("end",ae),i.removeEventListener("inputsourceschange",J);for(let _e=0;_e<H.length;_e++){let Be=V[_e];Be!==null&&(V[_e]=null,H[_e].disconnect(Be))}de=null,fe=null,y.reset();for(let _e in C)delete C[_e];t.setRenderTarget(L),x=null,m=null,p=null,i=null,k=null,it.stop(),n.isPresenting=!1,t.setPixelRatio(E),t.setSize(G.width,G.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(_e){r=_e,n.isPresenting===!0&&Ke("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(_e){s=_e,n.isPresenting===!0&&Ke("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(_e){c=_e},this.getBaseLayer=function(){return m!==null?m:x},this.getBinding=function(){return p===null&&S&&(p=new XRWebGLBinding(i,e)),p},this.getFrame=function(){return M},this.getSession=function(){return i},this.setSession=async function(_e){if(i=_e,i!==null){if(L=t.getRenderTarget(),i.addEventListener("select",$),i.addEventListener("selectstart",$),i.addEventListener("selectend",$),i.addEventListener("squeeze",$),i.addEventListener("squeezestart",$),i.addEventListener("squeezeend",$),i.addEventListener("end",ae),i.addEventListener("inputsourceschange",J),I.xrCompatible!==!0&&await e.makeXRCompatible(),E=t.getPixelRatio(),t.getSize(G),S&&"createProjectionLayer"in XRWebGLBinding.prototype){let Pe=null,nt=null,ot=null;I.depth&&(ot=I.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Pe=I.stencil?Ko:Zi,nt=I.stencil?ka:Li);let at={colorFormat:e.RGBA8,depthFormat:ot,scaleFactor:r};p=this.getBinding(),m=p.createProjectionLayer(at),i.updateRenderState({layers:[m]}),t.setPixelRatio(1),t.setSize(m.textureWidth,m.textureHeight,!1),k=new si(m.textureWidth,m.textureHeight,{format:Bn,type:Qn,depthTexture:new wo(m.textureWidth,m.textureHeight,nt,void 0,void 0,void 0,void 0,void 0,void 0,Pe),stencilBuffer:I.stencil,colorSpace:t.outputColorSpace,samples:I.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{let Pe={antialias:I.antialias,alpha:!0,depth:I.depth,stencil:I.stencil,framebufferScaleFactor:r};x=new XRWebGLLayer(i,e,Pe),i.updateRenderState({baseLayer:x}),t.setPixelRatio(1),t.setSize(x.framebufferWidth,x.framebufferHeight,!1),k=new si(x.framebufferWidth,x.framebufferHeight,{format:Bn,type:Qn,colorSpace:t.outputColorSpace,stencilBuffer:I.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}k.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(s),it.setContext(i),it.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return y.getDepthTexture()};function J(_e){for(let Be=0;Be<_e.removed.length;Be++){let Pe=_e.removed[Be],nt=V.indexOf(Pe);nt>=0&&(V[nt]=null,H[nt].disconnect(Pe))}for(let Be=0;Be<_e.added.length;Be++){let Pe=_e.added[Be],nt=V.indexOf(Pe);if(nt===-1){for(let at=0;at<H.length;at++)if(at>=V.length){V.push(Pe),nt=at;break}else if(V[at]===null){V[at]=Pe,nt=at;break}if(nt===-1)break}let ot=H[nt];ot&&ot.connect(Pe)}}let Ce=new j,Se=new j;function Ve(_e,Be,Pe){Ce.setFromMatrixPosition(Be.matrixWorld),Se.setFromMatrixPosition(Pe.matrixWorld);let nt=Ce.distanceTo(Se),ot=Be.projectionMatrix.elements,at=Pe.projectionMatrix.elements,xt=ot[14]/(ot[10]-1),rt=ot[14]/(ot[10]+1),ft=(ot[9]+1)/ot[5],Ot=(ot[9]-1)/ot[5],lt=(ot[8]-1)/ot[0],kt=(at[8]+1)/at[0],Tt=xt*lt,Vt=xt*kt,W=nt/(-lt+kt),on=W*-lt;if(Be.matrixWorld.decompose(_e.position,_e.quaternion,_e.scale),_e.translateX(on),_e.translateZ(W),_e.matrixWorld.compose(_e.position,_e.quaternion,_e.scale),_e.matrixWorldInverse.copy(_e.matrixWorld).invert(),ot[10]===-1)_e.projectionMatrix.copy(Be.projectionMatrix),_e.projectionMatrixInverse.copy(Be.projectionMatrixInverse);else{let gt=xt+W,zt=rt+W,Fe=Tt-on,tn=Vt+(nt-on),O=ft*rt/zt*gt,w=Ot*rt/zt*gt;_e.projectionMatrix.makePerspective(Fe,tn,O,w,gt,zt),_e.projectionMatrixInverse.copy(_e.projectionMatrix).invert()}}function Ye(_e,Be){Be===null?_e.matrixWorld.copy(_e.matrix):_e.matrixWorld.multiplyMatrices(Be.matrixWorld,_e.matrix),_e.matrixWorldInverse.copy(_e.matrixWorld).invert()}this.updateCamera=function(_e){if(i===null)return;let Be=_e.near,Pe=_e.far;y.texture!==null&&(y.depthNear>0&&(Be=y.depthNear),y.depthFar>0&&(Pe=y.depthFar)),ee.near=Y.near=B.near=Be,ee.far=Y.far=B.far=Pe,(de!==ee.near||fe!==ee.far)&&(i.updateRenderState({depthNear:ee.near,depthFar:ee.far}),de=ee.near,fe=ee.far),ee.layers.mask=_e.layers.mask|6,B.layers.mask=ee.layers.mask&-5,Y.layers.mask=ee.layers.mask&-3;let nt=_e.parent,ot=ee.cameras;Ye(ee,nt);for(let at=0;at<ot.length;at++)Ye(ot[at],nt);ot.length===2?Ve(ee,B,Y):ee.projectionMatrix.copy(B.projectionMatrix),Ze(_e,ee,nt)};function Ze(_e,Be,Pe){Pe===null?_e.matrix.copy(Be.matrixWorld):(_e.matrix.copy(Pe.matrixWorld),_e.matrix.invert(),_e.matrix.multiply(Be.matrixWorld)),_e.matrix.decompose(_e.position,_e.quaternion,_e.scale),_e.updateMatrixWorld(!0),_e.projectionMatrix.copy(Be.projectionMatrix),_e.projectionMatrixInverse.copy(Be.projectionMatrixInverse),_e.isPerspectiveCamera&&(_e.fov=br*2*Math.atan(1/_e.projectionMatrix.elements[5]),_e.zoom=1)}this.getCamera=function(){return ee},this.getFoveation=function(){if(!(m===null&&x===null))return l},this.setFoveation=function(_e){l=_e,m!==null&&(m.fixedFoveation=_e),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=_e)},this.hasDepthSensing=function(){return y.texture!==null},this.getDepthSensingMesh=function(){return y.getMesh(ee)},this.getCameraTexture=function(_e){return C[_e]};let It=null;function ut(_e,Be){if(h=Be.getViewerPose(c||a),M=Be,h!==null){let Pe=h.views;x!==null&&(t.setRenderTargetFramebuffer(k,x.framebuffer),t.setRenderTarget(k));let nt=!1;Pe.length!==ee.cameras.length&&(ee.cameras.length=0,nt=!0);for(let rt=0;rt<Pe.length;rt++){let ft=Pe[rt],Ot=null;if(x!==null)Ot=x.getViewport(ft);else{let kt=p.getViewSubImage(m,ft);Ot=kt.viewport,rt===0&&(t.setRenderTargetTextures(k,kt.colorTexture,kt.depthStencilTexture),t.setRenderTarget(k))}let lt=U[rt];lt===void 0&&(lt=new xn,lt.layers.enable(rt),lt.viewport=new Yt,U[rt]=lt),lt.matrix.fromArray(ft.transform.matrix),lt.matrix.decompose(lt.position,lt.quaternion,lt.scale),lt.projectionMatrix.fromArray(ft.projectionMatrix),lt.projectionMatrixInverse.copy(lt.projectionMatrix).invert(),lt.viewport.set(Ot.x,Ot.y,Ot.width,Ot.height),rt===0&&(ee.matrix.copy(lt.matrix),ee.matrix.decompose(ee.position,ee.quaternion,ee.scale)),nt===!0&&ee.cameras.push(lt)}let ot=i.enabledFeatures;if(ot&&ot.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&S){p=n.getBinding();let rt=p.getDepthInformation(Pe[0]);rt&&rt.isValid&&rt.texture&&y.init(rt,i.renderState)}if(ot&&ot.includes("camera-access")&&S){t.state.unbindTexture(),p=n.getBinding();for(let rt=0;rt<Pe.length;rt++){let ft=Pe[rt].camera;if(ft){let Ot=C[ft];Ot||(Ot=new zs,C[ft]=Ot);let lt=p.getCameraImage(ft);Ot.sourceTexture=lt}}}}for(let Pe=0;Pe<H.length;Pe++){let nt=V[Pe],ot=H[Pe];nt!==null&&ot!==void 0&&ot.update(nt,Be,c||a)}It&&It(_e,Be),Be.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Be}),M=null}let it=new gv;it.setAnimationLoop(ut),this.setAnimationLoop=function(_e){It=_e},this.dispose=function(){}}},iA=new Ct,Cv=new mt;Cv.set(-1,0,0,0,1,0,0,0,1);function oA(o,t){function e(y,C){y.matrixAutoUpdate===!0&&y.updateMatrix(),C.value.copy(y.matrix)}function n(y,C){C.color.getRGB(y.fogColor.value,yp(o)),C.isFog?(y.fogNear.value=C.near,y.fogFar.value=C.far):C.isFogExp2&&(y.fogDensity.value=C.density)}function i(y,C,I,L,k){C.isNodeMaterial?C.uniformsNeedUpdate=!1:C.isMeshBasicMaterial?r(y,C):C.isMeshLambertMaterial?(r(y,C),C.envMap&&(y.envMapIntensity.value=C.envMapIntensity)):C.isMeshToonMaterial?(r(y,C),p(y,C)):C.isMeshPhongMaterial?(r(y,C),h(y,C),C.envMap&&(y.envMapIntensity.value=C.envMapIntensity)):C.isMeshStandardMaterial?(r(y,C),m(y,C),C.isMeshPhysicalMaterial&&x(y,C,k)):C.isMeshMatcapMaterial?(r(y,C),M(y,C)):C.isMeshDepthMaterial?r(y,C):C.isMeshDistanceMaterial?(r(y,C),S(y,C)):C.isMeshNormalMaterial?r(y,C):C.isLineBasicMaterial?(a(y,C),C.isLineDashedMaterial&&s(y,C)):C.isPointsMaterial?l(y,C,I,L):C.isSpriteMaterial?c(y,C):C.isShadowMaterial?(y.color.value.copy(C.color),y.opacity.value=C.opacity):C.isShaderMaterial&&(C.uniformsNeedUpdate=!1)}function r(y,C){y.opacity.value=C.opacity,C.color&&y.diffuse.value.copy(C.color),C.emissive&&y.emissive.value.copy(C.emissive).multiplyScalar(C.emissiveIntensity),C.map&&(y.map.value=C.map,e(C.map,y.mapTransform)),C.alphaMap&&(y.alphaMap.value=C.alphaMap,e(C.alphaMap,y.alphaMapTransform)),C.bumpMap&&(y.bumpMap.value=C.bumpMap,e(C.bumpMap,y.bumpMapTransform),y.bumpScale.value=C.bumpScale,C.side===$n&&(y.bumpScale.value*=-1)),C.normalMap&&(y.normalMap.value=C.normalMap,e(C.normalMap,y.normalMapTransform),y.normalScale.value.copy(C.normalScale),C.side===$n&&y.normalScale.value.negate()),C.displacementMap&&(y.displacementMap.value=C.displacementMap,e(C.displacementMap,y.displacementMapTransform),y.displacementScale.value=C.displacementScale,y.displacementBias.value=C.displacementBias),C.emissiveMap&&(y.emissiveMap.value=C.emissiveMap,e(C.emissiveMap,y.emissiveMapTransform)),C.specularMap&&(y.specularMap.value=C.specularMap,e(C.specularMap,y.specularMapTransform)),C.alphaTest>0&&(y.alphaTest.value=C.alphaTest);let I=t.get(C),L=I.envMap,k=I.envMapRotation;L&&(y.envMap.value=L,y.envMapRotation.value.setFromMatrix4(iA.makeRotationFromEuler(k)).transpose(),L.isCubeTexture&&L.isRenderTargetTexture===!1&&y.envMapRotation.value.premultiply(Cv),y.reflectivity.value=C.reflectivity,y.ior.value=C.ior,y.refractionRatio.value=C.refractionRatio),C.lightMap&&(y.lightMap.value=C.lightMap,y.lightMapIntensity.value=C.lightMapIntensity,e(C.lightMap,y.lightMapTransform)),C.aoMap&&(y.aoMap.value=C.aoMap,y.aoMapIntensity.value=C.aoMapIntensity,e(C.aoMap,y.aoMapTransform))}function a(y,C){y.diffuse.value.copy(C.color),y.opacity.value=C.opacity,C.map&&(y.map.value=C.map,e(C.map,y.mapTransform))}function s(y,C){y.dashSize.value=C.dashSize,y.totalSize.value=C.dashSize+C.gapSize,y.scale.value=C.scale}function l(y,C,I,L){y.diffuse.value.copy(C.color),y.opacity.value=C.opacity,y.size.value=C.size*I,y.scale.value=L*.5,C.map&&(y.map.value=C.map,e(C.map,y.uvTransform)),C.alphaMap&&(y.alphaMap.value=C.alphaMap,e(C.alphaMap,y.alphaMapTransform)),C.alphaTest>0&&(y.alphaTest.value=C.alphaTest)}function c(y,C){y.diffuse.value.copy(C.color),y.opacity.value=C.opacity,y.rotation.value=C.rotation,C.map&&(y.map.value=C.map,e(C.map,y.mapTransform)),C.alphaMap&&(y.alphaMap.value=C.alphaMap,e(C.alphaMap,y.alphaMapTransform)),C.alphaTest>0&&(y.alphaTest.value=C.alphaTest)}function h(y,C){y.specular.value.copy(C.specular),y.shininess.value=Math.max(C.shininess,1e-4)}function p(y,C){C.gradientMap&&(y.gradientMap.value=C.gradientMap)}function m(y,C){y.metalness.value=C.metalness,C.metalnessMap&&(y.metalnessMap.value=C.metalnessMap,e(C.metalnessMap,y.metalnessMapTransform)),y.roughness.value=C.roughness,C.roughnessMap&&(y.roughnessMap.value=C.roughnessMap,e(C.roughnessMap,y.roughnessMapTransform)),C.envMap&&(y.envMapIntensity.value=C.envMapIntensity)}function x(y,C,I){y.ior.value=C.ior,C.sheen>0&&(y.sheenColor.value.copy(C.sheenColor).multiplyScalar(C.sheen),y.sheenRoughness.value=C.sheenRoughness,C.sheenColorMap&&(y.sheenColorMap.value=C.sheenColorMap,e(C.sheenColorMap,y.sheenColorMapTransform)),C.sheenRoughnessMap&&(y.sheenRoughnessMap.value=C.sheenRoughnessMap,e(C.sheenRoughnessMap,y.sheenRoughnessMapTransform))),C.clearcoat>0&&(y.clearcoat.value=C.clearcoat,y.clearcoatRoughness.value=C.clearcoatRoughness,C.clearcoatMap&&(y.clearcoatMap.value=C.clearcoatMap,e(C.clearcoatMap,y.clearcoatMapTransform)),C.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=C.clearcoatRoughnessMap,e(C.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),C.clearcoatNormalMap&&(y.clearcoatNormalMap.value=C.clearcoatNormalMap,e(C.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(C.clearcoatNormalScale),C.side===$n&&y.clearcoatNormalScale.value.negate())),C.dispersion>0&&(y.dispersion.value=C.dispersion),C.iridescence>0&&(y.iridescence.value=C.iridescence,y.iridescenceIOR.value=C.iridescenceIOR,y.iridescenceThicknessMinimum.value=C.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=C.iridescenceThicknessRange[1],C.iridescenceMap&&(y.iridescenceMap.value=C.iridescenceMap,e(C.iridescenceMap,y.iridescenceMapTransform)),C.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=C.iridescenceThicknessMap,e(C.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),C.transmission>0&&(y.transmission.value=C.transmission,y.transmissionSamplerMap.value=I.texture,y.transmissionSamplerSize.value.set(I.width,I.height),C.transmissionMap&&(y.transmissionMap.value=C.transmissionMap,e(C.transmissionMap,y.transmissionMapTransform)),y.thickness.value=C.thickness,C.thicknessMap&&(y.thicknessMap.value=C.thicknessMap,e(C.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=C.attenuationDistance,y.attenuationColor.value.copy(C.attenuationColor)),C.anisotropy>0&&(y.anisotropyVector.value.set(C.anisotropy*Math.cos(C.anisotropyRotation),C.anisotropy*Math.sin(C.anisotropyRotation)),C.anisotropyMap&&(y.anisotropyMap.value=C.anisotropyMap,e(C.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=C.specularIntensity,y.specularColor.value.copy(C.specularColor),C.specularColorMap&&(y.specularColorMap.value=C.specularColorMap,e(C.specularColorMap,y.specularColorMapTransform)),C.specularIntensityMap&&(y.specularIntensityMap.value=C.specularIntensityMap,e(C.specularIntensityMap,y.specularIntensityMapTransform))}function M(y,C){C.matcap&&(y.matcap.value=C.matcap)}function S(y,C){let I=t.get(C).light;y.referencePosition.value.setFromMatrixPosition(I.matrixWorld),y.nearDistance.value=I.shadow.camera.near,y.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function rA(o,t,e,n){let i={},r={},a=[],s=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function l(I,L){let k=L.program;n.uniformBlockBinding(I,k)}function c(I,L){let k=i[I.id];k===void 0&&(M(I),k=h(I),i[I.id]=k,I.addEventListener("dispose",y));let H=L.program;n.updateUBOMapping(I,H);let V=t.render.frame;r[I.id]!==V&&(m(I),r[I.id]=V)}function h(I){let L=p();I.__bindingPointIndex=L;let k=o.createBuffer(),H=I.__size,V=I.usage;return o.bindBuffer(o.UNIFORM_BUFFER,k),o.bufferData(o.UNIFORM_BUFFER,H,V),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,L,k),k}function p(){for(let I=0;I<s;I++)if(a.indexOf(I)===-1)return a.push(I),I;return st("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(I){let L=i[I.id],k=I.uniforms,H=I.__cache;o.bindBuffer(o.UNIFORM_BUFFER,L);for(let V=0,G=k.length;V<G;V++){let E=Array.isArray(k[V])?k[V]:[k[V]];for(let B=0,Y=E.length;B<Y;B++){let U=E[B];if(x(U,V,B,H)===!0){let ee=U.__offset,de=Array.isArray(U.value)?U.value:[U.value],fe=0;for(let $=0;$<de.length;$++){let ae=de[$],J=S(ae);typeof ae=="number"||typeof ae=="boolean"?(U.__data[0]=ae,o.bufferSubData(o.UNIFORM_BUFFER,ee+fe,U.__data)):ae.isMatrix3?(U.__data[0]=ae.elements[0],U.__data[1]=ae.elements[1],U.__data[2]=ae.elements[2],U.__data[3]=0,U.__data[4]=ae.elements[3],U.__data[5]=ae.elements[4],U.__data[6]=ae.elements[5],U.__data[7]=0,U.__data[8]=ae.elements[6],U.__data[9]=ae.elements[7],U.__data[10]=ae.elements[8],U.__data[11]=0):ArrayBuffer.isView(ae)?U.__data.set(new ae.constructor(ae.buffer,ae.byteOffset,U.__data.length)):(ae.toArray(U.__data,fe),fe+=J.storage/Float32Array.BYTES_PER_ELEMENT)}o.bufferSubData(o.UNIFORM_BUFFER,ee,U.__data)}}}o.bindBuffer(o.UNIFORM_BUFFER,null)}function x(I,L,k,H){let V=I.value,G=L+"_"+k;if(H[G]===void 0)return typeof V=="number"||typeof V=="boolean"?H[G]=V:ArrayBuffer.isView(V)?H[G]=V.slice():H[G]=V.clone(),!0;{let E=H[G];if(typeof V=="number"||typeof V=="boolean"){if(E!==V)return H[G]=V,!0}else{if(ArrayBuffer.isView(V))return!0;if(E.equals(V)===!1)return E.copy(V),!0}}return!1}function M(I){let L=I.uniforms,k=0,H=16;for(let G=0,E=L.length;G<E;G++){let B=Array.isArray(L[G])?L[G]:[L[G]];for(let Y=0,U=B.length;Y<U;Y++){let ee=B[Y],de=Array.isArray(ee.value)?ee.value:[ee.value];for(let fe=0,$=de.length;fe<$;fe++){let ae=de[fe],J=S(ae),Ce=k%H,Se=Ce%J.boundary,Ve=Ce+Se;k+=Se,Ve!==0&&H-Ve<J.storage&&(k+=H-Ve),ee.__data=new Float32Array(J.storage/Float32Array.BYTES_PER_ELEMENT),ee.__offset=k,k+=J.storage}}}let V=k%H;return V>0&&(k+=H-V),I.__size=k,I.__cache={},this}function S(I){let L={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(L.boundary=4,L.storage=4):I.isVector2?(L.boundary=8,L.storage=8):I.isVector3||I.isColor?(L.boundary=16,L.storage=12):I.isVector4?(L.boundary=16,L.storage=16):I.isMatrix3?(L.boundary=48,L.storage=48):I.isMatrix4?(L.boundary=64,L.storage=64):I.isTexture?Ke("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(I)?(L.boundary=16,L.storage=I.byteLength):Ke("WebGLRenderer: Unsupported uniform value type.",I),L}function y(I){let L=I.target;L.removeEventListener("dispose",y);let k=a.indexOf(L.__bindingPointIndex);a.splice(k,1),o.deleteBuffer(i[L.id]),delete i[L.id],delete r[L.id]}function C(){for(let I in i)o.deleteBuffer(i[I]);a=[],i={},r={}}return{bind:l,update:c,dispose:C}}var aA=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),ro=null;function sA(){return ro===null&&(ro=new Sa(aA,16,16,Zo,oo),ro.name="DFG_LUT",ro.minFilter=sn,ro.magFilter=sn,ro.wrapS=gi,ro.wrapT=gi,ro.generateMipmaps=!1,ro.needsUpdate=!0),ro}var ou=class{constructor(t={}){let{canvas:e=U_(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:m=!1,outputBufferType:x=Qn}=t;this.isWebGLRenderer=!0;let M;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");M=n.getContextAttributes().alpha}else M=a;let S=x,y=new Set([Md,Cd,yd]),C=new Set([Qn,Li,Da,ka,vd,xd]),I=new Uint32Array(4),L=new Int32Array(4),k=new j,H=null,V=null,G=[],E=[],B=null;this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Ri,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let Y=this,U=!1,ee=null;this._outputColorSpace=dn;let de=0,fe=0,$=null,ae=-1,J=null,Ce=new Yt,Se=new Yt,Ve=null,Ye=new dt(0),Ze=0,It=e.width,ut=e.height,it=1,_e=null,Be=null,Pe=new Yt(0,0,It,ut),nt=new Yt(0,0,It,ut),ot=!1,at=new Ea,xt=!1,rt=!1,ft=new Ct,Ot=new j,lt=new Yt,kt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Tt=!1;function Vt(){return $===null?it:1}let W=n;function on(T,q){return e.getContext(T,q)}try{let T={alpha:!0,depth:i,stencil:r,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:p};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${"184"}`),e.addEventListener("webglcontextlost",be,!1),e.addEventListener("webglcontextrestored",Je,!1),e.addEventListener("webglcontextcreationerror",_t,!1),W===null){let q="webgl2";if(W=on(q,T),W===null)throw on(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw st("WebGLRenderer: "+T.message),T}let gt,zt,Fe,tn,O,w,K,pe,Me,Ae,Le,ce,ge,Ge,qe,Re,Ie,pt,bt,Nt,X,Oe,ue;function We(){gt=new mT(W),gt.init(),X=new eA(W,gt),zt=new aT(W,gt,t,X),Fe=new JP(W,gt),zt.reversedDepthBuffer&&m&&Fe.buffers.depth.setReversed(!0),tn=new _T(W),O=new VP,w=new QP(W,gt,Fe,O,zt,X,tn),K=new pT(Y),pe=new yS(W),Oe=new oT(W,pe),Me=new fT(W,pe,tn,Oe),Ae=new xT(W,Me,pe,Oe,tn),pt=new vT(W,zt,w),qe=new sT(O),Le=new FP(Y,K,gt,zt,Oe,qe),ce=new oA(Y,O),ge=new UP,Ge=new qP(gt),Ie=new iT(Y,K,Fe,Ae,M,l),Re=new ZP(Y,Ae,zt),ue=new rA(W,tn,zt,Fe),bt=new rT(W,gt,tn),Nt=new gT(W,gt,tn),tn.programs=Le.programs,Y.capabilities=zt,Y.extensions=gt,Y.properties=O,Y.renderLists=ge,Y.shadowMap=Re,Y.state=Fe,Y.info=tn}We(),S!==Qn&&(B=new yT(S,e.width,e.height,i,r));let Ne=new Bp(Y,W);this.xr=Ne,this.getContext=function(){return W},this.getContextAttributes=function(){return W.getContextAttributes()},this.forceContextLoss=function(){let T=gt.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){let T=gt.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return it},this.setPixelRatio=function(T){T!==void 0&&(it=T,this.setSize(It,ut,!1))},this.getSize=function(T){return T.set(It,ut)},this.setSize=function(T,q,re=!0){if(Ne.isPresenting){Ke("WebGLRenderer: Can't change size while VR device is presenting.");return}It=T,ut=q,e.width=Math.floor(T*it),e.height=Math.floor(q*it),re===!0&&(e.style.width=T+"px",e.style.height=q+"px"),B!==null&&B.setSize(e.width,e.height),this.setViewport(0,0,T,q)},this.getDrawingBufferSize=function(T){return T.set(It*it,ut*it).floor()},this.setDrawingBufferSize=function(T,q,re){It=T,ut=q,it=re,e.width=Math.floor(T*re),e.height=Math.floor(q*re),this.setViewport(0,0,T,q)},this.setEffects=function(T){if(S===Qn){st("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(T){for(let q=0;q<T.length;q++)if(T[q].isOutputPass===!0){Ke("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}B.setEffects(T||[])},this.getCurrentViewport=function(T){return T.copy(Ce)},this.getViewport=function(T){return T.copy(Pe)},this.setViewport=function(T,q,re,te){T.isVector4?Pe.set(T.x,T.y,T.z,T.w):Pe.set(T,q,re,te),Fe.viewport(Ce.copy(Pe).multiplyScalar(it).round())},this.getScissor=function(T){return T.copy(nt)},this.setScissor=function(T,q,re,te){T.isVector4?nt.set(T.x,T.y,T.z,T.w):nt.set(T,q,re,te),Fe.scissor(Se.copy(nt).multiplyScalar(it).round())},this.getScissorTest=function(){return ot},this.setScissorTest=function(T){Fe.setScissorTest(ot=T)},this.setOpaqueSort=function(T){_e=T},this.setTransparentSort=function(T){Be=T},this.getClearColor=function(T){return T.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor(...arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha(...arguments)},this.clear=function(T=!0,q=!0,re=!0){let te=0;if(T){let ie=!1;if($!==null){let He=$.texture.format;ie=y.has(He)}if(ie){let He=$.texture.type,$e=C.has(He),ze=Ie.getClearColor(),je=Ie.getClearAlpha(),Qe=ze.r,vt=ze.g,wt=ze.b;$e?(I[0]=Qe,I[1]=vt,I[2]=wt,I[3]=je,W.clearBufferuiv(W.COLOR,0,I)):(L[0]=Qe,L[1]=vt,L[2]=wt,L[3]=je,W.clearBufferiv(W.COLOR,0,L))}else te|=W.COLOR_BUFFER_BIT}q&&(te|=W.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),re&&(te|=W.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),te!==0&&W.clear(te)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(T){T.setRenderer(this),ee=T},this.dispose=function(){e.removeEventListener("webglcontextlost",be,!1),e.removeEventListener("webglcontextrestored",Je,!1),e.removeEventListener("webglcontextcreationerror",_t,!1),Ie.dispose(),ge.dispose(),Ge.dispose(),O.dispose(),K.dispose(),Ae.dispose(),Oe.dispose(),ue.dispose(),Le.dispose(),Ne.dispose(),Ne.removeEventListener("sessionstart",Mm),Ne.removeEventListener("sessionend",wm),nr.stop()};function be(T){T.preventDefault(),Ps("WebGLRenderer: Context Lost."),U=!0}function Je(){Ps("WebGLRenderer: Context Restored."),U=!1;let T=tn.autoReset,q=Re.enabled,re=Re.autoUpdate,te=Re.needsUpdate,ie=Re.type;We(),tn.autoReset=T,Re.enabled=q,Re.autoUpdate=re,Re.needsUpdate=te,Re.type=ie}function _t(T){st("WebGLRenderer: A WebGL context could not be created. Reason: ",T.statusMessage)}function un(T){let q=T.target;q.removeEventListener("dispose",un),Xt(q)}function Xt(T){uo(T),O.remove(T)}function uo(T){let q=O.get(T).programs;q!==void 0&&(q.forEach(function(re){Le.releaseProgram(re)}),T.isShaderMaterial&&Le.releaseShaderCache(T))}this.renderBufferDirect=function(T,q,re,te,ie,He){q===null&&(q=kt);let $e=ie.isMesh&&ie.matrixWorld.determinant()<0,ze=lx(T,q,re,te,ie);Fe.setMaterial(te,$e);let je=re.index,Qe=1;if(te.wireframe===!0){if(je=Me.getWireframeAttribute(re),je===void 0)return;Qe=2}let vt=re.drawRange,wt=re.attributes.position,et=vt.start*Qe,qt=(vt.start+vt.count)*Qe;He!==null&&(et=Math.max(et,He.start*Qe),qt=Math.min(qt,(He.start+He.count)*Qe)),je!==null?(et=Math.max(et,0),qt=Math.min(qt,je.count)):wt!=null&&(et=Math.max(et,0),qt=Math.min(qt,wt.count));let hn=qt-et;if(hn<0||hn===1/0)return;Oe.setup(ie,te,ze,re,je);let ln,jt=bt;if(je!==null&&(ln=pe.get(je),jt=Nt,jt.setIndex(ln)),ie.isMesh)te.wireframe===!0?(Fe.setLineWidth(te.wireframeLinewidth*Vt()),jt.setMode(W.LINES)):jt.setMode(W.TRIANGLES);else if(ie.isLine){let Rn=te.linewidth;Rn===void 0&&(Rn=1),Fe.setLineWidth(Rn*Vt()),ie.isLineSegments?jt.setMode(W.LINES):ie.isLineLoop?jt.setMode(W.LINE_LOOP):jt.setMode(W.LINE_STRIP)}else ie.isPoints?jt.setMode(W.POINTS):ie.isSprite&&jt.setMode(W.TRIANGLES);if(ie.isBatchedMesh)if(gt.get("WEBGL_multi_draw"))jt.renderMultiDraw(ie._multiDrawStarts,ie._multiDrawCounts,ie._multiDrawCount);else{let Rn=ie._multiDrawStarts,Xe=ie._multiDrawCounts,ti=ie._multiDrawCount,Rt=je?pe.get(je).bytesPerElement:1,hi=O.get(te).currentProgram.getUniforms();for(let Bi=0;Bi<ti;Bi++)hi.setValue(W,"_gl_DrawID",Bi),jt.render(Rn[Bi]/Rt,Xe[Bi])}else if(ie.isInstancedMesh)jt.renderInstances(et,hn,ie.count);else if(re.isInstancedBufferGeometry){let Rn=re._maxInstanceCount!==void 0?re._maxInstanceCount:1/0,Xe=Math.min(re.instanceCount,Rn);jt.renderInstances(et,hn,Xe)}else jt.render(et,hn)};function Vi(T,q,re){T.transparent===!0&&T.side===_i&&T.forceSinglePass===!1?(T.side=$n,T.needsUpdate=!0,ml(T,q,re),T.side=Di,T.needsUpdate=!0,ml(T,q,re),T.side=_i):ml(T,q,re)}this.compile=function(T,q,re=null){re===null&&(re=T),V=Ge.get(re),V.init(q),E.push(V),re.traverseVisible(function(ie){ie.isLight&&ie.layers.test(q.layers)&&(V.pushLight(ie),ie.castShadow&&V.pushShadow(ie))}),T!==re&&T.traverseVisible(function(ie){ie.isLight&&ie.layers.test(q.layers)&&(V.pushLight(ie),ie.castShadow&&V.pushShadow(ie))}),V.setupLights();let te=new Set;return T.traverse(function(ie){if(!(ie.isMesh||ie.isPoints||ie.isLine||ie.isSprite))return;let He=ie.material;if(He)if(Array.isArray(He))for(let $e=0;$e<He.length;$e++){let ze=He[$e];Vi(ze,re,ie),te.add(ze)}else Vi(He,re,ie),te.add(He)}),V=E.pop(),te},this.compileAsync=function(T,q,re=null){let te=this.compile(T,q,re);return new Promise(ie=>{function He(){if(te.forEach(function($e){O.get($e).currentProgram.isReady()&&te.delete($e)}),te.size===0){ie(T);return}setTimeout(He,10)}gt.get("KHR_parallel_shader_compile")!==null?He():setTimeout(He,10)})};let Cu=null;function ax(T){Cu&&Cu(T)}function Mm(){nr.stop()}function wm(){nr.start()}let nr=new gv;nr.setAnimationLoop(ax),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(T){Cu=T,Ne.setAnimationLoop(T),T===null?nr.stop():nr.start()},Ne.addEventListener("sessionstart",Mm),Ne.addEventListener("sessionend",wm),this.render=function(T,q){if(q!==void 0&&q.isCamera!==!0){st("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;ee!==null&&ee.renderStart(T,q);let re=Ne.enabled===!0&&Ne.isPresenting===!0,te=B!==null&&($===null||re)&&B.begin(Y,$);if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),Ne.enabled===!0&&Ne.isPresenting===!0&&(B===null||B.isCompositing()===!1)&&(Ne.cameraAutoUpdate===!0&&Ne.updateCamera(q),q=Ne.getCamera()),T.isScene===!0&&T.onBeforeRender(Y,T,q,$),V=Ge.get(T,E.length),V.init(q),V.state.textureUnits=w.getTextureUnits(),E.push(V),ft.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),at.setFromProjectionMatrix(ft,Ai,q.reversedDepth),rt=this.localClippingEnabled,xt=qe.init(this.clippingPlanes,rt),H=ge.get(T,G.length),H.init(),G.push(H),Ne.enabled===!0&&Ne.isPresenting===!0){let $e=Y.xr.getDepthSensingMesh();$e!==null&&Mu($e,q,-1/0,Y.sortObjects)}Mu(T,q,0,Y.sortObjects),H.finish(),Y.sortObjects===!0&&H.sort(_e,Be),Tt=Ne.enabled===!1||Ne.isPresenting===!1||Ne.hasDepthSensing()===!1,Tt&&Ie.addToRenderList(H,T),this.info.render.frame++,xt===!0&&qe.beginShadows();let ie=V.state.shadowsArray;if(Re.render(ie,T,q),xt===!0&&qe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(te&&B.hasRenderPass())===!1){let $e=H.opaque,ze=H.transmissive;if(V.setupLights(),q.isArrayCamera){let je=q.cameras;if(ze.length>0)for(let Qe=0,vt=je.length;Qe<vt;Qe++){let wt=je[Qe];Em($e,ze,T,wt)}Tt&&Ie.render(T);for(let Qe=0,vt=je.length;Qe<vt;Qe++){let wt=je[Qe];Sm(H,T,wt,wt.viewport)}}else ze.length>0&&Em($e,ze,T,q),Tt&&Ie.render(T),Sm(H,T,q)}$!==null&&fe===0&&(w.updateMultisampleRenderTarget($),w.updateRenderTargetMipmap($)),te&&B.end(Y),T.isScene===!0&&T.onAfterRender(Y,T,q),Oe.resetDefaultState(),ae=-1,J=null,E.pop(),E.length>0?(V=E[E.length-1],w.setTextureUnits(V.state.textureUnits),xt===!0&&qe.setGlobalState(Y.clippingPlanes,V.state.camera)):V=null,G.pop(),G.length>0?H=G[G.length-1]:H=null,ee!==null&&ee.renderEnd()};function Mu(T,q,re,te){if(T.visible===!1)return;if(T.layers.test(q.layers)){if(T.isGroup)re=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(q);else if(T.isLightProbeGrid)V.pushLightProbeGrid(T);else if(T.isLight)V.pushLight(T),T.castShadow&&V.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||at.intersectsSprite(T)){te&<.setFromMatrixPosition(T.matrixWorld).applyMatrix4(ft);let $e=Ae.update(T),ze=T.material;ze.visible&&H.push(T,$e,ze,re,lt.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||at.intersectsObject(T))){let $e=Ae.update(T),ze=T.material;if(te&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),lt.copy(T.boundingSphere.center)):($e.boundingSphere===null&&$e.computeBoundingSphere(),lt.copy($e.boundingSphere.center)),lt.applyMatrix4(T.matrixWorld).applyMatrix4(ft)),Array.isArray(ze)){let je=$e.groups;for(let Qe=0,vt=je.length;Qe<vt;Qe++){let wt=je[Qe],et=ze[wt.materialIndex];et&&et.visible&&H.push(T,$e,et,re,lt.z,wt)}}else ze.visible&&H.push(T,$e,ze,re,lt.z,null)}}let He=T.children;for(let $e=0,ze=He.length;$e<ze;$e++)Mu(He[$e],q,re,te)}function Sm(T,q,re,te){let{opaque:ie,transmissive:He,transparent:$e}=T;V.setupLightsView(re),xt===!0&&qe.setGlobalState(Y.clippingPlanes,re),te&&Fe.viewport(Ce.copy(te)),ie.length>0&&pl(ie,q,re),He.length>0&&pl(He,q,re),$e.length>0&&pl($e,q,re),Fe.buffers.depth.setTest(!0),Fe.buffers.depth.setMask(!0),Fe.buffers.color.setMask(!0),Fe.setPolygonOffset(!1)}function Em(T,q,re,te){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;if(V.state.transmissionRenderTarget[te.id]===void 0){let et=gt.has("EXT_color_buffer_half_float")||gt.has("EXT_color_buffer_float");V.state.transmissionRenderTarget[te.id]=new si(1,1,{generateMipmaps:!0,type:et?oo:Qn,minFilter:Ni,samples:Math.max(4,zt.samples),stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:St.workingColorSpace})}let He=V.state.transmissionRenderTarget[te.id],$e=te.viewport||Ce;He.setSize($e.z*Y.transmissionResolutionScale,$e.w*Y.transmissionResolutionScale);let ze=Y.getRenderTarget(),je=Y.getActiveCubeFace(),Qe=Y.getActiveMipmapLevel();Y.setRenderTarget(He),Y.getClearColor(Ye),Ze=Y.getClearAlpha(),Ze<1&&Y.setClearColor(16777215,.5),Y.clear(),Tt&&Ie.render(re);let vt=Y.toneMapping;Y.toneMapping=Ri;let wt=te.viewport;if(te.viewport!==void 0&&(te.viewport=void 0),V.setupLightsView(te),xt===!0&&qe.setGlobalState(Y.clippingPlanes,te),pl(T,re,te),w.updateMultisampleRenderTarget(He),w.updateRenderTargetMipmap(He),gt.has("WEBGL_multisampled_render_to_texture")===!1){let et=!1;for(let qt=0,hn=q.length;qt<hn;qt++){let ln=q[qt],{object:jt,geometry:Rn,material:Xe,group:ti}=ln;if(Xe.side===_i&&jt.layers.test(te.layers)){let Rt=Xe.side;Xe.side=$n,Xe.needsUpdate=!0,Tm(jt,re,te,Rn,Xe,ti),Xe.side=Rt,Xe.needsUpdate=!0,et=!0}}et===!0&&(w.updateMultisampleRenderTarget(He),w.updateRenderTargetMipmap(He))}Y.setRenderTarget(ze,je,Qe),Y.setClearColor(Ye,Ze),wt!==void 0&&(te.viewport=wt),Y.toneMapping=vt}function pl(T,q,re){let te=q.isScene===!0?q.overrideMaterial:null;for(let ie=0,He=T.length;ie<He;ie++){let $e=T[ie],{object:ze,geometry:je,group:Qe}=$e,vt=$e.material;vt.allowOverride===!0&&te!==null&&(vt=te),ze.layers.test(re.layers)&&Tm(ze,q,re,je,vt,Qe)}}function Tm(T,q,re,te,ie,He){T.onBeforeRender(Y,q,re,te,ie,He),T.modelViewMatrix.multiplyMatrices(re.matrixWorldInverse,T.matrixWorld),T.normalMatrix.getNormalMatrix(T.modelViewMatrix),ie.onBeforeRender(Y,q,re,te,T,He),ie.transparent===!0&&ie.side===_i&&ie.forceSinglePass===!1?(ie.side=$n,ie.needsUpdate=!0,Y.renderBufferDirect(re,q,te,ie,T,He),ie.side=Di,ie.needsUpdate=!0,Y.renderBufferDirect(re,q,te,ie,T,He),ie.side=_i):Y.renderBufferDirect(re,q,te,ie,T,He),T.onAfterRender(Y,q,re,te,ie,He)}function ml(T,q,re){q.isScene!==!0&&(q=kt);let te=O.get(T),ie=V.state.lights,He=V.state.shadowsArray,$e=ie.state.version,ze=Le.getParameters(T,ie.state,He,q,re,V.state.lightProbeGridArray),je=Le.getProgramCacheKey(ze),Qe=te.programs;te.environment=T.isMeshStandardMaterial||T.isMeshLambertMaterial||T.isMeshPhongMaterial?q.environment:null,te.fog=q.fog;let vt=T.isMeshStandardMaterial||T.isMeshLambertMaterial&&!T.envMap||T.isMeshPhongMaterial&&!T.envMap;te.envMap=K.get(T.envMap||te.environment,vt),te.envMapRotation=te.environment!==null&&T.envMap===null?q.environmentRotation:T.envMapRotation,Qe===void 0&&(T.addEventListener("dispose",un),Qe=new Map,te.programs=Qe);let wt=Qe.get(je);if(wt!==void 0){if(te.currentProgram===wt&&te.lightsStateVersion===$e)return Am(T,ze),wt}else ze.uniforms=Le.getUniforms(T),ee!==null&&T.isNodeMaterial&&ee.build(T,re,ze),T.onBeforeCompile(ze,Y),wt=Le.acquireProgram(ze,je),Qe.set(je,wt),te.uniforms=ze.uniforms;let et=te.uniforms;return(!T.isShaderMaterial&&!T.isRawShaderMaterial||T.clipping===!0)&&(et.clippingPlanes=qe.uniform),Am(T,ze),te.needsLights=dx(T),te.lightsStateVersion=$e,te.needsLights&&(et.ambientLightColor.value=ie.state.ambient,et.lightProbe.value=ie.state.probe,et.directionalLights.value=ie.state.directional,et.directionalLightShadows.value=ie.state.directionalShadow,et.spotLights.value=ie.state.spot,et.spotLightShadows.value=ie.state.spotShadow,et.rectAreaLights.value=ie.state.rectArea,et.ltc_1.value=ie.state.rectAreaLTC1,et.ltc_2.value=ie.state.rectAreaLTC2,et.pointLights.value=ie.state.point,et.pointLightShadows.value=ie.state.pointShadow,et.hemisphereLights.value=ie.state.hemi,et.directionalShadowMatrix.value=ie.state.directionalShadowMatrix,et.spotLightMatrix.value=ie.state.spotLightMatrix,et.spotLightMap.value=ie.state.spotLightMap,et.pointShadowMatrix.value=ie.state.pointShadowMatrix),te.lightProbeGrid=V.state.lightProbeGridArray.length>0,te.currentProgram=wt,te.uniformsList=null,wt}function Pm(T){if(T.uniformsList===null){let q=T.currentProgram.getUniforms();T.uniformsList=Ba.seqWithValue(q.seq,T.uniforms)}return T.uniformsList}function Am(T,q){let re=O.get(T);re.outputColorSpace=q.outputColorSpace,re.batching=q.batching,re.batchingColor=q.batchingColor,re.instancing=q.instancing,re.instancingColor=q.instancingColor,re.instancingMorph=q.instancingMorph,re.skinning=q.skinning,re.morphTargets=q.morphTargets,re.morphNormals=q.morphNormals,re.morphColors=q.morphColors,re.morphTargetsCount=q.morphTargetsCount,re.numClippingPlanes=q.numClippingPlanes,re.numIntersection=q.numClipIntersection,re.vertexAlphas=q.vertexAlphas,re.vertexTangents=q.vertexTangents,re.toneMapping=q.toneMapping}function sx(T,q){if(T.length===0)return null;if(T.length===1)return T[0].texture!==null?T[0]:null;k.setFromMatrixPosition(q.matrixWorld);for(let re=0,te=T.length;re<te;re++){let ie=T[re];if(ie.texture!==null&&ie.boundingBox.containsPoint(k))return ie}return null}function lx(T,q,re,te,ie){q.isScene!==!0&&(q=kt),w.resetTextureUnits();let He=q.fog,$e=te.isMeshStandardMaterial||te.isMeshLambertMaterial||te.isMeshPhongMaterial?q.environment:null,ze=$===null?Y.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:St.workingColorSpace,je=te.isMeshStandardMaterial||te.isMeshLambertMaterial&&!te.envMap||te.isMeshPhongMaterial&&!te.envMap,Qe=K.get(te.envMap||$e,je),vt=te.vertexColors===!0&&!!re.attributes.color&&re.attributes.color.itemSize===4,wt=!!re.attributes.tangent&&(!!te.normalMap||te.anisotropy>0),et=!!re.morphAttributes.position,qt=!!re.morphAttributes.normal,hn=!!re.morphAttributes.color,ln=Ri;te.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(ln=Y.toneMapping);let jt=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Rn=jt!==void 0?jt.length:0,Xe=O.get(te),ti=V.state.lights;if(xt===!0&&(rt===!0||T!==J)){let nn=T===J&&te.id===ae;qe.setState(te,T,nn)}let Rt=!1;te.version===Xe.__version?(Xe.needsLights&&Xe.lightsStateVersion!==ti.state.version||Xe.outputColorSpace!==ze||ie.isBatchedMesh&&Xe.batching===!1||!ie.isBatchedMesh&&Xe.batching===!0||ie.isBatchedMesh&&Xe.batchingColor===!0&&ie.colorTexture===null||ie.isBatchedMesh&&Xe.batchingColor===!1&&ie.colorTexture!==null||ie.isInstancedMesh&&Xe.instancing===!1||!ie.isInstancedMesh&&Xe.instancing===!0||ie.isSkinnedMesh&&Xe.skinning===!1||!ie.isSkinnedMesh&&Xe.skinning===!0||ie.isInstancedMesh&&Xe.instancingColor===!0&&ie.instanceColor===null||ie.isInstancedMesh&&Xe.instancingColor===!1&&ie.instanceColor!==null||ie.isInstancedMesh&&Xe.instancingMorph===!0&&ie.morphTexture===null||ie.isInstancedMesh&&Xe.instancingMorph===!1&&ie.morphTexture!==null||Xe.envMap!==Qe||te.fog===!0&&Xe.fog!==He||Xe.numClippingPlanes!==void 0&&(Xe.numClippingPlanes!==qe.numPlanes||Xe.numIntersection!==qe.numIntersection)||Xe.vertexAlphas!==vt||Xe.vertexTangents!==wt||Xe.morphTargets!==et||Xe.morphNormals!==qt||Xe.morphColors!==hn||Xe.toneMapping!==ln||Xe.morphTargetsCount!==Rn||!!Xe.lightProbeGrid!=V.state.lightProbeGridArray.length>0)&&(Rt=!0):(Rt=!0,Xe.__version=te.version);let hi=Xe.currentProgram;Rt===!0&&(hi=ml(te,q,ie),ee&&te.isNodeMaterial&&ee.onUpdateProgram(te,hi,Xe));let Bi=!1,Oo=!1,Nr=!1,Kt=hi.getUniforms(),pn=Xe.uniforms;if(Fe.useProgram(hi.program)&&(Bi=!0,Oo=!0,Nr=!0),te.id!==ae&&(ae=te.id,Oo=!0),Xe.needsLights){let nn=sx(V.state.lightProbeGridArray,ie);Xe.lightProbeGrid!==nn&&(Xe.lightProbeGrid=nn,Oo=!0)}if(Bi||J!==T){Fe.buffers.depth.getReversed()&&T.reversedDepth!==!0&&(T._reversedDepth=!0,T.updateProjectionMatrix()),Kt.setValue(W,"projectionMatrix",T.projectionMatrix),Kt.setValue(W,"viewMatrix",T.matrixWorldInverse);let ko=Kt.map.cameraPosition;ko!==void 0&&ko.setValue(W,Ot.setFromMatrixPosition(T.matrixWorld)),zt.logarithmicDepthBuffer&&Kt.setValue(W,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&Kt.setValue(W,"isOrthographic",T.isOrthographicCamera===!0),J!==T&&(J=T,Oo=!0,Nr=!0)}if(Xe.needsLights&&(ti.state.directionalShadowMap.length>0&&Kt.setValue(W,"directionalShadowMap",ti.state.directionalShadowMap,w),ti.state.spotShadowMap.length>0&&Kt.setValue(W,"spotShadowMap",ti.state.spotShadowMap,w),ti.state.pointShadowMap.length>0&&Kt.setValue(W,"pointShadowMap",ti.state.pointShadowMap,w)),ie.isSkinnedMesh){Kt.setOptional(W,ie,"bindMatrix"),Kt.setOptional(W,ie,"bindMatrixInverse");let nn=ie.skeleton;nn&&(nn.boneTexture===null&&nn.computeBoneTexture(),Kt.setValue(W,"boneTexture",nn.boneTexture,w))}ie.isBatchedMesh&&(Kt.setOptional(W,ie,"batchingTexture"),Kt.setValue(W,"batchingTexture",ie._matricesTexture,w),Kt.setOptional(W,ie,"batchingIdTexture"),Kt.setValue(W,"batchingIdTexture",ie._indirectTexture,w),Kt.setOptional(W,ie,"batchingColorTexture"),ie._colorsTexture!==null&&Kt.setValue(W,"batchingColorTexture",ie._colorsTexture,w));let Do=re.morphAttributes;if((Do.position!==void 0||Do.normal!==void 0||Do.color!==void 0)&&pt.update(ie,re,hi),(Oo||Xe.receiveShadow!==ie.receiveShadow)&&(Xe.receiveShadow=ie.receiveShadow,Kt.setValue(W,"receiveShadow",ie.receiveShadow)),(te.isMeshStandardMaterial||te.isMeshLambertMaterial||te.isMeshPhongMaterial)&&te.envMap===null&&q.environment!==null&&(pn.envMapIntensity.value=q.environmentIntensity),pn.dfgLUT!==void 0&&(pn.dfgLUT.value=sA()),Oo){if(Kt.setValue(W,"toneMappingExposure",Y.toneMappingExposure),Xe.needsLights&&cx(pn,Nr),He&&te.fog===!0&&ce.refreshFogUniforms(pn,He),ce.refreshMaterialUniforms(pn,te,it,ut,V.state.transmissionRenderTarget[T.id]),Xe.needsLights&&Xe.lightProbeGrid){let nn=Xe.lightProbeGrid;pn.probesSH.value=nn.texture,pn.probesMin.value.copy(nn.boundingBox.min),pn.probesMax.value.copy(nn.boundingBox.max),pn.probesResolution.value.copy(nn.resolution)}Ba.upload(W,Pm(Xe),pn,w)}if(te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Ba.upload(W,Pm(Xe),pn,w),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&Kt.setValue(W,"center",ie.center),Kt.setValue(W,"modelViewMatrix",ie.modelViewMatrix),Kt.setValue(W,"normalMatrix",ie.normalMatrix),Kt.setValue(W,"modelMatrix",ie.matrixWorld),te.uniformsGroups!==void 0){let nn=te.uniformsGroups;for(let ko=0,Lr=nn.length;ko<Lr;ko++){let Im=nn[ko];ue.update(Im,hi),ue.bind(Im,hi)}}return hi}function cx(T,q){T.ambientLightColor.needsUpdate=q,T.lightProbe.needsUpdate=q,T.directionalLights.needsUpdate=q,T.directionalLightShadows.needsUpdate=q,T.pointLights.needsUpdate=q,T.pointLightShadows.needsUpdate=q,T.spotLights.needsUpdate=q,T.spotLightShadows.needsUpdate=q,T.rectAreaLights.needsUpdate=q,T.hemisphereLights.needsUpdate=q}function dx(T){return T.isMeshLambertMaterial||T.isMeshToonMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isShadowMaterial||T.isShaderMaterial&&T.lights===!0}this.getActiveCubeFace=function(){return de},this.getActiveMipmapLevel=function(){return fe},this.getRenderTarget=function(){return $},this.setRenderTargetTextures=function(T,q,re){let te=O.get(T);te.__autoAllocateDepthBuffer=T.resolveDepthBuffer===!1,te.__autoAllocateDepthBuffer===!1&&(te.__useRenderToTexture=!1),O.get(T.texture).__webglTexture=q,O.get(T.depthTexture).__webglTexture=te.__autoAllocateDepthBuffer?void 0:re,te.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(T,q){let re=O.get(T);re.__webglFramebuffer=q,re.__useDefaultFramebuffer=q===void 0};let ux=W.createFramebuffer();this.setRenderTarget=function(T,q=0,re=0){$=T,de=q,fe=re;let te=null,ie=!1,He=!1;if(T){let ze=O.get(T);if(ze.__useDefaultFramebuffer!==void 0){Fe.bindFramebuffer(W.FRAMEBUFFER,ze.__webglFramebuffer),Ce.copy(T.viewport),Se.copy(T.scissor),Ve=T.scissorTest,Fe.viewport(Ce),Fe.scissor(Se),Fe.setScissorTest(Ve),ae=-1;return}else if(ze.__webglFramebuffer===void 0)w.setupRenderTarget(T);else if(ze.__hasExternalTextures)w.rebindTextures(T,O.get(T.texture).__webglTexture,O.get(T.depthTexture).__webglTexture);else if(T.depthBuffer){let vt=T.depthTexture;if(ze.__boundDepthTexture!==vt){if(vt!==null&&O.has(vt)&&(T.width!==vt.image.width||T.height!==vt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");w.setupDepthRenderbuffer(T)}}let je=T.texture;(je.isData3DTexture||je.isDataArrayTexture||je.isCompressedArrayTexture)&&(He=!0);let Qe=O.get(T).__webglFramebuffer;T.isWebGLCubeRenderTarget?(Array.isArray(Qe[q])?te=Qe[q][re]:te=Qe[q],ie=!0):T.samples>0&&w.useMultisampledRTT(T)===!1?te=O.get(T).__webglMultisampledFramebuffer:Array.isArray(Qe)?te=Qe[re]:te=Qe,Ce.copy(T.viewport),Se.copy(T.scissor),Ve=T.scissorTest}else Ce.copy(Pe).multiplyScalar(it).floor(),Se.copy(nt).multiplyScalar(it).floor(),Ve=ot;if(re!==0&&(te=ux),Fe.bindFramebuffer(W.FRAMEBUFFER,te)&&Fe.drawBuffers(T,te),Fe.viewport(Ce),Fe.scissor(Se),Fe.setScissorTest(Ve),ie){let ze=O.get(T.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_CUBE_MAP_POSITIVE_X+q,ze.__webglTexture,re)}else if(He){let ze=q;for(let je=0;je<T.textures.length;je++){let Qe=O.get(T.textures[je]);W.framebufferTextureLayer(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0+je,Qe.__webglTexture,re,ze)}}else if(T!==null&&re!==0){let ze=O.get(T.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,ze.__webglTexture,re)}ae=-1},this.readRenderTargetPixels=function(T,q,re,te,ie,He,$e,ze=0){if(!(T&&T.isWebGLRenderTarget)){st("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let je=O.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&$e!==void 0&&(je=je[$e]),je){Fe.bindFramebuffer(W.FRAMEBUFFER,je);try{let Qe=T.textures[ze],vt=Qe.format,wt=Qe.type;if(T.textures.length>1&&W.readBuffer(W.COLOR_ATTACHMENT0+ze),!zt.textureFormatReadable(vt)){st("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!zt.textureTypeReadable(wt)){st("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=T.width-te&&re>=0&&re<=T.height-ie&&W.readPixels(q,re,te,ie,X.convert(vt),X.convert(wt),He)}finally{let Qe=$!==null?O.get($).__webglFramebuffer:null;Fe.bindFramebuffer(W.FRAMEBUFFER,Qe)}}},this.readRenderTargetPixelsAsync=async function(T,q,re,te,ie,He,$e,ze=0){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let je=O.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&$e!==void 0&&(je=je[$e]),je)if(q>=0&&q<=T.width-te&&re>=0&&re<=T.height-ie){Fe.bindFramebuffer(W.FRAMEBUFFER,je);let Qe=T.textures[ze],vt=Qe.format,wt=Qe.type;if(T.textures.length>1&&W.readBuffer(W.COLOR_ATTACHMENT0+ze),!zt.textureFormatReadable(vt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!zt.textureTypeReadable(wt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let et=W.createBuffer();W.bindBuffer(W.PIXEL_PACK_BUFFER,et),W.bufferData(W.PIXEL_PACK_BUFFER,He.byteLength,W.STREAM_READ),W.readPixels(q,re,te,ie,X.convert(vt),X.convert(wt),0);let qt=$!==null?O.get($).__webglFramebuffer:null;Fe.bindFramebuffer(W.FRAMEBUFFER,qt);let hn=W.fenceSync(W.SYNC_GPU_COMMANDS_COMPLETE,0);return W.flush(),await H_(W,hn,4),W.bindBuffer(W.PIXEL_PACK_BUFFER,et),W.getBufferSubData(W.PIXEL_PACK_BUFFER,0,He),W.deleteBuffer(et),W.deleteSync(hn),He}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(T,q=null,re=0){let te=Math.pow(2,-re),ie=Math.floor(T.image.width*te),He=Math.floor(T.image.height*te),$e=q!==null?q.x:0,ze=q!==null?q.y:0;w.setTexture2D(T,0),W.copyTexSubImage2D(W.TEXTURE_2D,re,0,0,$e,ze,ie,He),Fe.unbindTexture()};let hx=W.createFramebuffer(),px=W.createFramebuffer();this.copyTextureToTexture=function(T,q,re=null,te=null,ie=0,He=0){let $e,ze,je,Qe,vt,wt,et,qt,hn,ln=T.isCompressedTexture?T.mipmaps[He]:T.image;if(re!==null)$e=re.max.x-re.min.x,ze=re.max.y-re.min.y,je=re.isBox3?re.max.z-re.min.z:1,Qe=re.min.x,vt=re.min.y,wt=re.isBox3?re.min.z:0;else{let pn=Math.pow(2,-ie);$e=Math.floor(ln.width*pn),ze=Math.floor(ln.height*pn),T.isDataArrayTexture?je=ln.depth:T.isData3DTexture?je=Math.floor(ln.depth*pn):je=1,Qe=0,vt=0,wt=0}te!==null?(et=te.x,qt=te.y,hn=te.z):(et=0,qt=0,hn=0);let jt=X.convert(q.format),Rn=X.convert(q.type),Xe;q.isData3DTexture?(w.setTexture3D(q,0),Xe=W.TEXTURE_3D):q.isDataArrayTexture||q.isCompressedArrayTexture?(w.setTexture2DArray(q,0),Xe=W.TEXTURE_2D_ARRAY):(w.setTexture2D(q,0),Xe=W.TEXTURE_2D),Fe.activeTexture(W.TEXTURE0),Fe.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,q.flipY),Fe.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),Fe.pixelStorei(W.UNPACK_ALIGNMENT,q.unpackAlignment);let ti=Fe.getParameter(W.UNPACK_ROW_LENGTH),Rt=Fe.getParameter(W.UNPACK_IMAGE_HEIGHT),hi=Fe.getParameter(W.UNPACK_SKIP_PIXELS),Bi=Fe.getParameter(W.UNPACK_SKIP_ROWS),Oo=Fe.getParameter(W.UNPACK_SKIP_IMAGES);Fe.pixelStorei(W.UNPACK_ROW_LENGTH,ln.width),Fe.pixelStorei(W.UNPACK_IMAGE_HEIGHT,ln.height),Fe.pixelStorei(W.UNPACK_SKIP_PIXELS,Qe),Fe.pixelStorei(W.UNPACK_SKIP_ROWS,vt),Fe.pixelStorei(W.UNPACK_SKIP_IMAGES,wt);let Nr=T.isDataArrayTexture||T.isData3DTexture,Kt=q.isDataArrayTexture||q.isData3DTexture;if(T.isDepthTexture){let pn=O.get(T),Do=O.get(q),nn=O.get(pn.__renderTarget),ko=O.get(Do.__renderTarget);Fe.bindFramebuffer(W.READ_FRAMEBUFFER,nn.__webglFramebuffer),Fe.bindFramebuffer(W.DRAW_FRAMEBUFFER,ko.__webglFramebuffer);for(let Lr=0;Lr<je;Lr++)Nr&&(W.framebufferTextureLayer(W.READ_FRAMEBUFFER,W.COLOR_ATTACHMENT0,O.get(T).__webglTexture,ie,wt+Lr),W.framebufferTextureLayer(W.DRAW_FRAMEBUFFER,W.COLOR_ATTACHMENT0,O.get(q).__webglTexture,He,hn+Lr)),W.blitFramebuffer(Qe,vt,$e,ze,et,qt,$e,ze,W.DEPTH_BUFFER_BIT,W.NEAREST);Fe.bindFramebuffer(W.READ_FRAMEBUFFER,null),Fe.bindFramebuffer(W.DRAW_FRAMEBUFFER,null)}else if(ie!==0||T.isRenderTargetTexture||O.has(T)){let pn=O.get(T),Do=O.get(q);Fe.bindFramebuffer(W.READ_FRAMEBUFFER,hx),Fe.bindFramebuffer(W.DRAW_FRAMEBUFFER,px);for(let nn=0;nn<je;nn++)Nr?W.framebufferTextureLayer(W.READ_FRAMEBUFFER,W.COLOR_ATTACHMENT0,pn.__webglTexture,ie,wt+nn):W.framebufferTexture2D(W.READ_FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,pn.__webglTexture,ie),Kt?W.framebufferTextureLayer(W.DRAW_FRAMEBUFFER,W.COLOR_ATTACHMENT0,Do.__webglTexture,He,hn+nn):W.framebufferTexture2D(W.DRAW_FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,Do.__webglTexture,He),ie!==0?W.blitFramebuffer(Qe,vt,$e,ze,et,qt,$e,ze,W.COLOR_BUFFER_BIT,W.NEAREST):Kt?W.copyTexSubImage3D(Xe,He,et,qt,hn+nn,Qe,vt,$e,ze):W.copyTexSubImage2D(Xe,He,et,qt,Qe,vt,$e,ze);Fe.bindFramebuffer(W.READ_FRAMEBUFFER,null),Fe.bindFramebuffer(W.DRAW_FRAMEBUFFER,null)}else Kt?T.isDataTexture||T.isData3DTexture?W.texSubImage3D(Xe,He,et,qt,hn,$e,ze,je,jt,Rn,ln.data):q.isCompressedArrayTexture?W.compressedTexSubImage3D(Xe,He,et,qt,hn,$e,ze,je,jt,ln.data):W.texSubImage3D(Xe,He,et,qt,hn,$e,ze,je,jt,Rn,ln):T.isDataTexture?W.texSubImage2D(W.TEXTURE_2D,He,et,qt,$e,ze,jt,Rn,ln.data):T.isCompressedTexture?W.compressedTexSubImage2D(W.TEXTURE_2D,He,et,qt,ln.width,ln.height,jt,ln.data):W.texSubImage2D(W.TEXTURE_2D,He,et,qt,$e,ze,jt,Rn,ln);Fe.pixelStorei(W.UNPACK_ROW_LENGTH,ti),Fe.pixelStorei(W.UNPACK_IMAGE_HEIGHT,Rt),Fe.pixelStorei(W.UNPACK_SKIP_PIXELS,hi),Fe.pixelStorei(W.UNPACK_SKIP_ROWS,Bi),Fe.pixelStorei(W.UNPACK_SKIP_IMAGES,Oo),He===0&&q.generateMipmaps&&W.generateMipmap(Xe),Fe.unbindTexture()},this.initRenderTarget=function(T){O.get(T).__webglFramebuffer===void 0&&w.setupRenderTarget(T)},this.initTexture=function(T){T.isCubeTexture?w.setTextureCube(T,0):T.isData3DTexture?w.setTexture3D(T,0):T.isDataArrayTexture||T.isCompressedArrayTexture?w.setTexture2DArray(T,0):w.setTexture2D(T,0),Fe.unbindTexture()},this.resetState=function(){de=0,fe=0,$=null,Fe.reset(),Oe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ai}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=St._getDrawingBufferColorSpace(t),e.unpackColorSpace=St._getUnpackColorSpace()}};var su=class extends Xs{constructor(t){super(t)}parse(t,e){let n={mipmaps:[],width:0,height:0,format:null,mipmapCount:1,isCubemap:!1},i=542327876,r=131072,a=512,s=1024,l=2048,c=4096,h=8192,p=16384,m=32768,x=95,M=96;function S(xt){return xt.charCodeAt(0)+(xt.charCodeAt(1)<<8)+(xt.charCodeAt(2)<<16)+(xt.charCodeAt(3)<<24)}function y(xt){return String.fromCharCode(xt&255,xt>>8&255,xt>>16&255,xt>>24&255)}function C(xt,rt,ft,Ot){let lt=ft*Ot*4,kt=new Uint8Array(xt,rt,lt),Tt=new Uint8Array(lt),Vt=0,W=0;for(let on=0;on<Ot;on++)for(let gt=0;gt<ft;gt++){let zt=kt[W];W++;let Fe=kt[W];W++;let tn=kt[W];W++;let O=kt[W];W++,Tt[Vt]=tn,Vt++,Tt[Vt]=Fe,Vt++,Tt[Vt]=zt,Vt++,Tt[Vt]=O,Vt++}return Tt}function I(xt,rt,ft,Ot){let lt=ft*Ot*3,kt=new Uint8Array(xt,rt,lt),Tt=new Uint8Array(ft*Ot*4),Vt=0,W=0;for(let on=0;on<Ot;on++)for(let gt=0;gt<ft;gt++){let zt=kt[W];W++;let Fe=kt[W];W++;let tn=kt[W];W++,Tt[Vt]=tn,Vt++,Tt[Vt]=Fe,Vt++,Tt[Vt]=zt,Vt++,Tt[Vt]=255,Vt++}return Tt}let L=S("DXT1"),k=S("DXT3"),H=S("DXT5"),V=S("ETC1"),G=S("DX10"),E=31,B=5,Y=0,U=1,ee=2,de=3,fe=4,$=7,ae=21,J=22,Ce=23,Se=24,Ve=25,Ye=26,Ze=28,It=0,ut=new Int32Array(t,0,E);if(ut[Y]!==i)return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),n;let it,_e=ut[ae],Be=!1,Pe=!1,nt=ut[U]+4;switch(_e){case L:it=8,n.format=Tr;break;case k:it=16,n.format=Pr;break;case H:it=16,n.format=Ar;break;case V:it=8,n.format=Ra;break;case G:nt+=B*4;let rt=new Int32Array(t,(E+1)*4,B)[It];switch(rt){case M:{it=16,n.format=Na;break}case x:{it=16,n.format=La;break}default:return console.error("THREE.DDSLoader.parse: Unsupported DXGI_FORMAT code ",rt),n}break;default:if(ut[J]===32&&ut[Ce]&16711680&&ut[Se]&65280&&ut[Ve]&255&&ut[Ye]&4278190080)Be=!0,it=64,n.format=Bn;else if(ut[J]===24&&ut[Ce]&16711680&&ut[Se]&65280&&ut[Ve]&255)Pe=!0,it=64,n.format=Bn;else return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",y(_e)),n}n.mipmapCount=1,ut[ee]&r&&e!==!1&&(n.mipmapCount=Math.max(1,ut[$]));let ot=ut[Ze];if(n.isCubemap=!!(ot&a),n.isCubemap&&(!(ot&s)||!(ot&l)||!(ot&c)||!(ot&h)||!(ot&p)||!(ot&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),n;n.width=ut[fe],n.height=ut[de];let at=n.isCubemap?6:1;for(let xt=0;xt<at;xt++){let rt=n.width,ft=n.height;for(let Ot=0;Ot<n.mipmapCount;Ot++){let lt,kt;Be?(lt=C(t,nt,rt,ft),kt=lt.length):Pe?(lt=I(t,nt,rt,ft),kt=rt*ft*3):(kt=Math.max(4,rt)/4*Math.max(4,ft)/4*it,lt=new Uint8Array(t,nt,kt));let Tt={data:lt,width:rt,height:ft};n.mipmaps.push(Tt),nt+=kt,rt=Math.max(rt>>1,1),ft=Math.max(ft>>1,1)}}return n}};function Up(o,t){if(t===_p)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(t===Fa||t===rl){let e=o.getIndex();if(e===null){let a=[],s=o.getAttribute("position");if(s!==void 0){for(let l=0;l<s.count;l++)a.push(l);o.setIndex(a),e=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let n=e.count-2,i=[];if(t===Fa)for(let a=1;a<=n;a++)i.push(e.getX(0)),i.push(e.getX(a)),i.push(e.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(i.push(e.getX(a)),i.push(e.getX(a+1)),i.push(e.getX(a+2))):(i.push(e.getX(a+2)),i.push(e.getX(a+1)),i.push(e.getX(a)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let r=o.clone();return r.setIndex(i),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),o}function Mv(o){let t=new Map,e=new Map,n=o.clone();return wv(o,n,function(i,r){t.set(r,i),e.set(i,r)}),n.traverse(function(i){if(!i.isSkinnedMesh)return;let r=i,a=t.get(i),s=a.skeleton.bones;r.skeleton=a.skeleton.clone(),r.bindMatrix.copy(a.bindMatrix),r.skeleton.bones=s.map(function(l){return e.get(l)}),r.bind(r.skeleton,r.bindMatrix)}),n}function wv(o,t,e){e(o,t);for(let n=0;n<o.children.length;n++)wv(o.children[n],t.children[n],e)}var lu=class extends Jo{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new $p(e)}),this.register(function(e){return new Yp(e)}),this.register(function(e){return new im(e)}),this.register(function(e){return new om(e)}),this.register(function(e){return new rm(e)}),this.register(function(e){return new Kp(e)}),this.register(function(e){return new Zp(e)}),this.register(function(e){return new Jp(e)}),this.register(function(e){return new Qp(e)}),this.register(function(e){return new qp(e)}),this.register(function(e){return new em(e)}),this.register(function(e){return new jp(e)}),this.register(function(e){return new nm(e)}),this.register(function(e){return new tm(e)}),this.register(function(e){return new Wp(e)}),this.register(function(e){return new cu(e,Et.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new cu(e,Et.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new am(e)})}load(t,e,n,i){let r=this,a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){let c=Ao.extractUrlBase(t);a=Ao.resolveURL(c,this.path)}else a=Ao.extractUrlBase(t);this.manager.itemStart(t);let s=function(c){i?i(c):console.error(c),r.manager.itemError(t),r.manager.itemEnd(t)},l=new Mr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,function(c){try{r.parse(c,a,function(h){e(h),r.manager.itemEnd(t)},s)}catch(h){s(h)}},n,s)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,n,i){let r,a={},s={},l=new TextDecoder;if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(l.decode(new Uint8Array(t,0,4))===Av){try{a[Et.KHR_BINARY_GLTF]=new sm(t)}catch(p){i&&i(p);return}r=JSON.parse(a[Et.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(t));else r=t;if(r.asset===void 0||r.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new mm(r,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){let p=this.pluginCallbacks[h](c);p.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),s[p.name]=p,a[p.name]=!0}if(r.extensionsUsed)for(let h=0;h<r.extensionsUsed.length;++h){let p=r.extensionsUsed[h],m=r.extensionsRequired||[];switch(p){case Et.KHR_MATERIALS_UNLIT:a[p]=new Xp;break;case Et.KHR_DRACO_MESH_COMPRESSION:a[p]=new lm(r,this.dracoLoader);break;case Et.KHR_TEXTURE_TRANSFORM:a[p]=new cm;break;case Et.KHR_MESH_QUANTIZATION:a[p]=new dm;break;default:m.indexOf(p)>=0&&s[p]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+p+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(n,i)}parseAsync(t,e){let n=this;return new Promise(function(i,r){n.parse(t,e,i,r)})}};function cA(){let o={};return{get:function(t){return o[t]},add:function(t,e){o[t]=e},remove:function(t){delete o[t]},removeAll:function(){o={}}}}function gn(o,t,e){let n=o.json.materials[t];return n.extensions&&n.extensions[e]?n.extensions[e]:null}var Et={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Wp=class{constructor(t){this.parser=t,this.name=Et.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let t=this.parser,e=this.parser.json.nodes||[];for(let n=0,i=e.length;n<i;n++){let r=e[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(t){let e=this.parser,n="light:"+t,i=e.cache.get(n);if(i)return i;let r=e.json,l=((r.extensions&&r.extensions[this.name]||{}).lights||[])[t],c,h=new dt(16777215);l.color!==void 0&&h.setRGB(l.color[0],l.color[1],l.color[2],Xn);let p=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new Po(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Ks(h),c.distance=p;break;case"spot":c=new js(h),c.distance=p,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),so(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=e.createUniqueName(l.name||"light_"+t),i=Promise.resolve(c),e.cache.add(n,i),i}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){let e=this,n=this.parser,r=n.json.nodes[t],s=(r.extensions&&r.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(l){return n._getNodeRef(e.cache,s,l)})}},Xp=class{constructor(){this.name=Et.KHR_MATERIALS_UNLIT}getMaterialType(){return ci}extendParams(t,e,n){let i=[];t.color=new dt(1,1,1),t.opacity=1;let r=e.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){let a=r.baseColorFactor;t.color.setRGB(a[0],a[1],a[2],Xn),t.opacity=a[3]}r.baseColorTexture!==void 0&&i.push(n.assignTexture(t,"map",r.baseColorTexture,dn))}return Promise.all(i)}},qp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);return n===null||n.emissiveStrength!==void 0&&(e.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},$p=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];if(n.clearcoatFactor!==void 0&&(e.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&i.push(this.parser.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&i.push(this.parser.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(i.push(this.parser.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let r=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new At(r,r)}return Promise.all(i)}},Yp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_DISPERSION}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);return n===null||(e.dispersion=n.dispersion!==void 0?n.dispersion:0),Promise.resolve()}},jp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];return n.iridescenceFactor!==void 0&&(e.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&i.push(this.parser.assignTexture(e,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(e.iridescenceIOR=n.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&i.push(this.parser.assignTexture(e,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(i)}},Kp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_SHEEN}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];if(e.sheenColor=new dt(0,0,0),e.sheenRoughness=0,e.sheen=1,n.sheenColorFactor!==void 0){let r=n.sheenColorFactor;e.sheenColor.setRGB(r[0],r[1],r[2],Xn)}return n.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&i.push(this.parser.assignTexture(e,"sheenColorMap",n.sheenColorTexture,dn)),n.sheenRoughnessTexture!==void 0&&i.push(this.parser.assignTexture(e,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(i)}},Zp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];return n.transmissionFactor!==void 0&&(e.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&i.push(this.parser.assignTexture(e,"transmissionMap",n.transmissionTexture)),Promise.all(i)}},Jp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_VOLUME}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];e.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&i.push(this.parser.assignTexture(e,"thicknessMap",n.thicknessTexture)),e.attenuationDistance=n.attenuationDistance||1/0;let r=n.attenuationColor||[1,1,1];return e.attenuationColor=new dt().setRGB(r[0],r[1],r[2],Xn),Promise.all(i)}},Qp=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_IOR}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);return n===null||(e.ior=n.ior!==void 0?n.ior:1.5,e.ior===0&&(e.ior=1e3)),Promise.resolve()}},em=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_SPECULAR}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];e.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&i.push(this.parser.assignTexture(e,"specularIntensityMap",n.specularTexture));let r=n.specularColorFactor||[1,1,1];return e.specularColor=new dt().setRGB(r[0],r[1],r[2],Xn),n.specularColorTexture!==void 0&&i.push(this.parser.assignTexture(e,"specularColorMap",n.specularColorTexture,dn)),Promise.all(i)}},tm=class{constructor(t){this.parser=t,this.name=Et.EXT_MATERIALS_BUMP}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];return e.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&i.push(this.parser.assignTexture(e,"bumpMap",n.bumpTexture)),Promise.all(i)}},nm=class{constructor(t){this.parser=t,this.name=Et.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){return gn(this.parser,t,this.name)!==null?Zn:null}extendMaterialParams(t,e){let n=gn(this.parser,t,this.name);if(n===null)return Promise.resolve();let i=[];return n.anisotropyStrength!==void 0&&(e.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(e.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&i.push(this.parser.assignTexture(e,"anisotropyMap",n.anisotropyTexture)),Promise.all(i)}},im=class{constructor(t){this.parser=t,this.name=Et.KHR_TEXTURE_BASISU}loadTexture(t){let e=this.parser,n=e.json,i=n.textures[t];if(!i.extensions||!i.extensions[this.name])return null;let r=i.extensions[this.name],a=e.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,a)}},om=class{constructor(t){this.parser=t,this.name=Et.EXT_TEXTURE_WEBP}loadTexture(t){let e=this.name,n=this.parser,i=n.json,r=i.textures[t];if(!r.extensions||!r.extensions[e])return null;let a=r.extensions[e],s=i.images[a.source],l=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);c!==null&&(l=c)}return n.loadTextureImage(t,a.source,l)}},rm=class{constructor(t){this.parser=t,this.name=Et.EXT_TEXTURE_AVIF}loadTexture(t){let e=this.name,n=this.parser,i=n.json,r=i.textures[t];if(!r.extensions||!r.extensions[e])return null;let a=r.extensions[e],s=i.images[a.source],l=n.textureLoader;if(s.uri){let c=n.options.manager.getHandler(s.uri);c!==null&&(l=c)}return n.loadTextureImage(t,a.source,l)}},cu=class{constructor(t,e){this.name=e,this.parser=t}loadBufferView(t){let e=this.parser.json,n=e.bufferViews[t];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(s){let l=i.byteOffset||0,c=i.byteLength||0,h=i.count,p=i.byteStride,m=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(h,p,m,i.mode,i.filter).then(function(x){return x.buffer}):a.ready.then(function(){let x=new ArrayBuffer(h*p);return a.decodeGltfBuffer(new Uint8Array(x),h,p,m,i.mode,i.filter),x})})}else return null}},am=class{constructor(t){this.name=Et.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){let e=this.parser.json,n=e.nodes[t];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let i=e.meshes[n.mesh];for(let c of i.primitives)if(c.mode!==vi.TRIANGLES&&c.mode!==vi.TRIANGLE_STRIP&&c.mode!==vi.TRIANGLE_FAN&&c.mode!==void 0)return null;let a=n.extensions[this.name].attributes,s=[],l={};for(let c in a)s.push(this.parser.getDependency("accessor",a[c]).then(h=>(l[c]=h,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(t)),Promise.all(s).then(c=>{let h=c.pop(),p=h.isGroup?h.children:[h],m=c[0].count,x=[];for(let M of p){let S=new Ct,y=new j,C=new ai,I=new j(1,1,1),L=new Ls(M.geometry,M.material,m);for(let k=0;k<m;k++)l.TRANSLATION&&y.fromBufferAttribute(l.TRANSLATION,k),l.ROTATION&&C.fromBufferAttribute(l.ROTATION,k),l.SCALE&&I.fromBufferAttribute(l.SCALE,k),L.setMatrixAt(k,S.compose(y,C,I));for(let k in l)if(k==="_COLOR_0"){let H=l[k];L.instanceColor=new $o(H.array,H.itemSize,H.normalized)}else k!=="TRANSLATION"&&k!=="ROTATION"&&k!=="SCALE"&&M.geometry.setAttribute(k,l[k]);En.prototype.copy.call(L,M),this.parser.assignFinalMaterial(L),x.push(L)}return h.isGroup?(h.clear(),h.add(...x),h):x[0]}))}},Av="glTF",cl=12,Sv={JSON:1313821514,BIN:5130562},sm=class{constructor(t){this.name=Et.KHR_BINARY_GLTF,this.content=null,this.body=null;let e=new DataView(t,0,cl),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Av)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let i=this.header.length-cl,r=new DataView(t,cl),a=0;for(;a<i;){let s=r.getUint32(a,!0);a+=4;let l=r.getUint32(a,!0);if(a+=4,l===Sv.JSON){let c=new Uint8Array(t,cl+a,s);this.content=n.decode(c)}else if(l===Sv.BIN){let c=cl+a;this.body=t.slice(c,c+s)}a+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}},lm=class{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Et.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){let n=this.json,i=this.dracoLoader,r=t.extensions[this.name].bufferView,a=t.extensions[this.name].attributes,s={},l={},c={};for(let h in a){let p=hm[h]||h.toLowerCase();s[p]=a[h]}for(let h in t.attributes){let p=hm[h]||h.toLowerCase();if(a[h]!==void 0){let m=n.accessors[t.attributes[h]],x=za[m.componentType];c[p]=x.name,l[p]=m.normalized===!0}}return e.getDependency("bufferView",r).then(function(h){return new Promise(function(p,m){i.decodeDracoFile(h,function(x){for(let M in x.attributes){let S=x.attributes[M],y=l[M];y!==void 0&&(S.normalized=y)}p(x)},s,c,Xn,m)})})}},cm=class{constructor(){this.name=Et.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}},dm=class{constructor(){this.name=Et.KHR_MESH_QUANTIZATION}},du=class extends Qi{constructor(t,e,n,i){super(t,e,n,i)}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i*3+i;for(let a=0;a!==i;a++)e[a]=n[r+a];return e}interpolate_(t,e,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=s*2,c=s*3,h=i-e,p=(n-e)/h,m=p*p,x=m*p,M=t*c,S=M-c,y=-2*x+3*m,C=x-m,I=1-y,L=C-m+p;for(let k=0;k!==s;k++){let H=a[S+k+s],V=a[S+k+l]*h,G=a[M+k+s],E=a[M+k]*h;r[k]=I*H+L*V+y*G+C*E}return r}},dA=new ai,um=class extends du{interpolate_(t,e,n,i){let r=super.interpolate_(t,e,n,i);return dA.fromArray(r).normalize().toArray(r),r}},vi={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},za={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ev={9728:fn,9729:sn,9984:gd,9985:Oa,9986:Er,9987:Ni},Tv={33071:gi,33648:fa,10497:ki},zp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hm={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},er={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},uA={CUBICSPLINE:void 0,LINEAR:xr,STEP:vr},Hp={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function hA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new So({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Di})),o.DefaultMaterial}function Dr(o,t,e){for(let n in e.extensions)o[n]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=e.extensions[n])}function so(o,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(o.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function pA(o,t,e){let n=!1,i=!1,r=!1;for(let c=0,h=t.length;c<h;c++){let p=t[c];if(p.POSITION!==void 0&&(n=!0),p.NORMAL!==void 0&&(i=!0),p.COLOR_0!==void 0&&(r=!0),n&&i&&r)break}if(!n&&!i&&!r)return Promise.resolve(o);let a=[],s=[],l=[];for(let c=0,h=t.length;c<h;c++){let p=t[c];if(n){let m=p.POSITION!==void 0?e.getDependency("accessor",p.POSITION):o.attributes.position;a.push(m)}if(i){let m=p.NORMAL!==void 0?e.getDependency("accessor",p.NORMAL):o.attributes.normal;s.push(m)}if(r){let m=p.COLOR_0!==void 0?e.getDependency("accessor",p.COLOR_0):o.attributes.color;l.push(m)}}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(l)]).then(function(c){let h=c[0],p=c[1],m=c[2];return n&&(o.morphAttributes.position=h),i&&(o.morphAttributes.normal=p),r&&(o.morphAttributes.color=m),o.morphTargetsRelative=!0,o})}function mA(o,t){if(o.updateMorphTargets(),t.weights!==void 0)for(let e=0,n=t.weights.length;e<n;e++)o.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){let e=t.extras.targetNames;if(o.morphTargetInfluences.length===e.length){o.morphTargetDictionary={};for(let n=0,i=e.length;n<i;n++)o.morphTargetDictionary[e[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function fA(o){let t,e=o.extensions&&o.extensions[Et.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+Gp(e.attributes):t=o.indices+":"+Gp(o.attributes)+":"+o.mode,o.targets!==void 0)for(let n=0,i=o.targets.length;n<i;n++)t+=":"+Gp(o.targets[n]);return t}function Gp(o){let t="",e=Object.keys(o).sort();for(let n=0,i=e.length;n<i;n++)t+=e[n]+":"+o[e[n]]+";";return t}function pm(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function gA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":o.search(/\.ktx2($|\?)/i)>0||o.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}var _A=new Ct,mm=class{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new cA,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,r=!1,a=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){let s=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(s)===!0;let l=s.match(/Version\/(\d+)/);i=n&&l?parseInt(l[1],10):-1,r=s.indexOf("Firefox")>-1,a=r?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||r&&a<98?this.textureLoader=new qs(this.options.manager):this.textureLoader=new Js(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){let n=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){let s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:n,userData:{}};return Dr(r,s,i),so(s,i),Promise.all(n._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(let l of s.scenes)l.updateMatrixWorld();t(s)})}).catch(e)}_markDefs(){let t=this.json.nodes||[],e=this.json.skins||[],n=this.json.meshes||[];for(let i=0,r=e.length;i<r;i++){let a=e[i].joints;for(let s=0,l=a.length;s<l;s++)t[a[s]].isBone=!0}for(let i=0,r=t.length;i<r;i++){let a=t[i];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,n){if(t.refs[e]<=1)return n;let i=n.clone(),r=(a,s)=>{let l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(let[c,h]of a.children.entries())r(h,s.children[c])};return r(n,i),i.name+="_instance_"+t.uses[e]++,i}_invokeOne(t){let e=Object.values(this.plugins);e.push(this);for(let n=0;n<e.length;n++){let i=t(e[n]);if(i)return i}return null}_invokeAll(t){let e=Object.values(this.plugins);e.unshift(this);let n=[];for(let i=0;i<e.length;i++){let r=t(e[i]);r&&n.push(r)}return n}getDependency(t,e){let n=t+":"+e,i=this.cache.get(n);if(!i){switch(t){case"scene":i=this.loadScene(e);break;case"node":i=this._invokeOne(function(r){return r.loadNode&&r.loadNode(e)});break;case"mesh":i=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(e)});break;case"accessor":i=this.loadAccessor(e);break;case"bufferView":i=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(e)});break;case"buffer":i=this.loadBuffer(e);break;case"material":i=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(e)});break;case"texture":i=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(e)});break;case"skin":i=this.loadSkin(e);break;case"animation":i=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(e)});break;case"camera":i=this.loadCamera(e);break;default:if(i=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(t,e)}),!i)throw new Error("Unknown type: "+t);break}this.cache.add(n,i)}return i}getDependencies(t){let e=this.cache.get(t);if(!e){let n=this,i=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(i.map(function(r,a){return n.getDependency(t,a)})),this.cache.add(t,e)}return e}loadBuffer(t){let e=this.json.buffers[t],n=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[Et.KHR_BINARY_GLTF].body);let i=this.options;return new Promise(function(r,a){n.load(Ao.resolveURL(e.uri,i.path),r,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){let e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(n){let i=e.byteLength||0,r=e.byteOffset||0;return n.slice(r,r+i)})}loadAccessor(t){let e=this,n=this.json,i=this.json.accessors[t];if(i.bufferView===void 0&&i.sparse===void 0){let a=zp[i.type],s=za[i.componentType],l=i.normalized===!0,c=new s(i.count*a);return Promise.resolve(new bn(c,a,l))}let r=[];return i.bufferView!==void 0?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),i.sparse!==void 0&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then(function(a){let s=a[0],l=zp[i.type],c=za[i.componentType],h=c.BYTES_PER_ELEMENT,p=h*l,m=i.byteOffset||0,x=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,M=i.normalized===!0,S,y;if(x&&x!==p){let C=Math.floor(m/x),I="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+C+":"+i.count,L=e.cache.get(I);L||(S=new c(s,C*x,i.count*x/h),L=new Ca(S,x/h),e.cache.add(I,L)),y=new Ma(L,l,m%x/h,M)}else s===null?S=new c(i.count*l):S=new c(s,m,i.count*l),y=new bn(S,l,M);if(i.sparse!==void 0){let C=zp.SCALAR,I=za[i.sparse.indices.componentType],L=i.sparse.indices.byteOffset||0,k=i.sparse.values.byteOffset||0,H=new I(a[1],L,i.sparse.count*C),V=new c(a[2],k,i.sparse.count*l);s!==null&&(y=new bn(y.array.slice(),y.itemSize,y.normalized)),y.normalized=!1;for(let G=0,E=H.length;G<E;G++){let B=H[G];if(y.setX(B,V[G*l]),l>=2&&y.setY(B,V[G*l+1]),l>=3&&y.setZ(B,V[G*l+2]),l>=4&&y.setW(B,V[G*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}y.normalized=M}return y})}loadTexture(t){let e=this.json,n=this.options,r=e.textures[t].source,a=e.images[r],s=this.textureLoader;if(a.uri){let l=n.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(t,r,s)}loadTextureImage(t,e,n){let i=this,r=this.json,a=r.textures[t],s=r.images[e],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=this.loadImageSource(e,n).then(function(h){h.flipY=!1,h.name=a.name||s.name||"",h.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(h.name=s.uri);let m=(r.samplers||{})[a.sampler]||{};return h.magFilter=Ev[m.magFilter]||sn,h.minFilter=Ev[m.minFilter]||Ni,h.wrapS=Tv[m.wrapS]||ki,h.wrapT=Tv[m.wrapT]||ki,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==fn&&h.minFilter!==sn,i.associations.set(h,{textures:t}),h}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(t,e){let n=this,i=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(p=>p.clone());let a=i.images[t],s=self.URL||self.webkitURL,l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=n.getDependency("bufferView",a.bufferView).then(function(p){c=!0;let m=new Blob([p],{type:a.mimeType});return l=s.createObjectURL(m),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");let h=Promise.resolve(l).then(function(p){return new Promise(function(m,x){let M=m;e.isImageBitmapLoader===!0&&(M=function(S){let y=new ei(S);y.needsUpdate=!0,m(y)}),e.load(Ao.resolveURL(p,r.path),M,void 0,x)})}).then(function(p){return c===!0&&s.revokeObjectURL(l),so(p,a),p.userData.mimeType=a.mimeType||gA(a.uri),p}).catch(function(p){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),p});return this.sourceCache[t]=h,h}assignTexture(t,e,n,i){let r=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),r.extensions[Et.KHR_TEXTURE_TRANSFORM]){let s=n.extensions!==void 0?n.extensions[Et.KHR_TEXTURE_TRANSFORM]:void 0;if(s){let l=r.associations.get(a);a=r.extensions[Et.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),r.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),t[e]=a,a})}assignFinalMaterial(t){let e=t.geometry,n=t.material,i=e.attributes.tangent===void 0,r=e.attributes.color!==void 0,a=e.attributes.normal===void 0;if(t.isPoints){let s="PointsMaterial:"+n.uuid,l=this.cache.get(s);l||(l=new Pa,Kn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(s,l)),n=l}else if(t.isLine){let s="LineBasicMaterial:"+n.uuid,l=this.cache.get(s);l||(l=new Ta,Kn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,this.cache.add(s,l)),n=l}if(i||r||a){let s="ClonedMaterial:"+n.uuid+":";i&&(s+="derivative-tangents:"),r&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=n.clone(),r&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(n))),n=l}t.material=n}getMaterialType(){return So}loadMaterial(t){let e=this,n=this.json,i=this.extensions,r=n.materials[t],a,s={},l=r.extensions||{},c=[];if(l[Et.KHR_MATERIALS_UNLIT]){let p=i[Et.KHR_MATERIALS_UNLIT];a=p.getMaterialType(),c.push(p.extendParams(s,r,e))}else{let p=r.pbrMetallicRoughness||{};if(s.color=new dt(1,1,1),s.opacity=1,Array.isArray(p.baseColorFactor)){let m=p.baseColorFactor;s.color.setRGB(m[0],m[1],m[2],Xn),s.opacity=m[3]}p.baseColorTexture!==void 0&&c.push(e.assignTexture(s,"map",p.baseColorTexture,dn)),s.metalness=p.metallicFactor!==void 0?p.metallicFactor:1,s.roughness=p.roughnessFactor!==void 0?p.roughnessFactor:1,p.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(s,"metalnessMap",p.metallicRoughnessTexture)),c.push(e.assignTexture(s,"roughnessMap",p.metallicRoughnessTexture))),a=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(t,s)})))}r.doubleSided===!0&&(s.side=_i);let h=r.alphaMode||Hp.OPAQUE;if(h===Hp.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,h===Hp.MASK&&(s.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&a!==ci&&(c.push(e.assignTexture(s,"normalMap",r.normalTexture)),s.normalScale=new At(1,1),r.normalTexture.scale!==void 0)){let p=r.normalTexture.scale;s.normalScale.set(p,p)}if(r.occlusionTexture!==void 0&&a!==ci&&(c.push(e.assignTexture(s,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&a!==ci){let p=r.emissiveFactor;s.emissive=new dt().setRGB(p[0],p[1],p[2],Xn)}return r.emissiveTexture!==void 0&&a!==ci&&c.push(e.assignTexture(s,"emissiveMap",r.emissiveTexture,dn)),Promise.all(c).then(function(){let p=new a(s);return r.name&&(p.name=r.name),so(p,r),e.associations.set(p,{materials:t}),r.extensions&&Dr(i,p,r),p})}createUniqueName(t){let e=rn.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){let e=this,n=this.extensions,i=this.primitiveCache;function r(s){return n[Et.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,e).then(function(l){return Pv(l,s,e)})}let a=[];for(let s=0,l=t.length;s<l;s++){let c=t[s],h=fA(c),p=i[h];if(p)a.push(p.promise);else{let m;c.extensions&&c.extensions[Et.KHR_DRACO_MESH_COMPRESSION]?m=r(c):m=Pv(new qn,c,e),i[h]={primitive:c,promise:m},a.push(m)}}return Promise.all(a)}loadMesh(t){let e=this,n=this.json,i=this.extensions,r=n.meshes[t],a=r.primitives,s=[];for(let l=0,c=a.length;l<c;l++){let h=a[l].material===void 0?hA(this.cache):this.getDependency("material",a[l].material);s.push(h)}return s.push(e.loadGeometries(a)),Promise.all(s).then(function(l){let c=l.slice(0,l.length-1),h=l[l.length-1],p=[];for(let x=0,M=h.length;x<M;x++){let S=h[x],y=a[x],C,I=c[x];if(y.mode===vi.TRIANGLES||y.mode===vi.TRIANGLE_STRIP||y.mode===vi.TRIANGLE_FAN||y.mode===void 0)C=r.isSkinnedMesh===!0?new Rs(S,I):new kn(S,I),C.isSkinnedMesh===!0&&C.normalizeSkinWeights(),y.mode===vi.TRIANGLE_STRIP?C.geometry=Up(C.geometry,rl):y.mode===vi.TRIANGLE_FAN&&(C.geometry=Up(C.geometry,Fa));else if(y.mode===vi.LINES)C=new Fs(S,I);else if(y.mode===vi.LINE_STRIP)C=new Cr(S,I);else if(y.mode===vi.LINE_LOOP)C=new Vs(S,I);else if(y.mode===vi.POINTS)C=new Bs(S,I);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(C.geometry.morphAttributes).length>0&&mA(C,r),C.name=e.createUniqueName(r.name||"mesh_"+t),so(C,r),y.extensions&&Dr(i,C,y),e.assignFinalMaterial(C),p.push(C)}for(let x=0,M=p.length;x<M;x++)e.associations.set(p[x],{meshes:t,primitives:x});if(p.length===1)return r.extensions&&Dr(i,p[0],r),p[0];let m=new Ii;r.extensions&&Dr(i,m,r),e.associations.set(m,{meshes:t});for(let x=0,M=p.length;x<M;x++)m.add(p[x]);return m})}loadCamera(t){let e,n=this.json.cameras[t],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?e=new xn(bp.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(e=new Yo(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(e.name=this.createUniqueName(n.name)),so(e,n),Promise.resolve(e)}loadSkin(t){let e=this.json.skins[t],n=[];for(let i=0,r=e.joints.length;i<r;i++)n.push(this._loadNodeShallow(e.joints[i]));return e.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",e.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){let r=i.pop(),a=i,s=[],l=[];for(let c=0,h=a.length;c<h;c++){let p=a[c];if(p){s.push(p);let m=new Ct;r!==null&&m.fromArray(r.array,c*16),l.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Ns(s,l)})}loadAnimation(t){let e=this.json,n=this,i=e.animations[t],r=i.name?i.name:"animation_"+t,a=[],s=[],l=[],c=[],h=[];for(let p=0,m=i.channels.length;p<m;p++){let x=i.channels[p],M=i.samplers[x.sampler],S=x.target,y=S.node,C=i.parameters!==void 0?i.parameters[M.input]:M.input,I=i.parameters!==void 0?i.parameters[M.output]:M.output;S.node!==void 0&&(a.push(this.getDependency("node",y)),s.push(this.getDependency("accessor",C)),l.push(this.getDependency("accessor",I)),c.push(M),h.push(S))}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(l),Promise.all(c),Promise.all(h)]).then(function(p){let m=p[0],x=p[1],M=p[2],S=p[3],y=p[4],C=[];for(let L=0,k=m.length;L<k;L++){let H=m[L],V=x[L],G=M[L],E=S[L],B=y[L];if(H===void 0)continue;H.updateMatrix&&H.updateMatrix();let Y=n._createAnimationTracks(H,V,G,E,B);if(Y)for(let U=0;U<Y.length;U++)C.push(Y[U])}let I=new Ws(r,void 0,C);return so(I,i),I})}createNodeMesh(t){let e=this.json,n=this,i=e.nodes[t];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(r){let a=n._getNodeRef(n.meshCache,i.mesh,r);return i.weights!==void 0&&a.traverse(function(s){if(s.isMesh)for(let l=0,c=i.weights.length;l<c;l++)s.morphTargetInfluences[l]=i.weights[l]}),a})}loadNode(t){let e=this.json,n=this,i=e.nodes[t],r=n._loadNodeShallow(t),a=[],s=i.children||[];for(let c=0,h=s.length;c<h;c++)a.push(n.getDependency("node",s[c]));let l=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([r,Promise.all(a),l]).then(function(c){let h=c[0],p=c[1],m=c[2];m!==null&&h.traverse(function(x){x.isSkinnedMesh&&x.bind(m,_A)});for(let x=0,M=p.length;x<M;x++)h.add(p[x]);if(h.userData.pivot!==void 0&&p.length>0){let x=h.userData.pivot,M=p[0];h.pivot=new j().fromArray(x),h.position.x-=x[0],h.position.y-=x[1],h.position.z-=x[2],M.position.set(0,0,0),delete h.userData.pivot}return h})}_loadNodeShallow(t){let e=this.json,n=this.extensions,i=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];let r=e.nodes[t],a=r.name?i.createUniqueName(r.name):"",s=[],l=i._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return l&&s.push(l),r.camera!==void 0&&s.push(i.getDependency("camera",r.camera).then(function(c){return i._getNodeRef(i.cameraCache,r.camera,c)})),i._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){s.push(c)}),this.nodeCache[t]=Promise.all(s).then(function(c){let h;if(r.isBone===!0?h=new wa:c.length>1?h=new Ii:c.length===1?h=c[0]:h=new En,h!==c[0])for(let p=0,m=c.length;p<m;p++)h.add(c[p]);if(r.name&&(h.userData.name=r.name,h.name=a),so(h,r),r.extensions&&Dr(n,h,r),r.matrix!==void 0){let p=new Ct;p.fromArray(r.matrix),h.applyMatrix4(p)}else r.translation!==void 0&&h.position.fromArray(r.translation),r.rotation!==void 0&&h.quaternion.fromArray(r.rotation),r.scale!==void 0&&h.scale.fromArray(r.scale);if(!i.associations.has(h))i.associations.set(h,{});else if(r.mesh!==void 0&&i.meshCache.refs[r.mesh]>1){let p=i.associations.get(h);i.associations.set(h,he({},p))}return i.associations.get(h).nodes=t,h}),this.nodeCache[t]}loadScene(t){let e=this.extensions,n=this.json.scenes[t],i=this,r=new Ii;n.name&&(r.name=i.createUniqueName(n.name)),so(r,n),n.extensions&&Dr(e,r,n);let a=n.nodes||[],s=[];for(let l=0,c=a.length;l<c;l++)s.push(i.getDependency("node",a[l]));return Promise.all(s).then(function(l){for(let h=0,p=l.length;h<p;h++){let m=l[h];m.parent!==null?r.add(Mv(m)):r.add(m)}let c=h=>{let p=new Map;for(let[m,x]of i.associations)(m instanceof Kn||m instanceof ei)&&p.set(m,x);return h.traverse(m=>{let x=i.associations.get(m);x!=null&&p.set(m,x)}),p};return i.associations=c(r),r})}_createAnimationTracks(t,e,n,i,r){let a=[],s=t.name?t.name:t.uuid,l=[];function c(x){x.morphTargetInfluences&&l.push(x.name?x.name:x.uuid)}er[r.path]===er.weights?(c(t),t.isGroup&&t.children.forEach(c)):l.push(s);let h;switch(er[r.path]){case er.weights:h=eo;break;case er.rotation:h=to;break;case er.translation:case er.scale:h=no;break;default:n.itemSize===1?h=eo:h=no;break}let p=i.interpolation!==void 0?uA[i.interpolation]:xr,m=this._getArrayFromAccessor(n);for(let x=0,M=l.length;x<M;x++){let S=new h(l[x]+"."+er[r.path],e.array,m,p);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(S),a.push(S)}return a}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){let n=pm(e.constructor),i=new Float32Array(e.length);for(let r=0,a=e.length;r<a;r++)i[r]=e[r]*n;e=i}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(n){let i=this instanceof to?um:du;return new i(this.times,this.values,this.getValueSize()/3,n)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function vA(o,t,e){let n=t.attributes,i=new li;if(n.POSITION!==void 0){let s=e.json.accessors[n.POSITION],l=s.min,c=s.max;if(l!==void 0&&c!==void 0){if(i.set(new j(l[0],l[1],l[2]),new j(c[0],c[1],c[2])),s.normalized){let h=pm(za[s.componentType]);i.min.multiplyScalar(h),i.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let r=t.targets;if(r!==void 0){let s=new j,l=new j;for(let c=0,h=r.length;c<h;c++){let p=r[c];if(p.POSITION!==void 0){let m=e.json.accessors[p.POSITION],x=m.min,M=m.max;if(x!==void 0&&M!==void 0){if(l.setX(Math.max(Math.abs(x[0]),Math.abs(M[0]))),l.setY(Math.max(Math.abs(x[1]),Math.abs(M[1]))),l.setZ(Math.max(Math.abs(x[2]),Math.abs(M[2]))),m.normalized){let S=pm(za[m.componentType]);l.multiplyScalar(S)}s.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(s)}o.boundingBox=i;let a=new jn;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,o.boundingSphere=a}function Pv(o,t,e){let n=t.attributes,i=[];function r(a,s){return e.getDependency("accessor",a).then(function(l){o.setAttribute(s,l)})}for(let a in n){let s=hm[a]||a.toLowerCase();s in o.attributes||i.push(r(n[a],s))}if(t.indices!==void 0&&!o.index){let a=e.getDependency("accessor",t.indices).then(function(s){o.setIndex(s)});i.push(a)}return St.workingColorSpace!==Xn&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${St.workingColorSpace}" not supported.`),so(o,t),vA(o,t,e),Promise.all(i).then(function(){return t.targets!==void 0?pA(o,t.targets,e):o})}var xA=["tagsElement"],bA=["thumbCanvas"],yA=(o,t)=>t.category.componentId,CA=(o,t)=>t.id;function MA(o,t){if(o&1){let e=Z();v(0,"button",25),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectTab(i))}),u(1),b()}if(o&2){let e=t.$implicit,n=g(3);oe("active",n.selectedTab()===e),d(),me(" ",e.category.name," ")}}function wA(o,t){if(o&1&&(v(0,"nav",8),ve(1,MA,2,3,"button",24,ct),b()),o&2){let e=g();d(),xe(e.tabs)}}function SA(o,t){if(o&1){let e=Z();v(0,"section",9)(1,"input",26),ne("input",function(i){P(e);let r=g(2);return A(r.updateFilterName((i.target.value||"").toString()))}),b(),v(2,"input",27),ne("input",function(i){P(e);let r=g(2);return A(r.updateFilterDrawableId((i.target.value||"").toString()))}),b(),v(3,"input",28),ne("input",function(i){P(e);let r=g(2);return A(r.updateFilterTextureId((i.target.value||"").toString()))}),b()()}if(o&2){let e=g(2);d(),Ee("value",e.filter().name),d(),Ee("value",e.filter().drawableId),d(),Ee("value",e.filter().textureId)}}function EA(o,t){if(o&1){let e=Z();v(0,"button",31),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.toggleTag(i))}),v(1,"span",6),u(2,"sell"),b(),v(3,"span"),u(4),b()()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.isTagEnabled(e)),d(4),D(e)}}function TA(o,t){if(o&1&&(v(0,"section",10)(1,"div",29,1),ve(3,EA,5,3,"button",30,ct),b()()),o&2){let e=g(2);d(3),xe(e.selectedTabTags())}}function PA(o,t){if(o&1){let e=Z();v(0,"label",32)(1,"div",33)(2,"span"),u(3),b(),v(4,"strong"),u(5),b()(),v(6,"input",34),ne("input",function(i){let r=P(e).$implicit,a=g(3);return A(a.onAlternateSliderInput(r,(i.target.value||"0").toString()))})("change",function(i){let r=P(e).$implicit,a=g(3);return A(a.onAlternateSliderChange(r,(i.target.value||"0").toString()))}),b()()}if(o&2){let e=t.$implicit,n=g(3);d(3),D(e.category.name),d(2),D(n.alternateCounter(e)),d(),Ee("max",n.alternateSliderMax(e))("value",n.alternateSliderIndex(e))("disabled",n.alternateSliderMax(e)===0)}}function AA(o,t){if(o&1&&(v(0,"section",11),ve(1,PA,7,5,"label",32,yA),b()),o&2){let e=g(2);d(),xe(e.alternateTabs())}}function IA(o,t){o&1&&(v(0,"span",42),u(1,"star"),b())}function OA(o,t){if(o&1){let e=Z();v(0,"button",38),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectItem(i))}),Te(1,"div",39),v(2,"div",40)(3,"div",41),R(4,IA,2,0,"span",42),v(5,"span"),u(6),b()()(),v(7,"div",43),ne("click",function(i){return i.stopPropagation()}),v(8,"button",44),ne("click",function(i){let r=P(e).$implicit,a=g(3);return A(a.cycleItemTexture(r,-1,i))}),v(9,"span",6),u(10,"chevron_left"),b()(),v(11,"span",45),u(12),b(),v(13,"button",46),ne("click",function(i){let r=P(e).$implicit,a=g(3);return A(a.cycleItemTexture(r,1,i))}),v(14,"span",6),u(15,"chevron_right"),b()()()()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.isItemSelected(e)),d(),Dt("background-image",n.itemImage(e)),d(3),N(e.recommended?4:-1),d(2),D(e.name),d(2),Ee("disabled",!n.itemHasTextureControls(e)),d(4),D(n.textureCounterLabel(e)),d(),Ee("disabled",!n.itemHasTextureControls(e))}}function DA(o,t){if(o&1&&(v(0,"section",35)(1,"div",36),ve(2,OA,16,9,"button",37,CA),b()()),o&2){let e=g(2);oe("disabled",e.loadingItems()),d(2),xe(e.items())}}function kA(o,t){if(o&1){let e=Z();v(0,"button",52),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.loadItems(i))}),u(1),b()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.pageIsCurrent(e)),d(),D(e)}}function RA(o,t){if(o&1&&(v(0,"div",51),u(1),b()),o&2){let e=g(3);d(),D(e.page())}}function NA(o,t){if(o&1){let e=Z();v(0,"button",52),ne("click",function(){P(e);let i=g(3);return A(i.loadItems(i.midPages()))}),u(1),b()}if(o&2){let e=g(3);oe("selected",e.midPages()===e.page()),d(),D(e.midPages())}}function LA(o,t){if(o&1&&(v(0,"div",51),u(1),b()),o&2){let e=g(3);d(),D(e.page())}}function FA(o,t){if(o&1){let e=Z();v(0,"button",52),ne("click",function(){P(e);let i=g(3);return A(i.loadItems(i.pages()))}),u(1),b()}if(o&2){let e=g(3);oe("selected",e.pages()===e.page()),d(),D(e.pages())}}function VA(o,t){if(o&1){let e=Z();v(0,"section",47)(1,"button",48),ne("click",function(){P(e);let i=g(2);return A(i.loadItems(i.page()-1))}),v(2,"span",6),u(3,"chevron_left"),b()(),v(4,"div",49),ve(5,kA,2,3,"button",50,Ln),R(7,RA,2,1,"div",51),R(8,NA,2,3,"button",50),R(9,LA,2,1,"div",51),R(10,FA,2,3,"button",50),b(),v(11,"button",48),ne("click",function(){P(e);let i=g(2);return A(i.loadItems(i.page()+1))}),v(12,"span",6),u(13,"chevron_right"),b()()()}if(o&2){let e=g(2);oe("disabled",e.loadingItems()),d(),oe("disabled",e.page()===1),d(4),xe(e.displayPageNumbers()),d(2),N(e.shouldShowBeforeMedianCurrentPage()?7:-1),d(),N(e.midPages()?8:-1),d(),N(e.shouldShowAfterMedianCurrentPage()?9:-1),d(),N(e.pages()>10?10:-1),d(),oe("disabled",e.page()===e.pages())}}function BA(o,t){if(o&1){let e=Z();v(0,"button",59),ne("click",function(){P(e);let i=g().$implicit,r=g(2);return A(r.revert(i))}),v(1,"span",6),u(2,"undo"),b()()}}function UA(o,t){if(o&1&&(v(0,"div",16)(1,"div",53),u(2),b(),v(3,"article",54)(4,"div",55)(5,"div",56),u(6),b(),v(7,"div",57)(8,"span"),u(9),b(),R(10,BA,3,0,"button",58),b()()()()),o&2){let e=t.$implicit,n=g(2);d(2),D(n.previewHeading(e)),d(),Dt("background-image",n.componentImage(e,n.selectedComponents()[e].drawableId,n.selectedComponents()[e].textureId)),oe("changed",n.clothingSlotChanged(e)),d(3),D(n.selectedComponents()[e].name),d(3),cn("D",n.selectedComponents()[e].drawableId,"/T",n.selectedComponents()[e].textureId),d(),N(n.clothingSlotChanged(e)?10:-1)}}function zA(o,t){o&1&&(u(0," Use "),v(1,"span",60),u(2,"M"),b(),u(3," to toggle looking around. "))}function HA(o,t){o&1&&(u(0," Use "),v(1,"span",60),u(2,"ARROW KEYS"),b(),u(3," to scroll through the pages. "))}function GA(o,t){if(o&1){let e=Z();v(0,"section",3)(1,"header",4)(2,"div",5)(3,"span",6),u(4,"checkroom"),b(),v(5,"div")(6,"h2"),u(7),b(),v(8,"p"),u(9,"Outfit Store"),b()()(),v(10,"button",7),ne("click",function(){P(e);let i=g();return A(i.close())}),v(11,"span",6),u(12,"close"),b()()(),R(13,wA,3,0,"nav",8),R(14,SA,4,3,"section",9),R(15,TA,5,0,"section",10),R(16,AA,3,0,"section",11),R(17,DA,4,2,"section",12),R(18,VA,14,10,"section",13),v(19,"section",14)(20,"h3"),u(21,"Your Outfit"),b(),v(22,"div",15),ve(23,UA,11,9,"div",16,Ln),b()(),v(25,"footer",17)(26,"div",18),R(27,zA,4,0)(28,HA,4,0),b(),v(29,"label",19)(30,"input",20),ne("change",function(i){P(e);let r=g();return A(r.setAlternateView((i.target.checked||!1)===!0))}),b(),v(31,"span"),u(32,"Alternate view"),b()(),v(33,"button",21),ne("click",function(){P(e);let i=g();return A(i.submit())}),u(34,"Change Outfit"),b(),v(35,"button",22),ne("click",function(){P(e);let i=g();return A(i.close())}),u(36,"Cancel"),b()(),Te(37,"canvas",23,0),b()}if(o&2){let e=g();oe("disabled",e.changingOutfit())("alternate",e.alternateView()),d(7),D(t.property.name),d(6),N(e.alternateView()?-1:13),d(),N(e.alternateView()?-1:14),d(),N(!e.alternateView()&&e.selectedTabTags().length>0?15:-1),d(),N(e.alternateView()?16:-1),d(),N(e.alternateView()?-1:17),d(),N(!e.alternateView()&&e.pages()>1?18:-1),d(5),xe(e.previewOrder),d(4),N(e.alternateView()?27:28),d(3),Ee("checked",e.alternateView())}}var Mn=window.mp,Iv=[1,7,11,8,3,4,6],WA=[1,7,3,4,6,8,11],XA={1:"Mask",3:"Torso",4:"Pants",6:"Shoes",7:"Neckwear",8:"Undershirt",11:"Top"},qA={1:["mask","teef","head"],3:["uppr"],4:["lowr"],6:["feet"],7:["accs"],8:["accs","jbib","uppr"],11:["jbib"]},$A=typeof window<"u"&&/^(localhost|127\.0\.0\.1)$/i.test(window.location.hostname)?"http://localhost:3000/model-server":"https://ucp.southwest-roleplay.dev/model-server",fm=o=>`${$A}${o.startsWith("/")?o:`/${o}`}`;function YA(){return{1:{drawableId:0,textureId:0,name:"",imageUrl:""},3:{drawableId:0,textureId:0,name:"",imageUrl:""},4:{drawableId:0,textureId:0,name:"",imageUrl:""},6:{drawableId:0,textureId:0,name:"",imageUrl:""},7:{drawableId:0,textureId:0,name:"",imageUrl:""},8:{drawableId:0,textureId:0,name:"",imageUrl:""},11:{drawableId:0,textureId:0,name:"",imageUrl:""}}}function Ov(){return{name:"",drawableId:"",textureId:"",tags:[]}}var Dv=(()=>{class o{constructor(){this.data=F(void 0),this.items=F([]),this.loadingItems=F(!1),this.selectedTab=F(null),this.page=F(1),this.pages=F(0),this.displayPages=F(0),this.midPages=F(0),this.filter=F(Ov()),this.selectedComponents=F(YA()),this.changingOutfit=F(!1),this.expanded=F(!1),this.allowExpansion=F(!1),this.alternateView=F(!1),this.itemThumbnails=F({}),this.textureOptionsByItem=F({}),this.selectedPreviewImages=F({}),this.alternateOptionsByComponent=F({}),this.alternateIndexByComponent=F({}),this.previewOrder=Iv,this.visible=le(()=>!!this.data()),this.selectedTabTags=le(()=>this.selectedTab()?.tags??[]),this.isFilterApplied=le(()=>{let e=this.filter();return!!(e.drawableId||e.textureId||e.name)}),this.displayPageNumbers=le(()=>{let e=this.displayPages();return Array.from({length:e},(n,i)=>i+1)}),this.filterTimeout=null,this.currentPed="mp_m_freemode_01",this.modelIndexBySlot={},this.gltfLoader=new lu,this.ddsLoader=new su,this.gltfTemplateCache=new Map,this.thumbGenId=0,this.alternateRenderTimeouts=new Map,this.alternateDataLoaded=!1,this.alternateDataRequested=!1,this.fallbackTabQueue=[],this.fallbackTabIndex=-1,this.fallbackSearchActive=!1,this.onOutfitStoreInit=e=>this.init(e),this.onOutfitStorePage=(e,n,i)=>this.receivePage(e,n,i),this.onOutfitStoreAlternateData=e=>this.receiveAlternateData(e),this.onOutfitStoreClose=()=>this.close(),this.onOutfitStoreSubmitProcessed=()=>this.changingOutfit.set(!1),this.onWindowKeyDown=e=>{if(this.data()){if(e.key==="ArrowLeft"){if(this.page()===1)return;this.loadItems(this.page()-1);return}if(e.key==="ArrowRight"){if(this.page()===this.pages())return;this.loadItems(this.page()+1)}}},Mn.events.add("outfitStore:init",this.onOutfitStoreInit),Mn.events.add("outfitStore:page",this.onOutfitStorePage),Mn.events.add("outfitStore:alternateData",this.onOutfitStoreAlternateData),Mn.events.add("outfitStore:close",this.onOutfitStoreClose),Mn.events.add("outfitStore:submitProcessed",this.onOutfitStoreSubmitProcessed),window.addEventListener("keydown",this.onWindowKeyDown)}ngOnDestroy(){Mn.events.remove("outfitStore:init",this.onOutfitStoreInit),Mn.events.remove("outfitStore:page",this.onOutfitStorePage),Mn.events.remove("outfitStore:alternateData",this.onOutfitStoreAlternateData),Mn.events.remove("outfitStore:close",this.onOutfitStoreClose),Mn.events.remove("outfitStore:submitProcessed",this.onOutfitStoreSubmitProcessed),window.removeEventListener("keydown",this.onWindowKeyDown),this.clearFilterTimeout(),this.clearAlternateRenderTimeouts(),this.thumbRenderer?.dispose(),this.disposeAssetCaches()}selectTab(e){this.fallbackSearchActive=!1,this.fallbackTabQueue=[],this.fallbackTabIndex=-1,this.activateTab(e)}updateFilterName(e){this.filter.update(n=>De(he({},n),{name:e})),this.scheduleFilterLoad()}updateFilterDrawableId(e){this.filter.update(n=>De(he({},n),{drawableId:e})),this.scheduleFilterLoad()}updateFilterTextureId(e){this.filter.update(n=>De(he({},n),{textureId:e})),this.scheduleFilterLoad()}toggleTag(e){this.filter.update(n=>De(he({},n),{tags:n.tags.includes(e)?n.tags.filter(i=>i!==e):[...n.tags,e]})),this.loadItems(1)}isTagEnabled(e){return this.filter().tags.includes(e)}isItemSelected(e){let n=this.selectedComponents()[e.componentId];return n?n.drawableId===e.drawableId&&n.textureId===e.textureId:!1}itemHasTextureControls(e){return(this.textureOptionsByItem()[this.drawableKey(e.componentId,e.drawableId)]??[]).length>1}textureCounterLabel(e){let n=this.textureOptionsByItem()[this.drawableKey(e.componentId,e.drawableId)]??[e.textureId];return`${Math.max(n.indexOf(e.textureId),0)+1}/${n.length}`}cycleItemTexture(e,n,i){i.preventDefault(),i.stopPropagation();let r=this.drawableKey(e.componentId,e.drawableId),a=this.textureOptionsByItem()[r]??[];if(a.length<=1)return;let l=(Math.max(a.indexOf(e.textureId),0)+n+a.length)%a.length,c=a[l]??e.textureId,h=De(he({},e),{textureId:c});this.items.update(p=>p.map(m=>m.id===e.id?h:m)),this.generateItemThumbnails([h]),this.selectItem(h)}toggleExpanded(){this.expanded.update(e=>!e)}setAlternateView(e){this.alternateView.set(!!e),e&&this.requestAlternateData()}alternateTabs(){return this.data()?.tabs??[]}alternateOptions(e){return this.alternateOptionsByComponent()[e.category.componentId]??[]}alternateSliderMax(e){let n=this.alternateOptions(e);return Math.max(n.length-1,0)}alternateSliderIndex(e){return this.alternateIndexByComponent()[e.category.componentId]??0}alternateCounter(e){let n=this.alternateOptions(e);return n.length?`${this.alternateSliderIndex(e)+1}/${n.length}`:"0/0"}onAlternateSliderInput(e,n){this.applyAlternateSliderValue(e,n,!1)}onAlternateSliderChange(e,n){this.applyAlternateSliderValue(e,n,!0)}applyAlternateSliderValue(e,n,i){let r=Number.parseInt(n,10);if(Number.isNaN(r))return;let a=e.category.componentId,l=this.alternateOptions(e)[r];if(l){if(this.alternateIndexByComponent.update(c=>De(he({},c),{[a]:r})),this.selectedComponents.update(c=>De(he({},c),{[a]:De(he({},c[a]),{drawableId:l.drawableId,textureId:l.textureId,name:l.name})})),Mn.events.call("outfitStore:alternatePreviewLocal",a,l.drawableId,l.textureId,0),i){this.flushAlternateRender(a,l.drawableId,l.textureId);return}this.scheduleAlternateRender(a,l.drawableId,l.textureId)}}loadItems(e){let n=this.data(),i=this.selectedTab();!n||!i||(this.loadingItems.set(!0),Mn.events.call("callServerEvent","outfitStore:page",n.property.id,i.category.componentId,e-1,JSON.stringify(this.filter())))}selectItem(e){this.selectedComponents.update(n=>De(he({},n),{[e.componentId]:e})),this.renderSelectedPreview(e.componentId,e.drawableId,e.textureId),Mn.events.call("callServerEvent","outfitStore:preview",e.componentId,e.drawableId,e.textureId)}revert(e){let n=this.data();if(!n)return;let i=n.equippedComponents[e];this.selectedComponents.update(r=>De(he({},r),{[e]:i})),this.renderSelectedPreview(e,i.drawableId,i.textureId),Mn.events.call("callServerEvent","outfitStore:preview",e,i.drawableId,i.textureId)}submit(){let e=this.data();if(!e||this.changingOutfit())return;let n=this.selectedComponents(),i=WA.map(r=>{let a=e.equippedComponents[r]??{drawableId:0,textureId:0,name:""},s=n[r]??a;return{componentId:r,drawableId:Number.isFinite(s.drawableId)?s.drawableId:0,textureId:Number.isFinite(s.textureId)?s.textureId:0}});this.changingOutfit.set(!0);try{Mn.events.call("callServerEvent","outfitStore:change",e.property.id,JSON.stringify(i))}catch{this.changingOutfit.set(!1)}}close(){Mn.events.call("cursor:off"),this.items.set([]),this.data.set(void 0),this.selectedTab.set(null),this.loadingItems.set(!1),this.page.set(1),this.pages.set(0),this.displayPages.set(0),this.midPages.set(0),this.expanded.set(!1),this.allowExpansion.set(!1),this.alternateView.set(!1),this.textureOptionsByItem.set({}),this.alternateOptionsByComponent.set({}),this.alternateIndexByComponent.set({}),this.alternateDataLoaded=!1,this.alternateDataRequested=!1,this.changingOutfit.set(!1),this.clearFilterTimeout(),this.clearAlternateRenderTimeouts(),Mn.events.call("callServerEvent","outfitStore:closed")}pageIsCurrent(e){return e===this.page()}shouldShowBeforeMedianCurrentPage(){let e=this.page(),n=this.displayPages(),i=this.midPages(),r=this.pages();return e>n&&e!==i&&e<i&&e!==r}shouldShowAfterMedianCurrentPage(){let e=this.page(),n=this.displayPages(),i=this.midPages(),r=this.pages();return e>n&&e!==i&&e>i&&e!==r}previewHeading(e){return XA[e]}clothingSlotChanged(e){let n=this.data();if(!n)return!1;let i=this.selectedComponents()[e],r=n.equippedComponents[e];return!(i.drawableId===r.drawableId&&i.textureId===r.textureId)}componentImage(e,n,i){let r=this.selectedPreviewImages()[e];if(r)return`url(${r})`;let a=this.selectedComponents()[e]?.imageUrl;return a?`url(${a})`:""}itemImage(e){let n=this.itemThumbKey(e.componentId,e.drawableId,e.textureId),i=this.itemThumbnails()[n];return i?`url(${i})`:e.imageUrl?`url(${e.imageUrl})`:this.componentImage(e.componentId,e.drawableId,e.textureId)}init(e){this.data.set(JSON.parse(e)),this.currentPed=this.data()?.gender==="f"?"mp_f_freemode_01":"mp_m_freemode_01",this.loadModelIndex(),this.fallbackSearchActive=!1,this.fallbackTabQueue=[],this.fallbackTabIndex=-1,this.resetFilter(),this.selectedComponents.set(he({},this.data().equippedComponents)),this.itemThumbnails.set({}),this.selectedPreviewImages.set({}),this.alternateOptionsByComponent.set({}),this.alternateIndexByComponent.set({}),this.alternateDataLoaded=!1,this.alternateDataRequested=!1,this.changingOutfit.set(!1),this.expanded.set(!1),this.allowExpansion.set(!1),this.selectTab(this.data().tabs[0]),this.renderSelectedPreviewSet(),this.requestAlternateData(),Mn.events.call("cursor:on")}receivePage(e,n,i){let r=JSON.parse(i),a=this.collapseItemsByDrawable(r);this.fallbackSearchActive=!1,this.fallbackTabQueue=[],this.fallbackTabIndex=-1,this.items.set(a.items),this.textureOptionsByItem.set(a.textureOptionsByItem),this.page.set(e+1),this.pages.set(n),this.loadingItems.set(!1),this.setPagination(),this.itemThumbnails.set({}),this.generateItemThumbnails(a.items)}resetFilter(){this.clearFilterTimeout(),this.filter.set(Ov())}scheduleFilterLoad(){this.clearFilterTimeout(),this.filterTimeout=setTimeout(()=>{this.loadItems(1)},750)}clearFilterTimeout(){this.filterTimeout&&(clearTimeout(this.filterTimeout),this.filterTimeout=null)}scheduleAlternateRender(e,n,i){let r=this.alternateRenderTimeouts.get(e);r&&clearTimeout(r);let a=setTimeout(()=>{this.alternateRenderTimeouts.delete(e),this.renderSelectedPreview(e,n,i)},1e3);this.alternateRenderTimeouts.set(e,a)}flushAlternateRender(e,n,i){let r=this.alternateRenderTimeouts.get(e);r&&(clearTimeout(r),this.alternateRenderTimeouts.delete(e)),this.renderSelectedPreview(e,n,i)}clearAlternateRenderTimeouts(){for(let e of this.alternateRenderTimeouts.values())clearTimeout(e);this.alternateRenderTimeouts.clear()}setPagination(){if(this.displayPages.set(0),this.midPages.set(0),this.pages()>10){this.displayPages.set(10);let e=this.getPageMedian();this.midPages.set(e<=10?0:e);return}this.displayPages.set(this.pages())}getPageMedian(){let e=Array.from({length:this.pages()},(a,s)=>s),n=Math.floor(e.length/2),i=[...e].sort((a,s)=>a-s),r=e.length%2!==0?i[n]:(i[n-1]+i[n])/2;return Math.floor(r)}activateTab(e){this.selectedTab.set(e),this.resetFilter(),this.expanded.set(!1),this.items.set([]),this.page.set(1),this.pages.set(0),this.displayPages.set(0),this.midPages.set(0),this.itemThumbnails.set({}),this.textureOptionsByItem.set({}),this.loadItems(1)}requestAlternateData(){let e=this.data();!e||this.alternateDataLoaded||this.alternateDataRequested||(this.alternateDataRequested=!0,Mn.events.call("callServerEvent","outfitStore:alternateData",e.property.id))}receiveAlternateData(e){if(!this.data()){this.alternateDataRequested=!1;return}let n;try{n=JSON.parse(e)}catch{this.alternateDataRequested=!1;return}let i={},r={};for(let a of n.components){let s=a.componentId,l=[...a.items];i[s]=l;let c=this.selectedComponents()[s],h=l.findIndex(p=>p.drawableId===c.drawableId&&p.textureId===c.textureId);r[s]=h>=0?h:0}this.alternateOptionsByComponent.set(i),this.alternateIndexByComponent.set(r),this.alternateDataLoaded=!0,this.alternateDataRequested=!1}tryFallbackTab(){let e=this.data(),n=this.selectedTab();if(!e||e.tabs.length<=1||!n)return!1;this.fallbackSearchActive?this.fallbackTabIndex+=1:(this.fallbackSearchActive=!0,this.fallbackTabQueue=e.tabs.filter(r=>r!==n),this.fallbackTabIndex=0);let i=this.fallbackTabQueue[this.fallbackTabIndex];return i?(this.activateTab(i),!0):(this.fallbackSearchActive=!1,this.fallbackTabQueue=[],this.fallbackTabIndex=-1,!1)}itemThumbKey(e,n,i){return`${e}:${n}:${i}`}drawableKey(e,n){return`${e}:${n}`}collapseItemsByDrawable(e){let n=new Map;for(let a of e){let s=this.drawableKey(a.componentId,a.drawableId),l=n.get(s);if(l){l.push(a);continue}n.set(s,[a])}let i=[],r={};for(let[a,s]of n.entries()){let l=[...s].sort((M,S)=>M.textureId-S.textureId),c=Array.from(new Set(l.map(M=>M.textureId))).sort((M,S)=>M-S);r[a]=c;let h=l[0],p=this.selectedComponents()[h.componentId],m=p&&p.drawableId===h.drawableId?p.textureId:c[0]??h.textureId,x=l.find(M=>M.textureId===m)??h;i.push(De(he({},x),{textureId:m}))}return i.sort((a,s)=>a.drawableId-s.drawableId||a.id-s.id),{items:i,textureOptionsByItem:r}}async loadModelIndex(){if(!(Object.keys(this.modelIndexBySlot).length>0))try{let e=await fetch(fm("/list"));if(!e.ok)return;let n=await e.json();this.modelIndexBySlot=n[this.currentPed]??{}}catch{this.modelIndexBySlot={}}}async generateItemThumbnails(e){if(!e.length||(await this.loadModelIndex(),this.ensureThumbRenderer(),!this.thumbRenderer||!this.thumbScene||!this.thumbCamera))return;let n=++this.thumbGenId;this.thumbRenderer.setClearColor(0,0);for(let i of e){if(n!==this.thumbGenId)return;let r=await this.renderItemToDataUrl(i.componentId,i.drawableId,i.textureId);r&&this.itemThumbnails.update(a=>De(he({},a),{[this.itemThumbKey(i.componentId,i.drawableId,i.textureId)]:r}))}}async renderSelectedPreviewSet(){let e=this.selectedComponents();for(let n of Iv){let i=e[n];i&&await this.renderSelectedPreview(n,i.drawableId,i.textureId)}}async renderSelectedPreview(e,n,i){await this.loadModelIndex(),this.ensureThumbRenderer();let r=await this.renderItemToDataUrl(e,n,i);r&&this.selectedPreviewImages.update(a=>De(he({},a),{[e]:r}))}async renderItemToDataUrl(e,n,i){if(!this.thumbScene||!this.thumbRenderer||!this.thumbCamera)return null;let r=this.resolveRenderAsset(e,n,i);if(!r)return null;let a=fm(`/files/glb/${r.ped}/${r.slot}/${r.glb}`),s=r.textureFolder?fm(`/files/textures/${r.ped}/${r.slot}/${r.textureFolder}/${r.textureFolder}.dds`):null,l=null;try{if(l=await this.instantiateGroup(a),s)try{let p=await this.createTextureInstance(s,1);this.applyTexture(l,p,!1)}catch{}let c=this.getCameraPose(e,r.slot);this.thumbCamera.position.set(...c.position),this.thumbCamera.lookAt(...c.target),this.thumbScene.add(l),this.thumbRenderer.render(this.thumbScene,this.thumbCamera);let h=this.thumbRenderer.domElement.toDataURL("image/png");return this.thumbScene.remove(l),this.disposeGroup(l),h}catch{return l&&this.disposeGroup(l),null}}resolveRenderAsset(e,n,i){let r=null,a=this.drawableCandidates(n);for(let[s,l]of Object.entries(this.modelIndexBySlot)){let c=l.find(y=>{if(y.index===null)return!1;let C=Number(y.index);return a.includes(C)});if(!c)continue;let h=c.textures.find(y=>this.textureIdFromFolder(y)===i)??null,p=c.textures[0]??null,M=(qA[e].some(y=>s.toLowerCase().includes(y))?40:0)+(h?200:p?10:0),S={ped:this.currentPed,slot:s,glb:c.glb,textureFolder:h??p,score:M};(!r||S.score>r.score)&&(r=S)}return r?{ped:r.ped,slot:r.slot,glb:r.glb,textureFolder:r.textureFolder}:null}drawableCandidates(e){let n=new Set([e]);return e>=1e4&&n.add(e-1e4),Array.from(n).filter(i=>Number.isFinite(i)&&i>=0)}textureIdFromFolder(e){let n=e.match(/_([a-z]+)_[^_]+$/i);if(n){let r=n[1].toLowerCase(),a=0;for(let s=0;s<r.length;s+=1)a=a*26+(r.charCodeAt(s)-96);return Math.max(a-1,0)}let i=e.match(/_(\d+)$/);return i&&Number.parseInt(i[1],10)||0}ensureThumbRenderer(){let e=this.thumbCanvas?.nativeElement;if(e&&(this.thumbRenderer||(this.thumbRenderer=new ou({canvas:e,antialias:!0,alpha:!0,preserveDrawingBuffer:!0}),this.thumbRenderer.setPixelRatio(1),this.thumbRenderer.setSize(160,160),this.thumbRenderer.outputColorSpace=dn,this.thumbRenderer.toneMapping=el,this.thumbRenderer.shadowMap.enabled=!1),!this.thumbScene)){this.thumbScene=new Os,this.thumbScene.background=null,this.thumbCamera=new xn(50,1,.01,200),this.thumbCamera.position.set(0,.56,1.6),this.thumbCamera.lookAt(0,.38,0),this.thumbScene.add(new Zs(16777215,.5));let n=new Po(16777215,1.4);n.position.set(2,4,3),this.thumbScene.add(n);let i=new Po(8947967,.4);i.position.set(-2,2,-1),this.thumbScene.add(i);let r=new Po(16777215,.6);r.position.set(0,3,-3),this.thumbScene.add(r)}}getCameraPose(e,n){let i=(n??"").toLowerCase(),r={full:{position:[0,.58,.95],target:[0,.44,0]},accs:{position:[0,.28,.95],target:[0,.14,0]},feet:{position:[0,-.55,1.2],target:[0,-.72,0]},hair:{position:[0,.76,.95],target:[0,.62,0]},head:{position:[0,.76,.95],target:[0,.62,0]},jbib:{position:[0,.44,1.1],target:[0,.28,0]},lowr:{position:[0,-.08,.95],target:[0,-.22,0]}};return i.includes("accs")?r.accs:i.includes("feet")||i.includes("shoe")||i.includes("foot")?r.feet:i.includes("hair")?r.hair:i.includes("head")?r.head:i.includes("jbib")?r.jbib:i.includes("lowr")||i.includes("pant")||i.includes("leg")?r.lowr:e===6?{position:[0,-.55,1.2],target:[0,-.72,0]}:e===4?{position:[0,-.08,.95],target:[0,-.22,0]}:e===1?{position:[0,.76,.95],target:[0,.62,0]}:r.full}instantiateGroup(e){let n=this.gltfTemplateCache.get(e);if(n)return n.then(r=>r.clone(!0));let i=new Promise((r,a)=>{this.gltfLoader.load(e,s=>r(s.scene),void 0,a)}).catch(r=>{throw this.gltfTemplateCache.delete(e),r});return this.gltfTemplateCache.set(e,i),i.then(r=>r.clone(!0))}createTextureInstance(e,n){return new Promise((i,r)=>{this.ddsLoader.load(e,a=>{a.colorSpace=dn,a.wrapS=ki,a.wrapT=ki,a.needsUpdate=!0,a.anisotropy=n,i(a)},void 0,r)})}applyTexture(e,n,i=!0){e.traverse(r=>{if(!r.isMesh)return;let a=r;(a.material?Array.isArray(a.material)?a.material:[a.material]:[]).forEach(l=>l.dispose()),a.material=i?new So({map:n,roughness:.7,metalness:.1}):new ci({map:n})})}disposeGroup(e){e.traverse(n=>{if(!n.isMesh)return;let i=n;i.geometry?.dispose?.(),(i.material?Array.isArray(i.material)?i.material:[i.material]:[]).forEach(a=>{a.map?.dispose?.(),a.dispose()})})}disposeAssetCaches(){this.gltfTemplateCache.clear()}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-outfit-store"]],viewQuery:function(n,i){if(n&1&&yi(xA,5)(bA,5),n&2){let r;Bt(r=Ut())&&(i.tagsElement=r.first),Bt(r=Ut())&&(i.thumbCanvas=r.first)}},decls:1,vars:1,consts:[["thumbCanvas",""],["tagsElement",""],[1,"outfit-store-wrap",3,"disabled","alternate"],[1,"outfit-store-wrap"],[1,"outfit-header"],[1,"title-block"],[1,"material-symbols-outlined"],["type","button","aria-label","Close outfit store",1,"close-button",3,"click"],[1,"outfit-tabs"],[1,"filter-block"],[1,"tag-shell"],[1,"alternate-panel","scrollbar-neon"],[1,"grid-frame",3,"disabled"],[1,"pagination",3,"disabled"],[1,"preview-block"],[1,"preview-grid"],[1,"preview-cell"],[1,"actions"],[1,"actions-hint"],["for","alt-view-toggle",1,"alt-view-toggle"],["id","alt-view-toggle","type","checkbox",3,"change","checked"],["type","button",1,"primary",3,"click"],["type","button",1,"secondary",3,"click"],["aria-hidden","true",1,"thumb-canvas"],["type","button",1,"tab-button",3,"active"],["type","button",1,"tab-button",3,"click"],["type","text","placeholder","Name",3,"input","value"],["type","text","placeholder","Drawable ID",1,"numeric",3,"input","value"],["type","text","placeholder","Texture ID",1,"numeric",3,"input","value"],[1,"tag-list"],["type","button",1,"tag-chip",3,"selected"],["type","button",1,"tag-chip",3,"click"],[1,"alternate-slider-row"],[1,"alternate-row-head"],["type","range","min","0",3,"input","change","max","value","disabled"],[1,"grid-frame"],[1,"grid","scrollbar-neon"],["type","button",1,"item-card",3,"selected"],["type","button",1,"item-card",3,"click"],[1,"item-card__thumb"],[1,"item-card__inner"],[1,"item-name"],[1,"recommended","material-symbols-outlined"],[1,"item-texture-controls",3,"click"],["type","button","aria-label","Previous texture",1,"item-texture-btn",3,"click","disabled"],[1,"item-texture-counter"],["type","button","aria-label","Next texture",1,"item-texture-btn",3,"click","disabled"],[1,"pagination"],["type","button",1,"page-arrow",3,"click"],[1,"pages"],["type","button",1,"page-button",3,"selected"],[1,"page-button","selected"],["type","button",1,"page-button",3,"click"],[1,"preview-heading"],[1,"preview-card"],[1,"preview-card__inner"],[1,"preview-name"],[1,"preview-meta"],["type","button",1,"revert-button"],["type","button",1,"revert-button",3,"click"],[1,"hotkey"]],template:function(n,i){if(n&1&&R(0,GA,39,13,"section",2),n&2){let r;N((r=i.visible()&&i.data())?0:-1,r)}},dependencies:[tt],styles:['[_nghost-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;box-sizing:border-box;z-index:3;pointer-events:none}.outfit-store-wrap[_ngcontent-%COMP%]{pointer-events:auto;width:50vw;max-width:50vw;max-height:min(96vh,72rem);display:flex;flex-direction:column;color:var(--sw-text);border:1px solid rgba(var(--sw-accent-rgb),.3);border-top:none;border-radius:16px;background:linear-gradient(160deg,#181a1fdb,#101216d1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:0 24px 52px #00000085,0 0 0 1px rgba(var(--sw-accent-rgb),.08) inset;overflow:hidden;-webkit-user-select:none;user-select:none}.outfit-store-wrap.alternate[_ngcontent-%COMP%]{width:min(52rem,64vw);max-width:min(52rem,64vw);max-height:min(96vh,68rem);margin-left:auto;margin-right:1rem}.outfit-store-wrap.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.75}.outfit-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.85rem 1rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.34);background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.22),rgba(var(--sw-accent-rgb),.07))}.title-block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem}.title-block[_ngcontent-%COMP%] .material-symbols-outlined[_ngcontent-%COMP%]{color:#ff95a2;font-size:1.6rem}.title-block[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1rem;color:#f4f7fb}.title-block[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.1rem 0 0;text-transform:uppercase;letter-spacing:.08em;font-size:.68rem;color:var(--sw-text-soft)}.close-button[_ngcontent-%COMP%], .tab-button[_ngcontent-%COMP%], .tag-chip[_ngcontent-%COMP%], .item-card[_ngcontent-%COMP%], .page-arrow[_ngcontent-%COMP%], .page-button[_ngcontent-%COMP%], .revert-button[_ngcontent-%COMP%], .primary[_ngcontent-%COMP%], .secondary[_ngcontent-%COMP%], .expand-button[_ngcontent-%COMP%]{border:0;font:inherit}.close-button[_ngcontent-%COMP%]{width:2.25rem;height:2.25rem;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;color:var(--sw-text-soft);background:#ffffff0d}.close-button[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.18);color:#fff}.outfit-tabs[_ngcontent-%COMP%]{display:flex;align-items:stretch;overflow:hidden;background:#11121680;border-bottom:1px solid rgba(255,255,255,.07)}.tab-button[_ngcontent-%COMP%]{flex:1 1 0;padding:.7rem .9rem;text-transform:uppercase;letter-spacing:.05em;font-size:.78rem;color:var(--sw-text-soft);background:transparent;border-bottom:2px solid transparent;text-align:center}.tab-button[_ngcontent-%COMP%]:hover{background:#ffffff0a;color:#fff}.tab-button.active[_ngcontent-%COMP%]{color:#fff;background:rgba(var(--sw-accent-rgb),.1);border-bottom-color:rgba(var(--sw-accent-rgb),.85)}.filter-block[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.75rem .9rem}.filter-block[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1 1 0;min-width:0;border:1px solid rgba(var(--sw-accent-rgb),.18);border-radius:10px;background:#0a0c1080;color:var(--sw-text);padding:.55rem .65rem;outline:none}.filter-block[_ngcontent-%COMP%] input.numeric[_ngcontent-%COMP%]{flex:0 0 6.25rem}.filter-block[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:var(--sw-text-soft)}.filter-block[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-color:rgba(var(--sw-accent-rgb),.6);box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.14)}.tag-shell[_ngcontent-%COMP%]{padding:0 .9rem .75rem;overflow:visible}.tag-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem}.tag-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.28rem .45rem;border-radius:8px;background:#ffffff0a;color:var(--sw-text-soft);border:1px solid rgba(255,255,255,.07)}.tag-chip[_ngcontent-%COMP%] .material-symbols-outlined[_ngcontent-%COMP%]{font-size:1rem}.tag-chip.selected[_ngcontent-%COMP%]{background:rgba(var(--sw-accent-rgb),.16);color:#fff}.grid-frame[_ngcontent-%COMP%]{background:#00000029;padding:.75rem .9rem;border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08)}.alternate-panel[_ngcontent-%COMP%]{display:grid;gap:.55rem;padding:.75rem .9rem;max-height:min(58vh,34rem);overflow-y:auto;border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08);background:#00000029}.alternate-slider-row[_ngcontent-%COMP%]{display:grid;gap:.35rem;padding:.55rem .6rem;border-radius:10px;background:#ffffff0a;border:1px solid rgba(255,255,255,.08)}.alternate-row-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;color:var(--sw-text);font-size:.78rem;text-transform:uppercase;letter-spacing:.06em}.alternate-row-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#ffb8c0;font-size:.74rem;font-weight:700}.alternate-slider-row[_ngcontent-%COMP%] input[type=range][_ngcontent-%COMP%]{width:100%;accent-color:var(--sw-accent)}.grid-frame.disabled[_ngcontent-%COMP%], .pagination.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}.grid[_ngcontent-%COMP%]{overflow:hidden;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(3,9rem);gap:.5rem}.item-card[_ngcontent-%COMP%]{width:100%;height:100%;position:relative;border-radius:12px;cursor:pointer;background-color:#2a2d34;background-image:linear-gradient(45deg,rgba(255,255,255,.08) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.08) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.16) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.16) 75%);background-size:14px 14px;background-position:0 0,0 7px,7px -7px,-7px 0;background-repeat:repeat;color:#fff;overflow:hidden;transform:translateZ(0);isolation:isolate}.item-card[_ngcontent-%COMP%]:hover{transform:scale(1.02)}.item-card.selected[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 2px rgba(var(--sw-accent-rgb),.72)}.item-card.selected[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;border-radius:12px;box-shadow:inset 0 0 0 1px #ffffff47;pointer-events:none;z-index:3}.item-card.selected[_ngcontent-%COMP%] .item-card__inner[_ngcontent-%COMP%]{background:linear-gradient(0deg,rgba(var(--sw-accent-rgb),.28),#00000014 32% 68%,rgba(var(--sw-accent-rgb),.24))}.item-card__thumb[_ngcontent-%COMP%]{position:absolute;inset:0;background-size:contain;background-position:center;background-repeat:no-repeat;z-index:1}.item-card__inner[_ngcontent-%COMP%]{position:absolute;inset:0;padding:.35rem .35rem 1.85rem;font-size:.74rem;text-shadow:0 0 5px rgba(0,0,0,.85);display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(0deg,#00000080,#0000000a 25% 75%,#00000073);z-index:2}.item-card[_ngcontent-%COMP%]:hover .item-card__inner[_ngcontent-%COMP%]{background:linear-gradient(0deg,#0000009e,#0000000f 25% 75%,#0000008c)}.item-name[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.15rem}.recommended[_ngcontent-%COMP%]{color:#7ab7ff;font-size:.95rem}.item-texture-controls[_ngcontent-%COMP%]{position:absolute;left:50%;bottom:.35rem;transform:translate(-50%);z-index:3;display:inline-flex;align-items:center;gap:.3rem}.item-texture-btn[_ngcontent-%COMP%]{width:1.45rem;height:1.5rem;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;border:0;background:#0000008f;color:#fff;cursor:pointer}.item-texture-btn[_ngcontent-%COMP%] .material-symbols-outlined[_ngcontent-%COMP%]{font-size:1rem}.item-texture-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:rgba(var(--sw-accent-rgb),.32)}.item-texture-btn[_ngcontent-%COMP%]:disabled{opacity:.38;cursor:default}.item-texture-counter[_ngcontent-%COMP%]{min-width:2.5rem;height:1.5rem;padding:0 .35rem;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;background:#00000075;color:#ffffffeb;font-size:.72rem;font-weight:600}.pagination[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:.25rem;padding:.55rem .9rem;background:#0000002e;border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08)}.pages[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.2rem}.page-arrow[_ngcontent-%COMP%], .page-button[_ngcontent-%COMP%]{min-width:1.95rem;height:1.7rem;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;background:#ffffff0a;color:var(--sw-text)}.page-arrow[_ngcontent-%COMP%]:hover, .page-button[_ngcontent-%COMP%]:hover{background:#ffffff1f}.page-arrow.disabled[_ngcontent-%COMP%]{opacity:.35}.page-button.selected[_ngcontent-%COMP%]{background:#ffffffdb;color:#1c2026;font-weight:700}.preview-block[_ngcontent-%COMP%]{padding:.75rem .9rem}.preview-block[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .55rem;font-size:.92rem;color:#f0f4fb}.preview-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,6.25rem);gap:.5rem}.preview-heading[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.72rem;font-weight:600;margin:0 0 .18rem .12rem;color:#ffffff6b}.preview-card[_ngcontent-%COMP%]{position:relative;height:7.5rem;border-radius:12px;background-color:#0003;background-size:contain;background-position:center;background-repeat:no-repeat;opacity:.88;filter:saturate(.88) brightness(.92);transition:opacity .16s ease,filter .16s ease,box-shadow .16s ease;overflow:hidden}.preview-card.changed[_ngcontent-%COMP%]{opacity:1;filter:none;box-shadow:0 0 0 1px rgba(var(--sw-accent-rgb),.35),0 10px 24px #00000047}.preview-card__inner[_ngcontent-%COMP%]{position:absolute;inset:0;padding:.35rem;display:flex;flex-direction:column;justify-content:space-between;text-shadow:0 0 5px rgba(0,0,0,.8);background:linear-gradient(0deg,#00000075,#0000000a 25% 75%,#0000006b)}.preview-name[_ngcontent-%COMP%]{font-size:.74rem;color:#fff}.preview-meta[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-end;font-size:.72rem}.revert-button[_ngcontent-%COMP%]{width:1.8rem;height:1.8rem;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;background:#ffffff14;color:#fff}.revert-button[_ngcontent-%COMP%]:hover{background:#f073732e;color:#ff9f9f}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:.6rem;padding:.8rem .9rem;background:#0003}.actions-hint[_ngcontent-%COMP%]{margin-right:auto;display:inline-flex;align-items:center;gap:.35rem;color:var(--sw-text-soft);font-size:.78rem;font-weight:500}.alt-view-toggle[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.45rem;margin-right:.4rem;padding:.5rem .65rem;border-radius:10px;background:#ffffff0d;border:1px solid rgba(255,255,255,.08);color:var(--sw-text-soft);font-size:.76rem;letter-spacing:.01em;-webkit-user-select:none;user-select:none}.alt-view-toggle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin:0;accent-color:var(--sw-accent)}.primary[_ngcontent-%COMP%], .secondary[_ngcontent-%COMP%]{border-radius:10px;padding:.62rem .95rem;letter-spacing:.02em}.primary[_ngcontent-%COMP%]{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.92),#990f1feb);color:#fff}.secondary[_ngcontent-%COMP%]{background:#ffffff14;color:var(--sw-text)}.hotkey[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:1.4rem;height:1.4rem;padding:0 .35rem;border-radius:6px;border:1px solid rgba(255,255,255,.12);background:#0a0c10b8;color:#fff;font-size:.64rem}.thumb-canvas[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}@media(max-width:1400px){.grid[_ngcontent-%COMP%], .preview-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(4,6.25rem)}}@media(max-width:900px){.outfit-store-wrap[_ngcontent-%COMP%]{width:100%;max-width:none;max-height:calc(100vh - 2rem)}.grid[_ngcontent-%COMP%], .preview-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,6.25rem);justify-content:center}.filter-block[_ngcontent-%COMP%]{flex-wrap:wrap}.tag-shell[_ngcontent-%COMP%]{max-width:none}}'],changeDetection:0})}}return o})();function jA(o,t){if(o&1&&(v(0,"div",9)(1,"div",16),Te(2,"i",17),v(3,"span",18),u(4),b()(),v(5,"div",19)(6,"span",20),u(7),b(),v(8,"span",21),u(9,"/"),b(),v(10,"span",22),u(11),b()()()),o&2){let e=g();d(2),wn("fa-solid "+e.weapon().icon),d(2),D(e.weapon().name),d(3),D(e.weapon().ammo),d(4),D(e.weapon().reserve)}}function KA(o,t){o&1&&(v(0,"span",25),u(1,"CC"),b())}function ZA(o,t){if(o&1&&(v(0,"div",35),Te(1,"i",40),v(2,"span"),u(3),b()()),o&2){let e=g(2);d(3),me("",e.vehicle().altitude," ft")}}function JA(o,t){if(o&1&&Te(0,"div",41),o&2){let e=t.$implicit,n=g(2);oe("active",n.vehicle().fuel>=e*20)}}function QA(o,t){if(o&1&&(v(0,"div",15)(1,"div",23),Te(2,"i",24),v(3,"span"),u(4),b(),R(5,KA,2,0,"span",25),b(),v(6,"div",26)(7,"div",27),zi(),v(8,"svg",28),Te(9,"circle",29)(10,"circle",30),b(),Vr(),v(11,"div",31)(12,"span",32),u(13),b(),v(14,"span",33),u(15),b()()(),v(16,"div",34),R(17,ZA,4,1,"div",35),v(18,"div",36),Te(19,"i",37),v(20,"span"),u(21,"Fuel"),b()(),v(22,"div",38),ve(23,JA,1,2,"div",39,Ln),b()()()()),o&2){let e=g();d(2),wn("fa "+e.vehicle().icon),d(2),D(e.vehicle().name),d(),N(e.vehicle().cruiseControl?5:-1),d(5),Jt("stroke-dasharray",e.speedArc()),d(3),D(e.vehicle().speed),d(2),D(e.speedUnit()),d(2),N(e.vehicle().isAirVehicle&&e.vehicle().altitude?17:-1),d(6),xe(e.fuelSegments)}}var lo=window.mp,kv=(()=>{class o{constructor(e){this.cdr=e,this.visible=F(!1),this.health=F(100),this.healthCap=F(100),this.armor=F(0),this.cash=F("0"),this.bank=F("0"),this.location=F(""),this.vehicle=F(null),this.vehicleVisible=le(()=>!!this.vehicle()),this.weapon=F(null),this.weaponVisible=le(()=>!!this.weapon()),this.fuelSegments=[1,2,3,4,5],this.speedUnit=le(()=>{let n=this.vehicle();return n&&n.isAirVehicle?"kts":"mph"}),this.speedArc=le(()=>{let n=this.vehicle();if(!n)return"0 263.9";let i=n.limiter||200;return`${Math.min(n.speed,i)/i*197.9} 263.9`}),this.bigMapActive=F(!1),this.cashAmount=0,this.cashTimer=null,this.locationOverride=!1,lo.events.add("hudShow",n=>this.setVisible(n)),lo.events.add("hudHealth",(n,i)=>this.setHealth(n,i)),lo.events.add("hudArmor",n=>this.setArmor(n)),lo.events.add("hudCash",n=>this.animateCash(n)),lo.events.add("hudCashSet",n=>this.setCash(n)),lo.events.add("hudTick",n=>this.tick(n)),lo.events.add("hudVehicle",n=>this.setVehicleData(n)),lo.events.add("hudWeapon",n=>this.setWeaponData(n)),lo.events.add("hudLocation",n=>this.setLocation(n)),lo.events.add("bigMapActive",n=>{this.bigMapActive.set(!!n),this.cdr.markForCheck()})}setVisible(e){this.visible.set(!!e),this.cdr.markForCheck()}setHealth(e,n){this.health.set(Math.floor(e)),this.healthCap.set(Math.floor(n)),this.cdr.markForCheck()}setArmor(e){this.armor.set(Math.floor(e)),this.cdr.markForCheck()}animateCash(e){let n=this.cashAmount,i=this.getCountingMultiplier(Math.abs(e-n));this.clearCashTimer(),this.cashTimer=setInterval(()=>{this.cashAmount+=e<n?-i:i,this.cash.set(this.formatMoney(this.cashAmount)),(e<n&&this.cashAmount<=e||e>n&&this.cashAmount>=e)&&(this.cashAmount=e,this.cash.set(this.formatMoney(this.cashAmount)),this.clearCashTimer()),this.cdr.markForCheck()})}setCash(e){this.clearCashTimer(),this.cashAmount=e,this.cash.set(this.formatMoney(e)),this.cdr.markForCheck()}setLocation(e){this.locationOverride=!!e,this.location.set(e),this.cdr.markForCheck()}tick(e){let n=JSON.parse(e);n.property?this.location.set(n.property):n.location&&this.location.set(n.location),this.cdr.markForCheck()}setVehicleData(e){if(!e)this.vehicle.set(null);else{let n=typeof e=="string"?JSON.parse(e):e;this.vehicle.set(n)}this.cdr.markForCheck()}setWeaponData(e){e?this.weapon.set(JSON.parse(e)):this.weapon.set(null),this.cdr.markForCheck()}clearCashTimer(){this.cashTimer!==null&&(clearInterval(this.cashTimer),this.cashTimer=null)}getCountingMultiplier(e){let n=e.toString().length;return n>=9?1e6:n===8?3e4:n===7?1e4:n===6?5e3:n===5?200:n===4?50:n===3?15:1}formatMoney(e){return e.toLocaleString("en-US")}static{this.\u0275fac=function(n){return new(n||o)(Zt(Dn))}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-hud"]],decls:22,vars:14,consts:[[1,"hud"],[1,"stat-bars"],[1,"bar-group"],[1,"bar"],[1,"health-fill"],[1,"fa-solid","fa-heart","health-icon"],[1,"bar-group","armor-group"],[1,"armor-fill"],[1,"fa-solid","fa-shield","armor-icon"],[1,"weapon-strip"],[1,"info-strip"],[1,"info-section"],[1,"fa","fa-location-dot"],[1,"info-divider"],[1,"fa","fa-wallet"],[1,"vehicle-strip"],[1,"weapon-info"],[1,"fa-solid"],[1,"weapon-name"],[1,"weapon-ammo"],[1,"ammo-current"],[1,"ammo-sep"],[1,"ammo-reserve"],[1,"vehicle-name"],[1,"fa"],[1,"cruise-badge"],[1,"vehicle-details"],[1,"speedometer"],["viewBox","0 0 100 70",1,"speedo-svg"],["cx","50","cy","65","r","42","stroke-dasharray","197.9 263.9","transform","rotate(135 50 65)",1,"speedo-track"],["cx","50","cy","65","r","42","transform","rotate(135 50 65)",1,"speedo-fill"],[1,"speed-readout"],[1,"speed-value"],[1,"speed-unit"],[1,"vehicle-right"],[1,"alt-row"],[1,"fuel-label"],[1,"fa","fa-gas-pump"],[1,"fuel-segments"],[1,"fuel-seg",3,"active"],[1,"fa","fa-arrow-up"],[1,"fuel-seg"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),Te(4,"div",4),b(),Te(5,"i",5),b(),v(6,"div",6)(7,"div",3),Te(8,"div",7),b(),Te(9,"i",8),b()(),R(10,jA,12,5,"div",9),v(11,"div",10)(12,"div",11),Te(13,"i",12),v(14,"span"),u(15),b()(),Te(16,"div",13),v(17,"div",11),Te(18,"i",14),v(19,"span"),u(20),b()()(),R(21,QA,25,8,"div",15),b()),n&2&&(oe("visible",i.visible())("big-map",i.bigMapActive()),d(),oe("has-armor",i.armor()>0),d(3),Dt("height",i.health()+"%"),d(4),Dt("height",i.armor()+"%"),d(2),N(i.weaponVisible()?10:-1),d(5),D(i.location()),d(5),me("$",i.cash()),d(),N(i.vehicleVisible()?21:-1))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.hud[_ngcontent-%COMP%]{position:absolute;inset:0;display:none;color:#fff;-webkit-user-select:none;user-select:none;text-shadow:0 1px 3px rgba(0,0,0,.8)}.hud.visible[_ngcontent-%COMP%]{display:block}.hud.big-map[_ngcontent-%COMP%] .weapon-strip[_ngcontent-%COMP%]{bottom:41rem}.hud.big-map[_ngcontent-%COMP%] .stat-bars[_ngcontent-%COMP%]{left:24.92vw}.hud.big-map[_ngcontent-%COMP%] .info-strip[_ngcontent-%COMP%]{width:24.6vw}.hud.big-map[_ngcontent-%COMP%] .stat-bars.has-armor[_ngcontent-%COMP%] ~ .info-strip[_ngcontent-%COMP%]{width:25.2vw}.stat-bars[_ngcontent-%COMP%]{position:absolute;bottom:2.7rem;left:15.92vw;height:14rem;background:#0009;padding:.6rem .8rem;border-right:2px solid #e84141;display:flex;flex-direction:row;align-items:stretch;gap:.6rem}.bar-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.35rem;height:100%}.bar[_ngcontent-%COMP%]{width:1rem;flex:1;background:#ffffff1a;border-radius:4px;overflow:hidden;position:relative}.health-icon[_ngcontent-%COMP%]{font-size:.6rem;color:#e84141;flex-shrink:0}.armor-icon[_ngcontent-%COMP%]{font-size:.6rem;color:#4195e8;flex-shrink:0}.health-fill[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0;background:#e84141;border-radius:4px;transition:height .2s ease}.armor-fill[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0;background:#4195e8;border-radius:4px;transition:height .2s ease}.armor-group[_ngcontent-%COMP%]{max-width:0;overflow:hidden;opacity:0;transition:max-width .45s cubic-bezier(.34,1.56,.64,1),opacity .3s ease}.has-armor[_ngcontent-%COMP%] .armor-group[_ngcontent-%COMP%]{max-width:2rem;opacity:1}.weapon-strip[_ngcontent-%COMP%]{position:absolute;bottom:18rem;left:2rem;background:#0009;padding:.45rem .8rem;border-left:2px solid rgba(255,255,255,.25);display:flex;align-items:center;justify-content:space-between;gap:1.2rem;animation:_ngcontent-%COMP%_weapon-in .3s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes _ngcontent-%COMP%_weapon-in{0%{opacity:0;transform:translateY(.4rem)}to{opacity:1;transform:translateY(0)}}.weapon-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.07em}.weapon-info[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem;opacity:.7;color:#e84141}.weapon-name[_ngcontent-%COMP%]{font-weight:600;opacity:.95}.weapon-ammo[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.2rem}.ammo-current[_ngcontent-%COMP%]{font-size:.9rem;font-weight:700;letter-spacing:-.02em}.ammo-sep[_ngcontent-%COMP%]{font-size:.6rem;opacity:.4}.ammo-reserve[_ngcontent-%COMP%]{font-size:.65rem;opacity:.55;letter-spacing:.02em}.info-strip[_ngcontent-%COMP%]{position:absolute;bottom:.5rem;left:2rem;width:15.6vw;background:#0009;padding:.6rem .8rem;display:flex;align-items:center;gap:0;border-right:2px solid #e84141;border-left:2px solid #e84141}.stat-bars.has-armor[_ngcontent-%COMP%] ~ .info-strip[_ngcontent-%COMP%]{width:16.24vw}.info-section[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;opacity:.95;flex:1}.info-section[_ngcontent-%COMP%]:last-child{flex:0;margin-left:auto}.info-section[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.7rem;opacity:.7;width:.75rem;text-align:center;flex-shrink:0}.info-section[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.info-divider[_ngcontent-%COMP%]{width:1px;height:1rem;background:#ffffff4d;margin:0 .45rem;flex-shrink:0}.vehicle-strip[_ngcontent-%COMP%]{position:absolute;bottom:.5rem;right:2rem;width:16vw;background:#0009;padding:.5rem .7rem;display:flex;flex-direction:column;gap:.3rem;border-right:2px solid #4195e8}.vehicle-name[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.07em;opacity:.95}.vehicle-name[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem;opacity:.7;width:.7rem;text-align:center}.cruise-badge[_ngcontent-%COMP%]{margin-left:auto;font-size:.55rem;font-weight:700;background:#4195e8;color:#fff;padding:.05rem .25rem;border-radius:2px;letter-spacing:.05em}.alt-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;font-size:.65rem;opacity:.85;margin-bottom:.1rem}.alt-row[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.6rem;opacity:.7}.vehicle-details[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem}.speedometer[_ngcontent-%COMP%]{position:relative;width:4rem;flex-shrink:0}.speedo-svg[_ngcontent-%COMP%]{width:100%;display:block}.speedo-track[_ngcontent-%COMP%]{fill:none;stroke:#ffffff1a;stroke-width:7;stroke-linecap:round}.speedo-fill[_ngcontent-%COMP%]{fill:none;stroke:#4195e8;stroke-width:7;stroke-linecap:round;transition:stroke-dasharray .2s ease}.speed-readout[_ngcontent-%COMP%]{position:absolute;top:70%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;line-height:1}.speed-value[_ngcontent-%COMP%]{font-size:.85rem;font-weight:700;letter-spacing:-.02em}.speed-unit[_ngcontent-%COMP%]{font-size:.45rem;opacity:.6;text-transform:uppercase;letter-spacing:.05em}.vehicle-right[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.3rem}.fuel-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;font-size:.65rem;text-transform:uppercase;letter-spacing:.06em;opacity:.7}.fuel-label[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.6rem}.fuel-segments[_ngcontent-%COMP%]{display:flex;gap:.2rem;align-items:center}.fuel-seg[_ngcontent-%COMP%]{flex:1;height:.7rem;background:#ffffff1a;border-radius:2px;transition:background .3s ease}.fuel-seg.active[_ngcontent-%COMP%]{background:#4195e8}"],changeDetection:0})}}return o})();var eI=(o,t)=>t.id,tI=(o,t)=>t.label;function nI(o,t){if(o&1){let e=Z();v(0,"button",13),ne("click",function(){let i=P(e).$implicit,r=g(2).$implicit,a=g();return A(a.onAction(r,i))}),u(1),b()}if(o&2){let e=t.$implicit;d(),me(" ",e.label," ")}}function iI(o,t){if(o&1&&(v(0,"div",10),ve(1,nI,2,1,"button",12,tI),b()),o&2){let e=g().$implicit;d(),xe(e.actions)}}function oI(o,t){if(o&1&&Te(0,"div",14),o&2){let e=g().$implicit;Dt("animation-duration",e.duration+"ms")}}function rI(o,t){if(o&1){let e=Z();v(0,"div",2)(1,"div",3),Te(2,"i",4),v(3,"span",5),u(4),b(),v(5,"button",6),ne("click",function(){let i=P(e).$implicit,r=g();return A(r.dismiss(i.id))}),Te(6,"i",7),b()(),v(7,"div",8)(8,"p",9),u(9),b()(),R(10,iI,3,0,"div",10),R(11,oI,1,2,"div",11),b()}if(o&2){let e=t.$implicit,n=g();wn("toast--"+e.type),oe("toast--leaving",e.leaving),d(2),wn(n.typeIcon(e.type)),d(2),D(n.typeLabel(e.type)),d(5),D(e.message),d(),N(e.actions!=null&&e.actions.length?10:-1),d(),N(!(e.actions!=null&&e.actions.length)&&e.duration>0?11:-1)}}var uu=window.mp,Rv={info:"fa-circle-info",success:"fa-circle-check",warning:"fa-triangle-exclamation",error:"fa-circle-exclamation"},Nv={info:"Information",success:"Success",warning:"Warning",error:"Error"},aI=320,Lv=(()=>{class o{constructor(e){this.cdr=e,this.toasts=[],this.nextId=0,uu.events.add("notify:show",(n,i,r)=>{this.show(n,i||"info",Number(r)||5e3)}),uu.events.add("notify:action",(n,i,r,a)=>{let s=[];try{s=JSON.parse(a)}catch{}this.showAction(n,i,r||"info",s)}),uu.events.add("notify:dismiss",n=>{this.dismissByKey(n)})}typeIcon(e){return Rv[e]??Rv.info}typeLabel(e){return Nv[e]??Nv.info}dismiss(e){this.beginLeave(e)}onAction(e,n){uu.events.call("callServerEvent",n.event,...n.args??[]),this.beginLeave(e.id)}show(e,n,i){let r=this.nextId++;this.toasts=[...this.toasts,{id:r,message:e,type:n,duration:i,leaving:!1}],this.cdr.markForCheck(),setTimeout(()=>this.beginLeave(r),i)}showAction(e,n,i,r){this.dismissByKey(e);let a=this.nextId++;this.toasts=[...this.toasts,{id:a,key:e,message:n,type:i,duration:0,leaving:!1,actions:r}],this.cdr.markForCheck()}dismissByKey(e){let n=this.toasts.find(i=>i.key===e);n&&this.beginLeave(n.id)}beginLeave(e){let n=this.toasts.find(i=>i.id===e);!n||n.leaving||(this.toasts=this.toasts.map(i=>i.id===e?De(he({},i),{leaving:!0}):i),this.cdr.markForCheck(),setTimeout(()=>{this.toasts=this.toasts.filter(i=>i.id!==e),this.cdr.markForCheck()},aI))}static{this.\u0275fac=function(n){return new(n||o)(Zt(Dn))}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-notify"]],decls:3,vars:0,consts:[[1,"notify-container"],["role","alert","aria-live","assertive",1,"toast",3,"class","toast--leaving"],["role","alert","aria-live","assertive",1,"toast"],[1,"toast__header"],[1,"toast__icon","fa-solid"],[1,"toast__type-label"],["type","button","aria-label","Dismiss",1,"toast__close",3,"click"],[1,"fa-solid","fa-xmark"],[1,"toast__body"],[1,"toast__message"],[1,"toast__actions"],[1,"toast__progress",3,"animation-duration"],["type","button",1,"toast__action-btn"],["type","button",1,"toast__action-btn",3,"click"],[1,"toast__progress"]],template:function(n,i){n&1&&(v(0,"div",0),ve(1,rI,12,10,"div",1,eI),b()),n&2&&(d(),xe(i.toasts))},styles:['.toast--info[_ngcontent-%COMP%]{--toast-clr: #4a9eff;--toast-clr-bg: rgba(74, 158, 255, .1)}.toast--success[_ngcontent-%COMP%]{--toast-clr: #7ad694;--toast-clr-bg: rgba(122, 214, 148, .1)}.toast--warning[_ngcontent-%COMP%]{--toast-clr: #f5a85a;--toast-clr-bg: rgba(245, 168, 90, .1)}.toast--error[_ngcontent-%COMP%]{--toast-clr: #f07373;--toast-clr-bg: rgba(240, 115, 115, .1)}[_nghost-%COMP%]{display:block;position:absolute;inset:0;pointer-events:none}.notify-container[_ngcontent-%COMP%]{position:absolute;bottom:20rem;left:3rem;display:flex;flex-direction:column-reverse;gap:.6rem;width:22rem;pointer-events:none;z-index:9999}.toast[_ngcontent-%COMP%]{pointer-events:all;border-radius:10px;overflow:hidden;border:1px solid var(--sw-border, rgba(95, 101, 114, .48));background:linear-gradient(160deg,#2b2b2df0,#202228f7);box-shadow:0 8px 24px #00000073;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);animation:_ngcontent-%COMP%_toast-enter .25s cubic-bezier(.22,1,.36,1) forwards}.toast.toast--leaving[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_toast-leave .32s ease-in forwards}.toast__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.55rem .75rem;background:var(--toast-clr-bg);border-bottom:1px solid rgba(var(--sw-border, 95, 101, 114),.3)}.toast__icon[_ngcontent-%COMP%]{font-size:.9rem;color:var(--toast-clr);flex-shrink:0}.toast__type-label[_ngcontent-%COMP%]{flex:1;font-size:.72rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--toast-clr);font-family:var(--overlay-font-compact, "Inter", sans-serif)}.toast__close[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:1.4rem;height:1.4rem;border:none;background:transparent;cursor:pointer;border-radius:4px;color:var(--sw-text-soft, #a9b0bb);font-size:.75rem;transition:color .15s,background .15s;flex-shrink:0}.toast__close[_ngcontent-%COMP%]:hover{color:var(--sw-text, #d8dde6);background:#ffffff14}.toast__body[_ngcontent-%COMP%]{padding:.65rem .85rem .7rem}.toast__message[_ngcontent-%COMP%]{margin:0;font-size:.82rem;line-height:1.45;color:var(--sw-text, #d8dde6);font-family:var(--overlay-font-primary, "Google Sans", sans-serif);word-break:break-word}.toast__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:0 .85rem .75rem}.toast__action-btn[_ngcontent-%COMP%]{flex:1;padding:.35rem .6rem;border:1px solid var(--toast-clr);border-radius:6px;background:transparent;color:var(--toast-clr);font-size:.75rem;font-weight:600;font-family:var(--overlay-font-compact, "Inter", sans-serif);cursor:pointer;transition:background .15s,color .15s}.toast__action-btn[_ngcontent-%COMP%]:hover{background:var(--toast-clr);color:#111}.toast__action-btn[_ngcontent-%COMP%]:last-child{border-color:var(--sw-border, rgba(95, 101, 114, .48));color:var(--sw-text-soft, #a9b0bb)}.toast__action-btn[_ngcontent-%COMP%]:last-child:hover{background:#ffffff14;color:var(--sw-text, #d8dde6)}.toast__progress[_ngcontent-%COMP%]{height:2px;background:var(--toast-clr);transform-origin:left center;animation:_ngcontent-%COMP%_toast-progress linear forwards}@keyframes _ngcontent-%COMP%_toast-enter{0%{transform:translate(calc(-100% - 1rem));opacity:0}to{transform:translate(0);opacity:1}}@keyframes _ngcontent-%COMP%_toast-leave{0%{transform:translate(0);opacity:1;max-height:8rem;margin-bottom:0}to{transform:translate(calc(-100% - 1rem));opacity:0;max-height:0;margin-bottom:-.6rem}}@keyframes _ngcontent-%COMP%_toast-progress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}'],changeDetection:0})}}return o})();function sI(o,t){o&1&&(v(0,"div",1),Te(1,"div",3),v(2,"p"),u(3,"Loading stats..."),b()())}function lI(o,t){if(o&1&&(v(0,"section",4)(1,"article",5)(2,"span",6),u(3,"Level"),b(),v(4,"strong",7),u(5),b()(),v(6,"article",5)(7,"span",6),u(8,"Time Online"),b(),v(9,"strong",7),u(10),b()(),v(11,"article",5)(12,"span",6),u(13,"Status"),b(),v(14,"strong",7),u(15),b()()(),v(16,"section",8)(17,"article",9)(18,"h4"),u(19,"Identity"),b(),v(20,"div",10)(21,"span"),u(22,"Base Model"),b(),v(23,"strong"),u(24),b()(),v(25,"div",10)(26,"span"),u(27,"Age"),b(),v(28,"strong"),u(29),b()(),v(30,"div",10)(31,"span"),u(32,"Phone Number"),b(),v(33,"strong"),u(34),b()()(),v(35,"article",9)(36,"h4"),u(37,"Career"),b(),v(38,"div",10)(39,"span"),u(40,"Faction"),b(),v(41,"strong"),u(42),b()(),v(43,"div",10)(44,"span"),u(45,"Faction Rank"),b(),v(46,"strong"),u(47),b()(),v(48,"div",10)(49,"span"),u(50,"Companies"),b(),v(51,"strong"),u(52),b()(),v(53,"div",10)(54,"span"),u(55,"Positions"),b(),v(56,"strong"),u(57),b()()(),v(58,"article",9)(59,"h4"),u(60,"Assets"),b(),v(61,"div",10)(62,"span"),u(63,"Vehicles Owned"),b(),v(64,"strong"),u(65),b()(),v(66,"div",10)(67,"span"),u(68,"Property Keys"),b(),v(69,"strong"),u(70),b()(),v(71,"div",10)(72,"span"),u(73,"Net Worth"),b(),v(74,"strong"),u(75),b()()(),v(76,"article",9)(77,"h4"),u(78,"Session"),b(),v(79,"div",10)(80,"span"),u(81,"Current Session"),b(),v(82,"strong"),u(83),b()(),v(84,"div",10)(85,"span"),u(86,"Total Time Online"),b(),v(87,"strong"),u(88),b()(),v(89,"div",10)(90,"span"),u(91,"Status"),b(),v(92,"strong"),u(93),b()(),v(94,"div",10)(95,"span"),u(96,"Server Date"),b(),v(97,"strong"),u(98),b()()()()),o&2){let e=t,n=g();d(5),D(e.progression.level),d(5),D(n.timeOnlineDisplay()),d(5),D(e.session.status),d(9),D(e.identity.gender),d(5),D(e.identity.age),d(5),D(e.identity.phoneNumber),d(8),D(e.career.faction),d(5),D(e.career.factionRank),d(5),D(e.career.companies),d(5),D(e.career.companyPositions),d(8),D(e.assets.vehiclesOwned),d(5),D(e.assets.propertyKeys),d(5),D(e.assets.netWorth),d(8),D(n.currentSessionDisplay()),d(5),D(e.session.totalTimeOnlineSeconds),d(5),D(e.session.status),d(5),D(n.serverDateDisplay())}}function cI(o,t){o&1&&(v(0,"div",2)(1,"p"),u(2,"No stats available"),b()())}var gm=window.mp,Fv=(()=>{class o{constructor(){this.loading=F(!1),this.data=F(null),this.timeOnlineDisplay=le(()=>{let e=this.data();if(!e)return"--";let n=this.nowMs(),i=Math.max(0,Math.floor((n-e.serverTimestampMs)/1e3));return this.formatDuration(e.progression.timeOnlineTotalSeconds+i)}),this.currentSessionDisplay=le(()=>{let e=this.data();if(!e)return"--";let n=this.nowMs(),i=Math.max(0,Math.floor((n-e.serverTimestampMs)/1e3));return this.formatDuration(e.session.currentSessionSeconds+i)}),this.serverDateDisplay=le(()=>{let e=this.data();if(!e)return"--";let n=this.nowMs(),i=Math.max(0,n-e.serverTimestampMs);return new Date(e.serverTimestampMs+i).toLocaleString()}),this.handlers=[],this.nowMs=F(Date.now()),this.tickerId=null}ngOnInit(){this.tickerId=setInterval(()=>{this.nowMs.set(Date.now())},1e3),this.on("menu:stats",e=>{let n=this.parseStats(e);n&&(this.data.set(n),this.nowMs.set(Date.now()),this.loading.set(!1))}),this.refresh()}ngOnDestroy(){this.tickerId&&(clearInterval(this.tickerId),this.tickerId=null);for(let{name:e,fn:n}of this.handlers)gm.events.remove(e,n)}refresh(){this.loading.set(!0),gm.events.call("callServerEvent","menu:character:stats")}parseStats(e){if(!e||typeof e!="string")return null;try{let n=JSON.parse(e);if(!n||typeof n!="object")return null;let i=this.toNumber(n.serverTimestampMs)??Date.now(),r=Math.max(0,this.toNumber(n.progression?.timeOnlineTotalSeconds)??0),a=Math.max(0,this.toNumber(n.session?.currentSessionSeconds)??0);return{timestamp:this.toDisplayValue(n.timestamp)!=="--"?this.toDisplayValue(n.timestamp):new Date().toLocaleString(),serverTimestampMs:i,progression:{level:this.toDisplayValue(n.progression?.level),timeOnlineTotalSeconds:r},identity:{gender:this.toDisplayValue(n.identity?.gender),phoneNumber:this.toDisplayValue(n.identity?.phoneNumber),age:this.toDisplayValue(n.identity?.age)},career:{faction:this.toDisplayValue(n.career?.faction),factionRank:this.toDisplayValue(n.career?.factionRank),companies:this.toDisplayValue(n.career?.companies),companyPositions:this.toDisplayValue(n.career?.companyPositions)},assets:{vehiclesOwned:this.toDisplayValue(n.assets?.vehiclesOwned),propertyKeys:this.toDisplayValue(n.assets?.propertyKeys),netWorth:this.toDisplayValue(n.assets?.netWorth)},session:{currentSessionSeconds:a,totalTimeOnlineSeconds:this.formatDuration(Math.max(0,this.toNumber(n.session?.totalTimeOnlineSeconds)??0)),status:this.toDisplayValue(n.session?.status)}}}catch{return null}}toDisplayValue(e){if(e==null)return"--";if(typeof e=="number")return Number.isFinite(e)?e.toLocaleString():"--";if(typeof e=="boolean")return e?"Yes":"No";let n=String(e).trim();return n.length?n:"--"}toNumber(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim().length){let n=Number(e);return Number.isFinite(n)?n:null}return null}formatDuration(e){let n=Math.max(0,Math.floor(e)),i=Math.floor(n/86400),r=Math.floor(n%86400/3600),a=Math.floor(n%3600/60);return i>0?`${i}d ${r}h ${a}m`:r>0?`${r}h ${a}m`:`${a}m`}on(e,n){gm.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-character-stats"]],decls:4,vars:1,consts:[[1,"stats-panel"],[1,"stats-content","loading"],[1,"stats-content","empty"],[1,"spinner"],[1,"overview-top"],[1,"metric-card"],[1,"metric-label"],[1,"metric-value"],[1,"overview-grid"],[1,"overview-block"],[1,"field-row"]],template:function(n,i){if(n&1&&(v(0,"div",0),R(1,sI,4,0,"div",1)(2,lI,99,17)(3,cI,3,0,"div",2),b()),n&2){let r;d(),N(i.loading()?1:(r=i.data())?2:3,r)}},dependencies:[tt],styles:["[_nghost-%COMP%]{display:flex;flex:1;min-height:0}.stats-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;gap:1rem;padding:1rem}.stats-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.8rem}.stats-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:700;color:#fff;letter-spacing:.6px;text-transform:uppercase}.stats-header[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.74rem;color:#ffffff8c;letter-spacing:.2px}.action-btn[_ngcontent-%COMP%]{background:#d11b2d26;border:1px solid rgba(209,27,45,.35);color:#fff;padding:.4rem .8rem;border-radius:3px;cursor:pointer;font-size:.75rem;font-weight:600;transition:all .2s ease}.action-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#d11b2d40;border-color:#d11b2d8c;box-shadow:0 0 8px #d11b2d4d}.action-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.overview-top[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.metric-card[_ngcontent-%COMP%]{background:linear-gradient(155deg,#ffffff0d,#0a0a0a1f);border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:.7rem .8rem;display:flex;flex-direction:column;gap:.35rem}.metric-card.highlight[_ngcontent-%COMP%]{border-color:#d11b2d73;background:linear-gradient(150deg,#d11b2d33,#1414141f);box-shadow:inset 0 0 0 1px #d11b2d33}.metric-label[_ngcontent-%COMP%]{font-size:.68rem;color:#fff9;letter-spacing:.6px;text-transform:uppercase}.metric-value[_ngcontent-%COMP%]{font-size:1.08rem;color:#fff;line-height:1.15}.overview-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.overview-block[_ngcontent-%COMP%]{background:linear-gradient(155deg,#07090e73,#0000004d);border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:.75rem .8rem;display:flex;flex-direction:column;gap:.45rem}.overview-block[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .2rem;font-size:.74rem;font-weight:700;color:#ffffffe0;letter-spacing:.7px;text-transform:uppercase}.field-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:baseline;gap:.8rem;padding-top:.2rem;border-top:1px solid rgba(255,255,255,.06)}.field-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.72rem;color:#ffffff9e}.field-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.78rem;color:#fff;font-weight:600;text-align:right;overflow-wrap:anywhere}.stats-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;align-items:center;justify-content:center;min-height:0;gap:.8rem}.stats-content.loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .stats-content.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#ffffff80}.spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:2px solid rgba(209,27,45,.2);border-top-color:#d11b2d;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.stats-footer[_ngcontent-%COMP%]{text-align:center;padding-top:.5rem;border-top:1px solid rgba(209,27,45,.15)}.stats-footer[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:.7rem;color:#ffffff59;letter-spacing:.3px}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media(max-width:900px){.overview-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:680px){.stats-panel[_ngcontent-%COMP%]{padding:.8rem}.overview-top[_ngcontent-%COMP%], .overview-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})}}return o})();function dI(o,t){if(o&1){let e=Z();v(0,"button",15),ne("click",function(){P(e);let i=g(4);return A(i.cancelCapture())}),u(1,"Cancel"),b()}}function uI(o,t){if(o&1){let e=Z();v(0,"div",6)(1,"div",7)(2,"strong"),u(3),b(),v(4,"div",8)(5,"span",9),u(6),b(),v(7,"span",10),u(8),b()()(),v(9,"div",11)(10,"button",12),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.startCapture(i.id))}),u(11),b(),v(12,"button",13),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.resetOne(i.id))}),u(13,"Reset"),b(),R(14,dI,2,0,"button",14),b()()}if(o&2){let e=t.$implicit,n=g(3);d(3),D(n.labelFor(e.id)),d(2),oe("hold",n.isHold(e)),d(),D(n.isHold(e)?"HOLD":"PRESS"),d(2),me("Default: ",e.defaultCode),d(2),oe("capturing",n.isCapturing(e.id)),d(),me(" ",n.isCapturing(e.id)?"Press Key...":e.code," "),d(3),N(n.isCapturing(e.id)?14:-1)}}function hI(o,t){if(o&1&&(v(0,"section",4)(1,"header")(2,"h4"),u(3),b(),v(4,"span"),u(5),b()(),v(6,"div",5),ve(7,uI,15,9,"div",6,zr().trackByBind,!0),b()()),o&2){let e=t.$implicit;d(3),D(e.title),d(2),me("",e.entries.length," binds"),d(2),xe(e.entries)}}function pI(o,t){if(o&1&&ve(0,hI,9,2,"section",4,zr().trackByCategory,!0),o&2){let e=g();xe(e.categories())}}function mI(o,t){o&1&&(v(0,"div",3),Te(1,"div",16),v(2,"p"),u(3,"Loading keybinds..."),b()())}var Ha=window.mp,fI={phone:"Phone",playerList:"Player List",interactive:"Interact",opacityControl:"Chat Opacity",cursor:"Cursor Toggle",inventory:"Inventory",mission:"Mission Action",chat:"Chat",cancel:"Cancel Action",crouch:"Crouch",domelight:"Vehicle Dome Light",passengerEnter:"Enter Passenger Seat",lightsSiren:"Siren Lights",primarySiren:"Primary Siren",secondarySiren:"Secondary Siren",backupSiren:"Backup Siren",manualSiren:"Manual Siren",airhorn:"Airhorn",resetpos:"Reset Position",pushToStart:"Push To Start",propertyInteraction:"Property Interaction",manualUnfreeze:"Manual Unfreeze",interactionModifier:"Interaction Modifier",actionWheel:"Action Wheel",animPos:"Animation Positioning",selectiveFire:"Selective Fire",pointFinger:"Point Finger",vehicleLights:"Vehicle Lights",lock:"Vehicle Lock",alprCheckForward:"ALPR Check Forward",radarResetFast:"Radar Reset Fast",equipBulletWeapon:"Equip Bullet Weapon",equipMeleeWeapon:"Equip Melee Weapon",tackle:"Tackle",updateMiniMap:"Update Mini Map"},Vv=(()=>{class o{constructor(){this.categories=F([]),this.waitingFor=F(null),this.loaded=F(!1),this.handlers=[],this.keydownHandler=e=>this.onWindowKeydown(e)}ngOnInit(){this.on("binds:update",e=>{if(typeof e=="string")try{let n=JSON.parse(e);if(!Array.isArray(n))return;this.categories.set(this.buildCategories(n)),this.loaded.set(!0)}catch{}}),window.addEventListener("keydown",this.keydownHandler,{capture:!0}),Ha.events.call("binds:request")}ngOnDestroy(){window.removeEventListener("keydown",this.keydownHandler,{capture:!0});for(let{name:e,fn:n}of this.handlers)Ha.events.remove(e,n)}startCapture(e){this.waitingFor.set(e)}cancelCapture(){this.waitingFor.set(null)}resetOne(e){Ha.events.call("binds:resetOne",e)}resetAll(){Ha.events.call("binds:resetAll")}labelFor(e){return fI[e]??e}isHold(e){return!!e.keyDownAndUp}isCapturing(e){return this.waitingFor()===e}trackByBind(e,n){return n.id}trackByCategory(e,n){return String(n.condition)}onWindowKeydown(e){let n=this.waitingFor();if(!n)return;if(e.preventDefault(),e.stopPropagation(),e.key==="Escape"){this.cancelCapture();return}let i=Number(e.keyCode||e.which||0);if(!Number.isFinite(i)||i<=0)return;let r=this.toDisplayCode(e);r&&(Ha.events.call("binds:set",n,i,r),this.waitingFor.set(null))}toDisplayCode(e){let n=e.key;if(!n)return"";if(n.length===1)return n.toUpperCase();let r={Escape:"ESC"," ":"SPACE",Spacebar:"SPACE",Enter:"ENTER",Tab:"TAB",Backspace:"BACKSPACE",Alt:"ALT",AltGraph:"ALT",Control:"CTRL",Shift:"SHIFT",Meta:"META",ContextMenu:"MENU",ArrowUp:"UP",ArrowDown:"DOWN",ArrowLeft:"LEFT",ArrowRight:"RIGHT",PageUp:"PAGEUP",PageDown:"PAGEDOWN",Insert:"INS",Delete:"DEL",Home:"HOME",End:"END",CapsLock:"CAPSLOCK",NumLock:"NUMLOCK",ScrollLock:"SCROLLLOCK",Pause:"PAUSE",PrintScreen:"PRTSC"}[n];if(r)return r;if(/^F\d{1,2}$/i.test(n))return n.toUpperCase();let a=e.code||"";if(a.startsWith("Numpad")){let s=a.replace("Numpad","");return s==="Decimal"?"Numpad .":s==="Multiply"?"Numpad *":s==="Add"?"Numpad +":s==="Subtract"?"Numpad -":s==="Divide"?"Numpad /":s==="Enter"?"Numpad Enter":`Numpad ${s}`}return n.toUpperCase()}buildCategories(e){let n={0:[],1:[],2:[]};for(let i of e){let r=this.normalizeCondition(i.condition);n[r].push(De(he({},i),{condition:r}))}for(let i of[0,1,2])n[i].sort((r,a)=>this.labelFor(r.id).localeCompare(this.labelFor(a.id)));return[{title:"Always Available",condition:0,entries:n[0]},{title:"Vehicle Only",condition:1,entries:n[1]},{title:"On Foot Only",condition:2,entries:n[2]}]}normalizeCondition(e){return e===1||e===2?e:0}on(e,n){Ha.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-keybind-settings"]],decls:8,vars:1,consts:[[1,"keybinds-root"],[1,"keybinds-topbar"],["type","button",1,"small-btn",3,"click"],[1,"loading-state"],[1,"bind-category"],[1,"bind-list"],[1,"bind-row"],[1,"bind-meta"],[1,"bind-tags"],[1,"tag","mode"],[1,"tag","default"],[1,"bind-actions"],["type","button",1,"key-chip",3,"click"],["type","button",1,"row-btn",3,"click"],["type","button",1,"row-btn","muted"],["type","button",1,"row-btn","muted",3,"click"],[1,"spinner"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"p"),u(3,"Choose a bind and press a key. HOLD binds trigger on key down and key up."),b(),v(4,"button",2),ne("click",function(){return i.resetAll()}),u(5,"Reset All"),b()(),R(6,pI,2,0)(7,mI,4,0,"div",3),b()),n&2&&(d(6),N(i.loaded()?6:7))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;min-height:0}.keybinds-root[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;min-height:0;height:100%;overflow:auto;padding-right:.15rem;font-family:Inter,Google Sans,Segoe UI,sans-serif}.keybinds-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.6rem}.keybinds-topbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.74rem;color:#ffffffb3}.small-btn[_ngcontent-%COMP%], .row-btn[_ngcontent-%COMP%], .key-chip[_ngcontent-%COMP%]{border:1px solid rgba(var(--sw-accent-rgb),.4);border-radius:6px;background:rgba(var(--sw-accent-rgb),.14);color:#fff;font-family:Inter,Google Sans,Segoe UI,sans-serif;font-size:.7rem;font-weight:600;letter-spacing:.03em;padding:.35rem .5rem;cursor:pointer}.small-btn[_ngcontent-%COMP%]:hover, .row-btn[_ngcontent-%COMP%]:hover, .key-chip[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.24);border-color:rgba(var(--sw-accent-rgb),.64)}.bind-category[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.11);border-radius:8px;background:linear-gradient(155deg,#07090e73,#0000004d);padding:.6rem}.bind-category[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:.45rem}.bind-category[_ngcontent-%COMP%] header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;text-transform:uppercase;letter-spacing:.05em;font-size:.73rem;color:#fff}.bind-category[_ngcontent-%COMP%] header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.68rem;color:#ffffff94}.bind-list[_ngcontent-%COMP%]{display:grid;gap:.38rem}.bind-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.65rem;align-items:center;border-top:1px solid rgba(255,255,255,.06);padding-top:.38rem}.bind-row[_ngcontent-%COMP%]:first-child{border-top:0;padding-top:0}.bind-meta[_ngcontent-%COMP%]{min-width:0}.bind-meta[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin:0;font-size:.74rem;color:#ffffffe6}.bind-tags[_ngcontent-%COMP%]{margin-top:.18rem;display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}.tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border-radius:999px;border:1px solid rgba(255,255,255,.18);padding:.05rem .35rem;font-size:.62rem;letter-spacing:.04em}.tag.mode[_ngcontent-%COMP%]{color:bisque;border-color:#ffbe6e73;background:#ffbe6e24}.tag.mode.hold[_ngcontent-%COMP%]{color:#fff4a6;border-color:#e8d05185;background:#e8d05129}.tag.default[_ngcontent-%COMP%]{color:#ffffffad}.bind-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem}.key-chip[_ngcontent-%COMP%]{min-width:5.6rem;text-align:center}.key-chip.capturing[_ngcontent-%COMP%]{border-color:#ffd280e0;background:#ffd28033;color:#fff8dd}.row-btn[_ngcontent-%COMP%]{border-color:#fff3;background:#ffffff12}.row-btn[_ngcontent-%COMP%]:hover{border-color:rgba(var(--sw-accent-rgb),.7);background:rgba(var(--sw-accent-rgb),.2)}.row-btn.muted[_ngcontent-%COMP%]{border-color:#ffffff29;background:transparent;color:#ffffffb8}.loading-state[_ngcontent-%COMP%]{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.8rem}.loading-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#ffffff85}.spinner[_ngcontent-%COMP%]{width:22px;height:22px;border:2px solid rgba(209,27,45,.2);border-top-color:#d11b2d;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media(max-width:980px){.bind-row[_ngcontent-%COMP%]{grid-template-columns:1fr}.bind-actions[_ngcontent-%COMP%]{justify-content:flex-start;flex-wrap:wrap}}"],changeDetection:0})}}return o})();function gI(o,t){o&1&&(v(0,"div",1),Te(1,"div",2),v(2,"p"),u(3,"Loading walkstyles..."),b()())}function _I(o,t){if(o&1){let e=Z();v(0,"button",16),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.choose(i.clipset))}),v(1,"span",17),u(2),b(),v(3,"span",18),u(4),b()()}if(o&2){let e=t.$implicit,n=g(2);oe("active",n.pendingClipset()===e.clipset)("current",n.currentClipset()===e.clipset),d(2),D(e.label),d(2),D(e.preview)}}function vI(o,t){if(o&1){let e=Z();v(0,"button",16),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.choose(i.clipset))}),v(1,"span",17),u(2),b(),v(3,"span",18),u(4),b()()}if(o&2){let e=t.$implicit,n=g(2);oe("active",n.pendingClipset()===e.clipset)("current",n.currentClipset()===e.clipset),d(2),D(e.label),d(2),D(e.preview)}}function xI(o,t){if(o&1){let e=Z();v(0,"section",3)(1,"div")(2,"h4"),u(3,"Walkstyle Library"),b(),v(4,"p"),u(5,"Male and female libraries are split for browsing, but any character model can use any style."),b()(),v(6,"label",4)(7,"span"),u(8,"Search"),b(),v(9,"input",5),ne("input",function(i){P(e);let r=g();return A(r.updateSearch((i.target.value||"").toString()))}),b()()(),v(10,"section",6)(11,"article",7)(12,"span",8),u(13,"Current Style"),b(),v(14,"strong"),u(15),b()(),v(16,"article",7)(17,"span",8),u(18,"Pending Style"),b(),v(19,"strong"),u(20),b()(),v(21,"div",9)(22,"button",10),ne("click",function(){P(e);let i=g();return A(i.clear())}),u(23,"Use Default"),b(),v(24,"button",11),ne("click",function(){P(e);let i=g();return A(i.apply())}),u(25,"Apply Style"),b()()(),v(26,"section",12)(27,"article",13)(28,"header")(29,"h5"),u(30,"Male Library"),b(),v(31,"small"),u(32),b()(),v(33,"div",14),ve(34,_I,5,6,"button",15,zr().trackByClipset,!0),b()(),v(36,"article",13)(37,"header")(38,"h5"),u(39,"Female Library"),b(),v(40,"small"),u(41),b()(),v(42,"div",14),ve(43,vI,5,6,"button",15,zr().trackByClipset,!0),b()()()}if(o&2){let e=g();d(9),Ee("value",e.search()),d(6),D(e.currentLabel()),d(5),D(e.pendingLabel()),d(4),Ee("disabled",!e.dirty()),d(8),me("",e.filteredMale().length," styles"),d(2),xe(e.filteredMale()),d(7),me("",e.filteredFemale().length," styles"),d(2),xe(e.filteredFemale())}}var hu=window.mp,Bv=(()=>{class o{constructor(){this.loading=F(!0),this.search=F(""),this.options=F([]),this.currentClipset=F(null),this.pendingClipset=F(null),this.filteredMale=le(()=>this.filterGroup("male")),this.filteredFemale=le(()=>this.filterGroup("female")),this.currentLabel=le(()=>this.findLabel(this.currentClipset())),this.pendingLabel=le(()=>this.findLabel(this.pendingClipset())),this.dirty=le(()=>this.pendingClipset()!==this.currentClipset()),this.handlers=[]}ngOnInit(){this.on("walkstyle:update",e=>{if(typeof e=="string")try{let n=JSON.parse(e);if(!n||!Array.isArray(n.walkstyles))return;this.options.set(n.walkstyles),this.currentClipset.set(typeof n.selectedClipset=="string"?n.selectedClipset:null),this.pendingClipset.set(typeof n.selectedClipset=="string"?n.selectedClipset:null),this.loading.set(!1)}catch{}}),hu.events.call("callServerEvent","menu:walkstyle:request")}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)hu.events.remove(e,n)}updateSearch(e){this.search.set(e.trimStart())}choose(e){this.pendingClipset.set(e)}clear(){this.pendingClipset.set(null)}apply(){hu.events.call("callServerEvent","menu:walkstyle:save",JSON.stringify({clipset:this.pendingClipset()}))}trackByClipset(e,n){return n.clipset}filterGroup(e){let n=this.search().trim().toLowerCase();return this.options().filter(i=>i.group!==e?!1:n?i.label.toLowerCase().includes(n)||i.clipset.toLowerCase().includes(n):!0)}findLabel(e){if(!e)return"Default";let n=this.options().find(i=>i.clipset===e);return n?n.label:e}on(e,n){hu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-walkstyle-settings"]],decls:3,vars:1,consts:[[1,"walkstyle-page"],[1,"walkstyle-loading"],[1,"spinner"],[1,"walkstyle-toolbar"],[1,"search-box"],["type","text","placeholder","Find a style or clipset",3,"input","value"],[1,"walkstyle-summary"],[1,"summary-card"],[1,"summary-label"],[1,"summary-actions"],["type","button",1,"secondary-btn",3,"click"],["type","button",1,"primary-btn",3,"click","disabled"],[1,"walkstyle-columns"],[1,"walkstyle-group"],[1,"walkstyle-grid"],["type","button",1,"walkstyle-card",3,"active","current"],["type","button",1,"walkstyle-card",3,"click"],[1,"card-title"],[1,"card-meta"]],template:function(n,i){n&1&&(v(0,"div",0),R(1,gI,4,0,"div",1)(2,xI,45,6),b()),n&2&&(d(),N(i.loading()?1:2))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:flex;flex:1;min-height:0}.walkstyle-page[_ngcontent-%COMP%]{display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:.85rem;flex:1;min-height:0;overflow:hidden}.walkstyle-loading[_ngcontent-%COMP%]{min-height:280px;display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;gap:.8rem}.walkstyle-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#ffffff80;font-size:.84rem}.walkstyle-toolbar[_ngcontent-%COMP%], .walkstyle-summary[_ngcontent-%COMP%], .walkstyle-group[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:8px;background:linear-gradient(155deg,#07090e73,#0000004d);padding:.8rem}.walkstyle-toolbar[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:1rem}.walkstyle-toolbar[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:.86rem;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.05em}.walkstyle-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#ffffff9e;font-size:.76rem;line-height:1.4}.search-box[_ngcontent-%COMP%]{min-width:16rem;display:flex;flex-direction:column;gap:.3rem;font-size:.7rem;color:#ffffffb8;text-transform:uppercase;letter-spacing:.06em}.search-box[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.16);border-radius:6px;background:#00000038;color:#fff;padding:.55rem .65rem;font-size:.78rem}.walkstyle-summary[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;align-items:center}.summary-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.2rem}.summary-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#fff;font-size:.88rem}.summary-label[_ngcontent-%COMP%]{color:#ffffff94;font-size:.68rem;text-transform:uppercase;letter-spacing:.06em}.summary-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.55rem}.primary-btn[_ngcontent-%COMP%], .secondary-btn[_ngcontent-%COMP%]{border-radius:6px;padding:.5rem .75rem;font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.primary-btn[_ngcontent-%COMP%]{border:1px solid rgba(var(--sw-accent-rgb),.55);background:rgba(var(--sw-accent-rgb),.18);color:#fff}.primary-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.secondary-btn[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.12);background:#ffffff0a;color:#ffffffdb}.walkstyle-columns[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:.2rem}.walkstyle-columns[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}.walkstyle-columns[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:rgba(var(--sw-accent-rgb),.05)}.walkstyle-columns[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:999px;background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.65),rgba(var(--sw-accent-rgb),.42))}.walkstyle-columns[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.88),rgba(var(--sw-accent-rgb),.62))}.walkstyle-columns[_ngcontent-%COMP%]{scrollbar-color:rgba(var(--sw-accent-rgb),.7) rgba(var(--sw-accent-rgb),.08);scrollbar-width:thin}.walkstyle-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.8rem}.walkstyle-group[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.walkstyle-group[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0;color:#fffffff0;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em}.walkstyle-group[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#ffffff85;font-size:.72rem}.walkstyle-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}.walkstyle-card[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.1);border-radius:7px;background:#ffffff08;padding:.6rem;display:flex;flex-direction:column;gap:.28rem;text-align:left;color:#fff;cursor:pointer}.walkstyle-card[_ngcontent-%COMP%]:hover{border-color:rgba(var(--sw-accent-rgb),.4);background:rgba(var(--sw-accent-rgb),.08)}.walkstyle-card.active[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.72);background:rgba(var(--sw-accent-rgb),.16)}.walkstyle-card.current[_ngcontent-%COMP%]:not(.active){border-color:#ffffff47}.card-title[_ngcontent-%COMP%]{font-size:.77rem;font-weight:700}.card-meta[_ngcontent-%COMP%]{color:#ffffff8f;font-size:.66rem;line-height:1.35;word-break:break-word}.spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:2px solid rgba(209,27,45,.2);border-top-color:#d11b2d;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media(max-width:1100px){.walkstyle-summary[_ngcontent-%COMP%], .walkstyle-columns[_ngcontent-%COMP%], .walkstyle-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media(max-width:760px){.walkstyle-toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch}.search-box[_ngcontent-%COMP%]{min-width:0}.summary-actions[_ngcontent-%COMP%]{justify-content:stretch;flex-direction:column}}"],changeDetection:0})}}return o})();function bI(o,t){if(o&1){let e=Z();_(0,"section",2)(1,"div",4)(2,"h3"),u(3,"Walk Styles"),f(),_(4,"button",5),z("click",function(){P(e);let i=g(3);return A(i.closeAdvanced())}),u(5,"Back to Gameplay"),f()(),ye(6,"overlay-walkstyle-settings"),f()}}function yI(o,t){if(o&1){let e=Z();_(0,"section",3)(1,"div",4)(2,"h3"),u(3,"Keybinds"),f(),_(4,"button",5),z("click",function(){P(e);let i=g(3);return A(i.closeAdvanced())}),u(5,"Back to Gameplay"),f()(),ye(6,"overlay-keybind-settings"),f()}}function CI(o,t){if(o&1&&R(0,bI,7,0,"section",2)(1,yI,7,0,"section",3),o&2){let e=g(2);N(e.advancedView()==="walkstyle"?0:1)}}function MI(o,t){if(o&1){let e=Z();_(0,"section",6)(1,"div",7)(2,"h3"),u(3,"Advanced Gameplay"),f(),_(4,"p"),u(5,"Walk styles and keybind editing are separated from regular toggles."),f()(),_(6,"div",8)(7,"button",5),z("click",function(){P(e);let i=g(2);return A(i.openAdvanced("walkstyle"))}),u(8,"Walk Styles"),f(),_(9,"button",5),z("click",function(){P(e);let i=g(2);return A(i.openAdvanced("keybinds"))}),u(10,"Keybinds"),f()()(),_(11,"section",9)(12,"h4"),u(13,"Core Gameplay"),f(),_(14,"label",10)(15,"span"),u(16,"Talking Animations"),f(),_(17,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("talkingAnimations",i.target.checked))}),f()(),_(18,"label",10)(19,"span"),u(20,"Ambient Sounds"),f(),_(21,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("ambientSounds",i.target.checked))}),f()(),_(22,"label",10)(23,"span"),u(24,"Crawl On Back"),f(),_(25,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("crawlingStyle",i.target.checked))}),f()(),_(26,"label",10)(27,"span"),u(28,"Weapon Wheel Mode"),f(),_(29,"overlay-select",12),z("valueChange",function(i){P(e);let r=g(2);return A(r.onWeaponWheelSelect(i))}),f()()(),_(30,"section",9)(31,"h4"),u(32,"Communication"),f(),_(33,"label",10)(34,"span"),u(35,"Spell Check"),f(),_(36,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("spellCheck",i.target.checked))}),f()(),_(37,"label",10)(38,"span"),u(39,"Faction Chat"),f(),_(40,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("factionChat",i.target.checked))}),f()(),_(41,"label",10)(42,"span"),u(43,"Company Chat"),f(),_(44,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("companyChat",i.target.checked))}),f()(),_(45,"label",10)(46,"span"),u(47,"News Chat"),f(),_(48,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("newsChat",i.target.checked))}),f()(),_(49,"label",10)(50,"span"),u(51,"PM Chat"),f(),_(52,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("pmChat",i.target.checked))}),f()(),_(53,"label",10)(54,"span"),u(55,"Friend Notifications"),f(),_(56,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("friendNotify",i.target.checked))}),f()(),_(57,"label",10)(58,"span"),u(59,"Ignore Roadblock Messages"),f(),_(60,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("chatIgnoreRoadblockMessages",i.target.checked))}),f()(),_(61,"label",10)(62,"span"),u(63,"Damage Indicators in Chat"),f(),_(64,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("chatDamageIndicators",i.target.checked))}),f()()(),_(65,"section",9)(66,"h4"),u(67,"Navigation and Teamplay"),f(),_(68,"label",10)(69,"span"),u(70,"Map Enabled"),f(),_(71,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("mapOn",i.target.checked))}),f()(),_(72,"label",10)(73,"span"),u(74,"Auto Callsign"),f(),_(75,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("radioAutomaticCallsign",i.target.checked))}),f()(),_(76,"label",10)(77,"span"),u(78,"Passenger Waypoint Control"),f(),_(79,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setNumber("allowVehicleOccupantToSetWaypoint",i.target.checked?1:0))}),f()(),_(80,"label",10)(81,"span"),u(82,"Share Waypoint with Occupants"),f(),_(83,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setNumber("shareWaypointWithVehicleOccupants",i.target.checked?1:0))}),f()()(),_(84,"section",9)(85,"h4"),u(86,"Scale and Audio"),f(),_(87,"label",13)(88,"span"),u(89),f(),_(90,"input",14),z("input",function(i){P(e);let r=g(2);return A(r.previewNumber("uiScale",i.target.valueAsNumber))})("change",function(i){P(e);let r=g(2);return A(r.setNumber("uiScale",i.target.valueAsNumber))}),f()(),_(91,"label",13)(92,"span"),u(93),f(),_(94,"input",15),z("input",function(i){P(e);let r=g(2);return A(r.previewNumber("chatSize",i.target.valueAsNumber))})("change",function(i){P(e);let r=g(2);return A(r.setNumber("chatSize",i.target.valueAsNumber))}),f()(),_(95,"label",13)(96,"span"),u(97),f(),_(98,"input",16),z("input",function(i){P(e);let r=g(2);return A(r.previewNumber("xmMasterVolume",i.target.valueAsNumber))})("change",function(i){P(e);let r=g(2);return A(r.setNumber("xmMasterVolume",i.target.valueAsNumber))}),f()(),_(99,"label",13)(100,"span"),u(101),f(),_(102,"input",16),z("input",function(i){P(e);let r=g(2);return A(r.previewNumber("tvVolume",i.target.valueAsNumber))})("change",function(i){P(e);let r=g(2);return A(r.setNumber("tvVolume",i.target.valueAsNumber))}),f()(),_(103,"label",10)(104,"span"),u(105,"Native Vehicle Radio"),f(),_(106,"input",11),z("change",function(i){P(e);let r=g(2);return A(r.setBool("nativeVehicleRadio",i.target.checked))}),f()()()}if(o&2){let e=g(),n=g();d(17),Q("checked",e.talkingAnimations),d(4),Q("checked",e.ambientSounds),d(4),Q("checked",e.crawlingStyle),d(4),Q("options",n.weaponWheelOptions)("value",e.weaponWheelSelectMode),d(7),Q("checked",e.spellCheck),d(4),Q("checked",e.factionChat),d(4),Q("checked",e.companyChat),d(4),Q("checked",e.newsChat),d(4),Q("checked",e.pmChat),d(4),Q("checked",e.friendNotify),d(4),Q("checked",e.chatIgnoreRoadblockMessages),d(4),Q("checked",e.chatDamageIndicators),d(7),Q("checked",e.mapOn),d(4),Q("checked",e.radioAutomaticCallsign),d(4),Q("checked",e.allowVehicleOccupantToSetWaypoint===1),d(4),Q("checked",e.shareWaypointWithVehicleOccupants===1),d(6),me("UI Scale: ",e.uiScale),d(),Q("value",e.uiScale),d(3),me("Chat Size: ",e.chatSize),d(),Q("value",e.chatSize),d(3),me("Master Volume: ",e.xmMasterVolume,"%"),d(),Q("value",e.xmMasterVolume),d(3),me("TV Volume: ",e.tvVolume,"%"),d(),Q("value",e.tvVolume),d(4),Q("checked",e.nativeVehicleRadio)}}function wI(o,t){if(o&1&&R(0,CI,2,1)(1,MI,107,26),o&2){let e=g();N(e.advancedView()!=="none"?0:1)}}function SI(o,t){o&1&&(_(0,"div",1),ye(1,"div",17),_(2,"p"),u(3,"Waiting for gameplay settings..."),f()())}var pu={chatSize:15,uiScale:16,spellCheck:!1,factionChat:!0,companyChat:!0,newsChat:!0,pmChat:!0,friendNotify:!0,xmMasterVolume:50,tvVolume:50,nativeVehicleRadio:!1,mapOn:!0,hudOn:!0,hudCash:!0,hudHealth:!0,hudHealthDigitalValue:!1,hudLocation:!0,hudRadio:!0,hudVehicleName:!0,hudVehicleSpeed:!0,hudVehicleFuelDigitalValue:!1,hudVehicleFuel:!0,hudVehicleLights:!0,hudVehicleAltitude:!0,nametagsOn:!0,nametagsIdOn:0,nametagsShowMaskId:!1,nametagsShowTabbedIndicator:!0,nametagsShowTypingIndicator:!0,nametagsShowOwnAme:!0,nametagsShowSelf:!1,nametagFont:0,privacyShowAccountName:!1,allowVehicleOccupantToSetWaypoint:0,shareWaypointWithVehicleOccupants:0,chatIgnoreRoadblockMessages:!0,chatDamageIndicators:!0,radioAutomaticCallsign:!0,hudFahrenheit:!1,hudCompass:!0,hudTemperature:!0,weaponWheelSelectMode:0,talkingAnimations:!0,ambientSounds:!0,crawlingStyle:!1},mu=window.mp,Uv=(()=>{class o{constructor(){this.initialPayload=null,this.settings=F(pu),this.advancedView=F("none"),this.weaponWheelOptions=[{label:"Hold to Select",value:0},{label:"Tap to Select",value:1}],this.handlers=[]}ngOnChanges(e){"initialPayload"in e&&this.applyPayload(this.initialPayload)}ngOnInit(){this.on("settings:update",e=>{this.applyPayload(e)}),this.applyPayload(this.initialPayload),mu.events.call("settings:request")}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)mu.events.remove(e,n)}setBool(e,n){let i=this.settings();if(!i)return;let r=De(he({},i),{[e]:n});this.settings.set(r),this.save({[e]:n})}setNumber(e,n){let i=this.settings();if(!i||!Number.isFinite(n))return;let r=Math.round(n),a=De(he({},i),{[e]:r});this.settings.set(a),this.save({[e]:r})}previewNumber(e,n){let i=this.settings();if(!i||!Number.isFinite(n))return;let r=Math.round(n);this.settings.set(De(he({},i),{[e]:r}))}onWeaponWheelSelect(e){this.setNumber("weaponWheelSelectMode",e===1||e==="1"?1:0)}openAdvanced(e){this.advancedView.set(e)}closeAdvanced(){this.advancedView.set("none")}save(e){mu.events.call("settings:save",JSON.stringify(e))}applyPayload(e){if(typeof e=="string"){try{this.settings.set(he(he({},pu),JSON.parse(e)))}catch{this.settings.set(pu)}return}e&&typeof e=="object"&&this.settings.set(he(he({},pu),e))}on(e,n){mu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-gameplay-settings"]],inputs:{initialPayload:"initialPayload"},features:[Nn],decls:3,vars:1,consts:[[1,"gameplay-panel"],[1,"loading-state"],[1,"advanced-view","advanced-view-wide"],[1,"advanced-view"],[1,"advanced-head"],["type","button",1,"gateway-btn",3,"click"],[1,"advanced-gateway"],[1,"gateway-copy"],[1,"gateway-actions"],[1,"setting-card"],[1,"setting-row"],["type","checkbox",3,"change","checked"],[3,"valueChange","options","value"],[1,"setting-row","slider-row"],["type","range","min","10","max","22","step","1",3,"input","change","value"],["type","range","min","8","max","24","step","1",3,"input","change","value"],["type","range","min","0","max","100","step","1",3,"input","change","value"],[1,"spinner"]],template:function(n,i){if(n&1&&(_(0,"div",0),R(1,wI,2,1)(2,SI,4,0,"div",1),f()),n&2){let r;d(),N((r=i.settings())?1:2,r)}},dependencies:[tt,Vo,Bv,Vv],styles:["[_nghost-%COMP%]{display:flex;flex:1;min-height:0}.gameplay-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem;padding:.9rem;flex:1;min-height:0;overflow:hidden}.advanced-gateway[_ngcontent-%COMP%], .advanced-view[_ngcontent-%COMP%], .setting-card[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.11);border-radius:8px;background:linear-gradient(155deg,#07090e73,#0000004d);padding:.8rem}.advanced-view[_ngcontent-%COMP%]{grid-column:1/-1;display:flex;flex-direction:column;gap:.6rem;min-height:0;overflow:hidden}.advanced-view[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#ffffffb8;font-size:.8rem;line-height:1.4}.advanced-view-wide[_ngcontent-%COMP%]{padding:.8rem;height:100%;overflow:hidden}.advanced-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.8rem}.advanced-head[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:.88rem;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.05em}.advanced-gateway[_ngcontent-%COMP%]{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:.8rem;font-family:Inter,Google Sans,Segoe UI,sans-serif}.advanced-gateway[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:.88rem;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.05em}.advanced-gateway[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.76rem;color:#ffffff9e}.gateway-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.gateway-btn[_ngcontent-%COMP%]{border:1px solid rgba(var(--sw-accent-rgb),.45);border-radius:6px;background:rgba(var(--sw-accent-rgb),.12);color:#fff;font-size:.73rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:.45rem .65rem;cursor:pointer}.gateway-btn[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.2);border-color:rgba(var(--sw-accent-rgb),.65)}.setting-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.setting-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:.74rem;font-weight:700;color:#ffffffe6;text-transform:uppercase;letter-spacing:.06em}.setting-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.8rem;border-top:1px solid rgba(255,255,255,.06);padding-top:.35rem;font-size:.74rem;font-family:Inter,Google Sans,Segoe UI,sans-serif;color:#ffffffd1}.setting-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:1rem;height:1rem;accent-color:var(--sw-accent);cursor:pointer}.slider-row[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch}.slider-row[_ngcontent-%COMP%] input[type=range][_ngcontent-%COMP%]{width:100%;accent-color:var(--sw-accent)}.loading-state[_ngcontent-%COMP%]{grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.8rem}.loading-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.86rem;color:#ffffff80}.spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:2px solid rgba(209,27,45,.2);border-top-color:#d11b2d;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media(max-width:980px){.gameplay-panel[_ngcontent-%COMP%]{grid-template-columns:1fr}.advanced-gateway[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}"],changeDetection:0})}}return o})();function EI(o,t){if(o&1){let e=Z();_(0,"section",2)(1,"h4"),u(2,"General"),f(),_(3,"label",3)(4,"span"),u(5,"HUD Enabled"),f(),_(6,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudOn",i.target.checked))}),f()(),_(7,"label",3)(8,"span"),u(9,"Compass"),f(),_(10,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudCompass",i.target.checked))}),f()(),_(11,"label",3)(12,"span"),u(13,"Cash"),f(),_(14,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudCash",i.target.checked))}),f()(),_(15,"label",3)(16,"span"),u(17,"Location"),f(),_(18,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudLocation",i.target.checked))}),f()(),_(19,"label",3)(20,"span"),u(21,"Radio"),f(),_(22,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudRadio",i.target.checked))}),f()(),_(23,"label",3)(24,"span"),u(25,"Health Bar"),f(),_(26,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudHealth",i.target.checked))}),f()(),_(27,"label",3)(28,"span"),u(29,"Health Digital Value"),f(),_(30,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudHealthDigitalValue",i.target.checked))}),f()(),_(31,"label",3)(32,"span"),u(33,"Temperature"),f(),_(34,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudTemperature",i.target.checked))}),f()(),_(35,"label",3)(36,"span"),u(37,"Fahrenheit"),f(),_(38,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudFahrenheit",i.target.checked))}),f()(),_(39,"label",3)(40,"span"),u(41,"Show Account Name"),f(),_(42,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("privacyShowAccountName",i.target.checked))}),f()()(),_(43,"section",2)(44,"h4"),u(45,"Vehicle"),f(),_(46,"label",3)(47,"span"),u(48,"Vehicle Name"),f(),_(49,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleName",i.target.checked))}),f()(),_(50,"label",3)(51,"span"),u(52,"Speed"),f(),_(53,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleSpeed",i.target.checked))}),f()(),_(54,"label",3)(55,"span"),u(56,"Fuel Bar"),f(),_(57,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleFuel",i.target.checked))}),f()(),_(58,"label",3)(59,"span"),u(60,"Fuel Digital Value"),f(),_(61,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleFuelDigitalValue",i.target.checked))}),f()(),_(62,"label",3)(63,"span"),u(64,"Lights Indicator"),f(),_(65,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleLights",i.target.checked))}),f()(),_(66,"label",3)(67,"span"),u(68,"Altitude"),f(),_(69,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("hudVehicleAltitude",i.target.checked))}),f()()(),_(70,"section",2)(71,"h4"),u(72,"Nametags"),f(),_(73,"label",3)(74,"span"),u(75,"Nametags Enabled"),f(),_(76,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsOn",i.target.checked))}),f()(),_(77,"label",3)(78,"span"),u(79,"Show Own /ame"),f(),_(80,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsShowOwnAme",i.target.checked))}),f()(),_(81,"label",3)(82,"span"),u(83,"Show Own Nametag"),f(),_(84,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsShowSelf",i.target.checked))}),f()(),_(85,"label",3)(86,"span"),u(87,"Show Mask ID"),f(),_(88,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsShowMaskId",i.target.checked))}),f()(),_(89,"label",3)(90,"span"),u(91,"Tabbed Indicator"),f(),_(92,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsShowTabbedIndicator",i.target.checked))}),f()(),_(93,"label",3)(94,"span"),u(95,"Typing Indicator"),f(),_(96,"input",4),z("change",function(i){P(e);let r=g();return A(r.setBool("nametagsShowTypingIndicator",i.target.checked))}),f()(),_(97,"label",3)(98,"span"),u(99,"Show Player ID"),f(),_(100,"overlay-select",5),z("valueChange",function(i){P(e);let r=g();return A(r.setNumber("nametagsIdOn",+i))}),f()(),_(101,"label",3)(102,"span"),u(103,"Nametag Font"),f(),_(104,"overlay-select",5),z("valueChange",function(i){P(e);let r=g();return A(r.setNumber("nametagFont",+i))}),f()()()}if(o&2){let e=t,n=g();d(6),Q("checked",e.hudOn),d(4),Q("checked",e.hudCompass),d(4),Q("checked",e.hudCash),d(4),Q("checked",e.hudLocation),d(4),Q("checked",e.hudRadio),d(4),Q("checked",e.hudHealth),d(4),Q("checked",e.hudHealthDigitalValue),d(4),Q("checked",e.hudTemperature),d(4),Q("checked",e.hudFahrenheit),d(4),Q("checked",e.privacyShowAccountName),d(7),Q("checked",e.hudVehicleName),d(4),Q("checked",e.hudVehicleSpeed),d(4),Q("checked",e.hudVehicleFuel),d(4),Q("checked",e.hudVehicleFuelDigitalValue),d(4),Q("checked",e.hudVehicleLights),d(4),Q("checked",e.hudVehicleAltitude),d(7),Q("checked",e.nametagsOn),d(4),Q("checked",e.nametagsShowOwnAme),d(4),Q("checked",e.nametagsShowSelf),d(4),Q("checked",e.nametagsShowMaskId),d(4),Q("checked",e.nametagsShowTabbedIndicator),d(4),Q("checked",e.nametagsShowTypingIndicator),d(4),Q("options",n.nametagIdOptions)("value",e.nametagsIdOn),d(4),Q("options",n.nametagFontOptions)("value",e.nametagFont)}}function TI(o,t){o&1&&(_(0,"div",1),ye(1,"div",6),_(2,"p"),u(3,"Waiting for HUD settings..."),f()())}var fu={hudOn:!0,hudCash:!0,hudHealth:!0,hudHealthDigitalValue:!1,hudLocation:!0,hudRadio:!0,hudVehicleName:!0,hudVehicleSpeed:!0,hudVehicleFuel:!0,hudVehicleFuelDigitalValue:!1,hudVehicleLights:!0,hudVehicleAltitude:!0,hudFahrenheit:!1,hudCompass:!0,hudTemperature:!0,nametagsOn:!0,nametagsIdOn:0,nametagsShowMaskId:!1,nametagsShowTabbedIndicator:!0,nametagsShowTypingIndicator:!0,nametagsShowOwnAme:!0,nametagsShowSelf:!1,nametagFont:0,privacyShowAccountName:!1},gu=window.mp,zv=(()=>{class o{constructor(){this.initialPayload=null,this.settings=F(fu),this.nametagFontOptions=[{label:"Chalet London",value:0},{label:"House Script",value:1},{label:"Chalet Comprime Cologne",value:4},{label:"Pricedown",value:7}],this.nametagIdOptions=[{label:"After Name",value:0},{label:"Before Name",value:1},{label:"Never",value:2}],this.handlers=[]}ngOnChanges(e){"initialPayload"in e&&this.applyPayload(this.initialPayload)}ngOnInit(){this.on("settings:update",e=>{this.applyPayload(e)}),this.applyPayload(this.initialPayload),gu.events.call("settings:request")}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)gu.events.remove(e,n)}setBool(e,n){let i=this.settings();i&&(this.settings.set(De(he({},i),{[e]:n})),this.save({[e]:n}))}setNumber(e,n){let i=this.settings();i&&(this.settings.set(De(he({},i),{[e]:n})),this.save({[e]:n}))}save(e){gu.events.call("settings:save",JSON.stringify(e))}applyPayload(e){if(typeof e=="string"){try{this.settings.set(he(he({},fu),JSON.parse(e)))}catch{this.settings.set(fu)}return}e&&typeof e=="object"&&this.settings.set(he(he({},fu),e))}on(e,n){gu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-hud-settings"]],inputs:{initialPayload:"initialPayload"},features:[Nn],decls:3,vars:1,consts:[[1,"hud-panel"],[1,"loading-state"],[1,"setting-card"],[1,"setting-row"],["type","checkbox",3,"change","checked"],[3,"valueChange","options","value"],[1,"spinner"]],template:function(n,i){if(n&1&&(_(0,"div",0),R(1,EI,105,26)(2,TI,4,0,"div",1),f()),n&2){let r;d(),N((r=i.settings())?1:2,r)}},dependencies:[tt,Vo],styles:["[_nghost-%COMP%]{display:flex;flex:1;min-height:0}.hud-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem;padding:.9rem;flex:1;min-height:0;overflow:visible}.setting-card[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.11);border-radius:8px;background:linear-gradient(155deg,#07090e73,#0000004d);padding:.8rem;display:flex;flex-direction:column;gap:.45rem}.setting-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:.74rem;font-weight:700;color:#ffffffe6;text-transform:uppercase;letter-spacing:.06em}.setting-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.8rem;border-top:1px solid rgba(255,255,255,.06);padding-top:.35rem;font-size:.74rem;font-family:Inter,Google Sans,Segoe UI,sans-serif;color:#ffffffd1}.setting-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:1rem;height:1rem;accent-color:var(--sw-accent);cursor:pointer;flex-shrink:0}.loading-state[_ngcontent-%COMP%]{grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.8rem}.loading-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.86rem;color:#ffffff80}.spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:2px solid rgba(209,27,45,.2);border-top-color:#d11b2d;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"],changeDetection:0})}}return o})();function PI(o,t){o&1&&(_(0,"mat-tab",11)(1,"div",13)(2,"p"),u(3,"Faction settings coming soon"),f()()())}function AI(o,t){o&1&&(_(0,"mat-tab",12)(1,"div",13)(2,"p"),u(3,"Company settings coming soon"),f()()())}var _u=window.mp,Hv=(()=>{class o{constructor(){this.handlers=[],this.visibleTabs=F(new Set(["overview","gameplay","hud"])),this.settingsPayload=F(null),this.tabsPayload=null,this.on("settings:close",()=>this.close())}ngOnInit(){this.on("settings:update",e=>{if(typeof e=="string"){this.settingsPayload.set(e);return}e&&typeof e=="object"&&this.settingsPayload.set(JSON.stringify(e))}),_u.events.call("settings:request")}ngOnChanges(e){"tabsPayload"in e&&this.applyOptionalTabs(this.parseTabsPayload(this.tabsPayload))}applyOptionalTabs(e){let n=new Set(["overview","gameplay","hud"]);for(let i of e)(i==="faction"||i==="company")&&n.add(i);this.visibleTabs.set(n)}parseTabsPayload(e){if(Array.isArray(e))return e.filter(n=>n==="faction"||n==="company");if(typeof e!="string")return[];try{let n=JSON.parse(e);return Array.isArray(n)?n.filter(i=>i==="faction"||i==="company"):[]}catch{return[]}}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)_u.events.remove(e,n)}close(){_u.events.call("menu:destroy")}on(e,n){_u.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-settings"]],inputs:{tabsPayload:"tabsPayload"},features:[Nn],decls:18,vars:4,consts:[[1,"settings-panel"],[1,"settings-header"],["type","button",1,"close-btn",3,"click"],[1,"fa-solid","fa-xmark"],["animationDuration","150ms",1,"settings-tabs"],["label","Overview"],[1,"tab-content"],["label","Gameplay"],[1,"tab-content","gameplay-tab-content"],[3,"initialPayload"],["label","HUD"],["label","Faction"],["label","Company"],[1,"tab-content","placeholder-content"]],template:function(n,i){n&1&&(_(0,"div",0)(1,"div",1)(2,"h2"),u(3,"Settings"),f(),_(4,"button",2),z("click",function(){return i.close()}),ye(5,"i",3),f()(),_(6,"mat-tab-group",4)(7,"mat-tab",5)(8,"div",6),ye(9,"overlay-character-stats"),f()(),_(10,"mat-tab",7)(11,"div",8),ye(12,"overlay-gameplay-settings",9),f()(),_(13,"mat-tab",10)(14,"div",8),ye(15,"overlay-hud-settings",9),f()(),R(16,PI,4,0,"mat-tab",11),R(17,AI,4,0,"mat-tab",12),f()()),n&2&&(d(12),Q("initialPayload",i.settingsPayload()),d(3),Q("initialPayload",i.settingsPayload()),d(),N(i.visibleTabs().has("faction")?16:-1),d(),N(i.visibleTabs().has("company")?17:-1))},dependencies:[tt,Sl,Ml,wl,Fv,Uv,zv],styles:["[_nghost-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;pointer-events:none;z-index:60}.settings-panel[_ngcontent-%COMP%]{pointer-events:auto;display:flex;flex-direction:column;width:min(92vw,67rem);min-height:50vh;max-height:84vh;overflow:hidden;border:1px solid var(--sw-border);border-radius:14px;background:linear-gradient(160deg,#383c46e6,#202228f2);box-shadow:var(--sw-shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.settings-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.85rem .95rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.42);background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.23),rgba(var(--sw-accent-rgb),.08));flex-shrink:0}.settings-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:.98rem;font-weight:700;color:#f4f7fc}.close-btn[_ngcontent-%COMP%]{min-width:0;width:2.35rem;height:2.35rem;display:grid;place-items:center;padding:0;background:transparent;border:1px solid rgba(255,255,255,.1);border-radius:6px;color:var(--sw-text);cursor:pointer;transition:background .15s,border-color .15s}.close-btn[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.18);border-color:rgba(var(--sw-accent-rgb),.5);color:var(--sw-accent)}.close-btn[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{width:1.15rem;height:1.15rem;font-size:1.15rem;line-height:1.15rem}.settings-tabs[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0;--mdc-tab-indicator-active-indicator-color: var(--sw-accent);--mat-tab-header-active-label-text-color: var(--sw-text);--mat-tab-header-inactive-label-text-color: var(--sw-text-soft);--mat-tab-header-active-ripple-color: rgba(var(--sw-accent-rgb), .18);--mat-tab-header-inactive-ripple-color: rgba(var(--sw-accent-rgb), .12);--mat-tab-header-active-focus-label-text-color: var(--sw-text);--mat-tab-header-active-hover-label-text-color: var(--sw-text);--mat-tab-header-inactive-focus-label-text-color: var(--sw-text-soft);--mat-tab-header-inactive-hover-label-text-color: var(--sw-text)}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-header{border-bottom:1px solid rgba(var(--sw-accent-rgb),.2);background:#00000026}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-label-container{padding:0 .5rem}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab .mdc-tab__text-label{font-family:Inter,Google Sans,Segoe UI,sans-serif!important;font-size:14px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-wrapper{flex:1;min-height:0}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content{display:flex;flex-direction:column;min-height:0;overflow:hidden}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content>*{flex:1;min-height:0}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content>.mat-mdc-tab-body-content{flex:1;min-height:0}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content::-webkit-scrollbar{width:.5rem}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content::-webkit-scrollbar-track{background:rgba(var(--sw-accent-rgb),.05)}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content::-webkit-scrollbar-thumb{border-radius:999px;background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.65),rgba(var(--sw-accent-rgb),.42))}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.88),rgba(var(--sw-accent-rgb),.62))}.settings-tabs[_ngcontent-%COMP%] .mat-mdc-tab-body-content{scrollbar-color:rgba(var(--sw-accent-rgb),.7) rgba(var(--sw-accent-rgb),.08);scrollbar-width:thin}.tab-content[_ngcontent-%COMP%]{padding:0;display:flex;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.tab-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:.5rem}.tab-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:rgba(var(--sw-accent-rgb),.05)}.tab-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:999px;background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.65),rgba(var(--sw-accent-rgb),.42))}.tab-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(var(--sw-accent-rgb),.88),rgba(var(--sw-accent-rgb),.62))}.tab-content[_ngcontent-%COMP%]{scrollbar-color:rgba(var(--sw-accent-rgb),.7) rgba(var(--sw-accent-rgb),.08);scrollbar-width:thin}.gameplay-tab-content[_ngcontent-%COMP%]{overflow:hidden}.placeholder-content[_ngcontent-%COMP%]{padding:2rem .95rem}.placeholder-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:var(--sw-text-soft)}.placeholder-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:200px;padding:2rem}.placeholder-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#fff6;font-size:.9rem}"],changeDetection:0})}}return o})();function II(o,t){if(o&1){let e=Z();v(0,"div",5)(1,"button",7),ne("click",function(){P(e);let i=g();return A(i.navigate("deposit"))}),u(2,"Deposit"),b(),v(3,"button",7),ne("click",function(){P(e);let i=g();return A(i.navigate("withdraw"))}),u(4,"Withdraw"),b(),v(5,"button",7),ne("click",function(){P(e);let i=g();return A(i.navigate("balance"))}),u(6,"Check Balance"),b(),v(7,"button",8),ne("click",function(){P(e);let i=g();return A(i.close())}),u(8,"Cancel"),b()()}}function OI(o,t){o&1&&(v(0,"div",10),Te(1,"i",12),b())}function DI(o,t){if(o&1&&(v(0,"div",11),u(1),po(2,"number"),b()),o&2){let e=g(2);d(),me("$",mo(2,1,e.bankBalance()))}}function kI(o,t){if(o&1){let e=Z();v(0,"div",6)(1,"div",9),u(2,"Outstanding Balance"),b(),R(3,OI,2,0,"div",10)(4,DI,3,3,"div",11),v(5,"button",8),ne("click",function(){P(e);let i=g();return A(i.navigate("landing"))}),u(6,"Back"),b()()}if(o&2){let e=g();d(3),N(e.loadingBalance()?3:4)}}function RI(o,t){if(o&1&&(v(0,"div",17),u(1),b()),o&2){let e=t;oe("success",e.success)("error",!e.success),d(),D(e.message)}}function NI(o,t){o&1&&(v(0,"div",10),Te(1,"i",12),b())}function LI(o,t){if(o&1){let e=Z();v(0,"button",18),ne("click",function(){P(e);let i=g(2);return A(i.confirmDeposit())}),u(1,"Deposit"),b()}if(o&2){let e=g(2);Ee("disabled",!e.inputAmount())}}function FI(o,t){if(o&1){let e=Z();v(0,"div",6)(1,"div",9),u(2),po(3,"number"),b(),v(4,"input",13),ne("input",function(i){P(e);let r=g();return A(r.setAmount(i))}),b(),R(5,RI,2,5,"div",14),R(6,NI,2,0,"div",10)(7,LI,2,1,"button",15),v(8,"button",16),ne("click",function(){P(e);let i=g();return A(i.navigate("landing"))}),u(9,"Back"),b()()}if(o&2){let e,n=g();d(2),me("Deposit Amount (max $",mo(3,7,n.maxDeposit),")"),d(2),Ee("max",n.maxDeposit)("value",n.inputAmount())("disabled",n.operationPending()),d(),N((e=n.operationResult())?5:-1,e),d(),N(n.operationPending()?6:7),d(2),Ee("disabled",n.operationPending())}}function VI(o,t){if(o&1){let e=Z();v(0,"button",21),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.setQuickAmount(i))}),u(1),po(2,"number"),b()}if(o&2){let e=t.$implicit,n=g(2);Ee("disabled",n.operationPending()),d(),me("$",mo(2,2,e))}}function BI(o,t){if(o&1&&(v(0,"div",17),u(1),b()),o&2){let e=t;oe("success",e.success)("error",!e.success),d(),D(e.message)}}function UI(o,t){o&1&&(v(0,"div",10),Te(1,"i",12),b())}function zI(o,t){if(o&1){let e=Z();v(0,"button",18),ne("click",function(){P(e);let i=g(2);return A(i.confirmWithdraw())}),u(1,"Withdraw"),b()}if(o&2){let e=g(2);Ee("disabled",!e.inputAmount())}}function HI(o,t){if(o&1){let e=Z();v(0,"div",6)(1,"div",9),u(2),po(3,"number"),b(),v(4,"input",13),ne("input",function(i){P(e);let r=g();return A(r.setAmount(i))}),b(),v(5,"div",19),ve(6,VI,3,4,"button",20,Ln),b(),R(8,BI,2,5,"div",14),R(9,UI,2,0,"div",10)(10,zI,2,1,"button",15),v(11,"button",16),ne("click",function(){P(e);let i=g();return A(i.navigate("landing"))}),u(12,"Back"),b()()}if(o&2){let e,n=g();d(2),me("Withdraw Amount (max $",mo(3,7,n.maxWithdraw),")"),d(2),Ee("max",n.maxWithdraw)("value",n.inputAmount())("disabled",n.operationPending()),d(2),xe(n.quickAmounts),d(2),N((e=n.operationResult())?8:-1,e),d(),N(n.operationPending()?9:10),d(2),Ee("disabled",n.operationPending())}}var Ga=window.mp,Gv=(()=>{class o{constructor(){this.view=F("landing"),this.bankBalance=F(0),this.loadingBalance=F(!1),this.inputAmount=F(null),this.operationPending=F(!1),this.operationResult=F(null),this.quickAmounts=[100,500,1e3,5e3,1e4],this.maxDeposit=5e3,this.maxWithdraw=1e4,this.handlers=[]}ngOnInit(){this.on("atm:create",()=>this.view.set("landing")),this.on("atm:destroy",()=>this.view.set("landing")),this.on("atm:balance",e=>{let n=typeof e=="string"?Number(e):e;this.bankBalance.set(isNaN(n)?0:n),this.loadingBalance.set(!1)}),this.on("atm:depositResult",e=>{let n=e;this.operationPending.set(!1),this.operationResult.set({success:!n,message:n||"Deposit successful."})}),this.on("atm:withdrawResult",e=>{let n=e;this.operationPending.set(!1),this.operationResult.set({success:!n,message:n||"Withdrawal successful."})})}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)Ga.events.remove(e,n)}navigate(e){this.inputAmount.set(null),this.operationPending.set(!1),this.operationResult.set(null),e==="balance"&&(this.loadingBalance.set(!0),Ga.events.call("callServerEvent","atm:balance")),this.view.set(e)}setAmount(e){let n=e.target.valueAsNumber;this.inputAmount.set(isNaN(n)?null:n)}setQuickAmount(e){this.inputAmount.set(e)}confirmDeposit(){let e=this.inputAmount();if(e){if(e>this.maxDeposit){this.operationResult.set({success:!1,message:`Maximum deposit is $${this.maxDeposit.toLocaleString()}.`});return}this.operationPending.set(!0),this.operationResult.set(null),Ga.events.call("callServerEvent","atm:deposit",e)}}confirmWithdraw(){let e=this.inputAmount();if(e){if(e>this.maxWithdraw){this.operationResult.set({success:!1,message:`Maximum withdrawal is $${this.maxWithdraw.toLocaleString()}.`});return}this.operationPending.set(!0),this.operationResult.set(null),Ga.events.call("callServerEvent","atm:withdraw",e)}}close(){Ga.events.call("callServerEvent","atm:exit")}on(e,n){Ga.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-atm"]],decls:10,vars:4,consts:[[1,"atm-shell"],[1,"atm-header"],["aria-hidden","true",1,"atm-chip"],[1,"atm-title"],[1,"atm-body"],[1,"atm-menu"],[1,"atm-view"],[1,"atm-btn",3,"click"],[1,"atm-btn","secondary",3,"click"],[1,"atm-label"],[1,"atm-loading"],[1,"atm-amount"],[1,"fad","fa-fw","fa-spin","fa-spinner-third"],["type","number","min","1","placeholder","Enter amount...",1,"atm-input",3,"input","max","value","disabled"],[1,"atm-result",3,"success","error"],[1,"atm-btn",3,"disabled"],[1,"atm-btn","secondary",3,"click","disabled"],[1,"atm-result"],[1,"atm-btn",3,"click","disabled"],[1,"atm-quick-amounts"],[1,"atm-btn-sm",3,"disabled"],[1,"atm-btn-sm",3,"click","disabled"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1),Te(2,"span",2),v(3,"span",3),u(4,"ATM"),b()(),v(5,"div",4),R(6,II,9,0,"div",5),R(7,kI,7,1,"div",6),R(8,FI,10,9,"div",6),R(9,HI,13,9,"div",6),b()()),n&2&&(d(6),N(i.view()==="landing"?6:-1),d(),N(i.view()==="balance"?7:-1),d(),N(i.view()==="deposit"?8:-1),d(),N(i.view()==="withdraw"?9:-1))},dependencies:[tt,ef],styles:['.atm-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(26rem,92vw);background:linear-gradient(165deg,#2b2b2deb,#202228f5);border:1px solid rgba(95,101,114,.48);border-radius:14px;overflow:hidden;box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.atm-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:.9rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.atm-chip[_ngcontent-%COMP%]{width:18px;height:13px;border-radius:3px;background:linear-gradient(145deg,#ffcf7b,#b88a3b);box-shadow:inset 0 0 0 1px #22180a40}.atm-title[_ngcontent-%COMP%]{color:#f4f7fc;font-weight:700;font-size:.95rem;letter-spacing:.07em;text-transform:uppercase}.atm-body[_ngcontent-%COMP%]{padding:1rem}.atm-menu[_ngcontent-%COMP%], .atm-view[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.atm-label[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;margin-bottom:.15rem}.atm-amount[_ngcontent-%COMP%]{color:#f4f7fc;font-size:1.4rem;font-weight:700;font-family:"Source Serif 4",Georgia,serif}.atm-amount.bank[_ngcontent-%COMP%]{color:#ffb7bf}.atm-input[_ngcontent-%COMP%]{background:#ffffff0f;border:1px solid rgba(209,27,45,.26);border-radius:10px;color:#d8dde6;padding:.65rem .75rem;font-size:.95rem;outline:none}.atm-input[_ngcontent-%COMP%]:focus{border-color:#d11b2dad;box-shadow:0 0 0 2px #d11b2d33}.atm-btn[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dcc,#e52f41ad);border:1px solid rgba(209,27,45,.48);color:#fff;padding:.62rem .8rem;border-radius:10px;cursor:pointer;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;transition:all .18s ease}.atm-btn[_ngcontent-%COMP%]:hover{box-shadow:0 0 18px #d11b2d4d}.atm-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.atm-btn.secondary[_ngcontent-%COMP%]{background:#ffffff0f;border-color:#5f65727a;color:#a9b0bb}.atm-btn.secondary[_ngcontent-%COMP%]:hover{box-shadow:none;border-color:#d11b2d59}.atm-quick-amounts[_ngcontent-%COMP%]{display:flex;gap:.45rem;flex-wrap:wrap}.atm-btn-sm[_ngcontent-%COMP%]{background:#ffffff0a;border:1px solid rgba(255,255,255,.12);color:#d8dde6;padding:.4rem .58rem;border-radius:8px;cursor:pointer;font-size:.72rem;letter-spacing:.03em}.atm-btn-sm[_ngcontent-%COMP%]:hover{border-color:#d11b2d57;background:#d11b2d1f}'],changeDetection:0})}}return o})();function GI(o,t){if(o&1&&(v(0,"p",9),u(1),b()),o&2){let e=g();d(),D(e.error())}}var dl=window.mp,_m={hair:0,hairColor:0,highlightColor:0,eyebrows:0,eyebrowsOpacity:1,eyebrowsColor:0,facialHair:0,facialHairOpacity:1,facialHairColor:0,chestHair:0,chestHairOpacity:1,chestHairColor:0,scalpMicropigmentation:null},Wv=(()=>{class o{constructor(){this.title=F("Kane's Cuts"),this.state=F(he({},_m)),this.error=F(""),this.statePreview=F(JSON.stringify(_m,null,2)),this.handlers=[]}ngOnInit(){this.on("setAppData",(e,n)=>{try{let i=JSON.parse(String(n));i.barberShopName&&this.title.set(i.barberShopName),this.state.set(he(he({},_m),i)),this.refreshPreview(),this.error.set("")}catch{this.error.set("Unable to parse barber payload.")}}),this.on("purchasingError",()=>{this.error.set("Purchase failed. Please check funds and try again.")})}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)dl.events.remove(e,n)}setNumber(e,n){let i=Number(n.target.value);this.state.update(r=>De(he({},r),{[e]:i})),this.refreshPreview(),this.emitState()}purchase(){dl.events.call("callServerEvent","barbershop:purchase",JSON.stringify(this.state()),0)}exit(){dl.events.call("callServerEvent","barbershop:exit")}emitState(){dl.events.call("barbershop:state",JSON.stringify(this.state()))}refreshPreview(){this.statePreview.set(JSON.stringify(this.state(),null,2))}on(e,n){dl.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-barber"]],decls:58,vars:15,consts:[[1,"barber-shell"],["type","button",1,"cancel",3,"click"],[1,"controls"],["type","range","min","0","max","80",3,"input","value"],["type","range","min","0","max","63",3,"input","value"],["type","range","min","0","max","34",3,"input","value"],["type","range","min","0","max","28",3,"input","value"],["type","range","min","0","max","16",3,"input","value"],[1,"preview"],[1,"error"],[1,"actions"],["type","button",3,"click"],["type","button",1,"secondary",3,"click"]],template:function(n,i){n&1&&(v(0,"section",0)(1,"header")(2,"div")(3,"h2"),u(4,"Barber Shop"),b(),v(5,"p"),u(6),b()(),v(7,"button",1),ne("click",function(){return i.exit()}),u(8,"Cancel"),b()(),v(9,"main")(10,"div",2)(11,"label")(12,"span"),u(13,"Hair Style"),b(),v(14,"input",3),ne("input",function(a){return i.setNumber("hair",a)}),b(),v(15,"strong"),u(16),b()(),v(17,"label")(18,"span"),u(19,"Hair Color"),b(),v(20,"input",4),ne("input",function(a){return i.setNumber("hairColor",a)}),b(),v(21,"strong"),u(22),b()(),v(23,"label")(24,"span"),u(25,"Highlight"),b(),v(26,"input",4),ne("input",function(a){return i.setNumber("highlightColor",a)}),b(),v(27,"strong"),u(28),b()(),v(29,"label")(30,"span"),u(31,"Eyebrows"),b(),v(32,"input",5),ne("input",function(a){return i.setNumber("eyebrows",a)}),b(),v(33,"strong"),u(34),b()(),v(35,"label")(36,"span"),u(37,"Facial Hair"),b(),v(38,"input",6),ne("input",function(a){return i.setNumber("facialHair",a)}),b(),v(39,"strong"),u(40),b()(),v(41,"label")(42,"span"),u(43,"Chest Hair"),b(),v(44,"input",7),ne("input",function(a){return i.setNumber("chestHair",a)}),b(),v(45,"strong"),u(46),b()()(),v(47,"aside",8)(48,"h3"),u(49,"Session"),b(),v(50,"pre"),u(51),b(),R(52,GI,2,1,"p",9),v(53,"div",10)(54,"button",11),ne("click",function(){return i.purchase()}),u(55,"Purchase"),b(),v(56,"button",12),ne("click",function(){return i.exit()}),u(57,"Exit"),b()()()()()),n&2&&(d(6),D(i.title()),d(8),Ee("value",i.state().hair),d(2),D(i.state().hair),d(4),Ee("value",i.state().hairColor),d(2),D(i.state().hairColor),d(4),Ee("value",i.state().highlightColor),d(2),D(i.state().highlightColor),d(4),Ee("value",i.state().eyebrows),d(2),D(i.state().eyebrows),d(4),Ee("value",i.state().facialHair),d(2),D(i.state().facialHair),d(4),Ee("value",i.state().chestHair),d(2),D(i.state().chestHair),d(5),D(i.statePreview()),d(),N(i.error()?52:-1))},dependencies:[tt],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:grid;place-items:center}.barber-shell[_ngcontent-%COMP%]{width:min(980px,94vw);border-radius:14px;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;overflow:hidden;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;letter-spacing:.08em;text-transform:uppercase}p[_ngcontent-%COMP%]{margin:4px 0 0;color:#ffb7bf;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}.cancel[_ngcontent-%COMP%]{border:1px solid rgba(95,101,114,.48);background:#ffffff0f;color:#d8dde6;border-radius:9px;padding:.45rem .72rem;cursor:pointer;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}main[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 320px;gap:.75rem;padding:.75rem}.controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}label[_ngcontent-%COMP%]{display:grid;gap:6px;background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:.62rem}span[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}strong[_ngcontent-%COMP%]{color:#f0f3f8;font-size:.8rem}input[type=range][_ngcontent-%COMP%]{accent-color:#d11b2d}.preview[_ngcontent-%COMP%]{background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:10px}.preview[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 8px;color:#d7deef;font-size:.8rem;text-transform:uppercase}pre[_ngcontent-%COMP%]{margin:0;max-height:310px;overflow:auto;background:#0000003d;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:8px;color:#d8dfef;font-size:.72rem}.actions[_ngcontent-%COMP%]{margin-top:10px;display:flex;gap:8px}button[_ngcontent-%COMP%]{border:1px solid rgba(95,101,114,.48);background:#ffffff0f;color:#d8dde6;border-radius:9px;padding:.5rem .7rem;cursor:pointer;font-size:.74rem;text-transform:uppercase;letter-spacing:.06em}button.secondary[_ngcontent-%COMP%]{opacity:.75}.error[_ngcontent-%COMP%]{margin-top:8px;color:#ff9f9f;font-size:.8rem}@media(max-width:860px){main[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})}}return o})();var vm=[{question:"What should you do if you approach a stop sign?",choices:["Slow down and proceed if no one is coming","Stop and look in both directions","Speed up to clear the intersection quickly"],correct:"Stop and look in both directions"},{question:"(( You get in to an accident with another player. You should: ))",choices:["Skip if all parties agree.","Argue in /b about whos fault it was.","Roleplay it."],correct:"Roleplay it."},{question:"What does a yellow light mean?",choices:["Stop immediately","Proceed with caution","Speed up to pass the intersection"],correct:"Proceed with caution"},{question:"What should you do if you hear a siren behind you?",choices:["Continue driving normally","Pull over to the right and stop","Speed up to get out of the way"],correct:"Pull over to the right and stop"},{question:"When should you use your headlights?",choices:["Only when it is dark","Whenever visibility is low","Only at night"],correct:"Whenever visibility is low"},{question:"(( Intersections should be treated as: ))",choices:["First come first serve.","Intersections are not roleplayed on SW-RP.","Stop signs."],correct:"Stop signs."},{question:"What should you do if a pedestrian is crossing the street at a crosswalk?",choices:["Honk your horn to warn them","Continue driving as they walk","Stop and let them cross"],correct:"Stop and let them cross"},{question:"What does a red light mean?",choices:["You can make a U-turn","Stop and wait for the light to turn green","Proceed cautiously"],correct:"Stop and wait for the light to turn green"},{question:"You see a signal person at a road construction site ahead. You should obey his or her instructions:",choices:["Only if you see orange cones on the road ahead.","Unless they conflict with existing signs, signals, or laws.","At all times."],correct:"At all times."},{question:"You may not park your vehicle:",choices:["On the side of the freeway in an emergency.","Next to a red painted curb.","Within 100 feet of an elementary school."],correct:"Next to a red painted curb."},{question:"What should you do when driving in fog?",choices:["Use your high beams","Use your low beams","Speed up to drive through it quickly"],correct:"Use your low beams"},{question:"The safest precaution that you can take regarding the use of cellular phones and driving is:",choices:["Use hands-free devices so you can keep both hands on the steering wheel.","Keep your phone within easy reach so you won't need to take your eyes off the road.","Review the number before answering a call."],correct:"Use hands-free devices so you can keep both hands on the steering wheel."},{question:"What should you do if you are involved in a collision?",choices:["Leave the scene quickly","Stop, exchange information, and call the police","Drive away to avoid trouble"],correct:"Stop, exchange information, and call the police"},{question:"When should you use your turn signals?",choices:["Only when changing lanes","Before making any turn or lane change","Only when leaving the freeway"],correct:"Before making any turn or lane change"},{question:"What does a flashing red light mean?",choices:["Proceed with caution","Stop completely, then proceed when safe","You can turn right without stopping"],correct:"Stop completely, then proceed when safe"},{question:"What should you do if your car begins to skid?",choices:["Accelerate to regain control","Turn the steering wheel in the direction of the skid","Brake hard to stop the car"],correct:"Turn the steering wheel in the direction of the skid"},{question:"What does a yield sign mean?",choices:["You must stop","You must give way to other drivers","You may go if no one is coming"],correct:"You must give way to other drivers"},{question:"When parking uphill with a curb, which way should you turn your wheels?",choices:["Towards the curb","Away from the curb","Straight ahead"],correct:"Away from the curb"},{question:"What should you do if a traffic light is out?",choices:["Treat it like a stop sign","Ignore it","Drive through carefully"],correct:"Treat it like a stop sign"},{question:"When can you pass another vehicle on the right?",choices:["When the car is in the left lane","When there is enough space to do so safely","Only on a one-way street"],correct:"When there is enough space to do so safely"},{question:"When is it illegal to make a U-turn?",choices:["At a traffic signal","When there is no sign prohibiting it","At an intersection with a no U-turn sign"],correct:"At an intersection with a no U-turn sign"},{question:"What does a green arrow pointing right mean?",choices:["You can turn right","You must stop and wait","You can go straight or turn right"],correct:"You can turn right"},{question:"What does a double solid yellow line mean?",choices:["Passing allowed with caution","Do not cross to pass in either direction","Cross freely if the road is clear"],correct:"Do not cross to pass in either direction"},{question:"What should you do if you are driving and see an emergency vehicle with its lights flashing?",choices:["Continue driving as usual","Pull over to the right and stop","Speed up to clear the way"],correct:"Pull over to the right and stop"},{question:"What should you do when driving on a freeway and you miss your exit?",choices:["Make a U-turn and go back","Continue driving until the next exit","Stop and reverse to your exit"],correct:"Continue driving until the next exit"},{question:"When should you use your hazard lights?",choices:["Only when you are driving in heavy traffic","When your car breaks down or you are stopped in an emergency","When you are driving in fog"],correct:"When your car breaks down or you are stopped in an emergency"},{question:"What should you do if you are driving and your tires blow out?",choices:["Brake immediately","Hold the steering wheel tightly and ease off the gas","Turn on your hazard lights and speed up"],correct:"Hold the steering wheel tightly and ease off the gas"},{question:"What should you do if your vehicle stalls in the middle of an intersection?",choices:["Try to restart the engine","Immediately call for roadside assistance","Get out of the car and leave it"],correct:"Try to restart the engine"},{question:"What does a solid white line indicate?",choices:["You may change lanes","You must stay in your lane","It indicates a pedestrian crossing"],correct:"You must stay in your lane"},{question:"You have been involved in a traffic collision, you must:",choices:["Remain on scene.","Exchange information with the other party,","Call 911 for a traffic officer to file a report if necessary.","Call 911 immediately for any injuries.","All choices."],correct:"All choices."}];function WI(o,t){if(o&1){let e=Z();v(0,"label",13)(1,"input",14),ne("change",function(){let i=P(e).$implicit,r=g();return A(r.selectChoice(i))}),b(),v(2,"span"),u(3),b()()}if(o&2){let e=t.$implicit,n=g();oe("selected",n.selectedChoice()===e),d(),Ee("value",e),d(2),D(e)}}var ul=window.mp;function xm(o){let t=[...o];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var vu=class o{constructor(){this.questions=F([]),this.questionIndex=F(0),this.shuffledChoices=F([]),this.selectedChoice=F(null),this.timeLeft=F(600),this.incorrectAnswers=0,this.timerHandle=null,this.handlers=[],this.progressPct=()=>Math.floor(this.questionIndex()/Math.max(this.questions().length,1)*100),this.timerDisplay=()=>{let t=Math.floor(this.timeLeft()/60).toString().padStart(2,"0"),e=(this.timeLeft()%60).toString().padStart(2,"0");return`${t}:${e}`},this.currentQuestion=()=>this.questions()[this.questionIndex()]??{question:"",choices:[],correct:""}}static{this.MAX_INCORRECT=Math.floor(vm.length*.1)}static{this.EXAM_COUNT=15}ngOnInit(){this.on("openDMVTest",()=>this.startExam()),this.on("closeDMVTest",()=>this.clearTimer())}ngOnDestroy(){this.clearTimer();for(let{name:t,fn:e}of this.handlers)ul.events.remove(t,e)}startExam(){this.incorrectAnswers=0;let t=xm(vm).slice(0,o.EXAM_COUNT);this.questions.set(t),this.questionIndex.set(0),this.selectedChoice.set(null),this.shuffledChoices.set(xm(t[0]?.choices??[])),this.timeLeft.set(600),this.clearTimer(),this.timerHandle=setInterval(()=>{let e=this.timeLeft()-1;this.timeLeft.set(e),e<=0&&this.endExam(!1)},1e3)}selectChoice(t){this.selectedChoice.set(t)}submit(){if(!this.selectedChoice())return;let t=this.currentQuestion().correct;if(this.selectedChoice()!==t&&(this.incorrectAnswers++,this.incorrectAnswers>o.MAX_INCORRECT)){this.endExam(!1);return}let e=this.questionIndex()+1;e>=this.questions().length?this.endExam(!0):(this.questionIndex.set(e),this.shuffledChoices.set(xm(this.questions()[e].choices)),this.selectedChoice.set(null))}forceEnd(){ul.events.call("dmv:closeTest")}endExam(t){this.clearTimer();let e=this.questions().map(n=>n.question);ul.events.call("callServerEvent","dmv:showResults","license",t,e),ul.events.call("dmv:closeTest")}clearTimer(){this.timerHandle!=null&&(clearInterval(this.timerHandle),this.timerHandle=null)}on(t,e){ul.events.add(t,e),this.handlers.push({name:t,fn:e})}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-dmv"]],decls:20,vars:8,consts:[[1,"dmv-shell"],[1,"dmv-header"],["aria-hidden","true",1,"dmv-badge"],[1,"dmv-title"],[1,"dmv-timer"],[1,"dmv-close",3,"click"],[1,"dmv-banner"],[1,"dmv-question"],[1,"dmv-choices"],[1,"dmv-choice",3,"selected"],[1,"dmv-footer"],[1,"dmv-progress"],[1,"dmv-submit",3,"click","disabled"],[1,"dmv-choice"],["type","radio","name","choice",3,"change","value"]],template:function(e,n){e&1&&(v(0,"div",0)(1,"div",1),Te(2,"span",2),v(3,"span",3),u(4),b(),v(5,"span",4),u(6),b(),v(7,"button",5),ne("click",function(){return n.forceEnd()}),u(8,"\u2715"),b()(),v(9,"div",6)(10,"div",7),u(11),b()(),v(12,"div",8),ve(13,WI,4,4,"label",9,Ln),b(),v(15,"div",10)(16,"span",11),u(17),b(),v(18,"button",12),ne("click",function(){return n.submit()}),u(19,"Submit"),b()()()),e&2&&(d(4),me("DMV License Exam \u2014 ",n.progressPct(),"%"),d(),oe("warning",n.timeLeft()<=60),d(),D(n.timerDisplay()),d(5),D(n.currentQuestion().question),d(2),xe(n.shuffledChoices()),d(4),cn("Question ",n.questionIndex()+1," / ",n.questions().length),d(),Ee("disabled",!n.selectedChoice()))},styles:[".dmv-shell[_ngcontent-%COMP%]{width:min(38rem,94vw);background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);border-radius:14px;overflow:hidden;box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.dmv-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;padding:.85rem 1rem;background:linear-gradient(135deg,#d11b2d3b,#d11b2d14);border-bottom:1px solid rgba(209,27,45,.42)}.dmv-badge[_ngcontent-%COMP%]{width:.78rem;height:.78rem;border-radius:50%;background:radial-gradient(circle at 35% 35%,#ff9ca7,#d11b2d);box-shadow:0 0 12px #d11b2d59}.dmv-title[_ngcontent-%COMP%]{color:#f4f7fc;font-weight:700;font-size:.86rem;text-transform:uppercase;letter-spacing:.08em;flex:1}.dmv-timer[_ngcontent-%COMP%]{color:#d8dde6;font-family:monospace;font-size:.98rem;font-weight:700}.dmv-timer.warning[_ngcontent-%COMP%]{color:#ff8d8d;animation:_ngcontent-%COMP%_blink 1s step-start infinite}@keyframes _ngcontent-%COMP%_blink{50%{opacity:.3}}.dmv-close[_ngcontent-%COMP%]{background:none;border:none;color:#c7cfdf;cursor:pointer;font-size:1rem;padding:.2rem .5rem}.dmv-close[_ngcontent-%COMP%]:hover{color:#fff}.dmv-banner[_ngcontent-%COMP%]{padding:1rem;background:#181a1f9e;border-bottom:1px solid rgba(255,255,255,.08)}.dmv-question[_ngcontent-%COMP%]{color:#f0f3f8;font-size:.96rem;line-height:1.42}.dmv-choices[_ngcontent-%COMP%]{padding:.85rem 1rem;display:flex;flex-direction:column;gap:.45rem}.dmv-choice[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.7rem;padding:.58rem .72rem;border:1px solid rgba(255,255,255,.1);border-radius:10px;cursor:pointer;color:#d8dde6;font-size:.84rem;transition:all .18s ease}.dmv-choice[_ngcontent-%COMP%]:hover{background:#ffffff0d;border-color:#d11b2d5c}.dmv-choice.selected[_ngcontent-%COMP%]{background:#d11b2d29;border-color:#d11b2d80;color:#f4f7fc}.dmv-choice[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{accent-color:#d11b2d}.dmv-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.8rem 1rem;border-top:1px solid rgba(255,255,255,.08)}.dmv-progress[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.75rem;letter-spacing:.03em}.dmv-submit[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dc7,#e52f41ad);border:1px solid rgba(209,27,45,.48);color:#fff;padding:.55rem 1rem;border-radius:10px;cursor:pointer;font-weight:600;text-transform:uppercase;letter-spacing:.08em;font-size:.75rem}.dmv-submit[_ngcontent-%COMP%]:hover{box-shadow:0 0 18px #d11b2d4d}.dmv-submit[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}"],changeDetection:0})}};var xu=window.mp,Xv=(()=>{class o{constructor(){this.active=F(!1),this.pointer=F(0),this.zoneStart=F(35),this.zoneWidth=F(20),this.direction=1,this.anim=null,this.handlers=[]}ngOnInit(){this.on("fishingGame:start",()=>this.start()),this.on("fishingGame:stop",()=>this.stop())}ngOnDestroy(){this.stop();for(let{name:e,fn:n}of this.handlers)xu.events.remove(e,n)}start(){this.active.set(!0),this.pointer.set(0),this.zoneStart.set(25+Math.floor(Math.random()*45)),this.zoneWidth.set(18),this.anim&&clearInterval(this.anim),this.anim=setInterval(()=>{let e=this.pointer()+this.direction*1.5;(e<=0||e>=100)&&(this.direction*=-1),this.pointer.set(Math.max(0,Math.min(100,e)))},16)}stop(){this.active.set(!1),this.anim&&(clearInterval(this.anim),this.anim=null)}onKey(e){if(!this.active())return;if(e.code==="Escape"){e.preventDefault(),xu.events.call("fishingGame:ack:cancelled");return}if(e.code!=="Space")return;e.preventDefault();let n=this.pointer()>=this.zoneStart()&&this.pointer()<=this.zoneStart()+this.zoneWidth();xu.events.call(n?"fishingGame:ack:success":"fishingGame:ack:failed")}on(e,n){xu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-fishing"]],hostBindings:function(n,i){n&1&&z("keydown",function(a){return i.onKey(a)},_l)},decls:13,vars:8,consts:[[1,"fish-shell"],[1,"fish-title"],[1,"fish-meter"],[1,"fish-zone"],[1,"fish-pointer"],[1,"fish-hints"],[1,"fish-key"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1),u(2,"Fishing Challenge"),b(),v(3,"div",2),Te(4,"div",3)(5,"div",4),b(),v(6,"div",5)(7,"span",6),u(8,"SPACE"),b(),u(9," catch "),v(10,"span",6),u(11,"ESC"),b(),u(12," cancel"),b()()),n&2&&(oe("active",i.active()),d(4),Dt("left",i.zoneStart(),"%")("width",i.zoneWidth(),"%"),d(),Dt("left",i.pointer(),"%"))},styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.fish-shell[_ngcontent-%COMP%]{display:none;width:min(30rem,92vw);padding:1rem;border-radius:14px;background:linear-gradient(165deg,#2b2b2de6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.fish-shell.active[_ngcontent-%COMP%]{display:block}.fish-title[_ngcontent-%COMP%]{color:#f4f7fc;text-transform:uppercase;letter-spacing:.08em;font-weight:700;margin-bottom:.7rem;font-size:.83rem}.fish-meter[_ngcontent-%COMP%]{position:relative;height:14px;border-radius:999px;background:#ffffff14;overflow:hidden;border:1px solid rgba(255,255,255,.16)}.fish-zone[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;background:linear-gradient(90deg,#7ad694e6,#43b468eb);border-radius:999px}.fish-pointer[_ngcontent-%COMP%]{position:absolute;top:-7px;width:4px;height:28px;background:#f4f7fc;box-shadow:0 0 8px #ffffff80;transition:left .03s linear}.fish-hints[_ngcontent-%COMP%]{margin-top:.7rem;color:#a9b0bb;font-size:.77rem}.fish-key[_ngcontent-%COMP%]{margin-left:.72rem;margin-right:.35rem;padding:.14rem .5rem;border-radius:8px;background:#ffffff14;border:1px solid rgba(209,27,45,.26);color:#f4f7fc;font-weight:600;letter-spacing:.06em}.fish-key[_ngcontent-%COMP%]:first-child{margin-left:0}"],changeDetection:0})}}return o})();function XI(o,t){if(o&1&&(v(0,"span",8),u(1),b()),o&2){let e=g();d(),me("NIGHTSUN X",e.nightSunLevel())}}function qI(o,t){o&1&&(v(0,"span",8),u(1,"NIGHTVISION"),b())}function $I(o,t){if(o&1&&(v(0,"div",13),u(1),b()),o&2){let e=g();d(),me("",e.targetSpeed()," MPH")}}var qv=window.mp,$v=(()=>{class o{constructor(){this.active=F(!1),this.flightName=F("BLAINE COUNTY SHERIFF AIR"),this.x=F("0.000"),this.y=F("0.000"),this.z=F("0.000"),this.time=F(""),this.area=F("Unknown"),this.street=F(""),this.speed=F(0),this.altitude=F(0),this.heading=F(0),this.hasTarget=F(!1),this.targetSpeed=F(0),this.nightVision=F(!1),this.nightSun=F(!1),this.nightSunLevel=F(1),this.handlers=[]}ngOnInit(){this.on("flightName",e=>{this.active.set(!0),this.flightName.set(String(e??this.flightName()))}),this.on("tick",(e,n,i,r)=>{this.x.set(String(e)),this.y.set(String(n)),this.z.set(String(i)),this.time.set(String(r))}),this.on("location",(e,n,i,r,a)=>{this.area.set(String(e)),this.street.set(String(n)),this.speed.set(Number(i)),this.altitude.set(Number(r)),this.heading.set(Number(a))}),this.on("vehicleTarget",(e,n)=>{this.hasTarget.set(!!e),this.targetSpeed.set(Number(n))}),this.on("nightVisionToggle",e=>this.nightVision.set(Number(e)===1)),this.on("nightSun",(e,n)=>{this.nightSun.set(!!e),this.nightSunLevel.set(Number(n))})}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)qv.events.remove(e,n)}on(e,n){qv.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-leo-heli"]],decls:32,vars:15,consts:[[1,"heli-wrap"],[1,"heli-panel"],[1,"heli-header"],[1,"heli-name"],[1,"heli-coords"],[1,"heli-time"],[1,"heli-grid"],[1,"heli-tags"],[1,"heli-tag"],[1,"heli-location"],[1,"area"],[1,"street"],[1,"crosshair"],[1,"target-speed"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),u(4),b(),v(5,"div",4),u(6),b(),v(7,"div",5),u(8),b()(),v(9,"div",6)(10,"span"),u(11,"SPD"),b(),v(12,"span"),u(13),b(),v(14,"span"),u(15,"ALT"),b(),v(16,"span"),u(17),b(),v(18,"span"),u(19,"HDG"),b(),v(20,"span"),u(21),b()(),v(22,"div",7),R(23,XI,2,1,"span",8),R(24,qI,2,0,"span",8),b()(),v(25,"div",9)(26,"div",10),u(27),b(),v(28,"div",11),u(29),b()(),Te(30,"div",12),R(31,$I,2,1,"div",13),b()),n&2&&(oe("active",i.active()),d(4),D(i.flightName()),d(2),qm("",i.x()," ",i.y()," ",i.z()),d(2),D(i.time()),d(5),me("",i.speed()," KT"),d(4),me("",i.altitude()," FT"),d(4),me("",i.heading(),"\xB0"),d(2),N(i.nightSun()?23:-1),d(),N(i.nightVision()?24:-1),d(3),D(i.area()),d(2),D(i.street()),d(2),N(i.hasTarget()?31:-1))},styles:['[_nghost-%COMP%]{width:100%;height:100%;pointer-events:none}.heli-wrap[_ngcontent-%COMP%]{display:none;width:100%;height:100%;position:relative}.heli-wrap.active[_ngcontent-%COMP%]{display:block}.heli-panel[_ngcontent-%COMP%]{position:absolute;top:32px;left:32px;width:min(22rem,70vw);padding:.8rem;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);border-radius:12px;box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.heli-header[_ngcontent-%COMP%]{display:grid;gap:3px}.heli-name[_ngcontent-%COMP%]{color:#f4f7fc;font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:.82rem}.heli-coords[_ngcontent-%COMP%], .heli-time[_ngcontent-%COMP%]{color:#a9b0bb;font-family:monospace;font-size:.74rem}.heli-grid[_ngcontent-%COMP%]{margin-top:.55rem;display:grid;grid-template-columns:auto 1fr;gap:.2rem .6rem;color:#d8dde6;font-family:monospace;font-size:.75rem}.heli-grid[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(odd){color:#ffb7bf}.heli-tags[_ngcontent-%COMP%]{margin-top:.55rem;display:flex;gap:6px}.heli-tag[_ngcontent-%COMP%]{padding:.2rem .52rem;border-radius:999px;font-size:.62rem;letter-spacing:.08em;color:#fff;border:1px solid rgba(209,27,45,.5);background:#d11b2d40}.heli-location[_ngcontent-%COMP%]{position:absolute;left:32px;bottom:40px;padding:.65rem .8rem;background:linear-gradient(160deg,#383c46d6,#202228e6);border:1px solid rgba(95,101,114,.48);border-radius:10px}.area[_ngcontent-%COMP%]{color:#f0f3f8;font-weight:700;letter-spacing:.06em;font-size:.78rem}.street[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.74rem;margin-top:2px}.crosshair[_ngcontent-%COMP%]{position:absolute;left:50%;top:50%;width:22px;height:22px;border:2px solid rgba(255,255,255,.9);border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 10px #ffffff73}.crosshair[_ngcontent-%COMP%]:before, .crosshair[_ngcontent-%COMP%]:after{content:"";position:absolute;background:#ffffffe6}.crosshair[_ngcontent-%COMP%]:before{left:50%;top:-9px;width:2px;height:40px;transform:translate(-50%)}.crosshair[_ngcontent-%COMP%]:after{top:50%;left:-9px;height:2px;width:40px;transform:translateY(-50%)}.target-speed[_ngcontent-%COMP%]{position:absolute;left:50%;top:calc(50% + 34px);transform:translate(-50%);font-family:monospace;font-size:.72rem;letter-spacing:.12em;color:#ffb7bf;padding:.24rem .44rem;border:1px solid rgba(209,27,45,.45);background:#202228e6}'],changeDetection:0})}}return o})();function YI(o,t){if(o&1&&(v(0,"pre"),u(1),b()),o&2){let e=g();d(),D(e.payloadJson())}}function jI(o,t){o&1&&(v(0,"p",6),u(1,"Waiting for initialize payload."),b())}function KI(o,t){if(o&1&&(v(0,"div",9)(1,"div",10)(2,"span",11),u(3),b(),v(4,"span",12),u(5),b()(),v(6,"div",13),u(7),b()()),o&2){let e=t.$implicit;d(3),D(e.event),d(2),D(e.timestamp),d(2),D(e.payloadPreview)}}function ZI(o,t){o&1&&(v(0,"p",6),u(1,"No events yet."),b())}var bu=window.mp,Yv=(()=>{class o{constructor(){this.status=F("Connected"),this.payloadJson=F(""),this.eventLog=F([]),this.handlers=[]}ngOnInit(){this.on("initialize",e=>{this.status.set("Initialized"),this.payloadJson.set(this.stringify(e)),this.pushLog("initialize",[e])}),this.on("extras",e=>this.pushLog("extras",[e])),this.on("launch",(...e)=>this.pushLog("launch",e)),this.on("cancelTrace",(...e)=>this.pushLog("cancelTrace",e)),this.on("mdc:terminate",(...e)=>{this.status.set("Terminated"),this.pushLog("mdc:terminate",e)}),this.on("mdc:enableWindow",(...e)=>this.pushLog("mdc:enableWindow",e)),this.on("mdc:refreshNoteContent",(...e)=>this.pushLog("mdc:refreshNoteContent",e)),this.on("mdc:notesUpdated",(...e)=>this.pushLog("mdc:notesUpdated",e)),this.on("mdc:prisoner:get",(...e)=>this.pushLog("mdc:prisoner:get",e)),this.on("mdc:prison:cellBlockStatus",(...e)=>this.pushLog("mdc:prison:cellBlockStatus",e)),this.on("mdc:prison:updateCellStatus",(...e)=>this.pushLog("mdc:prison:updateCellStatus",e))}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)bu.events.remove(e,n)}requestInit(){bu.events.call("callServerEvent","mdc:requestInit")}close(){bu.events.call("callServerEvent","mdc:close")}pushLog(e,n){let i=n.map(r=>this.preview(r)).join(" | ").slice(0,420);this.eventLog.update(r=>[{event:e,timestamp:new Date().toLocaleTimeString(),payloadPreview:i},...r].slice(0,80))}preview(e){return typeof e=="string"?e:this.stringify(e)}stringify(e){try{if(typeof e=="string"){let n=JSON.parse(e);return JSON.stringify(n,null,2)}return JSON.stringify(e,null,2)}catch{return String(e)}}on(e,n){bu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-mdc"]],decls:25,vars:3,consts:[[1,"mdc-shell"],[1,"mdc-header"],[1,"header-actions"],["type","button",3,"click"],[1,"mdc-grid"],[1,"panel","payload-panel"],[1,"hint"],[1,"panel","events-panel"],[1,"event-list"],[1,"event-row"],[1,"meta"],[1,"name"],[1,"time"],[1,"preview"]],template:function(n,i){n&1&&(v(0,"section",0)(1,"header",1)(2,"div")(3,"h2"),u(4,"Mobile Data Computer"),b(),v(5,"p"),u(6),b()(),v(7,"div",2)(8,"button",3),ne("click",function(){return i.requestInit()}),u(9,"Request Init"),b(),v(10,"button",3),ne("click",function(){return i.close()}),u(11,"Close"),b()()(),v(12,"main",4)(13,"article",5)(14,"h3"),u(15,"Current Payload"),b(),R(16,YI,2,1,"pre")(17,jI,2,0,"p",6),b(),v(18,"aside",7)(19,"h3"),u(20,"Live Events"),b(),v(21,"div",8),ve(22,KI,8,3,"div",9,ct,!1,ZI,2,0,"p",6),b()()()()),n&2&&(d(6),D(i.status()),d(10),N(i.payloadJson()?16:17),d(6),xe(i.eventLog()))},dependencies:[tt],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:grid;place-items:center}.mdc-shell[_ngcontent-%COMP%]{width:min(1200px,95vw);height:min(740px,93vh);border-radius:14px;overflow:hidden;border:1px solid rgba(95,101,114,.48);background:linear-gradient(160deg,#383c46e6,#202228f2);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);display:flex;flex-direction:column}.mdc-header[_ngcontent-%COMP%]{padding:.85rem 1rem;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.mdc-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;letter-spacing:.08em;text-transform:uppercase}.mdc-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#ffb7bf;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase}.header-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid rgba(95,101,114,.48);background:#ffffff0f;color:#d8dde6;padding:.45rem .72rem;border-radius:9px;cursor:pointer;font-size:.72rem;text-transform:uppercase;letter-spacing:.08em}.header-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{border-color:#d11b2d85;color:#fff}.mdc-grid[_ngcontent-%COMP%]{flex:1;min-height:0;display:grid;grid-template-columns:1fr 380px;gap:.75rem;padding:.75rem}.panel[_ngcontent-%COMP%]{background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:.7rem;min-height:0}.panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 8px;color:#f0f3f8;font-size:.76rem;letter-spacing:.08em;text-transform:uppercase}.payload-panel[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;height:calc(100% - 24px);overflow:auto;color:#d8dde6;background:#00000040;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:.65rem;font-size:.75rem;line-height:1.35}.events-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column}.event-list[_ngcontent-%COMP%]{overflow:auto;display:grid;gap:7px}.event-row[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:8px;background:#ffffff05}.meta[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:8px;margin-bottom:4px}.name[_ngcontent-%COMP%]{color:#ffb7bf;font-size:.78rem;font-weight:600}.time[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.72rem}.preview[_ngcontent-%COMP%]{color:#d8dde6;font-size:.74rem;line-height:1.35;word-break:break-word}.hint[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.85rem}@media(max-width:980px){.mdc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"],changeDetection:0})}}return o})();var hl=window.mp,jv=(()=>{class o{constructor(){this.active=F(!1),this.remainingHits=F(0),this.fails=F(0),this.failLimit=F(1),this.targetSize=F(0),this.targetLocation=F(0),this.barDuration=F(2),this.hitCount=0,this.startTargetSize=0,this.endTargetSize=0,this.startDuration=0,this.endDuration=0,this.hitsDone=0,this.animFrame=null,this.barAngle=-90,this.lastTimestamp=0,this.targetDash=le(()=>{let e=2*Math.PI*96,n=this.targetSize()/360;return`${e*n} ${e}`}),this.targetTransform=le(()=>`rotate(${this.targetLocation()}deg)`),this.barTransform=le(()=>`rotate(${this.barAngle}deg)`),this.handlers=[]}ngOnInit(){this.on("minigame:start",(e,n,i,r,a,s)=>{this.hitCount=Number(e),this.hitsDone=0,this.failLimit.set(Number(n)),this.fails.set(0),this.remainingHits.set(this.hitCount),this.startTargetSize=Number(i),this.endTargetSize=Number(r),this.startDuration=Number(a),this.endDuration=Number(s),this.resetRound(),this.active.set(!0),this.barAngle=-90,this.lastTimestamp=performance.now(),this.animFrame=requestAnimationFrame(this.tick.bind(this))}),this.on("minigame:stop",()=>this.deactivate()),this.on("minigame:ack:failed",()=>this.deactivate()),this.on("minigame:ack:cancelled",()=>this.deactivate()),this.on("minigame:ack:success",()=>this.deactivate())}ngOnDestroy(){this.deactivate();for(let{name:e,fn:n}of this.handlers)hl.events.remove(e,n)}onKey(e){this.active()&&(e.code==="Space"&&(e.preventDefault(),this.hit()),e.code==="Escape"&&(e.preventDefault(),hl.events.call("minigame:ack:cancelled")))}hit(){let e=(this.barAngle+90+360)%360,n=(this.targetLocation()+360)%360,i=(n+this.targetSize()+360)%360,r;if(n<=i?r=e>=n&&e<=i:r=e>=n||e<=i,r){if(this.hitsDone++,this.remainingHits.set(this.hitCount-this.hitsDone),this.remainingHits()<=0){hl.events.call("minigame:ack:success");return}this.resetRound()}else{let a=this.fails()+1;if(this.fails.set(a),a>=this.failLimit()){hl.events.call("minigame:ack:failed");return}this.resetRound()}}resetRound(){this.targetLocation.set(Math.floor(Math.random()*360));let e=this.hitsDone/Math.max(this.hitCount-1,1),n=this.startTargetSize+(this.endTargetSize-this.startTargetSize)*e,i=this.startDuration+(this.endDuration-this.startDuration)*e;this.targetSize.set(n),this.barDuration.set(i)}tick(e){if(!this.active())return;let n=e-this.lastTimestamp;this.lastTimestamp=e;let i=360/(this.barDuration()*1e3);this.barAngle=(this.barAngle+i*n+360)%360-90,this.animFrame=requestAnimationFrame(this.tick.bind(this))}deactivate(){this.active.set(!1),this.animFrame!=null&&(cancelAnimationFrame(this.animFrame),this.animFrame=null)}on(e,n){hl.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-minigame"]],hostBindings:function(n,i){n&1&&z("keydown",function(a){return i.onKey(a)},_l)},decls:26,vars:13,consts:[[1,"mg-shell"],[1,"mg-hint-top"],[1,"mg-key"],[1,"mg-key-label"],[1,"mg-qte"],["viewBox","0 0 300 300"],["cx","150","cy","150","r","96",1,"mg-rail"],["cx","150","cy","150","r","96",1,"mg-target"],["x1","150","y1","150","x2","246","y2","150",1,"mg-bar"],[1,"mg-stats"],[1,"mg-stat"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"span",2),u(3,"SPACE"),b(),v(4,"span",3),u(5," to hit"),b(),u(6," \xA0\xA0 "),v(7,"span",2),u(8,"ESC"),b(),v(9,"span",3),u(10," to cancel"),b()(),v(11,"div",4),zi(),v(12,"svg",5),Te(13,"circle",6)(14,"circle",7)(15,"line",8),b(),Vr(),v(16,"div",9)(17,"div",10),u(18," Remaining: "),v(19,"strong"),u(20),b()(),v(21,"div",10),u(22," Fails: "),v(23,"strong"),u(24),b(),u(25),b()()()()),n&2&&(oe("active",i.active()),d(14),Dt("stroke-dasharray",i.targetDash())("transform",i.targetTransform()),d(),Dt("transform",i.barTransform())("animation-duration",i.barDuration()+"s"),d(5),D(i.remainingHits()),d(4),D(i.fails()),d(),me(" / ",i.failLimit()," "))},styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.mg-shell[_ngcontent-%COMP%]{display:none;flex-direction:column;align-items:center;gap:.85rem;padding:1rem;border-radius:14px;border:1px solid rgba(95,101,114,.48);background:linear-gradient(165deg,#2b2b2de6,#202228f2);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.mg-shell.active[_ngcontent-%COMP%]{display:flex}.mg-hint-top[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;color:#a9b0bb;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em}.mg-key[_ngcontent-%COMP%]{background:#ffffff14;border:1px solid rgba(209,27,45,.26);border-radius:8px;padding:.15rem .5rem;color:#f4f7fc;font-weight:600;font-size:.72rem;letter-spacing:.08em}.mg-qte[_ngcontent-%COMP%]{position:relative}svg[_ngcontent-%COMP%]{width:250px;height:250px;overflow:visible}.mg-rail[_ngcontent-%COMP%]{fill:none;stroke:#ffffff1f;stroke-width:8}.mg-target[_ngcontent-%COMP%]{fill:none;stroke:#d11b2dd1;stroke-width:8;transform-origin:150px 150px;stroke-linecap:round;filter:drop-shadow(0 0 6px rgba(209,27,45,.35))}.mg-bar[_ngcontent-%COMP%]{stroke:#f4f7fc;stroke-width:4;stroke-linecap:round;transform-origin:150px 150px;animation:_ngcontent-%COMP%_spin linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(-90deg)}to{transform:rotate(270deg)}}.mg-stats[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.25rem;margin-top:.45rem}.mg-stat[_ngcontent-%COMP%]{color:#a9b0bb;font-size:.76rem;text-transform:uppercase;letter-spacing:.05em}.mg-stat[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#f4f7fc}"],changeDetection:0})}}return o})();var yu=window.mp,Kv=(()=>{class o{constructor(){this.active=F(!1),this.renderedPlate=F(""),this.sourcePlate=null,this.removing=!1,this.index=0,this.timer=null,this.handlers=[]}ngOnInit(){this.on("initialize",e=>this.start(String(e),!1)),this.on("startRemoving",e=>this.start(String(e),!0)),this.on("plateScreen:close",()=>this.stop())}ngOnDestroy(){this.stop();for(let{name:e,fn:n}of this.handlers)yu.events.remove(e,n)}start(e,n){this.stop(),this.active.set(!0),this.sourcePlate=e,this.removing=n,this.index=n?e.length:0,this.renderedPlate.set(n?e:""),this.timer=setInterval(()=>{if(this.sourcePlate){if(this.removing){if(this.index--,this.index<0){this.finish();return}this.renderedPlate.set(this.sourcePlate.substring(0,this.index));return}if(this.index>=this.sourcePlate.length){this.finish();return}this.index++,this.renderedPlate.set(this.sourcePlate.substring(0,this.index))}},240)}finish(){this.removing?yu.events.call("removePlateScreen:finished"):yu.events.call("plateScreen:finished"),this.stop()}stop(){this.active.set(!1),this.timer&&(clearInterval(this.timer),this.timer=null),this.sourcePlate=null,this.renderedPlate.set("")}on(e,n){yu.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-plate-screen"]],decls:7,vars:3,consts:[[1,"plate-shell"],[1,"plate-card"],[1,"plate-kicker"],[1,"plate-frame"],[1,"plate-text"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Custom Plate Builder"),b(),v(4,"div",3)(5,"span",4),u(6),b()()()()),n&2&&(oe("active",i.active()),d(6),D(i.renderedPlate()))},styles:["[_nghost-%COMP%]{width:100%;height:100%;display:grid;place-items:center}.plate-shell[_ngcontent-%COMP%]{display:none}.plate-shell.active[_ngcontent-%COMP%]{display:block}.plate-card[_ngcontent-%COMP%]{width:min(30rem,92vw);padding:1rem;border-radius:14px;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.plate-kicker[_ngcontent-%COMP%]{margin-bottom:.65rem;color:#ffb7bf;font-size:.72rem;text-transform:uppercase;letter-spacing:.14em}.plate-frame[_ngcontent-%COMP%]{height:9.5rem;border-radius:10px;background:linear-gradient(180deg,#e9e7d6,#d9d2b0);border:2px solid #b5aa7e;display:grid;place-items:center;box-shadow:inset 0 0 24px #0000002e}.plate-text[_ngcontent-%COMP%]{font-family:Courier New,monospace;font-size:clamp(1.8rem,6vw,2.3rem);font-weight:700;letter-spacing:.18em;color:#1f1842;text-shadow:1px 1px 0 rgba(255,255,255,.8)}"],changeDetection:0})}}return o})();var JI=(o,t)=>t.model,QI=(o,t)=>t.index,eO=(o,t)=>t.type+"_"+t.index,tO=(o,t)=>t.id;function nO(o,t){if(o&1){let e=Z();v(0,"button",25),ne("click",function(){P(e);let i=g();return A(i.searchQuery.set(""))}),Te(1,"i",26),b()}}function iO(o,t){if(o&1){let e=Z();v(0,"button",27),ne("click",function(){let i=P(e).$implicit,r=g();return A(r.selectVehicle(i))}),v(1,"div",28)(2,"span",29),u(3),b(),v(4,"span",30),u(5),b()(),v(6,"span",31),u(7),b()()}if(o&2){let e,n=t.$implicit,i=g();oe("selected",((e=i.selectedVehicle())==null?null:e.model)===n.model),d(3),D(n.name),d(2),D(n.category),d(2),me("$",n.price.toLocaleString("en-US"))}}function oO(o,t){o&1&&(v(0,"p",10),u(1,"No vehicles match your search."),b())}function rO(o,t){if(o&1){let e=Z();v(0,"button",35),ne("click",function(){let i=P(e).$implicit,r=g(2);return A(r.pickColor(i.index))}),b()}if(o&2){let e=t.$implicit,n=g(2);Dt("background",e.css),oe("selected",n.activeColorIndex()===e.index),Ee("title",e.label)}}function aO(o,t){if(o&1){let e=Z();v(0,"div",32)(1,"button",21),ne("click",function(){P(e);let i=g();return A(i.setColorTarget("primary"))}),u(2,"Primary"),b(),v(3,"button",21),ne("click",function(){P(e);let i=g();return A(i.setColorTarget("secondary"))}),u(4,"Secondary"),b()(),v(5,"div",33),ve(6,rO,1,5,"button",34,QI),b()}if(o&2){let e=g();d(),oe("active",e.colorTarget()==="primary"),d(2),oe("active",e.colorTarget()==="secondary"),d(3),xe(e.colorSwatches)}}function sO(o,t){if(o&1){let e=Z();v(0,"button",37),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.pickWheel(i))}),v(1,"span",38),u(2),b(),v(3,"span",39),u(4),b()()}if(o&2){let e,n=t.$implicit,i=g(3);oe("selected",((e=i.selectedWheel())==null?null:e.type)===n.type&&((e=i.selectedWheel())==null?null:e.index)===n.index),d(2),D(n.name),d(2),D(n.category)}}function lO(o,t){if(o&1&&ve(0,sO,5,4,"button",36,eO),o&2){let e=g(2);xe(e.selectedVehicle().wheels)}}function cO(o,t){o&1&&(v(0,"p",10),u(1,"Loading wheels\u2026"),b())}function dO(o,t){o&1&&(v(0,"p",10),u(1,"No custom wheels for this model."),b())}function uO(o,t){if(o&1&&(v(0,"div",22),R(1,lO,2,0)(2,cO,2,0,"p",10)(3,dO,2,0,"p",10),b()),o&2){let e,n=g();d(),N(!((e=n.selectedVehicle())==null||e.wheels==null)&&e.wheels.length?1:n.wheelsLoading()?2:3)}}function hO(o,t){if(o&1){let e=Z();v(0,"button",42),ne("click",function(){let i=P(e).$implicit,r=g(4);return A(r.toggleUpgrade(i))}),v(1,"div",43)(2,"span",44),u(3),b(),v(4,"span",45),u(5),b()(),v(6,"span",46),u(7),b()()}if(o&2){let e=t.$implicit,n=g(4);oe("selected",n.selectedUpgradeIds().includes(e.id)),Ee("disabled",n.isUpgradeDisabled(e)&&!n.selectedUpgradeIds().includes(e.id)),d(3),D(e.name),d(2),me("$",e.price.toLocaleString("en-US")),d(2),D(e.description)}}function pO(o,t){if(o&1&&(v(0,"span",40),u(1),b(),ve(2,hO,8,6,"button",41,tO)),o&2){let e=t.$implicit,n=g(3);d(),D(e),d(),xe(n.upgradesInCategory(e))}}function mO(o,t){if(o&1&&ve(0,pO,4,1,null,null,Ln),o&2){let e=g(2);xe(e.upgradeCategories())}}function fO(o,t){o&1&&(v(0,"p",10),u(1,"No upgrades available."),b())}function gO(o,t){if(o&1&&R(0,mO,2,0)(1,fO,2,0,"p",10),o&2){let e=g();N(e.upgrades().length?0:1)}}function _O(o,t){if(o&1&&(v(0,"div",48)(1,"span"),u(2,"Base"),b(),v(3,"span"),u(4),b(),v(5,"span"),u(6),b(),v(7,"span"),u(8),b()()),o&2){let e=g(2);d(4),me("$",e.selectedPrice()),d(2),me("Upgrades (",e.selectedUpgradeIds().length,")"),d(2),me("+$",e.upgradesTotal().toLocaleString("en-US"))}}function vO(o,t){if(o&1&&(v(0,"div",52),u(1),b()),o&2){let e=g(2);oe("success",e.resultSuccess())("error",!e.resultSuccess()),d(),me(" ",e.resultMessage()," ")}}function xO(o,t){o&1&&u(0," Processing\u2026 ")}function bO(o,t){o&1&&u(0," Purchase ")}function yO(o,t){if(o&1){let e=Z();v(0,"span",40),u(1,"Purchase"),b(),v(2,"div",47),u(3),b(),R(4,_O,9,3,"div",48),v(5,"div",49),u(6),b(),R(7,vO,2,5,"div",50),v(8,"button",51),ne("click",function(){P(e);let i=g();return A(i.confirmPurchase())}),R(9,xO,1,0)(10,bO,1,0),b()}if(o&2){let e=g();d(3),D(t.name),d(),N(e.selectedUpgradeIds().length?4:-1),d(2),me("$",e.totalPrice()),d(),N(e.resultMessage()?7:-1),d(),Ee("disabled",e.purchasing()),d(),N(e.purchasing()?9:10)}}var Fi=window.mp,CO=[{index:0,css:"#1a1a1a",label:"Matte Black"},{index:1,css:"#2d2d2d",label:"Black"},{index:12,css:"#c0c0c0",label:"Silver"},{index:4,css:"#d4d4d4",label:"White"},{index:3,css:"#e8e8e8",label:"Bright White"},{index:27,css:"#cc3333",label:"Red"},{index:28,css:"#8b0000",label:"Dark Red"},{index:6,css:"#1e40af",label:"Blue"},{index:64,css:"#1d4ed8",label:"Bright Blue"},{index:35,css:"#0f172a",label:"Dark Blue"},{index:88,css:"#16a34a",label:"Green"},{index:53,css:"#166534",label:"Dark Green"},{index:92,css:"#86efac",label:"Mint"},{index:8,css:"#d97706",label:"Orange"},{index:7,css:"#fbbf24",label:"Yellow"},{index:13,css:"#f9fafb",label:"Frost White"},{index:51,css:"#7e22ce",label:"Purple"},{index:146,css:"#c084fc",label:"Lavender"},{index:135,css:"#f472b6",label:"Pink"},{index:26,css:"#92400e",label:"Brown"},{index:111,css:"#78716c",label:"Stone Grey"},{index:2,css:"#6b7280",label:"Gun Metal"},{index:150,css:"#e2b86b",label:"Gold"},{index:147,css:"#b0b0b0",label:"Chrome"}],Zv=(()=>{class o{constructor(){this.initPayload="",this.dealerName=F("Vehicle Dealer"),this.vehicles=F([]),this.upgrades=F([]),this.selectedVehicle=F(null),this.primaryColor=F(0),this.secondaryColor=F(0),this.colorTarget=F("primary"),this.activeTab=F("color"),this.selectedWheel=F(null),this.selectedUpgradeIds=F([]),this.purchasing=F(!1),this.resultMessage=F(""),this.resultSuccess=F(!1),this.isDragging=F(!1),this.searchQuery=F(""),this.wheelsLoading=F(!1),this.colorSwatches=CO,this.filteredVehicles=le(()=>{let e=this.searchQuery().toLowerCase().trim();return e?this.vehicles().filter(n=>n.name.toLowerCase().includes(e)||n.category.toLowerCase().includes(e)):this.vehicles()}),this.upgradeCategories=le(()=>{let e=new Set,n=[];for(let i of this.upgrades())e.has(i.category)||(e.add(i.category),n.push(i.category));return n}),this.activeColorIndex=le(()=>this.colorTarget()==="primary"?this.primaryColor():this.secondaryColor()),this.upgradesTotal=le(()=>this.selectedUpgradeIds().reduce((e,n)=>{let i=this.upgrades().find(r=>r.id===n);return e+(i?.price??0)},0)),this.totalPrice=le(()=>{let e=this.selectedVehicle();return e?(e.price+this.upgradesTotal()).toLocaleString("en-US"):"0"}),this.selectedPrice=le(()=>{let e=this.selectedVehicle();return e?e.price.toLocaleString("en-US"):"0"}),this.handlers=[],this.lastDragX=0,this.onDocumentMouseMove=e=>{if(!this.isDragging())return;let n=(e.clientX-this.lastDragX)*.4;this.lastDragX=e.clientX,Math.abs(n)>.5&&Fi.events.call("vehicleDealer:rotate",n)},this.onDocumentMouseUp=()=>{this.isDragging.set(!1)}}ngOnInit(){try{let e=JSON.parse(this.initPayload);this.dealerName.set(e.dealerName??"Vehicle Dealer"),this.vehicles.set(Array.isArray(e.vehicles)?e.vehicles:[]),this.upgrades.set(Array.isArray(e.upgrades)?e.upgrades:[]);let n=e.vehicles?.[0]??null;n&&this.selectVehicle(n)}catch{}this.on("vehicleDealer:purchaseResult",e=>{try{let n=JSON.parse(String(e));this.purchasing.set(!1),this.resultSuccess.set(n.success),this.resultMessage.set(n.message??(n.success?"Purchase successful!":"Purchase failed."))}catch{this.purchasing.set(!1),this.resultMessage.set("An unexpected error occurred."),this.resultSuccess.set(!1)}}),this.on("vehicleDealer:wheelsResult",(e,n)=>{this.wheelsLoading.set(!1);try{let i=JSON.parse(String(n)),r=this.selectedVehicle();if(r&&r.model===String(e)){this.selectedVehicle.set(De(he({},r),{wheels:i}));let a=i[0]??null;this.selectedWheel.set(a),a&&Fi.events.call("vehicleDealer:setWheels",a.type,a.index)}}catch{}}),document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp)}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)Fi.events.remove(e,n);document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp)}onDragStart(e){this.isDragging.set(!0),this.lastDragX=e.clientX,e.preventDefault()}rotate(e){Fi.events.call("vehicleDealer:rotate",e)}selectVehicle(e){this.selectedVehicle.set(De(he({},e),{wheels:[]})),this.selectedWheel.set(null),this.selectedUpgradeIds.set([]),this.wheelsLoading.set(!0),this.resultMessage.set(""),Fi.events.call("vehicleDealer:preview",e.model),Fi.events.call("callServerEvent","vehicleDealer:getWheels",e.model)}toggleUpgrade(e){let n=this.selectedUpgradeIds();n.includes(e.id)?this.selectedUpgradeIds.set(n.filter(i=>i!==e.id)):this.selectedUpgradeIds.set([...n,e.id])}isUpgradeDisabled(e){let n=this.selectedUpgradeIds();return!!(e.requiresUpgradeId!==null&&!n.includes(e.requiresUpgradeId)||e.conflicts.some(i=>n.includes(i)))}upgradesInCategory(e){return this.upgrades().filter(n=>n.category===e)}pickWheel(e){this.selectedWheel.set(e),Fi.events.call("vehicleDealer:setWheels",e.type,e.index)}setColorTarget(e){this.colorTarget.set(e)}pickColor(e){this.colorTarget()==="primary"?this.primaryColor.set(e):this.secondaryColor.set(e),Fi.events.call("vehicleDealer:setColor",this.primaryColor(),this.secondaryColor())}confirmPurchase(){let e=this.selectedVehicle();if(!e||this.purchasing())return;this.purchasing.set(!0),this.resultMessage.set("");let n=this.selectedWheel(),i={model:e.model,primaryColor:this.primaryColor(),secondaryColor:this.secondaryColor(),wheelType:n?.type??null,wheelIndex:n?.index??null,upgradeIds:this.selectedUpgradeIds()};Fi.events.call("callServerEvent","vehicleDealer:purchase",JSON.stringify(i))}exit(){Fi.events.call("callServerEvent","vehicleDealer:exit")}on(e,n){Fi.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-vehicle-dealer"]],inputs:{initPayload:"initPayload"},decls:46,vars:16,consts:[[1,"vd-root"],[1,"vd-drag-overlay",3,"mousedown"],[1,"vd-left"],[1,"vd-left__header"],[1,"vd-left__search"],[1,"fa-solid","fa-magnifying-glass"],["type","text","placeholder","Search vehicles\u2026",3,"input","value"],["type","button","title","Clear",1,"vd-search-clear"],[1,"vd-left__list","scrollbar-neon"],["type","button",1,"vd-vehicle-item",3,"selected"],[1,"vd-empty"],[1,"vd-rotate-controls"],["type","button","title","Rotate left",1,"vd-rotate-btn",3,"click"],[1,"fa-solid","fa-rotate-left"],[1,"vd-rotate-hint"],["type","button","title","Rotate right",1,"vd-rotate-btn",3,"click"],[1,"fa-solid","fa-rotate-right"],[1,"vd-side"],[1,"vd-side__header"],[1,"vd-side__body","scrollbar-neon"],[1,"vd-tabs"],["type","button",3,"click"],[1,"vd-wheels-list"],[1,"vd-side__footer"],["type","button",1,"warn","vd-full-btn",3,"click"],["type","button","title","Clear",1,"vd-search-clear",3,"click"],[1,"fa-solid","fa-xmark"],["type","button",1,"vd-vehicle-item",3,"click"],[1,"vd-vehicle-item__info"],[1,"vd-vehicle-item__name"],[1,"vd-vehicle-item__cat"],[1,"vd-vehicle-item__price"],[1,"vd-colors__targets"],[1,"vd-swatches"],["type","button",1,"vd-swatch",3,"selected","background","title"],["type","button",1,"vd-swatch",3,"click","title"],["type","button",1,"vd-wheel-item",3,"selected"],["type","button",1,"vd-wheel-item",3,"click"],[1,"vd-wheel-item__name"],[1,"vd-wheel-item__cat"],[1,"vd-section-heading"],["type","button",1,"vd-upgrade-item",3,"selected","disabled"],["type","button",1,"vd-upgrade-item",3,"click","disabled"],[1,"vd-upgrade-item__row"],[1,"vd-upgrade-item__name"],[1,"vd-upgrade-item__price"],[1,"vd-upgrade-item__desc"],[1,"vd-purchase__name"],[1,"vd-purchase__breakdown"],[1,"vd-purchase__price"],[1,"vd-purchase__result",3,"success","error"],["type","button",1,"primary","vd-full-btn",3,"click","disabled"],[1,"vd-purchase__result"]],template:function(n,i){if(n&1&&(v(0,"div",0)(1,"div",1),ne("mousedown",function(a){return i.onDragStart(a)}),b(),v(2,"aside",2)(3,"header",3)(4,"div")(5,"h2"),u(6),b(),v(7,"p"),u(8,"Select a vehicle"),b()()(),v(9,"div",4),Te(10,"i",5),v(11,"input",6),ne("input",function(a){return i.searchQuery.set(a.target.value)}),b(),R(12,nO,2,0,"button",7),b(),v(13,"div",8),ve(14,iO,8,5,"button",9,JI,!1,oO,2,0,"p",10),b()(),v(17,"div",11)(18,"button",12),ne("click",function(){return i.rotate(-45)}),Te(19,"i",13),b(),v(20,"span",14),u(21,"drag to rotate"),b(),v(22,"button",15),ne("click",function(){return i.rotate(45)}),Te(23,"i",16),b()(),v(24,"aside",17)(25,"header",18)(26,"div")(27,"h2"),u(28,"Customise"),b(),v(29,"p"),u(30,"Colour & purchase"),b()()(),v(31,"div",19)(32,"div",20)(33,"button",21),ne("click",function(){return i.activeTab.set("color")}),u(34,"Colour"),b(),v(35,"button",21),ne("click",function(){return i.activeTab.set("wheels")}),u(36,"Wheels"),b(),v(37,"button",21),ne("click",function(){return i.activeTab.set("upgrades")}),u(38,"Upgrades"),b()(),R(39,aO,8,4),R(40,uO,4,1,"div",22),R(41,gO,2,1),R(42,yO,11,6),b(),v(43,"footer",23)(44,"button",24),ne("click",function(){return i.exit()}),u(45," Leave Dealership "),b()()()()),n&2){let r;d(),oe("vd-drag-overlay--dragging",i.isDragging()),d(5),D(i.dealerName()),d(5),Ee("value",i.searchQuery()),d(),N(i.searchQuery()?12:-1),d(2),xe(i.filteredVehicles()),d(19),oe("active",i.activeTab()==="color"),d(2),oe("active",i.activeTab()==="wheels"),d(2),oe("active",i.activeTab()==="upgrades"),d(2),N(i.activeTab()==="color"?39:-1),d(),N(i.activeTab()==="wheels"?40:-1),d(),N(i.activeTab()==="upgrades"?41:-1),d(),N((r=i.selectedVehicle())?42:-1,r)}},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;position:absolute;inset:0;pointer-events:none}.vd-root[_ngcontent-%COMP%]{position:absolute;inset:0}.vd-drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:0;pointer-events:auto;cursor:grab}.vd-drag-overlay--dragging[_ngcontent-%COMP%]{cursor:grabbing}.vd-left[_ngcontent-%COMP%]{position:absolute;left:2rem;top:50%;transform:translateY(-50%);z-index:1;pointer-events:auto;width:280px;max-height:min(72vh,640px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.vd-left__header[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.vd-left__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;text-transform:uppercase;letter-spacing:.08em}.vd-left__header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:#ffb7bf;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}.vd-left__search[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.5rem;padding:.5rem .85rem;border-bottom:1px solid rgba(255,255,255,.06);background:#00000026}.vd-left__search[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.72rem;color:#ffffff4d;flex-shrink:0}.vd-left__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1 1 auto;background:transparent;border:none;outline:none;color:#eef2f8;font-size:.78rem;font-family:inherit}.vd-left__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#ffffff47}.vd-search-clear[_ngcontent-%COMP%]{flex-shrink:0;min-width:0;width:1.35rem;height:1.35rem;padding:0;display:grid;place-items:center;border-radius:50%;font-size:.65rem;background:#ffffff12;border-color:transparent;color:#ffffff73}.vd-search-clear[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#d11b2d4d;color:#fff}.vd-left__list[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden}.vd-vehicle-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;padding:.62rem 1rem;border-radius:0;border:0;border-bottom:1px solid rgba(255,255,255,.05);background:transparent;text-align:left;cursor:pointer;transition:background .12s ease}.vd-vehicle-item[_ngcontent-%COMP%]:last-child{border-bottom:0}.vd-vehicle-item[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#ffffff0f}.vd-vehicle-item.selected[_ngcontent-%COMP%]{background:#d11b2d26;border-color:#d11b2d4d}.vd-vehicle-item__info[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem;min-width:0}.vd-vehicle-item__name[_ngcontent-%COMP%]{font-size:.82rem;font-weight:600;color:#eef2f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vd-vehicle-item__cat[_ngcontent-%COMP%]{font-size:.67rem;color:var(--sw-text-soft);text-transform:uppercase;letter-spacing:.05em}.vd-vehicle-item__price[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--sw-good);white-space:nowrap;flex-shrink:0}.vd-empty[_ngcontent-%COMP%]{margin:0;padding:1rem;text-align:center;color:var(--sw-text-soft);font-size:.78rem}.vd-rotate-controls[_ngcontent-%COMP%]{position:absolute;bottom:1.5rem;left:50%;transform:translate(-50%);z-index:1;pointer-events:auto;display:flex;align-items:center;gap:.55rem;background:#00000080;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:.28rem .65rem}.vd-rotate-btn[_ngcontent-%COMP%]{min-width:0;width:1.75rem;height:1.75rem;padding:0;display:grid;place-items:center;border-radius:50%;font-size:.82rem}.vd-rotate-btn[_ngcontent-%COMP%]:hover:not(:disabled){transform:none}.vd-rotate-hint[_ngcontent-%COMP%]{font-size:.67rem;color:#ffffff61;letter-spacing:.04em;white-space:nowrap}.vd-side[_ngcontent-%COMP%]{position:absolute;right:2rem;top:50%;transform:translateY(-50%);z-index:1;pointer-events:auto;width:270px;max-height:min(72vh,640px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.vd-side__header[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.vd-side__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;text-transform:uppercase;letter-spacing:.08em}.vd-side__header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:#ffb7bf;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}.vd-side__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:.75rem;display:flex;flex-direction:column;gap:.55rem}.vd-side__footer[_ngcontent-%COMP%]{flex-shrink:0;padding:.65rem .75rem;border-top:1px solid rgba(95,101,114,.3)}.vd-section-heading[_ngcontent-%COMP%]{display:block;color:#ffb7bf;font-size:.68rem;text-transform:uppercase;letter-spacing:.1em;padding:2px 0;border-bottom:1px solid rgba(209,27,45,.3);margin-top:.25rem}.vd-section-heading[_ngcontent-%COMP%]:first-child{margin-top:0}.vd-tabs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.4rem;margin-bottom:.65rem}.vd-tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:.72rem;padding:.42rem 0;text-align:center;text-transform:uppercase;letter-spacing:.07em;font-weight:600;border-radius:10px;background:#ffffff0f;border-color:#5f65727a;color:#a9b0bb;transition:all .18s ease}.vd-tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled):not(.active){transform:none;box-shadow:none;border-color:#d11b2d59}.vd-tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dcc,#e52f41ad);border-color:#d11b2d7a;color:#fff}.vd-tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:0 0 18px #d11b2d4d}.vd-wheels-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;border-radius:8px;overflow:hidden;border:1px solid rgba(95,101,114,.3)}.vd-wheel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.1rem;width:100%;padding:.5rem .75rem;border-radius:0;border:0;border-bottom:1px solid rgba(255,255,255,.05);background:transparent;text-align:left;cursor:pointer;transition:background .12s ease}.vd-wheel-item[_ngcontent-%COMP%]:last-child{border-bottom:0}.vd-wheel-item[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#ffffff0f}.vd-wheel-item.selected[_ngcontent-%COMP%]{background:#d11b2d26;border-color:#d11b2d4d}.vd-wheel-item__name[_ngcontent-%COMP%]{font-size:.8rem;font-weight:600;color:#eef2f8}.vd-wheel-item__cat[_ngcontent-%COMP%]{font-size:.65rem;color:var(--sw-text-soft);text-transform:uppercase;letter-spacing:.05em}.vd-colors__targets[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;margin-bottom:.65rem}.vd-colors__targets[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:.72rem;padding:.42rem 0;text-align:center;text-transform:uppercase;letter-spacing:.07em;font-weight:600;border-radius:10px;background:#ffffff0f;border-color:#5f65727a;color:#a9b0bb;transition:all .18s ease}.vd-colors__targets[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled):not(.active){transform:none;box-shadow:none;border-color:#d11b2d59}.vd-colors__targets[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dcc,#e52f41ad);border-color:#d11b2d7a;color:#fff}.vd-colors__targets[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:0 0 18px #d11b2d4d}.vd-swatches[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(6,1fr);gap:.35rem}.vd-swatch[_ngcontent-%COMP%]{width:100%;aspect-ratio:1;border-radius:6px;border:2px solid transparent;padding:0;cursor:pointer;transition:transform .1s ease,border-color .1s ease}.vd-swatch[_ngcontent-%COMP%]:hover:not(:disabled){transform:scale(1.15);border-color:#ffffff80}.vd-swatch.selected[_ngcontent-%COMP%]{border-color:#fff;box-shadow:0 0 0 1px #d11b2dcc}.vd-purchase__name[_ngcontent-%COMP%]{font-weight:700;font-size:.9rem;color:#f0f3f8}.vd-purchase__price[_ngcontent-%COMP%]{font-size:1.15rem;font-weight:700;color:var(--sw-good)}.vd-purchase__result[_ngcontent-%COMP%]{font-size:.78rem;padding:.35rem .5rem;border-radius:8px}.vd-purchase__result.success[_ngcontent-%COMP%]{color:var(--sw-good);background:#7ad69424;border:1px solid rgba(122,214,148,.35)}.vd-purchase__result.error[_ngcontent-%COMP%]{color:var(--sw-bad);background:#f0737324;border:1px solid rgba(240,115,115,.35)}.vd-upgrade-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.18rem;width:100%;padding:.5rem .75rem;border-radius:8px;border:1px solid rgba(95,101,114,.3);background:#ffffff08;text-align:left;cursor:pointer;transition:background .12s ease,border-color .12s ease;margin-bottom:.3rem}.vd-upgrade-item[_ngcontent-%COMP%]:last-child{margin-bottom:0}.vd-upgrade-item[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#ffffff12;border-color:#d11b2d4d}.vd-upgrade-item[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.vd-upgrade-item.selected[_ngcontent-%COMP%]{background:#d11b2d26;border-color:#d11b2d80}.vd-upgrade-item__row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.vd-upgrade-item__name[_ngcontent-%COMP%]{font-size:.8rem;font-weight:600;color:#eef2f8}.vd-upgrade-item__price[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--sw-good);white-space:nowrap;flex-shrink:0}.vd-upgrade-item__desc[_ngcontent-%COMP%]{font-size:.67rem;color:var(--sw-text-soft);line-height:1.3}.vd-purchase__breakdown[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;gap:.1rem .5rem;font-size:.72rem;color:var(--sw-text-soft);margin-bottom:.2rem;padding:.3rem .1rem;border-bottom:1px solid rgba(255,255,255,.06)}.vd-full-btn[_ngcontent-%COMP%]{width:100%;padding:.62rem .8rem;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;border-radius:10px;transition:all .18s ease}.vd-full-btn.primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dcc,#e52f41ad);border-color:#d11b2d7a;color:#fff}.vd-full-btn.primary[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:0 0 18px #d11b2d4d}.vd-full-btn.warn[_ngcontent-%COMP%]{background:#ffffff0f;border-color:#5f65727a;color:#a9b0bb}.vd-full-btn.warn[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:none;border-color:#d11b2d59}.vd-full-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}"],changeDetection:0})}}return o})();var MO=(o,t)=>t.id,wO=(o,t)=>t.type+"_"+t.index,SO=(o,t)=>t.type;function EO(o,t){o&1&&Te(0,"span",21)}function TO(o,t){if(o&1){let e=Z();v(0,"button",20),ne("click",function(){let i=P(e).$implicit,r=g();return A(r.selectCategory(i))}),u(1),R(2,EO,1,0,"span",21),b()}if(o&2){let e=t.$implicit,n=g();oe("selected",n.selectedCategoryId()===e.id),d(),me(" ",e.name," "),d(),N(n.hasCategoryMod(e.id)?2:-1)}}function PO(o,t){o&1&&(v(0,"p",15),u(1,"Loading mods\u2026"),b())}function AO(o,t){o&1&&u(0," Stock ")}function IO(o,t){if(o&1&&u(0),o&2){let e=g().$implicit;me(" $",(e.price??0).toLocaleString("en-US")," ")}}function OO(o,t){if(o&1){let e=Z();v(0,"button",23),ne("click",function(){let i=P(e).$implicit,r=g(3);return A(r.selectMod(i))}),v(1,"span",24),u(2),b(),v(3,"span",25),R(4,AO,1,0)(5,IO,1,1),b()()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.isModSelected(e))("installed",n.isExistingMod(e)),d(2),D(e.description),d(2),N(e.index===-1?4:5)}}function DO(o,t){if(o&1&&ve(0,OO,6,6,"button",22,wO),o&2){let e=g(2);xe(e.categoryMods())}}function kO(o,t){o&1&&(v(0,"p",15),u(1,"No mods available for this category."),b())}function RO(o,t){if(o&1&&R(0,PO,2,0,"p",15)(1,DO,2,0)(2,kO,2,0,"p",15),o&2){let e=g();N(e.modsLoading()?0:e.categoryMods().length?1:2)}}function NO(o,t){o&1&&(v(0,"p",15),u(1,"Select a category on the left."),b())}function LO(o,t){if(o&1&&(v(0,"div",27)(1,"span",29),u(2),b(),v(3,"span",30),u(4),b()()),o&2){let e=t.$implicit;d(2),D(e.description),d(2),me("$",(e.price??0).toLocaleString("en-US"))}}function FO(o,t){if(o&1&&(v(0,"div",16)(1,"span",26),u(2,"Cart"),b(),ve(3,LO,5,2,"div",27,SO),v(5,"div",28)(6,"span"),u(7,"Total"),b(),v(8,"span"),u(9),b()()()),o&2){let e=g();d(3),xe(e.cartItems()),d(6),me("$",e.cartTotal().toLocaleString("en-US"))}}var co=window.mp,Jv=(()=>{class o{constructor(){this.initPayload="",this.shopName=F("Modification Shop"),this.categories=F([]),this.existingMods=F([]),this.selectedCategoryId=F(null),this.selectedCategoryName=F(""),this.categoryMods=F([]),this.cartMods=F([]),this.isDragging=F(!1),this.modsLoading=F(!1),this.cartItems=le(()=>this.cartMods().filter(e=>e.index!==-1)),this.cartTotal=le(()=>this.cartItems().reduce((e,n)=>e+(n.price??0),0)),this.effectiveMod=le(()=>{let e=this.selectedCategoryId();if(e===null)return null;let n=this.cartMods().find(i=>i.type===e);return n!==void 0?n:this.existingMods().find(i=>i.type===e)??null}),this.handlers=[],this.lastDragX=0,this.onDocumentMouseMove=e=>{if(!this.isDragging())return;let n=(e.clientX-this.lastDragX)*.4;this.lastDragX=e.clientX,Math.abs(n)>.5&&co.events.call("modshop:rotate",n)},this.onDocumentMouseUp=()=>{this.isDragging.set(!1)}}ngOnInit(){try{let e=JSON.parse(this.initPayload);this.shopName.set(e.propName??"Modification Shop"),this.categories.set(Array.isArray(e.categories)?e.categories:[]),this.existingMods.set(Array.isArray(e.existingMods)?e.existingMods:[]);let n=e.categories?.[0]??null;n&&this.selectCategory(n)}catch{}this.on("modshop:setMods",(e,n)=>{if(Number(n)===this.selectedCategoryId()){try{this.categoryMods.set(JSON.parse(String(e)))}catch{this.categoryMods.set([])}this.modsLoading.set(!1)}}),document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp)}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)co.events.remove(e,n);document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp)}onDragStart(e){this.isDragging.set(!0),this.lastDragX=e.clientX,e.preventDefault()}rotate(e){co.events.call("modshop:rotate",e)}selectCategory(e){this.selectedCategoryId()!==null&&co.events.call("modshop:resetPreview"),this.selectedCategoryId.set(e.id),this.selectedCategoryName.set(e.name),this.categoryMods.set([]),this.modsLoading.set(!0),co.events.call("modshop:requestMods",e.id)}selectMod(e){let r=[...this.cartMods().filter(a=>a.type!==e.type),e];this.cartMods.set(r),co.events.call("modshop:previewMod",e.type,e.index),co.events.call("modshop:updateCart",JSON.stringify(r))}isModSelected(e){let n=this.effectiveMod();return n===null?e.index===-1:n.index===e.index&&n.type===e.type}isExistingMod(e){return this.existingMods().some(n=>n.type===e.type&&n.index===e.index)}hasCategoryMod(e){return this.existingMods().some(n=>n.type===e)||this.cartMods().some(n=>n.type===e&&n.index!==-1)}checkout(){let e=this.cartMods();e.length&&co.events.call("callServerEvent","modshop:checkout",JSON.stringify(e))}exit(){co.events.call("callServerEvent","modshop:close")}on(e,n){co.events.add(e,n),this.handlers.push({name:e,fn:n})}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["special-modshop"]],inputs:{initPayload:"initPayload"},decls:33,vars:7,consts:[[1,"ms-root"],[1,"ms-drag-overlay",3,"mousedown"],[1,"ms-left"],[1,"ms-left__header"],[1,"ms-left__list","scrollbar-neon"],["type","button",1,"ms-cat-item",3,"selected"],[1,"ms-rotate-controls"],["type","button","title","Rotate left",1,"ms-rotate-btn",3,"click"],[1,"fa-solid","fa-rotate-left"],[1,"ms-rotate-hint"],["type","button","title","Rotate right",1,"ms-rotate-btn",3,"click"],[1,"fa-solid","fa-rotate-right"],[1,"ms-right"],[1,"ms-right__header"],[1,"ms-right__body","scrollbar-neon"],[1,"ms-empty"],[1,"ms-cart"],[1,"ms-right__footer"],["type","button",1,"ms-full-btn","primary",3,"click","disabled"],["type","button",1,"ms-full-btn","warn",3,"click"],["type","button",1,"ms-cat-item",3,"click"],[1,"ms-cat-badge"],["type","button",1,"ms-mod-item",3,"selected","installed"],["type","button",1,"ms-mod-item",3,"click"],[1,"ms-mod-item__name"],[1,"ms-mod-item__price"],[1,"ms-section-heading"],[1,"ms-cart-item"],[1,"ms-cart-total"],[1,"ms-cart-item__name"],[1,"ms-cart-item__price"]],template:function(n,i){n&1&&(v(0,"div",0)(1,"div",1),ne("mousedown",function(a){return i.onDragStart(a)}),b(),v(2,"aside",2)(3,"header",3)(4,"h2"),u(5),b(),v(6,"p"),u(7,"Select a category"),b()(),v(8,"div",4),ve(9,TO,3,4,"button",5,MO),b()(),v(11,"div",6)(12,"button",7),ne("click",function(){return i.rotate(-45)}),Te(13,"i",8),b(),v(14,"span",9),u(15,"drag to rotate"),b(),v(16,"button",10),ne("click",function(){return i.rotate(45)}),Te(17,"i",11),b()(),v(18,"aside",12)(19,"header",13)(20,"h2"),u(21),b(),v(22,"p"),u(23,"Choose a modification"),b()(),v(24,"div",14),R(25,RO,3,1)(26,NO,2,0,"p",15),R(27,FO,10,1,"div",16),b(),v(28,"footer",17)(29,"button",18),ne("click",function(){return i.checkout()}),u(30," Checkout "),b(),v(31,"button",19),ne("click",function(){return i.exit()}),u(32," Leave Shop "),b()()()()),n&2&&(d(),oe("ms-drag-overlay--dragging",i.isDragging()),d(4),D(i.shopName()),d(4),xe(i.categories()),d(12),D(i.selectedCategoryName()||"Select a category"),d(4),N(i.selectedCategoryId()!==null?25:26),d(2),N(i.cartItems().length?27:-1),d(2),Ee("disabled",!i.cartItems().length))},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;position:absolute;inset:0;pointer-events:none}.ms-root[_ngcontent-%COMP%]{position:absolute;inset:0}.ms-drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:0;pointer-events:auto;cursor:grab}.ms-drag-overlay--dragging[_ngcontent-%COMP%]{cursor:grabbing}.ms-left[_ngcontent-%COMP%]{position:absolute;left:2rem;top:50%;transform:translateY(-50%);z-index:1;pointer-events:auto;width:220px;max-height:min(72vh,640px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.ms-left__header[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.ms-left__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;text-transform:uppercase;letter-spacing:.08em}.ms-left__header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:#ffb7bf;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}.ms-left__list[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden}.ms-cat-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.6rem 1rem;border-radius:0;border:0;border-bottom:1px solid rgba(255,255,255,.05);background:transparent;text-align:left;cursor:pointer;font-size:.8rem;color:#c8cdd8;transition:background .12s ease}.ms-cat-item[_ngcontent-%COMP%]:last-child{border-bottom:0}.ms-cat-item[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#ffffff0f}.ms-cat-item.selected[_ngcontent-%COMP%]{background:#d11b2d26;border-color:#d11b2d4d;color:#f4f7fc}.ms-cat-badge[_ngcontent-%COMP%]{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--sw-good, #4ade80);flex-shrink:0}.ms-rotate-controls[_ngcontent-%COMP%]{position:absolute;bottom:1.5rem;left:50%;transform:translate(-50%);z-index:1;pointer-events:auto;display:flex;align-items:center;gap:.55rem;background:#00000080;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.08);border-radius:999px;padding:.28rem .65rem}.ms-rotate-btn[_ngcontent-%COMP%]{min-width:0;width:1.75rem;height:1.75rem;padding:0;display:grid;place-items:center;border-radius:50%;font-size:.82rem}.ms-rotate-btn[_ngcontent-%COMP%]:hover:not(:disabled){transform:none}.ms-rotate-hint[_ngcontent-%COMP%]{font-size:.67rem;color:#ffffff61;letter-spacing:.04em;white-space:nowrap}.ms-right[_ngcontent-%COMP%]{position:absolute;right:2rem;top:50%;transform:translateY(-50%);z-index:1;pointer-events:auto;width:280px;max-height:min(72vh,640px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:linear-gradient(160deg,#383c46e6,#202228f2);border:1px solid rgba(95,101,114,.48);box-shadow:0 18px 36px #0000006b;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.ms-right__header[_ngcontent-%COMP%]{flex-shrink:0;padding:.85rem 1rem;border-bottom:1px solid rgba(209,27,45,.42);background:linear-gradient(135deg,#d11b2d3b,#d11b2d14)}.ms-right__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:#f4f7fc;font-size:.95rem;text-transform:uppercase;letter-spacing:.08em}.ms-right__header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0;color:#ffb7bf;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em}.ms-right__body[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:.5rem 0;display:flex;flex-direction:column}.ms-mod-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;padding:.55rem 1rem;border-radius:0;border:0;border-bottom:1px solid rgba(255,255,255,.04);background:transparent;text-align:left;cursor:pointer;transition:background .12s ease}.ms-mod-item[_ngcontent-%COMP%]:last-child{border-bottom:0}.ms-mod-item[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;background:#ffffff0f}.ms-mod-item.selected[_ngcontent-%COMP%]{background:#d11b2d26;border-color:#d11b2d4d}.ms-mod-item.installed[_ngcontent-%COMP%]:not(.selected) .ms-mod-item__name[_ngcontent-%COMP%]{color:var(--sw-good, #4ade80)}.ms-mod-item__name[_ngcontent-%COMP%]{font-size:.8rem;color:#c8cdd8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ms-mod-item__price[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--sw-good, #4ade80);white-space:nowrap;flex-shrink:0}.ms-empty[_ngcontent-%COMP%]{margin:0;padding:1rem;text-align:center;color:var(--sw-text-soft);font-size:.78rem}.ms-section-heading[_ngcontent-%COMP%]{display:block;color:#ffb7bf;font-size:.68rem;text-transform:uppercase;letter-spacing:.1em;padding:.5rem 1rem .25rem;border-bottom:1px solid rgba(209,27,45,.3);margin-top:.25rem}.ms-cart[_ngcontent-%COMP%]{margin-top:auto;border-top:1px solid rgba(255,255,255,.07);padding:.25rem 0}.ms-cart-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.35rem 1rem;font-size:.78rem}.ms-cart-item__name[_ngcontent-%COMP%]{color:#c8cdd8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.ms-cart-item__price[_ngcontent-%COMP%]{font-weight:600;color:var(--sw-good, #4ade80);white-space:nowrap;flex-shrink:0}.ms-cart-total[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.4rem 1rem .25rem;border-top:1px solid rgba(255,255,255,.07);font-size:.82rem;font-weight:700;color:#f4f7fc}.ms-right__footer[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;gap:.4rem;padding:.65rem .75rem;border-top:1px solid rgba(95,101,114,.3)}.ms-full-btn[_ngcontent-%COMP%]{width:100%;padding:.62rem .8rem;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;border-radius:10px;transition:all .18s ease}.ms-full-btn.primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#d11b2dcc,#e52f41ad);border-color:#d11b2d7a;color:#fff}.ms-full-btn.primary[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:0 0 18px #d11b2d4d}.ms-full-btn.warn[_ngcontent-%COMP%]{background:#ffffff0f;border-color:#5f65727a;color:#a9b0bb}.ms-full-btn.warn[_ngcontent-%COMP%]:hover:not(:disabled){transform:none;box-shadow:none;border-color:#d11b2d59}.ms-full-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}"],changeDetection:0})}}return o})();function VO(o,t){if(o&1&&(zi(),Te(0,"path",14)),o&2){let e=t.$implicit,n=t.$index,i=g();oe("aw-segment--hovered",i.hoveredIndex()===n&&!i.isCenterSelected())("aw-segment--disabled",!e.enabled),Jt("d",e.path)}}function BO(o,t){if(o&1&&(zi(),Te(0,"line",4)),o&2){let e=t.$implicit;Jt("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2)}}function UO(o,t){if(o&1&&(v(0,"span",18),u(1),b()),o&2){let e=g().$implicit;d(),cn(" ",e.selectedWeaponIndex+1,"\u2009/\u2009",e.weapons.length," ")}}function zO(o,t){if(o&1&&(v(0,"span",19),u(1),b()),o&2){let e=g().$implicit;d(),D(e.currentWeapon.ammo)}}function HO(o,t){if(o&1&&(v(0,"div",15),Te(1,"i",16),v(2,"span",17),u(3),b(),R(4,UO,2,2,"span",18),R(5,zO,2,1,"span",19),b()),o&2){let e=t.$implicit,n=t.$index,i=g();Dt("left",e.iconX,"px")("top",e.iconY,"px"),oe("aw-seg-content--hovered",i.hoveredIndex()===n&&!i.isCenterSelected())("aw-seg-content--disabled",!e.enabled),d(),wn(e.icon),d(2),D(e.label),d(),N(i.wheelType()==="weapon"&&e.weapons.length>1?4:-1),d(),N(i.wheelType()==="weapon"&&(e.currentWeapon==null?null:e.currentWeapon.ammo)!==void 0?5:-1)}}function GO(o,t){if(o&1&&(v(0,"div",12)(1,"div",20),Te(2,"i",21),v(3,"span"),u(4),b()(),v(5,"div",22)(6,"span"),u(7),b(),v(8,"span",23),u(9),b()(),v(10,"div",20),Te(11,"i",24),v(12,"span"),u(13),b()()()),o&2){let e=t;d(4),D(e.prev),d(3),D(e.current),d(2),cn("",e.index,"\u2009/\u2009",e.total),d(4),D(e.next)}}function WO(o,t){if(o&1&&(v(0,"div",25),u(1),b()),o&2){let e=g();oe("aw-hover-info--visible",e.hoveredIndex()!==null&&!e.isCenterSelected()),d(),me(" ",e.hoverInfo()," ")}}var Wa=window.mp,XO=480,tx=240,nx=240,kr=80,Rr=206,Qv=(kr+Rr)/2,bm=1.4;function qO(o){return o*Math.PI/180}function tr(o,t){let e=qO(t);return{x:tx+o*Math.cos(e),y:nx+o*Math.sin(e)}}function ex(o,t,e,n){let i=(n-e+360)%360;i===0&&(i=360);let r=e+bm,a=n-bm,s=i-bm*2,l=tr(t,r),c=tr(t,a),h=tr(o,a),p=tr(o,r),m=s>180?1:0;return[`M ${l.x} ${l.y}`,`A ${t} ${t} 0 ${m} 1 ${c.x} ${c.y}`,`L ${h.x} ${h.y}`,`A ${o} ${o} 0 ${m} 0 ${p.x} ${p.y}`,"Z"].join(" ")}function ym(o){let t=360/o;return Array.from({length:o+1},(e,n)=>(270+n*t)%360)}var ix=(()=>{class o{constructor(){this.visible=F(!1),this.wheelType=F("action"),this.selMode=F("cursor"),this.centerAct=F("cancel"),this.actionItems=F([]),this.segments=F(null),this.hoveredIndex=F(null),this.isCenterSelected=F(!0),this.renderedSegments=le(()=>{if(this.wheelType()==="action")return this.buildActionSegments(this.actionItems());let n=this.segments();return n?this.buildWeaponSegments(n):[]}),this.centerLabel=le(()=>{switch(this.centerAct()){case"unarmed":return"Unarmed";case"back":return"Back";default:return"Cancel"}}),this.centerIcon=le(()=>{switch(this.centerAct()){case"unarmed":return"fa-solid fa-hand-fist";case"back":return"fa-solid fa-arrow-left";default:return"fa-solid fa-xmark"}}),this.hoverInfo=le(()=>{let e=this.hoveredIndex();if(e===null)return"";let i=this.renderedSegments()[e];return i?!i.enabled&&i.unavailableReason?i.unavailableReason:i.label:""}),this.scrollInfo=le(()=>{if(this.wheelType()!=="weapon"||this.isCenterSelected())return null;let e=this.hoveredIndex();if(e===null)return null;let n=this.renderedSegments()[e];if(!n||n.weapons.length<=1)return null;let i=n.weapons.length,r=n.selectedWeaponIndex;return{prev:n.weapons[(r-1+i)%i]?.label??"",current:n.weapons[r]?.label??"",next:n.weapons[(r+1)%i]?.label??"",index:r+1,total:i}}),this.SVG_SIZE=XO,this.CX=tx,this.CY=nx,this.INNER_R=kr,this.OUTER_R=Rr,this.dividerLines=le(()=>{let e=this.renderedSegments().length;return e<2?[]:ym(e).slice(0,e).map(n=>{let i=tr(kr,n),r=tr(Rr,n);return{x1:i.x,y1:i.y,x2:r.x,y2:r.y}})}),this.handlers=[]}ngOnInit(){this.on("actionWheel:show",e=>{let n=this.coerce(e);n&&(this.applyPayload(n),this.visible.set(!0))}),this.on("actionWheel:hide",()=>{this.visible.set(!1),this.actionItems.set([]),this.hoveredIndex.set(null),this.isCenterSelected.set(!0)}),this.on("actionWheel:hover",e=>{let n=this.coerce(e);n&&(this.isCenterSelected.set(n.isCenterSelected),this.hoveredIndex.set(n.isCenterSelected?null:n.hoveredIndex))}),this.on("actionWheel:updateWeaponSelection",e=>{let n=this.coerce(e);if(!n)return;let i=this.segments();if(!i)return;let r=i.map(a=>a.id===n.category?De(he({},a),{selectedWeaponIndex:n.selectedWeaponIndex}):a);this.segments.set(r)})}ngOnDestroy(){for(let{name:e,fn:n}of this.handlers)Wa.events.remove(e,n)}onMouseMove(e){if(!this.visible()||this.selMode()!=="cursor")return;let n=e.clientX-window.innerWidth/2,i=e.clientY-window.innerHeight/2,r=Math.sqrt(n*n+i*i),a=r<=kr,s=null;if(!a&&r<=Rr+20){let h=this.renderedSegments().length;h>0&&(s=this.getSegmentFromAngle(n,i,h))}let l=a!==this.isCenterSelected(),c=s!==this.hoveredIndex();(l||c)&&(this.isCenterSelected.set(a),this.hoveredIndex.set(a?null:s),Wa.events.call("actionWheel:overlayHover",a?null:s,a))}onWheel(e){if(e.preventDefault(),!this.visible()||this.isCenterSelected())return;let n=e.deltaY>0?1:-1;Wa.events.call("actionWheel:scroll",n)}onClick(e){if(!this.visible()||this.selMode()!=="cursor")return;let n=e.clientX-window.innerWidth/2,i=e.clientY-window.innerHeight/2,r=Math.sqrt(n*n+i*i);if(r<=kr){Wa.events.call("actionWheel:centerClick");return}if(r<=Rr+20){let a=this.renderedSegments().length;a>0&&Wa.events.call("actionWheel:segmentClick",this.getSegmentFromAngle(n,i,a))}}trackByIndex(e){return e}applyPayload(e){this.wheelType.set(e.wheelType),this.centerAct.set(e.centerAction),this.hoveredIndex.set(null),this.isCenterSelected.set(!0),e.wheelType==="action"?(this.selMode.set("cursor"),this.actionItems.set(e.items??[]),this.segments.set(null)):(this.selMode.set(e.selectionMode),this.actionItems.set([]),this.segments.set(e.segments))}buildActionSegments(e){if(!e.length)return[];let n=e.length,i=ym(n);return e.map((r,a)=>{let s=i[a],l=i[a+1]??i[0]+360,c=s+(l-s+360)%360/2,h=tr(Qv,c);return{path:ex(kr,Rr,s,l),iconX:h.x,iconY:h.y,label:r.label,icon:`fa-solid fa-${r.icon}`,enabled:r.enabled,weapons:[],selectedWeaponIndex:0,currentWeapon:null,unavailableReason:r.unavailableReason??""}})}buildWeaponSegments(e){let n=e.length,i=ym(n);return e.map((r,a)=>{let s=i[a],l=i[a+1]??i[0]+360,c=s+(l-s+360)%360/2,h=tr(Qv,c),p=r.weapons[r.selectedWeaponIndex]??r.weapons[0]??null,m=p?`fa-solid fa-${p.icon}`:`fa-solid fa-${r.icon}`;return{path:ex(kr,Rr,s,l),iconX:h.x,iconY:h.y,label:p?.label??r.label,icon:m,enabled:r.enabled,weapons:r.weapons,selectedWeaponIndex:r.selectedWeaponIndex,currentWeapon:p,unavailableReason:""}})}getSegmentFromAngle(e,n,i){let s=((Math.atan2(n,e)*180/Math.PI+360)%360-270+360)%360;return Math.floor(s/(360/i))%i}on(e,n){Wa.events.add(e,n),this.handlers.push({name:e,fn:n})}parse(e){try{return JSON.parse(e)}catch{return null}}coerce(e){return e?typeof e=="string"?this.parse(e):typeof e=="object"?e:null:null}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-action-wheel"]],decls:18,vars:26,consts:[[1,"aw-overlay",3,"mousemove","wheel","click"],[1,"aw-container"],["aria-hidden","true",1,"aw-svg"],[1,"aw-segment",3,"aw-segment--hovered","aw-segment--disabled"],[1,"aw-divider"],[1,"aw-outer-border"],[1,"aw-inner-ring"],[1,"aw-center-hub"],[1,"aw-seg-content",3,"aw-seg-content--hovered","aw-seg-content--disabled","left","top"],[1,"aw-center-content"],[1,"fa-fw","aw-center-icon"],[1,"aw-center-label"],[1,"aw-scroll-indicator","aw-scroll-indicator--visible"],[1,"aw-hover-info",3,"aw-hover-info--visible"],[1,"aw-segment"],[1,"aw-seg-content"],[1,"fa-fw","aw-seg-icon"],[1,"aw-seg-label"],[1,"aw-seg-count"],[1,"aw-seg-ammo"],[1,"aw-scroll-row","aw-scroll-row--adj"],[1,"fa-solid","fa-chevron-up"],[1,"aw-scroll-row","aw-scroll-row--current"],[1,"aw-scroll-pos"],[1,"fa-solid","fa-chevron-down"],[1,"aw-hover-info"]],template:function(n,i){if(n&1&&(v(0,"div",0),ne("mousemove",function(a){return i.onMouseMove(a)})("wheel",function(a){return i.onWheel(a)})("click",function(a){return i.onClick(a)}),v(1,"div",1),zi(),v(2,"svg",2),ve(3,VO,1,5,":svg:path",3,ct),ve(5,BO,1,4,":svg:line",4,ct),Te(7,"circle",5)(8,"circle",6)(9,"circle",7),b(),ve(10,HO,6,13,"div",8,ct),Vr(),v(12,"div",9),Te(13,"i",10),v(14,"span",11),u(15),b()(),R(16,GO,14,5,"div",12)(17,WO,2,3,"div",13),b()()),n&2){let r;Dt("pointer-events",i.visible()?"auto":"none"),oe("aw-overlay--visible",i.visible()),d(),oe("aw-container--visible",i.visible()),d(),Jt("viewBox","0 0 "+i.SVG_SIZE+" "+i.SVG_SIZE)("width",i.SVG_SIZE)("height",i.SVG_SIZE),d(),xe(i.renderedSegments()),d(2),xe(i.dividerLines()),d(2),Jt("cx",i.CX)("cy",i.CY)("r",i.OUTER_R+1),d(),Jt("cx",i.CX)("cy",i.CY)("r",i.INNER_R),d(),oe("aw-center-hub--hovered",i.isCenterSelected()),Jt("cx",i.CX)("cy",i.CY)("r",i.INNER_R-1),d(),xe(i.renderedSegments()),d(2),oe("aw-center-content--hovered",i.isCenterSelected()),d(),wn(i.centerIcon()),d(2),D(i.centerLabel()),d(),N((r=i.scrollInfo())?16:17,r)}},dependencies:[tt],styles:["[_nghost-%COMP%]{display:block;position:fixed;inset:0;pointer-events:none;z-index:50}.aw-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .16s ease}.aw-overlay--visible[_ngcontent-%COMP%]{opacity:1}.aw-container[_ngcontent-%COMP%]{position:relative;width:480px;height:480px;flex-shrink:0;transform:scale(.86);transition:transform .22s cubic-bezier(.2,.85,.32,1)}.aw-container--visible[_ngcontent-%COMP%]{transform:scale(1)}.aw-svg[_ngcontent-%COMP%]{position:absolute;inset:0;display:block;pointer-events:none;filter:drop-shadow(0 8px 32px rgba(0,0,0,.55))}.aw-segment[_ngcontent-%COMP%]{fill:#12141ad6;transition:fill .12s ease,stroke .12s ease;stroke:transparent;stroke-width:1.5}.aw-segment--hovered[_ngcontent-%COMP%]{fill:rgba(var(--sw-accent-rgb, 209, 27, 45),.38);stroke:rgba(var(--sw-accent-rgb, 209, 27, 45),.65)}.aw-segment--disabled[_ngcontent-%COMP%]{fill:#1011168c;opacity:.45}.aw-divider[_ngcontent-%COMP%]{stroke:#ffffff17;stroke-width:1}.aw-outer-border[_ngcontent-%COMP%]{fill:none;stroke:#ffffff21;stroke-width:1.5}.aw-inner-ring[_ngcontent-%COMP%]{fill:none;stroke:#ffffff1a;stroke-width:1}.aw-center-hub[_ngcontent-%COMP%]{fill:#0c0e13eb;transition:fill .12s ease}.aw-center-hub--hovered[_ngcontent-%COMP%]{fill:rgba(var(--sw-accent-rgb, 209, 27, 45),.42)}.aw-seg-content[_ngcontent-%COMP%]{position:absolute;display:flex;flex-direction:column;align-items:center;gap:.3rem;transform:translate(-50%,-50%);pointer-events:none;text-align:center;transition:opacity .14s ease}.aw-seg-content--disabled[_ngcontent-%COMP%]{opacity:.32}.aw-seg-icon[_ngcontent-%COMP%]{font-size:1.3rem;color:#ffffff9e;transition:color .12s ease,transform .12s ease}.aw-seg-content--hovered[_ngcontent-%COMP%] .aw-seg-icon[_ngcontent-%COMP%]{color:#fff;transform:scale(1.22);filter:drop-shadow(0 0 6px rgba(var(--sw-accent-rgb, 209, 27, 45),.7))}.aw-seg-content--disabled[_ngcontent-%COMP%] .aw-seg-icon[_ngcontent-%COMP%]{color:#ffffff4d}.aw-seg-label[_ngcontent-%COMP%]{font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:#ffffff80;transition:color .12s ease;white-space:nowrap}.aw-seg-content--hovered[_ngcontent-%COMP%] .aw-seg-label[_ngcontent-%COMP%]{color:#fff}.aw-seg-count[_ngcontent-%COMP%]{font-size:.54rem;font-weight:500;letter-spacing:.04em;color:#ffffff61;white-space:nowrap}.aw-seg-content--hovered[_ngcontent-%COMP%] .aw-seg-count[_ngcontent-%COMP%]{color:#ffffffa6}.aw-seg-ammo[_ngcontent-%COMP%]{font-size:.6rem;font-weight:700;letter-spacing:.04em;color:var(--sw-good, #7ad694);white-space:nowrap}.aw-center-content[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:.28rem;pointer-events:none;text-align:center}.aw-center-icon[_ngcontent-%COMP%]{font-size:1.1rem;color:#ffffff8c;transition:color .12s ease,transform .12s ease}.aw-center-content--hovered[_ngcontent-%COMP%] .aw-center-icon[_ngcontent-%COMP%]{color:#fff;transform:scale(1.18);filter:drop-shadow(0 0 6px rgba(var(--sw-accent-rgb, 209, 27, 45),.7))}.aw-center-label[_ngcontent-%COMP%]{font-size:.56rem;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:#fff6;transition:color .12s ease}.aw-center-content--hovered[_ngcontent-%COMP%] .aw-center-label[_ngcontent-%COMP%]{color:#fff}.aw-scroll-indicator[_ngcontent-%COMP%]{position:absolute;bottom:-2.6rem;left:50%;transform:translate(-50%);display:flex;flex-direction:column;align-items:center;gap:.12rem;background:#00000085;padding:.3rem 1.4rem;border-radius:6px;border:1px solid rgba(255,255,255,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:none;opacity:0;transition:opacity .14s ease}.aw-scroll-indicator--visible[_ngcontent-%COMP%]{opacity:1}.aw-scroll-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;white-space:nowrap}.aw-scroll-row--adj[_ngcontent-%COMP%]{font-size:.6rem;color:#ffffff59;letter-spacing:.04em}.aw-scroll-row--adj[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.48rem}.aw-scroll-row--current[_ngcontent-%COMP%]{font-size:.76rem;font-weight:600;color:#ffffffe0;gap:.65rem}.aw-scroll-pos[_ngcontent-%COMP%]{font-size:.54rem;font-weight:500;color:#ffffff61;letter-spacing:.04em}.aw-hover-info[_ngcontent-%COMP%]{position:absolute;bottom:-2.6rem;left:50%;transform:translate(-50%);white-space:nowrap;font-size:.76rem;font-weight:500;color:#ffffffb8;background:#00000085;padding:.28rem .72rem;border-radius:6px;border:1px solid rgba(255,255,255,.1);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);pointer-events:none;opacity:0;transition:opacity .14s ease}.aw-hover-info--visible[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}}return o})();var ox=()=>[],Cm=(o,t)=>t.id,rx=(o,t)=>t.keyword;function $O(o,t){o&1&&(_(0,"section",4),ye(1,"overlay-char-creator"),f())}function YO(o,t){o&1&&ye(0,"div",33)}function jO(o,t){if(o&1&&ye(0,"i",40),o&2){let e=g().$implicit,n=g(4);wn(n.getItemHighlighterIconClass(e.icon))}}function KO(o,t){if(o&1&&(_(0,"span",39),u(1),f()),o&2){let e=g().$implicit;d(),D(e.subtitle)}}function ZO(o,t){if(o&1){let e=Z();_(0,"div",32),R(1,YO,1,0,"div",33),ye(2,"div",34),_(3,"button",35),z("click",function(i){let r=P(e).$implicit,a=g(4);return A(a.onItemHighlighterSelect(r,i))}),R(4,jO,1,2,"i",36),_(5,"span",37)(6,"span",38),u(7),f(),R(8,KO,2,1,"span",39),f()()()}if(o&2){let e=t.$implicit,n=g(4);Dt("left",e.position.x,"px")("top",e.position.y,"px")("opacity",n.getItemHighlighterOpacity(e)),d(),N(n.shouldShowItemHighlighterSquare(e)?1:-1),d(2),oe("clickable",((e.options==null?null:e.options.length)??0)>0),d(),N(e.icon!=null&&e.icon.length?4:-1),d(3),D(e.title),d(),N(e.subtitle?8:-1)}}function JO(o,t){if(o&1&&(_(0,"section",28),ve(1,ZO,9,12,"div",31,rx),f()),o&2){let e=g(3);d(),xe(e.itemHighlighterList())}}function QO(o,t){o&1&&ye(0,"special-atm")}function eD(o,t){if(o&1&&ye(0,"overlay-settings",29),o&2){let e=g(3);Q("tabsPayload",e.settingsTabsPayload())}}function tD(o,t){o&1&&ye(0,"special-dmv")}function nD(o,t){o&1&&ye(0,"special-minigame")}function iD(o,t){o&1&&ye(0,"special-fishing")}function oD(o,t){o&1&&ye(0,"special-plate-screen")}function rD(o,t){o&1&&ye(0,"special-leo-heli")}function aD(o,t){o&1&&ye(0,"special-mdc")}function sD(o,t){o&1&&ye(0,"special-barber")}function lD(o,t){if(o&1&&ye(0,"special-vehicle-dealer",30),o&2){let e=g(3);Q("initPayload",e.vehicleDealerPayload())}}function cD(o,t){if(o&1&&ye(0,"special-modshop",30),o&2){let e=g(3);Q("initPayload",e.modshopPayload())}}function dD(o,t){if(o&1&&(ye(0,"overlay-chat")(1,"overlay-hud")(2,"overlay-notify"),R(3,JO,3,0,"section",28),R(4,QO,1,0,"special-atm"),R(5,eD,1,1,"overlay-settings",29),R(6,tD,1,0,"special-dmv"),R(7,nD,1,0,"special-minigame"),R(8,iD,1,0,"special-fishing"),R(9,oD,1,0,"special-plate-screen"),R(10,rD,1,0,"special-leo-heli"),R(11,aD,1,0,"special-mdc"),R(12,sD,1,0,"special-barber"),R(13,lD,1,1,"special-vehicle-dealer",30),R(14,cD,1,1,"special-modshop",30),ye(15,"overlay-action-wheel")),o&2){let e=g(2);d(3),N(e.show("vehicle-dealer")?-1:3),d(),N(e.show("atm")?4:-1),d(),N(e.show("settings")?5:-1),d(),N(e.show("dmv")?6:-1),d(),N(e.show("minigame")?7:-1),d(),N(e.show("fishing")?8:-1),d(),N(e.show("plate-screen")?9:-1),d(),N(e.show("leo-heli")?10:-1),d(),N(e.show("mdc")?11:-1),d(),N(e.show("barber")?12:-1),d(),N(e.show("vehicle-dealer")?13:-1),d(),N(e.show("modshop")?14:-1)}}function uD(o,t){if(o&1){let e=Z();_(0,"section",41)(1,"overlay-login-modal",42,1),z("submitted",function(i){P(e);let r=Ci(2),a=g(2);return A(a.onLoginSubmit(i,r))})("previewRequested",function(i){P(e);let r=Ci(2),a=g(2);return A(a.onPreviewRequested(i,r))})("previewCleared",function(){P(e);let i=Ci(2),r=g(2);return A(r.onPreviewCleared(i))})("characterSelected",function(i){P(e);let r=Ci(2),a=g(2);return A(a.onCharacterConfirmed(i,r))})("spawnSelected",function(i){P(e);let r=g(2);return A(r.onSpawnSelected(i))})("resetRequested",function(){P(e);let i=Ci(2),r=g(2);return A(r.onLoginReset(i))}),f()()}if(o&2){let e=g(2);oe("selection-flow",e.loginSelectionVisible())("characters-flow",e.loginCharacters().length>0),d(),Q("initialUsername",e.loginPrefilledName())("characters",e.loginCharacters())("spawns",e.loginSpawns())}}function hD(o,t){if(o&1&&ye(0,"i",40),o&2){let e=g().$implicit,n=g(3);wn(n.getItemHighlighterIconClass(e.icon))}}function pD(o,t){if(o&1&&(_(0,"span",50),u(1),f()),o&2){let e=g().$implicit;d(),D(e.subtitle)}}function mD(o,t){if(o&1){let e=Z();_(0,"button",48),z("click",function(){P(e);let i=g(3);return A(i.selectInteractAction())}),R(1,hD,1,2,"i",36),_(2,"span",49),u(3),f(),R(4,pD,2,1,"span",50),f()}if(o&2){let e=t.$implicit,n=t.$index,i=g(3);oe("selected",n===i.interactWindowSelectedIndex()),d(),N(e.icon!=null&&e.icon.length?1:-1),d(2),D(e.title),d(),N(e.subtitle?4:-1)}}function fD(o,t){if(o&1&&(_(0,"section",9)(1,"div",43)(2,"header",44)(3,"strong"),u(4),f()(),_(5,"div",45),ve(6,mD,5,5,"button",46,rx),f(),_(8,"footer",47)(9,"span")(10,"kbd"),u(11,"\u2191/\u2193"),f(),u(12," Navigate"),f(),_(13,"span")(14,"kbd"),u(15,"Enter"),f(),u(16," Select"),f(),_(17,"span")(18,"kbd"),u(19,"Esc"),f(),u(20," Close"),f()()()()),o&2){let e=g(2);d(4),D(e.interactWindowTitle()),d(2),xe(e.interactWindowItems())}}function gD(o,t){if(o&1&&(_(0,"section",11)(1,"header")(2,"strong"),u(3,"Object Editor"),f(),_(4,"span"),u(5),f()(),_(6,"div",51)(7,"div")(8,"kbd"),u(9,"Enter"),f(),_(10,"span"),u(11,"Confirm"),f()(),_(12,"div")(13,"kbd"),u(14,"Esc"),f(),_(15,"span"),u(16,"Cancel"),f()(),_(17,"div")(18,"kbd"),u(19,"Shift"),f(),_(20,"span"),u(21,"Toggle Mode"),f()(),_(22,"div")(23,"kbd"),u(24,"Home"),f(),_(25,"span"),u(26),f()(),_(27,"div")(28,"kbd"),u(29,"End"),f(),_(30,"span"),u(31),f()(),_(32,"div")(33,"kbd"),u(34,"Alt"),f(),_(35,"span"),u(36),f()(),_(37,"div")(38,"kbd"),u(39,"Ins"),f(),_(40,"span"),u(41,"Move In Front"),f()(),_(42,"div")(43,"kbd"),u(44,"Del"),f(),_(45,"span"),u(46,"Reset Rotation"),f()(),_(47,"div")(48,"kbd"),u(49,"Arrows"),f(),_(50,"span"),u(51),f()(),_(52,"div")(53,"kbd"),u(54,"PgUp/PgDn"),f(),_(55,"span"),u(56),f()(),_(57,"div")(58,"kbd"),u(59,"G"),f(),_(60,"span"),u(61),f()(),_(62,"div")(63,"kbd"),u(64,"H"),f(),_(65,"span"),u(66,"Gizmo Speed"),f()(),_(67,"div")(68,"kbd"),u(69,"LMB Drag"),f(),_(70,"span"),u(71,"Gizmo Drag Axis"),f()()()()),o&2){let e=t;d(5),D(e.mode==="rotation"?"Rotation":"Position"),d(21),me("Fluid ",e.fluid?"On":"Off"),d(5),cn("",e.mode==="rotation"?"Angle":"Speed"," ",e.mode==="rotation"?e.angle:e.speed+1),d(5),me("Relative ",e.relative?"On":"Off"),d(15),D(e.mode==="rotation"?"Rotate XY/Z":"Move XY"),d(5),D(e.mode==="rotation"?"Rotate X":"Move Z"),d(5),me("Gizmo ",e.gizmoMode)}}function _D(o,t){o&1&&ye(0,"i",53)}function vD(o,t){if(o&1&&(_(0,"div",52)(1,"span"),u(2),f(),_(3,"span"),R(4,_D,1,0,"i",53),f(),_(5,"span"),u(6),f(),_(7,"span"),u(8),f(),_(9,"span"),u(10),f()()),o&2){let e=t.$implicit;oe("unloaded",!e.loaded),d(2),D(e.id),d(2),N(e.premium?4:-1),d(2),D(e.name),d(2),D(e.level),d(2),D(e.ping)}}function xD(o,t){o&1&&(_(0,"p"),u(1,"No players match your filter."),f())}function bD(o,t){if(o&1&&(_(0,"span",19),u(1),f()),o&2){let e,n=g(2);d(),D(n.getInventoryWeightLabel((e=n.characterInventory())==null?null:e.weight,(e=n.characterInventory())==null?null:e.capacity))}}function yD(o,t){if(o&1){let e=Z();_(0,"button",55),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.toggleCharacterCategory(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(3);oe("selected",n.selectedCharacterCategory()===e),d(),me(" ",e," ")}}function CD(o,t){if(o&1&&(_(0,"div",22),ve(1,yD,2,3,"button",54,Ln),f()),o&2){let e=g(2);d(),xe(e.characterInventoryCategories())}}function MD(o,t){o&1&&ye(0,"img",69),o&2&&Q("src",t,Gi)}function wD(o,t){if(o&1&&(_(0,"div",68),R(1,MD,1,1,"img",69),_(2,"span"),u(3),f()()),o&2){let e,n=g().$implicit,i=g(2);d(),N((e=i.getInventoryItemImage(n))?1:-1,e),d(2),D(i.getInventoryItemName(n))}}function SD(o,t){o&1&&ye(0,"div",70)}function ED(o,t){if(o&1&&ye(0,"img",58),o&2){let e=g().$implicit,n=g(2);Q("src",t,Gi)("alt",n.getInventoryItemName(e))}}function TD(o,t){o&1&&(_(0,"span",61),u(1),f()),o&2&&(d(),D(t))}function PD(o,t){if(o&1){let e=Z();_(0,"button",71),z("click",function(){P(e);let i=g().$implicit,r=g(2);return A(r.transferCharacterItemToSecondary(i))}),ye(1,"i",72),f()}}function AD(o,t){if(o&1){let e=Z();_(0,"div",24),bi(1,wD,4,2,"div",56)(2,SD,1,0,"div",57),R(3,ED,1,2,"img",58),_(4,"div",59)(5,"span",60),u(6),f(),R(7,TD,2,1,"span",61),f(),_(8,"div",62)(9,"button",63),z("click",function(){let i=P(e).$implicit,r=g(2);return A(r.dropCharacterItem(i))}),ye(10,"i",64),f(),R(11,PD,2,0,"button",65),_(12,"button",66),z("click",function(i){let r=P(e).$implicit,a=g(2);return A(a.showInventoryItemContextMenu(r,i))}),ye(13,"i",67),f()()()}if(o&2){let e,n,i=t.$implicit,r=g(2);Q("cdkDragData",i),d(3),N((e=r.getInventoryItemImage(i))?3:-1,e),d(3),D(r.getInventoryItemName(i)),d(),N((n=r.getInventoryItemSubtitle(i))?7:-1,n),d(4),N(r.canTransferToSecondary()?11:-1)}}function ID(o,t){o&1&&(_(0,"p",25),u(1,"No items in your inventory."),f())}function OD(o,t){o&1&&(_(0,"span",76),ye(1,"i",77),f())}function DD(o,t){if(o&1){let e=Z();_(0,"button",74),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.openSecondaryInventory(i))}),ye(1,"i",75),_(2,"span"),u(3),f(),R(4,OD,2,0,"span",76),f()}if(o&2){let e=t.$implicit;Q("disabled",e.locked),d(3),D(e.name),d(),N(e.locked?4:-1)}}function kD(o,t){if(o&1&&(_(0,"footer",26),ve(1,DD,5,3,"button",73,Cm),f()),o&2){let e=g(2);d(),xe(e.availableInventories())}}function RD(o,t){if(o&1&&(_(0,"span",19),u(1),f()),o&2){let e,n=g(3);d(),D(n.getInventoryWeightLabel((e=n.secondaryInventory())==null?null:e.weight,(e=n.secondaryInventory())==null?null:e.capacity))}}function ND(o,t){if(o&1){let e=Z();_(0,"button",55),z("click",function(){let i=P(e).$implicit,r=g(4);return A(r.toggleSecondaryCategory(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(4);oe("selected",n.selectedSecondaryCategory()===e),d(),me(" ",e," ")}}function LD(o,t){if(o&1&&(_(0,"div",22),ve(1,ND,2,3,"button",54,Ln),f()),o&2){let e=g(3);d(),xe(e.secondaryInventoryCategories())}}function FD(o,t){o&1&&ye(0,"img",69),o&2&&Q("src",t,Gi)}function VD(o,t){if(o&1&&(_(0,"div",68),R(1,FD,1,1,"img",69),_(2,"span"),u(3),f()()),o&2){let e,n=g().$implicit,i=g(3);d(),N((e=i.getInventoryItemImage(n))?1:-1,e),d(2),D(i.getInventoryItemName(n))}}function BD(o,t){o&1&&ye(0,"div",70)}function UD(o,t){if(o&1&&ye(0,"img",58),o&2){let e=g().$implicit,n=g(3);Q("src",t,Gi)("alt",n.getInventoryItemName(e))}}function zD(o,t){o&1&&(_(0,"span",61),u(1),f()),o&2&&(d(),D(t))}function HD(o,t){if(o&1){let e=Z();_(0,"button",80),z("click",function(){P(e);let i=g().$implicit,r=g(3);return A(r.transferSecondaryItemToCharacter(i))}),ye(1,"i",81),f()}}function GD(o,t){if(o&1&&(_(0,"div",24),bi(1,VD,4,2,"div",56)(2,BD,1,0,"div",57),R(3,UD,1,2,"img",58),_(4,"div",59)(5,"span",60),u(6),f(),R(7,zD,2,1,"span",61),f(),_(8,"div",62),R(9,HD,2,0,"button",79),f()()),o&2){let e,n,i=t.$implicit,r=g(3);Q("cdkDragData",i),d(3),N((e=r.getInventoryItemImage(i))?3:-1,e),d(3),D(r.getInventoryItemName(i)),d(),N((n=r.getInventoryItemSubtitle(i))?7:-1,n),d(2),N(r.canTransferToSecondary()?9:-1)}}function WD(o,t){o&1&&(_(0,"p",25),u(1,"No items."),f())}function XD(o,t){if(o&1){let e=Z();_(0,"article",16)(1,"header",17)(2,"div",18)(3,"strong"),u(4),f(),R(5,RD,2,1,"span",19),f(),_(6,"button",78),z("click",function(){P(e);let i=g(2);return A(i.closeSecondaryInventory())}),ye(7,"i",21),f()(),R(8,LD,3,0,"div",22),_(9,"div",23,2),z("cdkDropListDropped",function(i){P(e);let r=g(2);return A(r.onInventoryDrop(i,"secondary"))}),ve(11,GD,10,5,"div",24,Cm,!1,WD,2,0,"p",25),f()()}if(o&2){let e,n=g(2);d(4),D(n.getSecondaryInventoryTitle()),d(),N((e=n.secondaryInventory())!=null&&e.capacity?5:-1),d(3),N(n.secondaryInventoryCategories().length>0?8:-1),d(),Q("cdkDropListData",n.filteredSecondaryInventoryItems()),d(2),xe(n.filteredSecondaryInventoryItems())}}function qD(o,t){if(o&1){let e=Z();_(0,"div",82),z("click",function(){P(e);let i=g(2);return A(i.cancelInvQty())}),f(),_(1,"div",83)(2,"p",84),u(3),_(4,"strong"),u(5),f()(),_(6,"div",85)(7,"input",86),z("input",function(i){P(e);let r=g(2);return A(r.setInvQtyValue(i.target.value))})("keydown.enter",function(){P(e);let i=g(2);return A(i.confirmInvQty())})("keydown.escape",function(){P(e);let i=g(2);return A(i.cancelInvQty())}),f(),_(8,"button",87),z("click",function(){P(e);let i=g(2);return A(i.setInvQtyAll())}),u(9,"ALL"),f()(),_(10,"p",88),u(11),f(),_(12,"div",89)(13,"button",90),z("click",function(){P(e);let i=g(2);return A(i.cancelInvQty())}),u(14,"Cancel"),f(),_(15,"button",91),z("click",function(){P(e);let i=g(2);return A(i.confirmInvQty())}),u(16,"Confirm"),f()()()}if(o&2){let e=t,n=g(2);d(3),me(" ",e.action==="drop"?"Drop":"Move"," "),d(2),D(n.getInventoryItemName(e.item)),d(2),Q("value",e.value)("min",n.getInvQtyInputMin(e))("max",e.max)("step",n.getInvQtyInputStep(e)),d(4),me("Max: ",n.getInvQtyMaxLabel(e))}}function $D(o,t){if(o&1&&(_(0,"div",92),ye(1,"i"),_(2,"span"),u(3),f()()),o&2){let e=t.$implicit;d(),wn("fa "+e.icon),d(2),D(e.name||"Custom stream")}}function YD(o,t){if(o&1&&(_(0,"section",27)(1,"strong"),u(2,"Radio"),f(),ve(3,$D,4,3,"div",92,ct),f()),o&2){let e=g(2);d(3),xe(e.radioHud())}}function jD(o,t){if(o&1){let e=Z();R(0,dD,16,12),R(1,uD,3,7,"section",7),_(2,"section",8)(3,"header")(4,"strong"),u(5,"Players"),f(),_(6,"span"),u(7),f()(),R(8,fD,21,1,"section",9),_(9,"input",10),z("input",function(i){P(e);let r=g();return A(r.setPlayerFilter((i.target.value||"").toString()))}),f(),R(10,gD,72,8,"section",11),_(11,"div",12)(12,"div",13)(13,"span"),u(14,"ID"),f(),ye(15,"span"),_(16,"span"),u(17,"Name"),f(),_(18,"span"),u(19,"Level"),f(),_(20,"span"),u(21,"Ping"),f()(),ve(22,vD,11,7,"div",14,ct),R(24,xD,2,0,"p"),f()(),_(25,"div",15)(26,"article",16)(27,"header",17)(28,"div",18)(29,"strong"),u(30),f(),R(31,bD,2,1,"span",19),f(),_(32,"button",20),z("click",function(){P(e);let i=g();return A(i.toggleInventory())}),ye(33,"i",21),f()(),R(34,CD,3,0,"div",22),_(35,"div",23,0),z("cdkDropListDropped",function(i){P(e);let r=g();return A(r.onInventoryDrop(i,"character"))}),ve(37,AD,14,5,"div",24,Cm,!1,ID,2,0,"p",25),f(),R(40,kD,3,0,"footer",26),f(),R(41,XD,14,5,"article",16),R(42,qD,17,7),f(),ye(43,"overlay-outfit-store"),R(44,YD,5,0,"section",27)}if(o&2){let e,n,i,r=g();N(r.loginUiVisible()?-1:0),d(),N(r.loginUiVisible()?1:-1),d(),oe("visible",r.playerListVisible()),d(5),D(r.playerList().length),d(),N(r.interactWindowVisible()?8:-1),d(),Q("value",r.playerFilter()),d(),N((e=r.objectEditorState())?10:-1,e),d(12),xe(r.filteredPlayerList()),d(2),N(r.playerListVisible()&&r.filteredPlayerList().length===0?24:-1),d(),oe("visible",r.inventoryVisible()),d(5),D(r.getCharacterInventoryTitle()),d(),N((n=r.characterInventory())!=null&&n.capacity?31:-1),d(3),N(r.characterInventoryCategories().length>0?34:-1),d(),Q("cdkDropListData",r.filteredCharacterInventoryItems()),d(2),xe(r.filteredCharacterInventoryItems()),d(3),N(r.hasSecondaryOptions()?40:-1),d(),N(r.secondaryInventory()?41:-1),d(),N((i=r.invQtyDialog())?42:-1,i),d(2),N(r.radioHud().length>0?44:-1)}}function KD(o,t){if(o&1&&ye(0,"i",102),o&2){let e=g(2);wn(e.getFontAwesomeIconClass(t))}}function ZD(o,t){if(o&1){let e=Z();_(0,"button",103),z("click",function(){P(e);let i=g(2);return A(i.closeModalButton())}),ye(1,"i",21),f()}}function JD(o,t){if(o&1){let e=Z();_(0,"overlay-info-modal",104),z("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function QD(o,t){if(o&1){let e=Z();_(0,"overlay-payment-modal",105),z("responded",function(i){P(e);let r=g(2);return A(r.onPaymentResponse(i))}),f()}if(o&2){let e=g(),n=g();Q("options",e.options)("status",n.paymentStatus())}}function e3(o,t){if(o&1&&ye(0,"overlay-confirmation-modal",98),o&2){let e=g();Q("options",e.options)}}function t3(o,t){if(o&1){let e=Z();_(0,"overlay-text-input-modal",106),z("valueChanged",function(i){P(e);let r=g(2);return A(r.onTextInputChanged(i))})("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function n3(o,t){if(o&1){let e=Z();_(0,"overlay-multi-input-modal",107),z("valuesChanged",function(i){P(e);let r=g(2);return A(r.onMultiInputChanged(i))})("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function i3(o,t){if(o&1){let e=Z();_(0,"overlay-list-modal",108),z("rowSelected",function(i){P(e);let r=g(2);return A(r.selectModalRow(i))}),f()}if(o&2){let e=g(),n=g();Q("options",e.options)("keys",n.modalListKeys())("selectedIndex",n.modalSelectedIndex())}}function o3(o,t){if(o&1){let e=Z();_(0,"overlay-categorized-list-modal",109),z("selectionChanged",function(i){P(e);let r=g(2);return A(r.onCategorizedSelectionChanged(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function r3(o,t){if(o&1){let e=Z();_(0,"overlay-categorized-list-modal",109),z("selectionChanged",function(i){P(e);let r=g(2);return A(r.onCategorizedSelectionChanged(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function a3(o,t){if(o&1){let e=Z();_(0,"overlay-landing-list-modal",104),z("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function s3(o,t){if(o&1){let e=Z();_(0,"overlay-lazy-data-browser-modal",104),z("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function l3(o,t){if(o&1){let e=Z();_(0,"overlay-custom-modal",104),z("responded",function(i){P(e);let r=g(2);return A(r.onModalContentResponse(i))}),f()}if(o&2){let e=g();Q("options",e.options)}}function c3(o,t){if(o&1){let e=Z();_(0,"button",111),z("click",function(){let i=P(e).$implicit,r=g(3);return A(r.clickModalButton(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=g(3);Q("ngClass",e.color||"secondary")("disabled",n.isButtonDisabled(e)),d(),me(" ",e.label," ")}}function d3(o,t){if(o&1&&(_(0,"footer",101),ve(1,c3,2,3,"button",110,ct),f()),o&2){let e=g();d(),xe(e.options.buttons||Xi(0,ox))}}function u3(o,t){if(o&1&&(_(0,"section",93)(1,"article",94)(2,"header",95)(3,"h2"),R(4,KD,1,2,"i",96),_(5,"span"),u(6),f()(),R(7,ZD,2,0,"button",97),f(),R(8,JD,1,1,"overlay-info-modal",98),R(9,QD,1,2,"overlay-payment-modal",99),R(10,e3,1,1,"overlay-confirmation-modal",98),R(11,t3,1,1,"overlay-text-input-modal",98),R(12,n3,1,1,"overlay-multi-input-modal",98),R(13,i3,1,3,"overlay-list-modal",100),R(14,o3,1,1,"overlay-categorized-list-modal",98),R(15,r3,1,1,"overlay-categorized-list-modal",98),R(16,a3,1,1,"overlay-landing-list-modal",98),R(17,s3,1,1,"overlay-lazy-data-browser-modal",98),R(18,l3,1,1,"overlay-custom-modal",98),R(19,d3,3,1,"footer",101),f()()),o&2){let e,n=t,i=g();oe("left",i.modalAlignLeft()),d(),oe("modal-list-layout",i.isModalType("list")||i.isModalType("categorizedList")),d(3),N((e=n.options.icon)?4:-1,e),d(2),D(n.options.title||"Modal"),d(),N(n.options.noClose?-1:7),d(),N(i.isModalType("info")?8:-1),d(),N(i.isModalType("payment")?9:-1),d(),N(i.isModalType("confirmation")?10:-1),d(),N(i.isModalType("textInput")?11:-1),d(),N(i.isModalType("multiInput")?12:-1),d(),N(i.isModalType("list")?13:-1),d(),N(i.isModalType("categorizedList")?14:-1),d(),N(i.isModalType("categoryView")?15:-1),d(),N(i.isModalType("landingList")?16:-1),d(),N(i.isModalType("lazyDataBrowser")?17:-1),d(),N(i.isModalType("custom")?18:-1),d(),N(n.type!=="payment"&&(n.options.buttons||Xi(19,ox)).length>0?19:-1)}}function h3(o,t){if(o&1&&(_(0,"h3"),u(1),f()),o&2){let e=g(2);d(),D(e.contextMenuTitle())}}function p3(o,t){if(o&1){let e=Z();_(0,"button",114),z("click",function(){let i=P(e).$index,r=g(2);return A(r.resolveContextMenu(i))}),u(1),f()}if(o&2){let e=t.$implicit,n=t.$index;d(),cn("",n+1,". ",e.caption)}}function m3(o,t){if(o&1&&(_(0,"section",112),R(1,h3,2,1,"h3"),ve(2,p3,2,2,"button",113,ct),f()),o&2){let e=g();Dt("left",e.contextMenuX(),"px")("top",e.contextMenuY(),"px"),d(),N(e.contextMenuTitle()?1:-1),d(),xe(e.contextMenuOptions())}}var se=window.mp,f3={info:"fa-solid fa-circle-info",warning:"fa-solid fa-triangle-exclamation",error:"fa-solid fa-circle-exclamation",close:"fa-solid fa-xmark",payments:"fa-solid fa-money-bill-wave",credit_card:"fa-solid fa-credit-card",expand_more:"fa-solid fa-chevron-down"},qU=(()=>{class o{static{this.ITEM_HIGHLIGHTER_FADE_MIN_OPACITY=.2}static{this.ITEM_HIGHLIGHTER_FADE_START_RADIUS=.12}static{this.ITEM_HIGHLIGHTER_FADE_END_RADIUS=.5}hideIfActive(e){this.activeView()===e&&this.activeView.set("none")}constructor(){this.overlayVisible=F(!0),this.loginDialogVisible=F(!1),this.loginPrefilledName=F(""),this.loginCharacters=F([]),this.loginSpawns=F([]),this.hideCharacterSelectionForConfirmation=F(!1),this.characterSelectionPendingConfirmation=F(!1),this.loginSelectionVisible=le(()=>this.loginCharacters().length>0||this.loginSpawns().length>0?!this.hideCharacterSelectionForConfirmation():!1),this.loginUiVisible=le(()=>this.loginDialogVisible()||this.loginSelectionVisible()),this.loginComponent=null,this.playerListVisible=F(!1),this.playerFilter=F(""),this.playerList=F([]),this.filteredPlayerList=le(()=>{let e=this.playerFilter().trim().toLowerCase();return e?this.playerList().filter(n=>n.name.toLowerCase().includes(e)):this.playerList()}),this.inventoryVisible=F(!1),this.availableInventories=F([]),this.characterInventory=F(null),this.characterInventoryItems=le(()=>this.characterInventory()?.items??[]),this.selectedCharacterCategory=F(null),this.characterInventoryCategories=le(()=>this.extractInventoryCategories(this.characterInventoryItems())),this.filteredCharacterInventoryItems=le(()=>{let e=this.selectedCharacterCategory(),n=this.characterInventoryItems();return e?n.filter(i=>this.getInventoryItemCategory(i)===e):n}),this.secondaryInventory=F(null),this.secondaryInventoryItems=le(()=>this.secondaryInventory()?.items??[]),this.selectedSecondaryCategory=F(null),this.secondaryInventoryCategories=le(()=>this.extractInventoryCategories(this.secondaryInventoryItems())),this.filteredSecondaryInventoryItems=le(()=>{let e=this.selectedSecondaryCategory(),n=this.secondaryInventoryItems();return e?n.filter(i=>this.getInventoryItemCategory(i)===e):n}),this.selectableSecondaryInventories=le(()=>this.availableInventories().filter(e=>!e.locked)),this.canTransferToSecondary=le(()=>!!this.characterInventory()&&!!this.secondaryInventory()&&this.isSecondaryInventoryUnlocked(this.secondaryInventory()?.id??-1)),this.radioHud=F([]),this.characterCreatorVisible=F(!1),this.invQtyDialog=F(null),this.preCharacterInventory=[],this.preSecondaryInventory=[],this.activeView=F("none"),this.settingsTabsPayload=F(null),this.vehicleDealerPayload=F(""),this.modshopPayload=F(""),this.modal=F(null),this.modalSelectedIndex=F(0),this.categorizedSelection=F(null),this.paymentStatus=F("idle"),this.modalListKeys=le(()=>{let e=this.modal();if(!e)return[];let n=e.options.keys;if(n&&n.length>0)return n;let i=e.options.items?.[0];return i?Object.keys(i):[]}),this.selectedModalItem=le(()=>{let e=this.modal();if(!e)return null;let n=e.options.items??[];if(n.length===0)return null;let i=this.modalSelectedIndex();return i<0||i>=n.length?null:n[i]??null}),this.modalTextValue=F(""),this.modalInputValues=F({}),this.contextMenuVisible=F(!1),this.contextMenuTitle=F(""),this.contextMenuOptions=F([]),this.contextMenuX=F(0),this.contextMenuY=F(0),this.itemHighlighterItems=F({}),this.itemHighlighterList=le(()=>Object.values(this.itemHighlighterItems())),this.objectEditorState=F(null),this.interactWindowVisible=F(!1),this.interactWindowSelectedIndex=F(0),this.interactWindowItems=F([]),this.interactWindowTitle=F(""),this.hideContextCursorAfterClick=!1,this.loadingNextContextMenu=!1,this.lastContextX=0,this.lastContextY=0,this.paymentStatusTimer=null,this.onOverlayShow=()=>this.overlayVisible.set(!0),this.onOverlayHide=()=>this.overlayVisible.set(!1),this.onOverlayToggle=()=>this.overlayVisible.update(e=>!e),this.onLoginShow=()=>{this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginDialogVisible.set(!0),this.loginCharacters.set([]),this.loginSpawns.set([]),this.loginComponent?.resetFromScratch(this.loginPrefilledName())},this.onLoginHide=()=>{this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginDialogVisible.set(!1),this.loginCharacters.set([]),this.loginSpawns.set([]),this.loginComponent?.onLoginSuccess()},this.onLoginSuccess=()=>{this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginDialogVisible.set(!1),this.loginCharacters.set([]),this.loginSpawns.set([]),this.loginComponent?.onLoginSuccess()},this.onLoginError=e=>{this.loginComponent&&this.loginComponent.onLoginError(e)},this.onLoginOtp=(e=!1)=>{this.loginDialogVisible.set(!0),this.loginComponent&&this.loginComponent.onLoginOtp(!!e)},this.onLoginCharacters=e=>{let n=this.parseJson(e,[]);this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginDialogVisible.set(!1),this.loginCharacters.set(Array.isArray(n)?n:[]),this.loginSpawns.set([])},this.onLoginSpawns=e=>{let n=this.parseJson(e,[]);this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginDialogVisible.set(!1),this.loginSpawns.set(Array.isArray(n)?n:[]),this.loginCharacters.set([])},this.onSetName=e=>{this.loginPrefilledName.set((e??"").toString())},this.onPlayerListShow=e=>{this.playerListVisible.set(!!e),e||this.playerFilter.set("")},this.onPlayerListData=e=>{let n=this.parseJson(e,{});this.playerList.set(Array.isArray(n.players)?n.players:[])},this.onInventoryToggle=e=>{this.inventoryVisible.set(!!e),e||(this.availableInventories.set([]),this.secondaryInventory.set(null),this.preSecondaryInventory=[],this.selectedCharacterCategory.set(null),this.selectedSecondaryCategory.set(null))},this.onInventoryAvailable=e=>{let n=this.parseJson(e,[]);this.availableInventories.set(Array.isArray(n)?n:[]);let i=this.secondaryInventory();i&&!this.isSecondaryInventoryUnlocked(i.id)&&this.secondaryInventory.set(null)},this.onPreInventoryCharacter=e=>{this.preCharacterInventory.push((e??"").toString())},this.onInventoryCharacter=e=>{let n=this.parseJson(this.preCharacterInventory.join(""),null);if(this.preCharacterInventory=[],!n||!Array.isArray(n.items)){this.characterInventory.set(null);return}this.characterInventory.set(De(he({},n),{weight:Number.isFinite(e)?e:n.weight}));let i=this.selectedCharacterCategory();i&&!this.characterInventoryCategories().includes(i)&&this.selectedCharacterCategory.set(null)},this.onPreInventorySecondary=e=>{this.preSecondaryInventory.push((e??"").toString())},this.onInventorySecondary=e=>{let n=this.parseJson(this.preSecondaryInventory.join(""),null);if(this.preSecondaryInventory=[],!n||!Array.isArray(n.items)){this.secondaryInventory.set(null);return}this.secondaryInventory.set(De(he({},n),{weight:Number.isFinite(e)?e:n.weight}));let i=this.selectedSecondaryCategory();i&&!this.secondaryInventoryCategories().includes(i)&&this.selectedSecondaryCategory.set(null)},this.onInventorySecondaryName=e=>{let n=this.secondaryInventory();n&&this.secondaryInventory.set(De(he({},n),{name:(e??"").toString()}))},this.onCharacterCreatorOpen=()=>{this.characterCreatorVisible.set(!0)},this.onCharacterCreatorClose=()=>{this.characterCreatorVisible.set(!1)},this.onSpecialView=e=>{let n=String(e);this.activeView.set(n)},this.onAtmCreate=()=>this.activeView.set("atm"),this.onSettingsCreate=e=>{this.settingsTabsPayload.set(e??null),this.activeView.set("settings")},this.onAtmDestroy=()=>this.hideIfActive("atm"),this.onSettingsDestroy=()=>{this.settingsTabsPayload.set(null),this.hideIfActive("settings")},this.onDmvOpen=()=>this.activeView.set("dmv"),this.onMinigameStart=()=>this.activeView.set("minigame"),this.onFishingStart=()=>this.activeView.set("fishing"),this.onPlateScreenInitialize=()=>this.activeView.set("plate-screen"),this.onLeoHeliStart=()=>this.activeView.set("leo-heli"),this.onMdcCreate=()=>this.activeView.set("mdc"),this.onVehicleDealerOpen=e=>{this.vehicleDealerPayload.set(String(e??"")),this.activeView.set("vehicle-dealer"),se.events.call("hudShow",!1)},this.onVehicleDealerClose=()=>{this.hideIfActive("vehicle-dealer"),setTimeout(()=>se.events.call("hudShow",!0),0)},this.onModshopOpen=e=>{this.modshopPayload.set(String(e??"")),this.activeView.set("modshop"),se.events.call("hudShow",!1)},this.onModshopClose=()=>{this.hideIfActive("modshop"),setTimeout(()=>se.events.call("hudShow",!0),0)},this.onDmvClose=()=>this.hideIfActive("dmv"),this.onMinigameStop=()=>this.hideIfActive("minigame"),this.onFishingStop=()=>this.hideIfActive("fishing"),this.onPlateScreenClose=()=>this.hideIfActive("plate-screen"),this.onSendHudRadio=e=>{if(Array.isArray(e)){this.radioHud.set(e);return}let n=this.parseJson(e,[]);this.radioHud.set(Array.isArray(n)?n:[])},this.onModal=(e,n,i)=>{let r=this.parseJson(i,{});this.clearPaymentTimer(),this.paymentStatus.set("idle"),this.modalTextValue.set(""),this.modalInputValues.set({}),this.categorizedSelection.set(null),this.modal.set({id:e,type:n,options:r}),this.modalSelectedIndex.set((r.selectable??!1)&&(r.items?.length??0)>0?0:-1)},this.onModalClose=()=>{this.closeModal()},this.onModalPaymentSuccess=e=>{let n=this.modal();!n||n.type!=="payment"||(this.paymentStatus.set(e?"success":"error"),this.clearPaymentTimer(),this.paymentStatusTimer=window.setTimeout(()=>{this.modal.set(null),this.paymentStatus.set("idle")},1200))},this.onPaymentError=()=>{this.onModalPaymentSuccess(!1)},this.onContextMenu=(e,n,i,r,a)=>{let s=Array.isArray(e)?e:this.parseJson(e,[]),l=n,c=i;n<0&&i<0&&(l=this.lastContextX,c=this.lastContextY),this.lastContextX=l,this.lastContextY=c,this.contextMenuX.set(l),this.contextMenuY.set(c),this.contextMenuTitle.set(r??""),this.contextMenuOptions.set(s),this.hideContextCursorAfterClick=!!a,this.loadingNextContextMenu=!0,this.contextMenuVisible.set(!0)},this.onContextMenuForceClose=()=>{this.closeContextMenu()},this.onContextMenuNumberPressed=(...e)=>{let n=e[0],i=typeof n=="number"?n:Number(n);if(!Number.isFinite(i)||!this.contextMenuVisible())return;let r=i-1;r<0||r>=this.contextMenuOptions().length||this.resolveContextMenu(r)},this.onItemHighlighterAdd=e=>{let n=this.parseJson(e,[]),i=Array.isArray(n)?n:[n];this.itemHighlighterItems.update(r=>{let a=he({},r);for(let s of i)!s||typeof s.keyword!="string"||!s.position||(a[s.keyword]=he(he({},a[s.keyword]),s));return a})},this.onItemHighlighterUpdate=(e,n)=>{if(!e)return;let i=this.parseJson(n,null);i&&this.itemHighlighterItems.update(r=>{let a=r[e];return a?De(he({},r),{[e]:De(he({},a),{position:i})}):r})},this.onItemHighlighterRemove=e=>{e&&this.itemHighlighterItems.update(n=>{if(!n[e])return n;let i=he({},n);return delete i[e],i})},this.onItemHighlighterClear=()=>{this.itemHighlighterItems.set({})},this.onItemHighlighterTest=(e,n,i)=>{let r=window.innerWidth||1920,a=window.innerHeight||1080,s=Number.isFinite(e)?e:Math.round(r*.46),l=Number.isFinite(n)?n:Math.round(a*.58),c=typeof i=="string"&&i.trim()?i.trim():"Test Package",h={keyword:"debug_item_highlighter_test",icon:["fa-solid","fa-box-open"],title:c,subtitle:"PRESS E TO INSPECT",options:[{caption:"Inspect",event:"notify",args:["~w~Item highlighter test action clicked."]}],position:{x:s,y:l}};this.onItemHighlighterAdd(JSON.stringify(h))},this.onInteractBindPressed=()=>{let e=this.itemHighlighterList();if(!e.length||!e.some(i=>i.options&&i.options.length>0))return;let n=e.find(i=>i.options&&i.options.length>0);n&&(this.interactWindowTitle.set(n.title),this.interactWindowItems.set(e.filter(i=>i.options&&i.options.length>0)),this.interactWindowSelectedIndex.set(0),this.interactWindowVisible.set(!0),se.events.call("cursor:on","interactWindow"))},this.onInteractWindowClose=()=>{this.interactWindowVisible.set(!1),this.interactWindowItems.set([]),this.interactWindowSelectedIndex.set(0),se.events.call("cursor:off","interactWindow")},this.onObjectEditorState=e=>{let n=this.parseJson(e,null);if(!n||typeof n!="object"){this.objectEditorState.set(null);return}if(!(n.active===!0)){this.objectEditorState.set(null);return}this.objectEditorState.set({active:!0,mode:n.mode==="rotation"?"rotation":"position",fluid:n.fluid===!0,speed:Number.isFinite(n.speed)?Number(n.speed):0,angle:Number.isFinite(n.angle)?Number(n.angle):1,relative:n.relative!==!1,gizmoMode:typeof n.gizmoMode=="string"?n.gizmoMode:"off",gizmoTranslateSpeed:Number.isFinite(n.gizmoTranslateSpeed)?Number(n.gizmoTranslateSpeed):1,gizmoRotateSpeed:Number.isFinite(n.gizmoRotateSpeed)?Number(n.gizmoRotateSpeed):1})},this.onDocumentClick=e=>{if(!this.contextMenuVisible())return;if(this.loadingNextContextMenu){this.loadingNextContextMenu=!1;return}let n=e.target;n instanceof Element&&(n.closest(".context-menu")||this.closeContextMenu())},this.onDocumentKeyDown=e=>{if(e.key==="Escape"){if(this.loginDialogVisible()&&this.loginComponent){e.preventDefault(),this.onLoginReset(this.loginComponent);return}if(this.contextMenuVisible()){this.closeContextMenu();return}if(this.modal()){this.closeModal();return}}if(e.key==="Escape"&&this.interactWindowVisible()){this.onInteractWindowClose();return}if(this.interactWindowVisible()){let r=this.interactWindowItems();if(r.length===0)return;if(e.key==="ArrowDown"){e.preventDefault(),this.interactWindowSelectedIndex.update(a=>a+1>=r.length?0:a+1);return}if(e.key==="ArrowUp"){e.preventDefault(),this.interactWindowSelectedIndex.update(a=>a<=0?r.length-1:a-1);return}if(e.key==="Enter"){e.preventDefault(),this.selectInteractAction();return}return}let n=this.modal();if(!n)return;if(n.type==="confirmation"&&e.key==="Enter"){e.preventDefault(),this.clickConfirmationPrimaryButton();return}if(n.type!=="list"||!(n.options.selectable??!1))return;let i=n.options.items??[];if(i.length!==0){if(e.key==="ArrowDown"){e.preventDefault(),this.modalSelectedIndex.update(r=>r+1>=i.length?0:r+1);return}if(e.key==="ArrowUp"){e.preventDefault(),this.modalSelectedIndex.update(r=>r<=0?i.length-1:r-1);return}if(e.key==="Home"){e.preventDefault(),this.modalSelectedIndex.set(0);return}if(e.key==="End"){e.preventDefault(),this.modalSelectedIndex.set(i.length-1);return}if(e.key==="PageDown"){e.preventDefault(),this.modalSelectedIndex.update(r=>Math.min(r+12,i.length-1));return}if(e.key==="PageUp"){e.preventDefault(),this.modalSelectedIndex.update(r=>Math.max(r-12,0));return}if(/^[0-9]$/.test(e.key)){e.preventDefault();let a=(e.key==="0"?10:Number(e.key))-1;i[a]&&this.modalSelectedIndex.set(a);return}e.key==="Enter"&&(e.preventDefault(),this.clickPrimaryModalButton())}},window.overlayDebugModalResponses=!0,se.events.add("overlay:show",this.onOverlayShow),se.events.add("overlay:hide",this.onOverlayHide),se.events.add("overlay:toggle",this.onOverlayToggle),se.events.add("login:show",this.onLoginShow),se.events.add("login:hide",this.onLoginHide),se.events.add("login:success",this.onLoginSuccess),se.events.add("login:error",this.onLoginError),se.events.add("login:otp",this.onLoginOtp),se.events.add("login:characters",this.onLoginCharacters),se.events.add("login:spawns",this.onLoginSpawns),se.events.add("setName",this.onSetName),se.events.add("playerList_show",this.onPlayerListShow),se.events.add("playerList_data",this.onPlayerListData),se.events.add("inventory:toggle",this.onInventoryToggle),se.events.add("inventory:available",this.onInventoryAvailable),se.events.add("pre:inventory:character",this.onPreInventoryCharacter),se.events.add("inventory:character",this.onInventoryCharacter),se.events.add("pre:inventory:secondary",this.onPreInventorySecondary),se.events.add("inventory:secondary",this.onInventorySecondary),se.events.add("inventory:secondary:name",this.onInventorySecondaryName),se.events.add("sendHudRadio",this.onSendHudRadio),se.events.add("characterCreator:open",this.onCharacterCreatorOpen),se.events.add("characterCreator:close",this.onCharacterCreatorClose),se.events.add("special:view",this.onSpecialView),se.events.add("atm:create",this.onAtmCreate),se.events.add("menu:create",this.onSettingsCreate),se.events.add("openDMVTest",this.onDmvOpen),se.events.add("minigame:start",this.onMinigameStart),se.events.add("fishingGame:start",this.onFishingStart),se.events.add("initialize",this.onPlateScreenInitialize),se.events.add("startRemoving",this.onPlateScreenInitialize),se.events.add("flightName",this.onLeoHeliStart),se.events.add("vehicleDealer:open",this.onVehicleDealerOpen),se.events.add("vehicleDealer:close",this.onVehicleDealerClose),se.events.add("modshop:open",this.onModshopOpen),se.events.add("modshop:close",this.onModshopClose),se.events.add("atm:destroy",this.onAtmDestroy),se.events.add("menu:destroy",this.onSettingsDestroy),se.events.add("closeDMVTest",this.onDmvClose),se.events.add("minigame:stop",this.onMinigameStop),se.events.add("fishingGame:stop",this.onFishingStop),se.events.add("plateScreen:close",this.onPlateScreenClose),se.events.add("modal",this.onModal),se.events.add("modal:close",this.onModalClose),se.events.add("modal:paymentSuccess",this.onModalPaymentSuccess),se.events.add("paymentError",this.onPaymentError),se.events.add("contextMenu",this.onContextMenu),se.events.add("contextMenu:forceClose",this.onContextMenuForceClose),se.events.add("contextMenu:numberPressed",this.onContextMenuNumberPressed),se.events.add("itemHighlighter:add",this.onItemHighlighterAdd),se.events.add("itemHighlighter:update",this.onItemHighlighterUpdate),se.events.add("itemHighlighter:remove",this.onItemHighlighterRemove),se.events.add("itemHighlighter:clear",this.onItemHighlighterClear),se.events.add("itemHighlighter:test",this.onItemHighlighterTest),se.events.add("objectEditor:state",this.onObjectEditorState),window.rageContextMenu=this.onContextMenu,document.addEventListener("click",this.onDocumentClick),document.addEventListener("keydown",this.onDocumentKeyDown),se.events.add("bindTrigger:interactive",this.onInteractBindPressed),se.events.call("overlay:ready"),se.events.add("bindTrigger:interactive",this.onInteractBindPressed)}ngOnDestroy(){se.events.remove("overlay:show",this.onOverlayShow),se.events.remove("overlay:hide",this.onOverlayHide),se.events.remove("overlay:toggle",this.onOverlayToggle),se.events.remove("login:show",this.onLoginShow),se.events.remove("login:hide",this.onLoginHide),se.events.remove("login:success",this.onLoginSuccess),se.events.remove("login:error",this.onLoginError),se.events.remove("login:otp",this.onLoginOtp),se.events.remove("login:characters",this.onLoginCharacters),se.events.remove("login:spawns",this.onLoginSpawns),se.events.remove("setName",this.onSetName),se.events.remove("playerList_show",this.onPlayerListShow),se.events.remove("playerList_data",this.onPlayerListData),se.events.remove("inventory:toggle",this.onInventoryToggle),se.events.remove("inventory:available",this.onInventoryAvailable),se.events.remove("pre:inventory:character",this.onPreInventoryCharacter),se.events.remove("inventory:character",this.onInventoryCharacter),se.events.remove("pre:inventory:secondary",this.onPreInventorySecondary),se.events.remove("inventory:secondary",this.onInventorySecondary),se.events.remove("inventory:secondary:name",this.onInventorySecondaryName),se.events.remove("sendHudRadio",this.onSendHudRadio),se.events.remove("characterCreator:open",this.onCharacterCreatorOpen),se.events.remove("characterCreator:close",this.onCharacterCreatorClose),se.events.remove("special:view",this.onSpecialView),se.events.remove("atm:create",this.onAtmCreate),se.events.remove("menu:create",this.onSettingsCreate),se.events.remove("openDMVTest",this.onDmvOpen),se.events.remove("minigame:start",this.onMinigameStart),se.events.remove("fishingGame:start",this.onFishingStart),se.events.remove("initialize",this.onPlateScreenInitialize),se.events.remove("startRemoving",this.onPlateScreenInitialize),se.events.remove("flightName",this.onLeoHeliStart),se.events.remove("vehicleDealer:open",this.onVehicleDealerOpen),se.events.remove("vehicleDealer:close",this.onVehicleDealerClose),se.events.remove("modshop:open",this.onModshopOpen),se.events.remove("modshop:close",this.onModshopClose),se.events.remove("atm:destroy",this.onAtmDestroy),se.events.remove("menu:destroy",this.onSettingsDestroy),se.events.remove("closeDMVTest",this.onDmvClose),se.events.remove("minigame:stop",this.onMinigameStop),se.events.remove("fishingGame:stop",this.onFishingStop),se.events.remove("plateScreen:close",this.onPlateScreenClose),se.events.remove("modal",this.onModal),se.events.remove("modal:close",this.onModalClose),se.events.remove("modal:paymentSuccess",this.onModalPaymentSuccess),se.events.remove("paymentError",this.onPaymentError),se.events.remove("contextMenu",this.onContextMenu),se.events.remove("contextMenu:forceClose",this.onContextMenuForceClose),se.events.remove("contextMenu:numberPressed",this.onContextMenuNumberPressed),se.events.remove("itemHighlighter:add",this.onItemHighlighterAdd),se.events.remove("itemHighlighter:update",this.onItemHighlighterUpdate),se.events.remove("itemHighlighter:remove",this.onItemHighlighterRemove),se.events.remove("itemHighlighter:clear",this.onItemHighlighterClear),se.events.remove("itemHighlighter:test",this.onItemHighlighterTest),se.events.remove("objectEditor:state",this.onObjectEditorState),se.events.remove("bindTrigger:interactive",this.onInteractBindPressed),document.removeEventListener("click",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeyDown),this.clearPaymentTimer()}setPlayerFilter(e){this.playerFilter.set(e)}toggleInventory(){se.events.call("bindTrigger:inventory")}openSecondaryInventory(e){e.locked||!Number.isFinite(e.id)||e.id<=0||se.events.call("callServerEvent","fetchInventory",e.id,e.blockMoving,e.worldInventory)}closeSecondaryInventory(){this.secondaryInventory.set(null),this.selectedSecondaryCategory.set(null)}toggleCharacterCategory(e){let n=e.trim();n&&this.selectedCharacterCategory.update(i=>i===n?null:n)}toggleSecondaryCategory(e){let n=e.trim();n&&this.selectedSecondaryCategory.update(i=>i===n?null:n)}onInventoryDrop(e,n){if(e.previousContainer===e.container)return;let i=e.item.data,r=n==="secondary"?"transfer-to-secondary":"transfer-to-character";this.maybePromptQty(i,r)}maybePromptQty(e,n){let i=Number(e.amount??1),r=!!e.type?.is_weight_multiplied,a=Number(e.type?.amount_multiplier??1)||1,s=r?i/a:i;if(!(r&&i>1)){this.executeInventoryAction(e,n,i);return}this.invQtyDialog.set({item:e,action:n,max:s,value:s,unit:e.type?.amount_unit?.trim()??"",multiplier:a,multiplied:r})}setInvQtyValue(e){let n=this.invQtyDialog();if(!n)return;let i=parseFloat(e),r=n.multiplied?Number((1/n.multiplier).toFixed(6)):1,a=Number.isFinite(i)?Math.max(r,Math.min(i,n.max)):n.value;this.invQtyDialog.set(De(he({},n),{value:a}))}setInvQtyAll(){let e=this.invQtyDialog();e&&this.invQtyDialog.set(De(he({},e),{value:e.max}))}confirmInvQty(){let e=this.invQtyDialog();if(!e)return;this.invQtyDialog.set(null);let n=e.multiplied?Math.max(1,Math.round(e.value*e.multiplier)):Math.max(1,Math.round(e.value));this.executeInventoryAction(e.item,e.action,n)}cancelInvQty(){this.invQtyDialog.set(null)}executeInventoryAction(e,n,i){n==="transfer-to-secondary"?this.doTransferCharacterItemToSecondary(e,i):n==="transfer-to-character"?this.doTransferSecondaryItemToCharacter(e,i):this.doDropCharacterItem(e,i)}transferCharacterItemToSecondary(e){this.maybePromptQty(e,"transfer-to-secondary")}dropCharacterItem(e){this.maybePromptQty(e,"drop")}transferSecondaryItemToCharacter(e){this.maybePromptQty(e,"transfer-to-character")}doTransferCharacterItemToSecondary(e,n){let i=this.characterInventory(),r=this.secondaryInventory();!i||!r||!this.canTransferToSecondary()||!Number.isFinite(e.id)||e.id<=0||se.events.call("callServerEvent","inventoryMove",i.id,r.id,JSON.stringify([e.id]),n)}doDropCharacterItem(e,n){this.characterInventory()&&(!Number.isFinite(e.id)||e.id<=0||se.events.call("callServerEvent","inventoryDropItem",e.id,n))}doTransferSecondaryItemToCharacter(e,n){let i=this.secondaryInventory(),r=this.characterInventory();!i||!r||!this.canTransferToSecondary()||!Number.isFinite(e.id)||e.id<=0||se.events.call("callServerEvent","inventoryMove",i.id,r.id,JSON.stringify([e.id]),n)}getCharacterInventoryTitle(){return this.characterInventory()?.name?.trim()||"MY INVENTORY"}getSecondaryInventoryTitle(){return this.secondaryInventory()?.name?.trim()||"SECONDARY INVENTORY"}getInventoryItemName(e){let n=e.name?.trim();if(n)return n;let i=e.type?.name?.trim();return i||"Unknown Item"}getInventoryItemImage(e){let n=e.data?.image;return`https://static.southwest-roleplay.com/public/items/${(typeof n=="string"?n.trim():"")||e.type?.image?.trim()||"unknown.png"}`}getInventoryItemSubtitle(e){if(e.childInventory){let c=Array.isArray(e.childInventory.items)?e.childInventory.items.length:0;return`${c} item${c===1?"":"s"}`}let n=Number(e.amount??0),i=!!e.type?.is_weight_multiplied,r=Number(e.type?.amount_multiplier??1)||1,a=e.type?.amount_unit?.trim()??"";if(!i)return a?`1 ${a}`:"";let s=n/r,l=this.formatAmount(s);return a?`${l} ${a}`:l}getInventoryWeightLabel(e,n){let i=this.formatWeightKg(e??0),r=this.formatWeightKg(n??0);return`${i} / ${r} kg`}getInvQtyInputMin(e){return e.multiplied?Number((1/e.multiplier).toFixed(6)):1}getInvQtyInputStep(e){return e.multiplied?"any":1}getInvQtyMaxLabel(e){let n=this.formatAmount(e.max);return e.unit?`${n} ${e.unit}`:n}formatWeightKg(e){let n=e/100;return this.formatAmount(n)}formatAmount(e){return Number.isFinite(e)?Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/\.00$/,"").replace(/(\.\d*[1-9])0+$/,"$1"):"0"}getInventoryItemCategory(e){let i=e.type?.category;return typeof i=="string"?i.trim()||"Uncategorized":i&&typeof i=="object"&&(typeof i.name=="string"?i.name.trim():"")||"Uncategorized"}getInventoryItemTitleExtra(e){let n=e,i="";return n.data?.weapon&&(i+=n.data.weapon.serial?` (${n.data.weapon.serial})`:""),n.data?.jerryCan&&(i+=` (${n.data.jerryCan.fuel}L)`),n.data?.plate&&(i+=` (${n.data.plate.plate})`),n.data?.phone&&(i+=` (${n.data.phone.number})`),n.data?.armour&&(i+=` (${n.data.armour.armour}%)`),n.data?.spraycan&&(i+=` (${n.data.spraycan.color})`),i}extractInventoryCategories(e){let n=new Set;for(let i of e)n.add(this.getInventoryItemCategory(i));return Array.from(n.values())}hasSecondaryOptions(){return this.availableInventories().length>0}isSecondaryInventoryUnlocked(e){return this.availableInventories().some(n=>n.id===e&&!n.locked)}modalAlignLeft(){return this.modal()?.options.align==="left"}showCharacterCreator(){if(!this.characterCreatorVisible())return!1;let e=this.modal();return!(e&&e.type==="confirmation")}show(e){return this.activeView()===e}selectModalRow(e){let n=this.modal();n&&(n.options.selectable??!1)&&this.modalSelectedIndex.set(e)}clickModalButton(e){e.disabled||e.selectedOnly&&!this.getModalSelection()||this.respondToModal({action:e.action,selected:this.getModalSelection()})}onTextInputChanged(e){this.modalTextValue.set(e)}onMultiInputChanged(e){this.modalInputValues.set(e)}onPaymentResponse(e){this.respondToModal(e)}onCategorizedSelectionChanged(e){this.categorizedSelection.set(e)}onModalContentResponse(e){this.respondToModal(e)}isModalType(e){return this.modal()?.type===e}isButtonDisabled(e){return e.disabled?!0:e.selectedOnly?!this.getModalSelection():!1}closeModalButton(){this.closeModal()}resolveContextMenu(e){let n=this.contextMenuOptions()[e];n&&(this.contextMenuVisible.set(!1),n.event&&se.events.call(n.event,...n.args??[]),this.hideContextCursorAfterClick&&se.events.call("cursor:off","contextMenu"))}trackByIndex(e){return e}onLoginSubmit(e,n){this.loginComponent=n,se.events.call("login:submit",e.username,e.password,e.otp??"",!1)}onLoginReset(e){this.loginComponent=e,this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1),this.loginCharacters.set([]),this.loginSpawns.set([]),e.resetFromScratch(this.loginPrefilledName()),se.events.call("login:reset")}onPreviewRequested(e,n){this.loginComponent=n,se.events.call("login:requestPreview",e)}onPreviewCleared(e){this.loginComponent=e,se.events.call("login:clearPreview")}onCharacterConfirmed(e,n){this.loginComponent=n,this.hideCharacterSelectionForConfirmation.set(!0),this.characterSelectionPendingConfirmation.set(!0),se.events.call("login:characterSelect",e)}onSpawnSelected(e){se.events.call("login:spawnSelect",e)}getFontAwesomeIconClass(e){let n=e.trim();if(!n)return"fa-solid fa-circle-question";if(n.includes("fa-"))return n;let i=n.toLowerCase().replace(/\s+/g,"_");return f3[i]??"fa-solid fa-circle-question"}getItemHighlighterIconClass(e){return!Array.isArray(e)||!e.length?"":e.join(" ")}getItemHighlighterOpacity(e){let n=window.innerWidth||1920,i=window.innerHeight||1080,r=Math.min(n,i)*.5;if(!r)return 1;let a=n*.5,s=i*.5,l=e.position.x-a,c=e.position.y-s,h=Math.sqrt(l*l+c*c)/r,p=o.ITEM_HIGHLIGHTER_FADE_START_RADIUS,m=o.ITEM_HIGHLIGHTER_FADE_END_RADIUS;if(h<=p)return 1;if(h>=m)return o.ITEM_HIGHLIGHTER_FADE_MIN_OPACITY;let x=(h-p)/(m-p),M=1-o.ITEM_HIGHLIGHTER_FADE_MIN_OPACITY;return 1-x*M}shouldShowItemHighlighterSquare(e){return!e.keyword.startsWith("world_item_")}onItemHighlighterSelect(e,n){e.options?.length&&(n.stopPropagation(),this.onItemHighlighterClear(),se.events.call("itemHighlighter:clear"),this.onContextMenu(e.options,n.clientX,n.clientY,e.title))}selectInteractAction(){let e=this.interactWindowItems(),n=this.interactWindowSelectedIndex();if(n<0||n>=e.length)return;let i=e[n];if(!i?.options?.length)return;let r=i.options;if(r.length===0)return;let a=r[0];a&&(this.onInteractWindowClose(),this.onItemHighlighterClear(),se.events.call("itemHighlighter:clear"),a.event&&se.events.call(a.event,...a.args??[]))}clickPrimaryModalButton(){let n=(this.modal()?.options.buttons??[])[0];n&&this.clickModalButton(n)}clickConfirmationPrimaryButton(){let n=(this.modal()?.options.buttons??[]).find(i=>i.color!=="secondary");if(n){this.clickModalButton(n);return}this.clickPrimaryModalButton()}closeModal(){let e=this.modal();if(!e)return;e.type==="confirmation"&&this.characterSelectionPendingConfirmation()&&(this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1));let n={action:"cancel"},i=e.options.keepCursor??!1,r=this.toModalPayloadJson(n);this.emitModalResponseDebug({modalId:e.id,modalType:e.type,keepCursor:i,payloadJson:r,payload:n,source:"close",timestamp:new Date().toISOString()}),se.events.call("modalResponse",e.id,r,i),this.modal.set(null),this.paymentStatus.set("idle")}respondToModal(e){let n=this.modal();if(!n)return;n.type==="confirmation"&&this.characterSelectionPendingConfirmation()&&(this.isNegativeModalAction(e)?(this.hideCharacterSelectionForConfirmation.set(!1),this.characterSelectionPendingConfirmation.set(!1)):this.hasModalAction(e)&&(this.loginCharacters.set([]),this.characterSelectionPendingConfirmation.set(!1)));let i=n.options.keepCursor??!1,r=this.toModalPayloadJson(e);this.emitModalResponseDebug({modalId:n.id,modalType:n.type,keepCursor:i,payloadJson:r,payload:e,source:"response",timestamp:new Date().toISOString()}),se.events.call("modalResponse",n.id,r,i),!this.shouldKeepModalOpen(e)&&(this.modal.set(null),this.paymentStatus.set("idle"))}shouldKeepModalOpen(e){return!e||typeof e!="object"||!("clear"in e)?!1:e.clear===!1}isNegativeModalAction(e){if(!e||typeof e!="object"||!("action"in e))return!1;let n=e.action;if(typeof n=="boolean")return n===!1;if(typeof n=="number")return n<=0;if(typeof n!="string")return!1;let i=n.trim().toLowerCase();return i==="no"||i==="cancel"||i==="decline"||i==="abort"||i==="back"||i==="false"||i==="0"}hasModalAction(e){return!!(e&&typeof e=="object"&&"action"in e)}getModalSelection(){let e=this.modal();return e?e.type==="textInput"?this.modalTextValue():e.type==="multiInput"?this.modalInputValues():e.type==="categorizedList"?this.categorizedSelection():this.selectedModalItem():null}closeContextMenu(){this.contextMenuVisible.set(!1),this.hideContextCursorAfterClick&&se.events.call("cursor:off","contextMenu")}parseJson(e,n){try{return JSON.parse(e)}catch{return n}}toModalPayloadJson(e){return JSON.stringify(e)}emitModalResponseDebug(e){window.dispatchEvent(new CustomEvent("overlay:modalResponse:debug",{detail:e})),console.info("[overlay] modalResponse payload",e)}clearPaymentTimer(){this.paymentStatusTimer!==null&&(clearTimeout(this.paymentStatusTimer),this.paymentStatusTimer=null)}isCharacterInventory(){return!0}showInventoryItemContextMenu(e,n){n.preventDefault();let i=[],r=e;if(i.push({caption:"Move",event:"inventory:move",args:[e.id]}),r.type?.category?.properties?.accessory&&r.data?.prop?.equipped&&i.pop(),e.childInventory&&i.push({caption:"Open",event:"inventory:open",args:[e.childInventory.id]}),this.isCharacterInventory()&&i.push({caption:"Show",event:"callServerEvent",args:["inventoryShowItem",e.id]},{caption:"Give",event:"callServerEvent",args:["inventoryGiveItem",e.id]},{caption:"Drop",event:"callServerEvent",args:["inventoryDropItem",e.id]}),r.type?.properties?.scratchoff&&(i.push({caption:"View",event:"callServerEvent",args:["scratchoff:view",e.id]}),e.name?.includes("$")?i.push({caption:"Claim prize",event:"callServerEvent",args:["scratchoff:claim",e.id]}):e.name?.includes("Loss")&&i.push({caption:"Discard ticket",event:"callServerEvent",args:["scratchoff:discard",e.id]})),r.type?.properties?.canBePlaced&&this.isCharacterInventory()&&i.push({caption:"Place in world",event:"callServerEvent",args:["inventoryPlaceItem",e.id]},{caption:"Place in vehicle",event:"callServerEvent",args:["inventoryPlaceVehicleItem",e.id]}),r.type?.properties?.canBeThrown&&this.isCharacterInventory()&&!r.type.properties.weapon&&i.push({caption:"Throw",event:"callServerEvent",args:["inventoryThrowItem",e.id]}),this.isCharacterInventory()&&r.type?.is_weight_multiplied&&!r.type.properties?.ammo&&!r.type.properties?.fish&&!r.type.properties?.money&&i.push({caption:"Split",event:"callServerEvent",args:["inventorySplitItem",e.id]}),r.type?.properties?.breathalyser&&this.isCharacterInventory()&&i.push({caption:"Use",event:"callServerEvent",args:["drug:item:breathalyser",e.id]}),r.type?.properties?.money&&this.isCharacterInventory()&&i.push({caption:"Unpack",event:"callServerEvent",args:["money:unpack",e.id]}),r.type?.properties?.lockpick&&this.isCharacterInventory()&&i.push({caption:r.data?.lockpick?.equipped?"Unequip":"Equip",event:"callServerEvent",args:["burglary:lockpick:status",e.id]}),r.type?.properties?.shovel&&this.isCharacterInventory()&&i.push({caption:r.data?.shovel?.equipped?"Unequip":"Equip",event:"callServerEvent",args:["corpse:shovel:toggle",e.id]}),r.type?.properties?.scratch_file&&this.isCharacterInventory()){let l=!0;this.characterInventoryItems().filter(h=>{let p=h;return p.type?.properties?.weapon&&p.data?.weapon?.serial&&!p.data.weapon.scratched}).forEach(h=>{i.push({caption:`Scratch serial on ${h.type?.name}`,event:"callServerEvent",args:["inventoryScratchWeapon",e.id,h.id],topBorder:l}),l&&(l=!1)})}if(r.type?.properties?.blankNote&&this.isCharacterInventory()&&i.push({caption:r.data?.blankNote?.blank?"Create Poster":"Read Poster",event:"callServerEvent",args:[r.data?.blankNote?.blank?"inventoryCreatePoster":"inventoryReadPoster",e.id]}),r.type?.properties?.camera&&this.isCharacterInventory()){if(r.data?.camera?.equipped)i.push({caption:"Unequip",event:"callServerEvent",args:["unequipCamera",e.id]});else if(i.push({caption:"Equip",event:"callServerEvent",args:["equipCamera",e.id]}),r.data?.camera?.lens){let l=this.characterInventoryItems().find(c=>c.id===r.data.camera.lens.itemId);l&&i.push({caption:`Remove ${l.type?.name}`,event:"callServerEvent",args:["camera:removeLens",e.id]})}}if(r.type?.properties?.lens&&this.isCharacterInventory()){let l=this.characterInventoryItems().find(c=>{let h=c;return h.type?.properties?.camera&&h.data?.camera?.lens?.itemId===e.id});if(l){let c=l;i.push({caption:`Remove from ${c.type?.name}`,event:"callServerEvent",args:["camera:removeLens",l.id]})}else{let c=this.characterInventoryItems().find(h=>{let p=h;return p.type?.properties?.camera&&p.data?.camera?.equipped&&!p.data?.camera?.lens});if(c){let h=c;i.push({caption:`Attach to ${h.type?.name}`,event:"callServerEvent",args:["camera:attachLens",c.id,e.id]})}}}r.type?.properties?.spraycan&&this.isCharacterInventory()&&i.push({caption:r.data?.spraycan?.equipped?"Unequip":"Equip",event:"callServerEvent",args:[r.data?.spraycan?.equipped?"unequipSpraycan":"equipSpraycan",e.id]}),r.type?.category?.properties?.accessory&&this.isCharacterInventory()&&i.push({caption:r.data?.prop?.equipped?"Take Off":"Wear",event:"callServerEvent",args:[r.data?.prop?.equipped?"inventoryPropTakeOff":"inventoryPropWear",e.id]}),r.type?.category?.properties?.rename&&this.isCharacterInventory()&&i.push({caption:"Rename",event:"callServerEvent",args:["inventoryRenameItem",e.id]});let a=r.data?.drug2?.dosage??r.type?.properties?.drug?.dosage??[];if(a.length&&this.isCharacterInventory()&&(a.length>1?i.push({caption:"Use",event:"inventory:selectDrugUsage",args:[e,a]}):i.push({caption:"Use",event:"callServerEvent",args:["inventoryTakeDrug",e.id,0]})),r.type?.properties?.portableRadio&&(this.isCharacterInventory()&&(r.data?.portableRadio?.primary?i.push({caption:r.data?.portableRadio?.state==="on"?"Turn Off":"Turn On",event:"callServerEvent",args:["toggleRadio",e.id,r.data?.portableRadio?.state==="on"?"off":"on"]}):i.push({caption:"Set as Primary",event:"callServerEvent",args:["setRadioPrimary",e.id]})),i.push({caption:`Local Slot: ${r.data?.portableRadio?.activeSlot}`,topBorder:!0}),r.data?.portableRadio?.slots?.length)){let l=!0;r.data.portableRadio.slots.forEach(c=>{i.push({caption:`Slot #${c.slot} - #${c.frequency}`,topBorder:l}),l&&(l=!1)})}if(r.type?.properties?.weaponAttachments?.component&&this.isCharacterInventory())if(r.data?.component?.equipped){let l=this.characterInventoryItems().find(c=>c.id===r.data.component.equipped);i.push({caption:`Remove from ${l?.type?.name}`,event:"callServerEvent",args:["inventoryWeaponComponentOff",e.id,l?.id],topBorder:!0})}else{let l=Object.keys(r.type.properties.weaponAttachments.component),c=!0;this.characterInventoryItems().forEach(h=>{let p=h;p.type?.properties?.weapon&&l.includes(`weapon_${p.type.properties.weapon.weaponID}`)&&(i.push({caption:`Attach to ${p.type?.name}`,event:"callServerEvent",args:["inventoryWeaponComponentOn",e.id,h.id],topBorder:c}),c&&(c=!1))})}if(r.type?.properties?.weapon&&this.isCharacterInventory()&&(i.push({caption:r.data?.weapon?.equipped?"Unequip":"Equip",event:"callServerEvent",args:[r.data?.weapon?.equipped?"inventoryWeaponUnequip":"inventoryWeaponEquip",e.id]}),e.amount&&r.data?.weapon?.equipped&&i.push({caption:"Unload ammo",event:"callServerEvent",args:["inventoryUnloadAmmo",e.id],topBorder:!0}),i.push({caption:"Place",event:"callServerEvent",args:["inventoryPlaceItem",e.id]}),r.data?.weapon?.equipped&&i.push({caption:"Throw",event:"callServerEvent",args:["inventoryThrowItem",e.id]})),r.type?.properties?.ammo&&this.isCharacterInventory()){i.push({caption:"Split",event:"callServerEvent",args:["inventorySplitAmmo",e.id]});let l=!0;this.characterInventoryItems().filter(h=>{let p=h;return p.type?.properties?.weapon&&p.type.properties.weapon.supportedAmmoItemTypes?.includes(r.type?.id??-1)}).forEach(h=>{i.push({caption:`Load to ${h.type?.name}`,event:"callServerEvent",args:["inventoryLoadAmmo",e.id,h.id],topBorder:l}),l&&(l=!1)})}if(r.type?.properties?.fishing?.rod?.odds&&this.isCharacterInventory()&&i.push({caption:"Start Fishing",event:"callServerEvent",args:["fishing:start",e.id]}),r.type?.properties?.fish&&this.isCharacterInventory()&&i.push({caption:"Sell",event:"callServerEvent",args:["fishing:sell",e.id]}),r.type?.properties?.fishing?.bait?.oddIncreaser&&this.isCharacterInventory()){let l=!0;this.characterInventoryItems().filter(h=>h.type?.properties?.fishing?.rod?.odds).forEach(h=>{i.push({caption:`Add to ${h.type?.name}`,event:"callServerEvent",args:["fishing:baitToRod",e.id,h.id],topBorder:l}),l&&(l=!1)})}if(r.data?.ticket){let l=r.data.ticket;i.push({caption:`Read ${l.entity_name}'s ticket`,event:"callServerEvent",args:["readTicket",e.id]}),!l.paid&&!l.excused&&i.push({caption:"Pay off ticket",event:"callServerEvent",args:["payTicket",e.id]})}if(r.type?.properties?.scenario&&this.isCharacterInventory()&&i.push({caption:"Use",event:"callServerEvent",args:["playScenario",r.type.properties.scenario]}),r.type?.properties?.anim&&this.isCharacterInventory()&&i.push({caption:"Use",event:"callServerEvent",args:["playAnim",r.type.properties.anim]}),r.type?.properties?.food&&this.isCharacterInventory()&&i.push({caption:"Eat",event:"callServerEvent",args:["useFoodItem",e.id]}),r.type?.properties?.license&&this.isCharacterInventory()&&i.push({caption:"Attach to nearby vehicle",event:"callServerEvent",args:["attachPlateToVehicle",e.id],topBorder:!0}),r.type?.properties?.postalDelivery&&this.isCharacterInventory()&&(i.push({caption:`${r.data?.postalDelivery?.address}`,topBorder:!0}),i.push({caption:"Open Stolen Package",event:"callServerEvent",args:["postalDelivery:openStolenPackage",e.id]})),r.type?.category?.properties?.medical&&this.isCharacterInventory()&&(r.type?.properties?.tourniquet||r.type?.properties?.gauze)){let l=r.type.properties.tourniquet?"tourniquet":"gauze";i.push({caption:"Apply to yourself",event:"callServerEvent",args:["useBloodStopper",e.id,l,"self"]}),i.push({caption:"Apply to player in front of you",event:"callServerEvent",args:["useBloodStopper",e.id,l,"nearby"]})}if((r.type?.properties?.handcuff||r.type?.properties?.ziptie)&&r.data?.restraints?.attachedTo&&i.push({caption:"This is attached to you."}),r.type?.properties?.makeup&&this.isCharacterInventory()&&(r.type.properties.makeup.patterns?.length>1?i.push({caption:"Apply",event:"inventory:selectMakeup",args:[e]}):i.push({caption:"Apply "+(r.type.properties.makeup.patterns?.[0]?.name??""),event:"callServerEvent",args:["inventoryUseMakeup",e.id,0]})),r.type?.properties?.makeupwipe&&this.isCharacterInventory()&&i.push({caption:"Wipe Everything",event:"callServerEvent",args:["makeupWipeEverything",e.id]},{caption:"Wipe Lipstick",event:"callServerEvent",args:["makeupWipeOverlay",8,e.id]},{caption:"Wipe Makeup",event:"callServerEvent",args:["makeupWipeOverlay",4,e.id]},{caption:"Wipe Blush",event:"callServerEvent",args:["makeupWipeOverlay",5,e.id]}),r.type?.properties?.phone&&this.isCharacterInventory()&&(r.data?.phone?.main||i.push({caption:"Make Primary",event:"callServerEvent",args:["setPrimaryPhone",e.id]}),r.data?.phone?.inUse||i.push({caption:"Switch to this phone",event:"callServerEvent",args:["switchToPhone",e.id]}),i.push({caption:"Switch color",event:"callServerEvent",args:["switchPhoneColor",e.id]})),r.type?.properties?.canBeHeld&&this.isCharacterInventory()&&i.push({caption:"Hold",event:"callServerEvent",args:["inventoryHoldItem",e.id]}),this.isCharacterInventory()&&r.type?.is_weight_multiplied){let l=!0;this.characterInventoryItems().filter(h=>h.type?.id===r.type?.id&&h.id!==e.id).forEach(h=>{let p=h;i.push({caption:`Merge with ${p.type?.name} (#${this.characterInventoryItems().indexOf(h)})`,event:"callServerEvent",args:["inventoryMergeItem",e.id,h.id],topBorder:l}),l&&(l=!1)})}r.type?.properties?.jerryCan&&this.isCharacterInventory()&&i.push({caption:r.data?.jerryCan?.equipped?"Unequip":"Equip",event:"callServerEvent",args:["jerrycan:toggle",e.id]}),r.type?.properties?.armour&&this.isCharacterInventory()&&i.push({caption:r.data?.armour?.equipped?"Unequip":"Equip",event:"callServerEvent",args:["armour:toggle",e.id]});let s=`${this.getInventoryItemName(e)} <span style="opacity: .5">in slot ${this.characterInventoryItems().indexOf(e)}${this.getInventoryItemTitleExtra(e)}</span>`;window.rageContextMenu&&window.rageContextMenu(i,n.clientX,n.clientY,s)}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=ke({type:o,selectors:[["overlay-root"]],decls:5,vars:8,consts:[["charList","cdkDropList"],["loginModal",""],["secList","cdkDropList"],[1,"overlay-root"],[1,"character-creator-host"],[1,"modal-wrapper",3,"left"],[1,"context-menu","panel",3,"left","top"],[1,"login-gateway",3,"selection-flow","characters-flow"],[1,"player-list","panel"],[1,"interact-window-overlay"],["type","text","placeholder","Filter",3,"input","value"],[1,"object-editor-hud","panel"],[1,"players"],[1,"row","legend"],[1,"row",3,"unloaded"],["cdkDropListGroup","",1,"inv-workspace"],[1,"inv-panel","panel"],[1,"inv-panel-header"],[1,"inv-panel-title"],[1,"inv-panel-weight"],["type","button","aria-label","Close inventory",1,"inv-close",3,"click"],["aria-hidden","true",1,"fa-solid","fa-xmark"],[1,"inv-tags"],["cdkDropList","","cdkDropListSortingDisabled","",1,"inv-list","scrollbar-neon",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","",1,"inv-row",3,"cdkDragData"],[1,"inv-empty"],[1,"inv-nearby"],[1,"radio-hud","panel"],["aria-hidden","true",1,"item-highlighter-layer"],[3,"tabsPayload"],[3,"initPayload"],[1,"item-highlighter-node",3,"left","top","opacity"],[1,"item-highlighter-node"],[1,"item-highlighter-box"],[1,"item-highlighter-line"],["type","button",1,"item-highlighter-label",3,"click"],[1,"fa-fw",3,"class"],[1,"item-highlighter-copy"],[1,"item-highlighter-title"],[1,"item-highlighter-subtitle"],[1,"fa-fw"],[1,"login-gateway"],[3,"submitted","previewRequested","previewCleared","characterSelected","spawnSelected","resetRequested","initialUsername","characters","spawns"],[1,"interact-window-panel"],[1,"interact-window-header"],[1,"interact-window-list"],["type","button",1,"interact-window-item",3,"selected"],[1,"interact-window-footer"],["type","button",1,"interact-window-item",3,"click"],[1,"interact-window-title"],[1,"interact-window-subtitle"],[1,"object-editor-grid"],[1,"row"],[1,"fa-solid","fa-star"],["type","button",1,"inv-tag",3,"selected"],["type","button",1,"inv-tag",3,"click"],["class","inv-drag-preview",4,"cdkDragPreview"],["class","inv-drag-placeholder",4,"cdkDragPlaceholder"],["loading","lazy",1,"inv-row-icon",3,"src","alt"],[1,"inv-row-copy"],[1,"inv-row-name"],[1,"inv-row-sub"],[1,"inv-row-actions"],["type","button","aria-label","Drop item",1,"inv-drop",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down"],["type","button","aria-label","Transfer to secondary inventory",1,"inv-transfer"],["type","button","aria-label","More actions",1,"inv-actions",3,"click"],["aria-hidden","true",1,"fa-solid","fa-ellipsis-vertical"],[1,"inv-drag-preview"],[3,"src"],[1,"inv-drag-placeholder"],["type","button","aria-label","Transfer to secondary inventory",1,"inv-transfer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-right"],["type","button",1,"inv-nearby-btn",3,"disabled"],["type","button",1,"inv-nearby-btn",3,"click","disabled"],["aria-hidden","true",1,"fa-solid","fa-box-open"],[1,"inv-nearby-lock"],["aria-hidden","true",1,"fa-solid","fa-lock"],["type","button","aria-label","Close secondary inventory",1,"inv-close",3,"click"],["type","button","aria-label","Transfer to character inventory",1,"inv-transfer"],["type","button","aria-label","Transfer to character inventory",1,"inv-transfer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-left"],[1,"inv-qty-backdrop",3,"click"],[1,"inv-qty-dialog","panel"],[1,"inv-qty-label"],[1,"inv-qty-row"],["type","number","autofocus","",1,"inv-qty-input",3,"input","keydown.enter","keydown.escape","value","min","max","step"],["type","button",1,"inv-qty-all",3,"click"],[1,"inv-qty-hint"],[1,"inv-qty-actions"],["type","button",1,"btn-secondary",3,"click"],["type","button",1,"btn-primary",3,"click"],[1,"station"],[1,"modal-wrapper"],[1,"modal","panel","scrollbar-neon"],[1,"modal-header"],["aria-hidden","true",3,"class"],["type","button","aria-label","Close modal",1,"modal-close"],[3,"options"],[3,"options","status"],[3,"options","keys","selectedIndex"],[1,"buttons"],["aria-hidden","true"],["type","button","aria-label","Close modal",1,"modal-close",3,"click"],[3,"responded","options"],[3,"responded","options","status"],[3,"valueChanged","responded","options"],[3,"valuesChanged","responded","options"],[3,"rowSelected","options","keys","selectedIndex"],[3,"selectionChanged","options"],["type","button",3,"ngClass","disabled"],["type","button",3,"click","ngClass","disabled"],[1,"context-menu","panel"],["type","button"],["type","button",3,"click"]],template:function(n,i){if(n&1&&(_(0,"main",3),R(1,$O,2,0,"section",4),R(2,jD,45,20),R(3,u3,20,20,"section",5),R(4,m3,4,5,"section",6),f()),n&2){let r;oe("hidden",!i.overlayVisible())("login-active",i.loginUiVisible()),d(),N(i.showCharacterCreator()?1:-1),d(),N(i.characterCreatorVisible()?-1:2),d(),N((r=i.modal())?3:-1,r),d(),N(i.contextMenuVisible()?4:-1)}},dependencies:[tt,Jm,$f,Wf,Gf,Hf,Xf,qf,p0,y0,jf,C0,x0,g0,Yf,m0,f0,h0,v0,M0,w0,Dv,kv,Lv,Hv,Gv,Wv,vu,jv,Xv,Kv,$v,Yv,Zv,Jv,ix],styles:['[_nghost-%COMP%]{--sw-bg-0: rgba(32, 34, 40, .74);--sw-bg-1: rgba(43, 43, 45, .82);--sw-bg-2: rgba(44, 47, 54, .86);--sw-bg-3: rgba(52, 56, 64, .9);--sw-text: #d8dde6;--sw-text-soft: #a9b0bb;--sw-border: rgba(95, 101, 114, .48);--sw-accent-rgb: 209, 27, 45;--sw-accent: #d11b2d;--sw-accent-soft: rgba(var(--sw-accent-rgb), .26);--sw-good: #7ad694;--sw-bad: #f07373;--sw-shadow: 0 18px 36px rgba(0, 0, 0, .42);--mat-sys-title-small-font: "Inter", "Google Sans", "Segoe UI", sans-serif;--mat-sys-body-small-font: "Inter", "Google Sans", "Segoe UI", sans-serif;--mat-sys-label-small-font: "Inter", "Google Sans", "Segoe UI", sans-serif;--mat-tab-label-text-font: "Inter", "Google Sans", "Segoe UI", sans-serif}.overlay-root[_ngcontent-%COMP%]{position:relative;width:100%;min-height:100vh;overflow:hidden;color:var(--sw-text);font-family:var(--overlay-font-primary, "Google Sans", "Inter", "Segoe UI", sans-serif);-webkit-user-select:none;user-select:none;letter-spacing:.01em}.overlay-root.hidden[_ngcontent-%COMP%]{display:none}.character-creator-host[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-start;padding:1rem 1rem 1rem .5rem;z-index:4;pointer-events:none}.character-creator-host[_ngcontent-%COMP%] overlay-char-creator[_ngcontent-%COMP%]{pointer-events:auto}.panel[_ngcontent-%COMP%]{border:1px solid var(--sw-border);border-radius:14px;background:linear-gradient(160deg,#383c46e6,#202228f2);box-shadow:var(--sw-shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.player-list[_ngcontent-%COMP%]{display:none;position:absolute;top:1.5rem;right:1.5rem;width:fit-content;max-width:min(92vw,36rem);max-height:min(72vh,52rem);padding:.9rem;overflow:hidden;pointer-events:none}.player-list.visible[_ngcontent-%COMP%]{display:block}.player-list[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.player-list[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.65rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.35);padding-bottom:.5rem}.player-list[_ngcontent-%COMP%] header[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{text-transform:uppercase;letter-spacing:.08em;font-size:.78rem;color:#f0f3f8}.player-list[_ngcontent-%COMP%] header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.8rem;color:#bfd6ff}.player-list[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:94%;margin-bottom:.5rem;border:1px solid rgba(var(--sw-accent-rgb),.35);border-radius:10px;background:#191b1fc7;color:var(--sw-text);padding:.55rem .65rem;outline:none}.player-list[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:var(--sw-text-soft)}.player-list[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-color:rgba(var(--sw-accent-rgb),.8);box-shadow:0 8px 18px #0000002e}.player-list[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--sw-accent);font-size:.6em}.players[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto;max-height:calc(min(72vh,52rem) - 7rem);border-radius:10px;border:1px solid rgba(255,255,255,.1);background:#181a1fd1}.players[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:grid;grid-template-columns:.5rem .6rem 1fr 3rem 4rem;gap:.6rem;padding:.55rem .65rem;align-items:center;border-top:1px solid rgba(255,255,255,.04)}.players[_ngcontent-%COMP%] .row.legend[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase;font-size:.7rem;color:var(--sw-text-soft);letter-spacing:.05em;background:rgba(var(--sw-accent-rgb),.12);border-top:0;position:sticky;top:0}.players[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:not(.legend):nth-child(2n){background:#ffffff04}.players[_ngcontent-%COMP%] .row.unloaded[_ngcontent-%COMP%]{opacity:.62}.players[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;padding:.75rem;color:var(--sw-text-soft)}.inv-workspace[_ngcontent-%COMP%]{display:none;position:absolute;left:.625rem;top:19.875rem;z-index:5;flex-direction:row;align-items:flex-start;gap:.45rem;width:fit-content;max-width:92vw;pointer-events:none}.inv-workspace.visible[_ngcontent-%COMP%]{display:flex}.inv-workspace[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.inv-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(30rem,44vw);flex-shrink:0;max-height:min(60vh,30rem);border-color:rgba(var(--sw-accent-rgb),.55);background:linear-gradient(160deg,#32121afa,#0e1118fc 22%,#0a0d12 70%);overflow:hidden}.inv-panel-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:.62rem .72rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.42);background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.23),rgba(var(--sw-accent-rgb),.08))}.inv-panel-title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.1rem;min-width:0}.inv-panel-header[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{text-transform:uppercase;letter-spacing:.04em;font-size:.9rem;font-weight:700;color:#f4f7fc}.inv-panel-weight[_ngcontent-%COMP%]{font-size:.62rem;color:var(--sw-text-soft);letter-spacing:.02em}.inv-close[_ngcontent-%COMP%]{min-width:0;width:1.85rem;height:1.85rem;padding:0;display:grid;place-items:center;border-radius:9px;border-color:#fff3;background:#ffffff0f}.inv-tags[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.22rem;padding:.3rem .32rem .05rem}.inv-tag[_ngcontent-%COMP%]{padding:.16rem .42rem;border-radius:999px;font-size:.64rem;letter-spacing:.02em;border:1px solid rgba(255,255,255,.14);background:#ffffff0a;color:#dde4f0}.inv-tag.selected[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.7);background:rgba(var(--sw-accent-rgb),.26);color:#f5f8ff}.inv-list[_ngcontent-%COMP%]{flex:1 1 auto;overflow-x:hidden;overflow-y:auto;margin:.25rem .32rem .32rem;padding:.18rem .2rem;max-height:23rem;min-height:0;border-radius:8px;background:#8c93a029}.inv-list[_ngcontent-%COMP%]::-webkit-scrollbar{width:.34rem}.inv-list[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:rgba(var(--sw-accent-rgb),.14);border-radius:999px}.inv-list[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ffffffd1;border-radius:999px}.inv-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem;padding:.3rem .55rem;border-top:1px solid rgba(255,255,255,.06);transition:background 90ms ease;min-width:0}.inv-drag-preview[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.3rem .7rem;border-radius:8px;background:#1e0c12eb;border:1px solid rgba(var(--sw-accent-rgb),.6);box-shadow:0 4px 18px #0000008c;opacity:.85;pointer-events:none;font-size:.86rem;font-weight:600;color:#f0f3f9;white-space:nowrap}.inv-drag-preview[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:1.55rem;height:1.55rem;object-fit:contain;border-radius:5px}.inv-drag-placeholder[_ngcontent-%COMP%]{height:2.15rem;border-radius:6px;background:rgba(var(--sw-accent-rgb),.12);border:1px dashed rgba(var(--sw-accent-rgb),.4);margin:2px 0}.inv-row.cdk-drag-dragging[_ngcontent-%COMP%]{opacity:.4}.inv-row[_ngcontent-%COMP%]:first-child{border-top:0}.inv-row[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.07)}.inv-row-icon[_ngcontent-%COMP%]{flex:0 0 auto;width:1.55rem;height:1.55rem;display:block;object-fit:contain;border:1px solid rgba(255,255,255,.1);border-radius:5px;background:#ffffff08;padding:.2rem;margin-right:0}.inv-row-copy[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.04rem;min-width:0;flex:1 1 auto}.inv-row-name[_ngcontent-%COMP%]{font-size:.86rem;font-weight:600;color:#f0f3f9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inv-row-sub[_ngcontent-%COMP%]{font-size:.72rem;color:#b4bdcb;white-space:nowrap}.inv-row-actions[_ngcontent-%COMP%]{flex:0 0 auto;margin-left:auto;display:flex;align-items:center;gap:.22rem}.inv-drop[_ngcontent-%COMP%]{flex:0 0 auto;width:2.15rem;height:1.55rem;padding:0;display:grid;place-items:center;border-radius:6px;font-size:.78rem;border-color:#ffffff24;background:#ffffff0f;color:#eef3fc}.inv-drop[_ngcontent-%COMP%]:hover:not(:disabled){background:rgba(var(--sw-accent-rgb),.22);border-color:rgba(var(--sw-accent-rgb),.72)}.inv-transfer[_ngcontent-%COMP%]{flex:0 0 auto;width:2.15rem;height:1.55rem;padding:0;display:grid;place-items:center;border-radius:6px;font-size:.78rem;border-color:#ffffff24;background:#ffffff0f;color:#eef3fc}.inv-transfer[_ngcontent-%COMP%]:hover:not(:disabled){background:rgba(var(--sw-accent-rgb),.22);border-color:rgba(var(--sw-accent-rgb),.72)}.inv-empty[_ngcontent-%COMP%]{margin:0;padding:.42rem .55rem;font-size:.72rem;color:var(--sw-text-soft)}.inv-nearby[_ngcontent-%COMP%]{flex:0 0 auto;border-top:1px solid rgba(var(--sw-accent-rgb),.35);padding:.32rem .45rem;display:flex;flex-wrap:wrap;gap:.22rem;max-height:min(9vh,4rem);overflow-y:auto}.inv-nearby-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.68rem;padding:.18rem .42rem;border-radius:7px}.inv-nearby-lock[_ngcontent-%COMP%]{color:var(--sw-text-soft);font-size:.68rem}.inv-qty-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:6}.inv-qty-dialog[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:7;width:min(18rem,88vw);padding:1rem 1.1rem .85rem;display:flex;flex-direction:column;gap:.55rem;background:linear-gradient(160deg,#32121afa,#0a0d12 80%);border-color:rgba(var(--sw-accent-rgb),.6);box-shadow:0 8px 32px #0009}.inv-qty-label[_ngcontent-%COMP%]{font-size:.88rem;color:#c8cdd8;margin:0}.inv-qty-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#f0f3f9}.inv-qty-row[_ngcontent-%COMP%]{display:flex;gap:.4rem;align-items:center}.inv-qty-input[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;padding:.35rem .5rem;background:#ffffff0f;border:1px solid rgba(var(--sw-accent-rgb),.4);border-radius:6px;color:#f0f3f9;font-size:.9rem;text-align:center}.inv-qty-input[_ngcontent-%COMP%]:focus{outline:none;border-color:rgba(var(--sw-accent-rgb),.8)}.inv-qty-input[_ngcontent-%COMP%]::-webkit-inner-spin-button, .inv-qty-input[_ngcontent-%COMP%]::-webkit-outer-spin-button{opacity:.4}.inv-qty-all[_ngcontent-%COMP%]{flex:0 0 auto;padding:.35rem .65rem;border-radius:6px;background:rgba(var(--sw-accent-rgb),.18);border:1px solid rgba(var(--sw-accent-rgb),.45);color:#f0f3f9;font-size:.76rem;font-weight:700;letter-spacing:.04em;cursor:pointer;transition:background 80ms ease}.inv-qty-all[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.3)}.inv-qty-hint[_ngcontent-%COMP%]{font-size:.72rem;color:var(--sw-text-soft);margin:0}.inv-qty-actions[_ngcontent-%COMP%]{display:flex;gap:.4rem;justify-content:flex-end;margin-top:.1rem}.radio-hud[_ngcontent-%COMP%]{position:absolute;right:1.5rem;bottom:1.5rem;width:fit-content;max-width:min(20rem,75vw);padding:.7rem;pointer-events:none}.object-editor-hud[_ngcontent-%COMP%]{position:absolute;right:1.5rem;bottom:1.5rem;width:min(31rem,82vw);padding:.85rem;pointer-events:none;z-index:25}.object-editor-hud[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.6rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.35);padding-bottom:.5rem}.object-editor-hud[_ngcontent-%COMP%] header[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{text-transform:uppercase;letter-spacing:.08em;font-size:.78rem;color:#f0f3f8}.object-editor-hud[_ngcontent-%COMP%] header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.78rem;color:#bfd6ff}.object-editor-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem .7rem}.object-editor-grid[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem;min-width:0}.object-editor-grid[_ngcontent-%COMP%] kbd[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:.16rem .38rem;border-radius:6px;border:1px solid rgba(var(--sw-accent-rgb),.5);background:#16181db3;color:#f2f6ff;font-size:.68rem;line-height:1;letter-spacing:.03em;white-space:nowrap}.object-editor-grid[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:0;font-size:.72rem;color:var(--sw-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.radio-hud[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.radio-hud[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-bottom:.35rem;text-transform:uppercase;letter-spacing:.06em;font-size:.74rem}.radio-hud[_ngcontent-%COMP%] .station[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.45rem;font-size:.78rem;color:var(--sw-text);padding:.2rem 0}.radio-hud[_ngcontent-%COMP%] .station[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:1rem;text-align:center;color:#ffb2bb}.modal-wrapper[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;padding:1rem;z-index:60}.modal-wrapper.left[_ngcontent-%COMP%]{justify-content:flex-start}.modal[_ngcontent-%COMP%]{pointer-events:auto;width:min(92vw,54rem);max-height:84vh;overflow-x:hidden;overflow-y:auto;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}.modal.modal-list-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:min(84vh,42rem);overflow:hidden}.modal.modal-list-layout[_ngcontent-%COMP%] .modal-header[_ngcontent-%COMP%], .modal.modal-list-layout[_ngcontent-%COMP%] .buttons[_ngcontent-%COMP%]{flex:0 0 auto}.modal.modal-list-layout[_ngcontent-%COMP%] overlay-list-modal[_ngcontent-%COMP%], .modal.modal-list-layout[_ngcontent-%COMP%] overlay-categorized-list-modal[_ngcontent-%COMP%]{display:block;flex:1 1 auto;min-height:0;overflow:hidden}.modal-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.85rem .95rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.42);background:linear-gradient(135deg,rgba(var(--sw-accent-rgb),.23),rgba(var(--sw-accent-rgb),.08))}.modal-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.55rem;margin:0;font-size:.98rem;font-weight:700;color:#f4f7fc}.modal-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{width:1.2rem;height:1.2rem;font-size:1.2rem;line-height:1.2rem}.modal-close[_ngcontent-%COMP%]{min-width:0;width:2.35rem;height:2.35rem;display:grid;place-items:center;padding:0}.modal-close[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{width:1.15rem;height:1.15rem;font-size:1.15rem;line-height:1.15rem}.modal[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .payment-state[_ngcontent-%COMP%]{margin:0;padding:.85rem .95rem 0;color:var(--sw-text);word-wrap:break-word;overflow-wrap:break-word;word-break:break-word}.payment-state[_ngcontent-%COMP%]{padding-bottom:.85rem}.payment-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;padding:.3rem .5rem;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:#ffffff0a}.payment-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:has(+*){margin-right:.4rem}.list[_ngcontent-%COMP%]{padding:.75rem .95rem}.list[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;overflow:hidden;border-radius:12px;border:1px solid rgba(255,255,255,.1)}.list[_ngcontent-%COMP%] thead.hidden[_ngcontent-%COMP%]{display:none}.list[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .list[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.58rem .7rem;border-top:1px solid rgba(255,255,255,.08)}.list[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.7rem;letter-spacing:.05em;color:var(--sw-text-soft);background:#ffffff08;border-top:0}.list[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{transition:background .12s ease}.list[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:#ffffff0f}.list[_ngcontent-%COMP%] tr.selected[_ngcontent-%COMP%]{background:var(--sw-accent-soft)}.buttons[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.55rem;padding:.95rem;position:relative;z-index:1}.context-menu[_ngcontent-%COMP%]{position:absolute;min-width:13rem;max-width:min(80vw,20rem);padding:.55rem;display:flex;flex-direction:column;gap:.35rem;z-index:70}.context-menu[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;padding:.25rem .35rem .45rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.35);font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:#bfd6ff}button[_ngcontent-%COMP%]{border:1px solid rgba(255,255,255,.2);border-radius:9px;background:#ffffff0f;color:#eef2f8;padding:.46rem .72rem;font-size:.8rem;font-weight:600;letter-spacing:.02em;cursor:pointer;transition:transform .11s ease,background .11s ease,border-color .11s ease}button[_ngcontent-%COMP%]:hover:not(:disabled){transform:translateY(-1px);background:#ffffff1f}button[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(0)}button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}button.primary[_ngcontent-%COMP%]{border-color:rgba(var(--sw-accent-rgb),.88);background:rgba(var(--sw-accent-rgb),.29);color:#e9f1ff}button.primary[_ngcontent-%COMP%]:hover:not(:disabled){background:rgba(var(--sw-accent-rgb),.42)}button.secondary[_ngcontent-%COMP%]{border-color:#a5abb86b;background:#70747d38;color:#dfe4ee}button.warn[_ngcontent-%COMP%]{border-color:#f073739e;background:#f0737333;color:#ffdcdc}.context-menu[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{text-align:left;width:100%;background:#ffffff0a}.context-menu[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.24);border-color:rgba(var(--sw-accent-rgb),.78)}.item-highlighter-layer[_ngcontent-%COMP%]{position:absolute;inset:0;pointer-events:none;z-index:25;overflow:hidden}.item-highlighter-node[_ngcontent-%COMP%]{position:absolute;width:0;height:0;transition:opacity .12s linear}.item-highlighter-box[_ngcontent-%COMP%]{position:absolute;width:22px;height:22px;left:-11px;top:-11px;border:1px solid rgba(var(--sw-accent-rgb),.78);border-radius:9px;background:linear-gradient(160deg,#383c46db,#202228eb);box-shadow:0 8px 16px #00000057;animation:_ngcontent-%COMP%_itemHighlighterSquareIn .12s ease-out}.item-highlighter-line[_ngcontent-%COMP%]{position:absolute;left:0;top:0;width:62px;height:2px;background:#d8dde6db;transform-origin:left center;transform:rotate(-28deg);box-shadow:0 0 10px #00000059;opacity:0;animation:_ngcontent-%COMP%_itemHighlighterLineIn .14s ease-out .12s forwards}.item-highlighter-label[_ngcontent-%COMP%]{position:absolute;left:58px;top:-62px;display:inline-flex;align-items:flex-start;gap:.55rem;padding:.46rem .72rem;min-height:0;border-radius:9px;border:1px solid rgba(var(--sw-accent-rgb),.62);background:linear-gradient(160deg,#383c46e6,#202228f0);color:var(--sw-text);font-size:.8rem;font-weight:600;line-height:1.2;letter-spacing:.02em;box-shadow:var(--sw-shadow);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);white-space:nowrap;pointer-events:auto;transform-origin:left center;clip-path:inset(0 100% 0 0);opacity:0;animation:_ngcontent-%COMP%_itemHighlighterLabelExpand .2s cubic-bezier(.2,.85,.32,1) .24s forwards}.item-highlighter-label.clickable[_ngcontent-%COMP%]{cursor:pointer}.item-highlighter-label[_ngcontent-%COMP%]:hover:not(:disabled){transform:translateY(0);background:linear-gradient(160deg,#3e424cf0,#24272ef5);border-color:rgba(var(--sw-accent-rgb),.84)}.item-highlighter-label[_ngcontent-%COMP%]:not(.clickable){pointer-events:none}.item-highlighter-label[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.88rem;color:var(--sw-text-soft);margin-top:.08rem}.item-highlighter-copy[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.08rem}.item-highlighter-title[_ngcontent-%COMP%]{font-weight:700}.item-highlighter-subtitle[_ngcontent-%COMP%]{font-size:.68rem;letter-spacing:.04em;color:var(--sw-text-soft);text-transform:uppercase}@keyframes _ngcontent-%COMP%_itemHighlighterSquareIn{0%{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _ngcontent-%COMP%_itemHighlighterLineIn{0%{width:0;opacity:0}to{width:62px;opacity:1}}@keyframes _ngcontent-%COMP%_itemHighlighterLabelExpand{0%{clip-path:inset(0 100% 0 0);transform:scaleX(.98);opacity:0}to{clip-path:inset(0 0 0 0);transform:scaleX(1);opacity:1}}@media(max-width:900px){.player-list[_ngcontent-%COMP%]{top:.7rem;right:.7rem;left:.7rem;width:auto;max-height:48vh}.players[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{grid-template-columns:3rem 1fr 4rem 3.6rem 3.6rem;gap:.4rem;font-size:.77rem}.modal[_ngcontent-%COMP%]{width:100%}.inv-workspace[_ngcontent-%COMP%]{left:.5rem;right:.5rem;top:12.5rem;flex-direction:column;width:auto;max-width:none}.inv-panel[_ngcontent-%COMP%]{width:100%;max-width:none;flex-shrink:1}.buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:1 1 calc(50% - .3rem)}}.login-gateway[_ngcontent-%COMP%]{display:flex;position:fixed;inset:0;align-items:center;justify-content:center;z-index:40;pointer-events:none}.login-gateway[_ngcontent-%COMP%] overlay-login-modal[_ngcontent-%COMP%]{width:100%;max-width:380px;pointer-events:auto}.login-gateway.selection-flow[_ngcontent-%COMP%]{align-items:center;justify-content:center;padding:1rem;overflow-y:auto}.login-gateway.selection-flow.characters-flow[_ngcontent-%COMP%]{justify-content:flex-start;padding-left:min(8vw,5rem)}.interact-window-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:30;animation:_ngcontent-%COMP%_fadeIn .15s ease-out}.interact-window-panel[_ngcontent-%COMP%]{pointer-events:auto;width:min(90vw,320px);max-height:60vh;display:flex;flex-direction:column;border-radius:14px;border:1px solid rgba(var(--sw-accent-rgb),.5);background:linear-gradient(160deg,#343840f5,#202228fa);box-shadow:0 0 40px #0009,inset 0 1px #ffffff1a;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:_ngcontent-%COMP%_slideUp .2s cubic-bezier(.2,.85,.32,1)}.interact-window-header[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid rgba(var(--sw-accent-rgb),.3);flex-shrink:0}.interact-window-header[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;font-size:.95rem;font-weight:700;color:#f0f3f8;text-transform:uppercase;letter-spacing:.06em}.interact-window-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:0}.interact-window-item[_ngcontent-%COMP%]{flex:0 0 auto;padding:.75rem 1rem;display:flex;align-items:center;gap:.6rem;border:none;background:transparent;color:var(--sw-text);font-size:.85rem;font-weight:500;text-align:left;cursor:pointer;transition:all .12s ease;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.interact-window-item[_ngcontent-%COMP%]:hover{background:rgba(var(--sw-accent-rgb),.18)}.interact-window-item.selected[_ngcontent-%COMP%]{background:rgba(var(--sw-accent-rgb),.32);color:#f0f3f8;box-shadow:inset 0 0 12px rgba(var(--sw-accent-rgb),.2)}.interact-window-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:1rem;color:rgba(var(--sw-accent-rgb),.9);flex-shrink:0}.interact-window-item[_ngcontent-%COMP%]:hover i[_ngcontent-%COMP%], .interact-window-item.selected[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:rgb(var(--sw-accent-rgb))}.interact-window-title[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis}.interact-window-subtitle[_ngcontent-%COMP%]{font-size:.75rem;color:var(--sw-text-soft);text-transform:uppercase;letter-spacing:.03em}.interact-window-footer[_ngcontent-%COMP%]{display:flex;gap:.8rem;padding:.65rem 1rem;border-top:1px solid rgba(var(--sw-accent-rgb),.2);font-size:.72rem;color:var(--sw-text-soft);flex-wrap:wrap;justify-content:center;flex-shrink:0}.interact-window-footer[_ngcontent-%COMP%] kbd[_ngcontent-%COMP%]{display:inline-block;padding:.2rem .4rem;border-radius:3px;background:rgba(var(--sw-accent-rgb),.2);border:1px solid rgba(var(--sw-accent-rgb),.4);font-family:Monaco,Courier New,monospace;font-weight:600;font-size:.65rem;letter-spacing:.01em}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}'],changeDetection:0})}}return o})();export{qU as OverlayAppComponent};
|