import{r as qu,_ as Ae,m as hi,B as $n,t as Ki,j as tt,v as Lt,w as ht,W as Wt,S as Tt,P as at,x as mn,V as Er,y as Yn,c as $t,g as cn,z as ci,i as oo,A as Tn,D as En,I as Fc,E as da,F as Bc,G as $c,H as zc,J as Hc,K as Uc,L as es,M as ju,o as Ns,N as Vc,p as Or,h as Fr,f as Xu,u as Gc,k as ua,d as Yu,a as Zu,O as Ju,e as ao,s as Qu}from"./CjKOaRnJ.js";import{G as m,z as x,X as d,J as M,I as Q,Y as B,T as U,a5 as te,_ as $e,$ as Ye,a2 as Ze,a3 as Je,W as I,P as O,U as Ku,O as N,a0 as en,L as Ee,a1 as Vi,ae as ji,ad as Wc,af as Yo,ag as eh,Z as ha,B as Es,V as Cn,a8 as fi,a9 as pi,Q as Ar,u as qc,ah as th,ai as nh}from"./Df1WkTgt.js";import{_ as An}from"./CyYbwBHq.js";import{_ as jc,c as ih,a as sh}from"./BNuGzYQL.js";import{_ as fa,a as pa}from"./BkGoyQoN.js";import{_ as mi}from"./D_14CtUv.js";import{I as Xc,_ as Br}from"./CZSHx-Cy.js";import{_ as Yc}from"./BZ7mZpvZ.js";import{T as Zc}from"./DesPaeqy.js";import{_ as ma}from"./CIOmOV8m.js";import{_ as rh}from"./Dvnr83Sw.js";import{_ as Jc}from"./dkTmKSDq.js";import{I as Qc}from"./tQoQbCg1.js";import{S as Os}from"./CBIWsuwb.js";import{_ as ga}from"./BVJO64NZ.js";import{_ as _a}from"./Dt8y8FBm.js";import{_ as kn}from"./BGSJZE8j.js";import{_ as $r}from"./D0RuSEZO.js";import{_ as Kc}from"./Bb9O83sl.js";import{D as va}from"./CGsZwTVG.js";import{_ as ya,a as xa}from"./BiQVPCad.js";import{a as oh}from"./DR952Ri9.js";import{_ as ed,a as td,b as nd}from"./C4sNXUUo.js";import{s as id}from"./CREXyGfr.js";import{metaData as sd}from"./CN-snPS1.js";import{_ as ah}from"./DchuUz7h.js";import{I as rd}from"./CuJBP5A5.js";import{I as od}from"./BiOoTMTl.js";import{_ as ad,a as ld}from"./BrWX0YvM.js";import{_ as lh}from"./BSPekq9q.js";import{_ as ch}from"./D1FG8PT8.js";import{_ as dh}from"./Fg0qWeO1.js";import{_ as uh}from"./Be8KtS9X.js";import{d as hh}from"./C19w2Uzp.js";import{u as fh}from"./R6YigEke.js";import"./CVL9DPoY.js";import"./D1J_4KHT.js";import"./BODobJQB.js";import"./DpE-_oJx.js";import"./C045Aw4U.js";import"./BR_SZSHo.js";import"./BAFXFVTT.js";import"./Cl5CIXYN.js";function ph(n,e){const{title:t,titleTemplate:i,...s}=n;return fh({title:t,titleTemplate:i,_flatMeta:s},{...e,transform(r){const o=qu({...r._flatMeta});return delete r._flatMeta,{...r,meta:o}}})}const mh={name:"ProductAdminPanel",data(){return{dropCacheStatus:"",recountPricesCurrentRegionStatus:"",recountPricesAllRegionsStatus:"",dropCachePricesStatus:"",expanded:!1}},computed:{...hi({product:"product/getData",region:"getRegionData",offers:"product/getOffers",warehouses:"warehouse/getWarehouses"}),regionSpan(){return`Регион: <a target="_blank"
href="${$n}/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=6&type=directoriy&ID=${this.region.ID}&lang=ru&find_section_section=90&WF=Y">
${this.region.NAME}</a> (ID: ${this.region.ID})`},vendor(){return`Производитель: <a target="_blank"
href="${$n}/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=1&type=directoriy&ID=${this.product.vendor.id}">
${this.product.vendor.name}</a> (ID: ${this.product.vendor.id})`},productSpan(){return`Основной товар (инфоблок #4) <a target="_blank"
href="${$n}/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=4&type=directoriy&ID=${this.product.id}">
${this.product.name}</a> (ID: ${this.product.id})`},warehouseSpan(){return`Склад: <a target="_blank"
href="${$n}/bitrix/admin/cat_store_edit.php?ID=${this.region.STOCK_SHIPPING.ID}">
${this.region.STOCK_SHIPPING.TITLE}</a> (ID: ${this.region.STOCK_SHIPPING.ID})`},priceTypeSpan(){return`Тип цены: <a target="_blank"
href="${$n}/bitrix/admin/cat_group_edit.php?ID=${this.region.CATALOG_GROUP.ID}">
${this.region.CATALOG_GROUP.NAME}</a> (ID: ${this.region.CATALOG_GROUP.ID})`},wholesalePriceTypeSpan(){return`Тип оптовой цены: <a target="_blank"
href="${$n}/bitrix/admin/cat_group_edit.php?ID=${this.region.CATALOG_GROUP.WHOLESALE_PRICE_TYPE_ID}">
Посмотреть</a> (ID: ${this.region.CATALOG_GROUP.WHOLESALE_PRICE_TYPE_ID})`}},methods:{offerSpan(n){return`<a target="_blank"
href="${$n}/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=5&type=1c_catalog&ID=${n.id}&lang=ru&WF=Y">
${n.name}</a>`},dropProductCache:async function(){this.dropCacheStatus.length===0&&(this.dropCacheStatus="Ожидание...",await this.$http.$post("/api_vue/clearCache/index.php?productId="+this.product.id).then(n=>{JSON.parse(n).status==="success"?this.dropCacheStatus="Выполнено":this.dropCacheStatus="Возникла ошибка или отсутсвовал кэш",setTimeout(()=>{this.dropCacheStatus=""},2500)}))},recountPrices:async function(n){(this.recountPricesCurrentRegionStatus.length===0||this.recountPricesAllRegionsStatus.length===0)&&(n?this.recountPricesCurrentRegionStatus="Ожидание...":this.recountPricesAllRegionsStatus="Ожидание...",await this.$http.$post("/api_vue/recountPrices/index.php",JSON.stringify({region:n?this.region.CATALOG_GROUP_ID:"",offerIds:Object.keys(this.offers),priceType:this.region.CATALOG_GROUP_ID})).then(e=>{JSON.parse(e).status==="success"?n?this.recountPricesCurrentRegionStatus="Выполнено":this.recountPricesAllRegionsStatus="Выполнено":n?this.recountPricesCurrentRegionStatus="Возникла ошибка":this.recountPricesAllRegionsStatus="Возникла ошибка",setTimeout(()=>{this.recountPricesCurrentRegionStatus="",this.recountPricesAllRegionsStatus=""},2500)}))},dropCachePrices:async function(){this.dropCachePricesStatus.length===0&&(this.dropCachePricesStatus="Ожидание...",await this.$http.$post("/api_vue/recountPrices/dropCache/",JSON.stringify({offerIds:Object.keys(this.offers),priceType:this.region.CATALOG_GROUP_ID})).then(n=>{JSON.parse(n).status==="success"?this.dropCachePricesStatus="Выполнено":this.dropCachePricesStatus="Возникла ошибка или отсутсвовал кэш",setTimeout(()=>{this.dropCachePricesStatus=""},2500)}))}}},gh={class:"product-admin-panel"},_h=d("div",{class:"title"}," БЛОК РАЗРАБОТЧИКОВ ",-1),vh={class:"options"},yh=["innerHTML"],xh=["innerHTML"],wh=["innerHTML"],bh=["innerHTML"],Mh=["innerHTML"],Sh=["innerHTML"],Ch={class:"option"},Th=["innerHTML"],Eh={key:0,class:"option"},Ah=["innerHTML"],kh={key:1,class:"option"},Lh=["innerHTML"],Rh={key:2,class:"option"},Ih=["innerHTML"],Ph={class:"offers-list"},Dh={class:"title"},Nh=d("div",null,"Список офферов",-1),Oh={key:0,class:"offers-table"},Fh=["innerHTML"],Bh={class:"offer__content"},$h={class:"primary"},zh=["innerHTML"],Hh=["innerHTML"],Uh={class:"prices"},Vh=d("div",{class:"price"},"Цены:",-1),Gh={class:"price"},Wh={class:"price"},qh={class:"price"},jh=["innerHTML"];function Xh(n,e,t,i,s,r){return m(),x("div",gh,[_h,d("div",null,[d("div",vh,[d("div",{class:"option",innerHTML:r.vendor},null,8,yh),d("div",{class:"option",innerHTML:r.regionSpan},null,8,xh),d("div",{class:"option",innerHTML:r.productSpan},null,8,wh),d("div",{class:"option",innerHTML:r.priceTypeSpan},null,8,bh),d("div",{class:"option",innerHTML:r.wholesalePriceTypeSpan},null,8,Mh),d("div",{class:"option",innerHTML:r.warehouseSpan},null,8,Sh),d("div",Ch,[d("span",{class:"action",onClick:e[0]||(e[0]=(...o)=>r.dropProductCache&&r.dropProductCache(...o))},"Сброс кэша карточки, офферов и отзывов"),d("span",{innerHTML:s.dropCacheStatus},null,8,Th)]),Object.keys(n.offers).length?(m(),x("div",Eh,[d("span",{class:"action",onClick:e[1]||(e[1]=o=>r.recountPrices(!0))},"Пересчитать цены (текущий регион)"),d("span",{innerHTML:s.recountPricesCurrentRegionStatus},null,8,Ah)])):M("",!0),Object.keys(n.offers).length?(m(),x("div",kh,[d("span",{class:"action",onClick:e[2]||(e[2]=o=>r.recountPrices(!1))},"Пересчитать цены (все регионы)"),d("span",{innerHTML:s.recountPricesAllRegionsStatus},null,8,Lh)])):M("",!0),Object.keys(n.offers).length?(m(),x("div",Rh,[d("span",{class:"action",onClick:e[3]||(e[3]=o=>r.dropCachePrices(!1))},"Сбросить кэш цен (все регионы)"),d("span",{innerHTML:s.dropCachePricesStatus},null,8,Ih)])):M("",!0)]),d("div",Ph,[d("div",Dh,[Nh,Q(),d("div",{class:"btn",onClick:e[4]||(e[4]=o=>s.expanded=!s.expanded)},B(s.expanded?"Свернуть":"Развернуть"),1)]),s.expanded?(m(),x("div",Oh,[(m(!0),x(U,null,te(n.offers,(o,a)=>(m(),x("div",{class:"offer",key:a},[d("div",{class:"id",innerHTML:o.id},null,8,Fh),d("div",Bh,[d("div",$h,[d("div",{class:"name",innerHTML:r.offerSpan(o)},null,8,zh),d("div",{class:"guid",innerHTML:`(${o.xmlId})`},null,8,Hh)]),d("div",Uh,[Vh,d("div",Gh,"Зачеркнутая: "+B(o.price.old)+" руб.",1),d("div",Wh,"Актуальная: "+B(o.price.new)+" руб.",1),d("div",qh,[Q("Скидка: "+B(parseInt(o.price.old)-parseInt(o.price.new))+" руб. ",1),d("span",{class:"disc",innerHTML:`(${o.price.percent} %)`},null,8,jh)])])])]))),128))])):M("",!0)])])])}const Yh=Ae(mh,[["render",Xh]]),Zh={name:"ImageLoader",props:{isForceLoading:{type:Boolean,default:!1,required:!1},src:{type:String,default:"",required:!0},alt:{type:String,default:"",required:!1}},data:()=>({imageLoaded:!0}),mounted(){this.$refs.image.addEventListener("load",this.onImageLoad)},methods:{onImageLoad(){this.imageLoaded=!0}}},Jh={key:0,class:"img"},Qh=["src","alt"],Kh={class:"loader"},ef={key:1,class:"img"},tf=["src"];function nf(n,e,t,i,s,r){return n.$device.isCrawler?(m(),x("div",ef,[d("img",{src:t.src,class:"original",ref:"image"},null,8,tf)])):(m(),x("div",Jh,[$e(d("img",{src:t.src,class:"original",ref:"image",onLoad:e[0]||(e[0]=(...o)=>r.onImageLoad&&r.onImageLoad(...o)),alt:t.alt},null,40,Qh),[[Ye,!t.isForceLoading&&n.imageLoaded]]),$e(d("div",Kh,null,512),[[Ye,t.isForceLoading||!n.imageLoaded]])]))}const Fs=Ae(Zh,[["render",nf],["__scopeId","data-v-89f98730"]]);/**
 * @license
 * Copyright 2010-2021 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const wa="135",gi={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},_i={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},sf=0,ol=1,rf=2,cd=1,of=2,bs=3,Xi=0,Mt=1,Yi=2,dd=1,Hn=0,Ss=1,al=2,ll=3,cl=4,af=5,Fi=100,lf=101,cf=102,dl=103,ul=104,df=200,uf=201,hf=202,ff=203,ud=204,hd=205,pf=206,mf=207,gf=208,_f=209,vf=210,yf=0,xf=1,wf=2,Zo=3,bf=4,Mf=5,Sf=6,Cf=7,zr=0,Tf=1,Ef=2,oi=0,Af=1,kf=2,Lf=3,Rf=4,If=5,fd=300,Bs=301,$s=302,Jo=303,Qo=304,Hr=306,ba=307,kr=1e3,Yt=1001,Ko=1002,At=1003,hl=1004,fl=1005,Qt=1006,Pf=1007,Ur=1008,qn=1009,Df=1010,Nf=1011,As=1012,Of=1013,Sr=1014,zn=1015,Gi=1016,Ff=1017,Bf=1018,$f=1019,Wi=1020,zf=1021,ai=1022,Ht=1023,Hf=1024,Uf=1025,Vf=Ht,li=1026,Zi=1027,Gf=1028,Wf=1029,qf=1030,jf=1031,Xf=1032,Yf=1033,pl=33776,ml=33777,gl=33778,_l=33779,vl=35840,yl=35841,xl=35842,wl=35843,Zf=36196,bl=37492,Ml=37496,Jf=37808,Qf=37809,Kf=37810,ep=37811,tp=37812,np=37813,ip=37814,sp=37815,rp=37816,op=37817,ap=37818,lp=37819,cp=37820,dp=37821,up=36492,hp=37840,fp=37841,pp=37842,mp=37843,gp=37844,_p=37845,vp=37846,yp=37847,xp=37848,wp=37849,bp=37850,Mp=37851,Sp=37852,Cp=37853,Tp=2200,Ep=2201,Ap=2202,Lr=2300,Rr=2301,lo=2302,Bi=2400,$i=2401,Ir=2402,Ma=2500,pd=2501,kp=0,Gt=3e3,Vr=3001,Sa=3007,Ca=3002,md=3004,gd=3005,_d=3006,Lp=3200,Rp=3201,ts=0,Ip=1,co=7680,Pp=519,ks=35044,Pr=35048,Sl="300 es";class Zn{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r<o;r++)s[r].call(this,e);e.target=null}}}const It=[];for(let n=0;n<256;n++)It[n]=(n<16?"0":"")+n.toString(16);const uo=Math.PI/180,ea=180/Math.PI;function fn(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(It[n&255]+It[n>>8&255]+It[n>>16&255]+It[n>>24&255]+"-"+It[e&255]+It[e>>8&255]+"-"+It[e>>16&15|64]+It[e>>24&255]+"-"+It[t&63|128]+It[t>>8&255]+"-"+It[t>>16&255]+It[t>>24&255]+It[i&255]+It[i>>8&255]+It[i>>16&255]+It[i>>24&255]).toUpperCase()}function Vt(n,e,t){return Math.max(e,Math.min(t,n))}function Dp(n,e){return(n%e+e)%e}function ho(n,e,t){return(1-t)*n+t*e}function Cl(n){return(n&n-1)===0&&n!==0}function Np(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}class ce{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}ce.prototype.isVector2=!0;class Pt{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,s,r,o,a,c,l){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=c,u[6]=i,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],c=i[6],l=i[1],u=i[4],h=i[7],f=i[2],p=i[5],g=i[8],_=s[0],w=s[3],v=s[6],y=s[1],C=s[4],S=s[7],T=s[2],P=s[5],b=s[8];return r[0]=o*_+a*y+c*T,r[3]=o*w+a*C+c*P,r[6]=o*v+a*S+c*b,r[1]=l*_+u*y+h*T,r[4]=l*w+u*C+h*P,r[7]=l*v+u*S+h*b,r[2]=f*_+p*y+g*T,r[5]=f*w+p*C+g*P,r[8]=f*v+p*S+g*b,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-i*r*u+i*a*c+s*r*l-s*o*c}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=u*o-a*l,f=a*c-u*r,p=l*r-o*c,g=t*h+i*f+s*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=h*_,e[1]=(s*l-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=f*_,e[4]=(u*t-s*c)*_,e[5]=(s*r-a*t)*_,e[6]=p*_,e[7]=(i*c-l*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const c=Math.cos(r),l=Math.sin(r);return this.set(i*c,i*l,-i*(c*o+l*a)+o+e,-s*l,s*c,-s*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),s=this.elements,r=s[0],o=s[3],a=s[6],c=s[1],l=s[4],u=s[7];return s[0]=t*r+i*c,s[3]=t*o+i*l,s[6]=t*a+i*u,s[1]=-i*r+t*c,s[4]=-i*o+t*l,s[7]=-i*a+t*u,this}translate(e,t){const i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}Pt.prototype.isMatrix3=!0;function vd(n){if(n.length===0)return-1/0;let e=n[0];for(let t=1,i=n.length;t<i;++t)n[t]>e&&(e=n[t]);return e}function Gr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Tl(n,e=0){let t=3735928559^e,i=1103547991^e;for(let s=0,r;s<n.length;s++)r=n.charCodeAt(s),t=Math.imul(t^r,2654435761),i=Math.imul(i^r,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}let vi;class ns{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{vi===void 0&&(vi=Gr("canvas")),vi.width=e.width,vi.height=e.height;const i=vi.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=vi}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let Op=0;class Dt extends Zn{constructor(e=Dt.DEFAULT_IMAGE,t=Dt.DEFAULT_MAPPING,i=Yt,s=Yt,r=Qt,o=Ur,a=Ht,c=qn,l=1,u=Gt){super(),Object.defineProperty(this,"id",{value:Op++}),this.uuid=fn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new ce(0,0),this.repeat=new ce(1,1),this.center=new ce(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Pt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,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.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.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){const s=this.image;if(s.uuid===void 0&&(s.uuid=fn()),!t&&e.images[s.uuid]===void 0){let r;if(Array.isArray(s)){r=[];for(let o=0,a=s.length;o<a;o++)s[o].isDataTexture?r.push(fo(s[o].image)):r.push(fo(s[o]))}else r=fo(s);e.images[s.uuid]={uuid:s.uuid,url:r}}i.image=s.uuid}return JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==fd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case kr:e.x=e.x-Math.floor(e.x);break;case Yt:e.x=e.x<0?0:1;break;case Ko: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 kr:e.y=e.y-Math.floor(e.y);break;case Yt:e.y=e.y<0?0:1;break;case Ko: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++}}Dt.DEFAULT_IMAGE=void 0;Dt.DEFAULT_MAPPING=fd;Dt.prototype.isTexture=!0;function fo(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?ns.getDataURL(n):n.data?{data:Array.prototype.slice.call(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}class lt{constructor(e=0,t=0,i=0,s=1){this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const c=e.elements,l=c[0],u=c[4],h=c[8],f=c[1],p=c[5],g=c[9],_=c[2],w=c[6],v=c[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(g-w)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(g+w)<.1&&Math.abs(l+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const C=(l+1)/2,S=(p+1)/2,T=(v+1)/2,P=(u+f)/4,b=(h+_)/4,z=(g+w)/4;return C>S&&C>T?C<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(C),s=P/i,r=b/i):S>T?S<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),i=P/s,r=z/s):T<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(T),i=b/r,s=z/r),this.set(i,s,r,t),this}let y=Math.sqrt((w-g)*(w-g)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(y)<.001&&(y=1),this.x=(w-g)/y,this.y=(h-_)/y,this.z=(f-u)/y,this.w=Math.acos((l+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}}lt.prototype.isVector4=!0;class Kt extends Zn{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new lt(0,0,e,t),this.scissorTest=!1,this.viewport=new lt(0,0,e,t),this.texture=new Dt(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Qt,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}Kt.prototype.isWebGLRenderTarget=!0;class Fp extends Kt{constructor(e,t,i){super(e,t);const s=this.texture;this.texture=[];for(let r=0;r<i;r++)this.texture[r]=s.clone()}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let s=0,r=this.texture.length;s<r;s++)this.texture[s].image.width=e,this.texture[s].image.height=t,this.texture[s].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone();return this}}Fp.prototype.isWebGLMultipleRenderTargets=!0;class Ta extends Kt{constructor(e,t,i={}){super(e,t,i),this.samples=4,this.ignoreDepthForMultisampleCopy=i.ignoreDepth!==void 0?i.ignoreDepth:!0,this.useRenderToTexture=i.useRenderToTexture!==void 0?i.useRenderToTexture:!1,this.useRenderbuffer=this.useRenderToTexture===!1}copy(e){return super.copy.call(this,e),this.samples=e.samples,this.useRenderToTexture=e.useRenderToTexture,this.useRenderbuffer=e.useRenderbuffer,this}}Ta.prototype.isWebGLMultisampleRenderTarget=!0;class Ft{constructor(e=0,t=0,i=0,s=1){this._x=e,this._y=t,this._z=i,this._w=s}static slerp(e,t,i,s){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,s)}static slerpFlat(e,t,i,s,r,o,a){let c=i[s+0],l=i[s+1],u=i[s+2],h=i[s+3];const f=r[o+0],p=r[o+1],g=r[o+2],_=r[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=f,e[t+1]=p,e[t+2]=g,e[t+3]=_;return}if(h!==_||c!==f||l!==p||u!==g){let w=1-a;const v=c*f+l*p+u*g+h*_,y=v>=0?1:-1,C=1-v*v;if(C>Number.EPSILON){const T=Math.sqrt(C),P=Math.atan2(T,v*y);w=Math.sin(w*P)/T,a=Math.sin(a*P)/T}const S=a*y;if(c=c*w+f*S,l=l*w+p*S,u=u*w+g*S,h=h*w+_*S,w===1-a){const T=1/Math.sqrt(c*c+l*l+u*u+h*h);c*=T,l*=T,u*=T,h*=T}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],c=i[s+1],l=i[s+2],u=i[s+3],h=r[o],f=r[o+1],p=r[o+2],g=r[o+3];return e[t]=a*g+u*h+c*p-l*f,e[t+1]=c*g+u*f+l*h-a*p,e[t+2]=l*g+u*p+a*f-c*h,e[t+3]=u*g-a*h-c*f-l*p,e}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 w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(i/2),u=a(s/2),h=a(r/2),f=c(i/2),p=c(s/2),g=c(r/2);switch(o){case"XYZ":this._x=f*u*h+l*p*g,this._y=l*p*h-f*u*g,this._z=l*u*g+f*p*h,this._w=l*u*h-f*p*g;break;case"YXZ":this._x=f*u*h+l*p*g,this._y=l*p*h-f*u*g,this._z=l*u*g-f*p*h,this._w=l*u*h+f*p*g;break;case"ZXY":this._x=f*u*h-l*p*g,this._y=l*p*h+f*u*g,this._z=l*u*g+f*p*h,this._w=l*u*h-f*p*g;break;case"ZYX":this._x=f*u*h-l*p*g,this._y=l*p*h+f*u*g,this._z=l*u*g-f*p*h,this._w=l*u*h+f*p*g;break;case"YZX":this._x=f*u*h+l*p*g,this._y=l*p*h+f*u*g,this._z=l*u*g-f*p*h,this._w=l*u*h-f*p*g;break;case"XZY":this._x=f*u*h-l*p*g,this._y=l*p*h-f*u*g,this._z=l*u*g+f*p*h,this._w=l*u*h+f*p*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],c=t[9],l=t[2],u=t[6],h=t[10],f=i+a+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-c)*p,this._y=(r-l)*p,this._z=(o-s)*p}else if(i>a&&i>h){const p=2*Math.sqrt(1+i-a-h);this._w=(u-c)/p,this._x=.25*p,this._y=(s+o)/p,this._z=(r+l)/p}else if(a>h){const p=2*Math.sqrt(1+a-i-h);this._w=(r-l)/p,this._x=(s+o)/p,this._y=.25*p,this._z=(c+u)/p}else{const p=2*Math.sqrt(1+h-i-a);this._w=(o-s)/p,this._x=(r+l)/p,this._y=(c+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Vt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,c=t._y,l=t._z,u=t._w;return this._x=i*u+o*a+s*l-r*c,this._y=s*u+o*c+r*a-i*l,this._z=r*u+o*l+i*c-s*a,this._w=o*u-i*a-s*c-r*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*s+t*this._y,this._z=p*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(c),u=Math.atan2(l,a),h=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=s*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Ft.prototype.isQuaternion=!0;class L{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(El.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(El.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,c=e.w,l=c*t+o*s-a*i,u=c*i+a*t-r*s,h=c*s+r*i-o*t,f=-r*t-o*i-a*s;return this.x=l*c+f*-r+u*-a-h*-o,this.y=u*c+f*-o+h*-r-l*-a,this.z=h*c+f*-a+l*-o-u*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,c=t.z;return this.x=s*c-r*a,this.y=r*o-i*c,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return po.copy(this).projectOnVector(e),this.sub(po)}reflect(e){return this.sub(po.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Vt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}L.prototype.isVector3=!0;const po=new L,El=new Ft;class nn{constructor(e=new L(1/0,1/0,1/0),t=new L(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(let c=0,l=e.length;c<l;c+=3){const u=e[c],h=e[c+1],f=e[c+2];u<t&&(t=u),h<i&&(i=h),f<s&&(s=f),u>r&&(r=u),h>o&&(o=h),f>a&&(a=f)}return this.min.set(t,i,s),this.max.set(r,o,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,s=1/0,r=-1/0,o=-1/0,a=-1/0;for(let c=0,l=e.count;c<l;c++){const u=e.getX(c),h=e.getY(c),f=e.getZ(c);u<t&&(t=u),h<i&&(i=h),f<s&&(s=f),u>r&&(r=u),h>o&&(o=h),f>a&&(a=f)}return this.min.set(t,i,s),this.max.set(r,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=hs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;t!==void 0&&(t.boundingBox===null&&t.computeBoundingBox(),mo.copy(t.boundingBox),mo.applyMatrix4(e.matrixWorld),this.union(mo));const i=e.children;for(let s=0,r=i.length;s<r;s++)this.expandByObject(i[s]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,hs),hs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fs),js.subVectors(this.max,fs),yi.subVectors(e.a,fs),xi.subVectors(e.b,fs),wi.subVectors(e.c,fs),Rn.subVectors(xi,yi),In.subVectors(wi,xi),ni.subVectors(yi,wi);let t=[0,-Rn.z,Rn.y,0,-In.z,In.y,0,-ni.z,ni.y,Rn.z,0,-Rn.x,In.z,0,-In.x,ni.z,0,-ni.x,-Rn.y,Rn.x,0,-In.y,In.x,0,-ni.y,ni.x,0];return!go(t,yi,xi,wi,js)||(t=[1,0,0,0,1,0,0,0,1],!go(t,yi,xi,wi,js))?!1:(Xs.crossVectors(Rn,In),t=[Xs.x,Xs.y,Xs.z],go(t,yi,xi,wi,js))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return hs.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(hs).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(vn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),vn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),vn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),vn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),vn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),vn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),vn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),vn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(vn),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}nn.prototype.isBox3=!0;const vn=[new L,new L,new L,new L,new L,new L,new L,new L],hs=new L,mo=new nn,yi=new L,xi=new L,wi=new L,Rn=new L,In=new L,ni=new L,fs=new L,js=new L,Xs=new L,ii=new L;function go(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){ii.fromArray(n,r);const a=s.x*Math.abs(ii.x)+s.y*Math.abs(ii.y)+s.z*Math.abs(ii.z),c=e.dot(ii),l=t.dot(ii),u=i.dot(ii);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>a)return!1}return!0}const Bp=new nn,Al=new L,_o=new L,vo=new L;class is{constructor(e=new L,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):Bp.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;r<o;r++)s=Math.max(s,i.distanceToSquared(e[r]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){vo.subVectors(e,this.center);const t=vo.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.add(vo.multiplyScalar(s/i)),this.radius+=s}return this}union(e){return _o.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Al.copy(e.center).add(_o)),this.expandByPoint(Al.copy(e.center).sub(_o)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const yn=new L,yo=new L,Ys=new L,Pn=new L,xo=new L,Zs=new L,wo=new L;class ss{constructor(e=new L,t=new L(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,yn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=yn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(yn.copy(this.direction).multiplyScalar(t).add(this.origin),yn.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){yo.copy(e).add(t).multiplyScalar(.5),Ys.copy(t).sub(e).normalize(),Pn.copy(this.origin).sub(yo);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Ys),a=Pn.dot(this.direction),c=-Pn.dot(Ys),l=Pn.lengthSq(),u=Math.abs(1-o*o);let h,f,p,g;if(u>0)if(h=o*c-a,f=o*a-c,g=r*u,h>=0)if(f>=-g)if(f<=g){const _=1/u;h*=_,f*=_,p=h*(h+o*f+2*a)+f*(o*h+f+2*c)+l}else f=r,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*c)+l;else f=-r,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*c)+l;else f<=-g?(h=Math.max(0,-(-o*r+a)),f=h>0?-r:Math.min(Math.max(-r,-c),r),p=-h*h+f*(f+2*c)+l):f<=g?(h=0,f=Math.min(Math.max(-r,-c),r),p=f*(f+2*c)+l):(h=Math.max(0,-(o*r+a)),f=h>0?r:Math.min(Math.max(-r,-c),r),p=-h*h+f*(f+2*c)+l);else f=o>0?-r:r,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*c)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),s&&s.copy(Ys).multiplyScalar(f).add(yo),p}intersectSphere(e,t){yn.subVectors(e.center,this.origin);const i=yn.dot(this.direction),s=yn.dot(yn)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,c=i+o;return a<0&&c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,c;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return l>=0?(i=(e.min.x-f.x)*l,s=(e.max.x-f.x)*l):(i=(e.max.x-f.x)*l,s=(e.min.x-f.x)*l),u>=0?(r=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(r=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||r>s||((r>i||i!==i)&&(i=r),(o<s||s!==s)&&(s=o),h>=0?(a=(e.min.z-f.z)*h,c=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,c=(e.min.z-f.z)*h),i>c||a>s)||((a>i||i!==i)&&(i=a),(c<s||s!==s)&&(s=c),s<0)?null:this.at(i>=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,yn)!==null}intersectTriangle(e,t,i,s,r){xo.subVectors(t,e),Zs.subVectors(i,e),wo.crossVectors(xo,Zs);let o=this.direction.dot(wo),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Pn.subVectors(this.origin,e);const c=a*this.direction.dot(Zs.crossVectors(Pn,Zs));if(c<0)return null;const l=a*this.direction.dot(xo.cross(Pn));if(l<0||c+l>o)return null;const u=-a*Pn.dot(wo);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class De{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,s,r,o,a,c,l,u,h,f,p,g,_,w){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=s,v[1]=r,v[5]=o,v[9]=a,v[13]=c,v[2]=l,v[6]=u,v[10]=h,v[14]=f,v[3]=p,v[7]=g,v[11]=_,v[15]=w,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 De().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/bi.setFromMatrixColumn(e,0).length(),r=1/bi.setFromMatrixColumn(e,1).length(),o=1/bi.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),c=Math.cos(s),l=Math.sin(s),u=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const f=o*u,p=o*h,g=a*u,_=a*h;t[0]=c*u,t[4]=-c*h,t[8]=l,t[1]=p+g*l,t[5]=f-_*l,t[9]=-a*c,t[2]=_-f*l,t[6]=g+p*l,t[10]=o*c}else if(e.order==="YXZ"){const f=c*u,p=c*h,g=l*u,_=l*h;t[0]=f+_*a,t[4]=g*a-p,t[8]=o*l,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=p*a-g,t[6]=_+f*a,t[10]=o*c}else if(e.order==="ZXY"){const f=c*u,p=c*h,g=l*u,_=l*h;t[0]=f-_*a,t[4]=-o*h,t[8]=g+p*a,t[1]=p+g*a,t[5]=o*u,t[9]=_-f*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const f=o*u,p=o*h,g=a*u,_=a*h;t[0]=c*u,t[4]=g*l-p,t[8]=f*l+_,t[1]=c*h,t[5]=_*l+f,t[9]=p*l-g,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const f=o*c,p=o*l,g=a*c,_=a*l;t[0]=c*u,t[4]=_-f*h,t[8]=g*h+p,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=p*h+g,t[10]=f-_*h}else if(e.order==="XZY"){const f=o*c,p=o*l,g=a*c,_=a*l;t[0]=c*u,t[4]=-h,t[8]=l*u,t[1]=f*h+_,t[5]=o*u,t[9]=p*h-g,t[2]=g*h-p,t[6]=a*u,t[10]=_*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose($p,e,zp)}lookAt(e,t,i){const s=this.elements;return jt.subVectors(e,t),jt.lengthSq()===0&&(jt.z=1),jt.normalize(),Dn.crossVectors(i,jt),Dn.lengthSq()===0&&(Math.abs(i.z)===1?jt.x+=1e-4:jt.z+=1e-4,jt.normalize(),Dn.crossVectors(i,jt)),Dn.normalize(),Js.crossVectors(jt,Dn),s[0]=Dn.x,s[4]=Js.x,s[8]=jt.x,s[1]=Dn.y,s[5]=Js.y,s[9]=jt.y,s[2]=Dn.z,s[6]=Js.z,s[10]=jt.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],c=i[8],l=i[12],u=i[1],h=i[5],f=i[9],p=i[13],g=i[2],_=i[6],w=i[10],v=i[14],y=i[3],C=i[7],S=i[11],T=i[15],P=s[0],b=s[4],z=s[8],oe=s[12],X=s[1],D=s[5],ge=s[9],G=s[13],V=s[2],Y=s[6],W=s[10],Z=s[14],fe=s[3],_e=s[7],ne=s[11],ie=s[15];return r[0]=o*P+a*X+c*V+l*fe,r[4]=o*b+a*D+c*Y+l*_e,r[8]=o*z+a*ge+c*W+l*ne,r[12]=o*oe+a*G+c*Z+l*ie,r[1]=u*P+h*X+f*V+p*fe,r[5]=u*b+h*D+f*Y+p*_e,r[9]=u*z+h*ge+f*W+p*ne,r[13]=u*oe+h*G+f*Z+p*ie,r[2]=g*P+_*X+w*V+v*fe,r[6]=g*b+_*D+w*Y+v*_e,r[10]=g*z+_*ge+w*W+v*ne,r[14]=g*oe+_*G+w*Z+v*ie,r[3]=y*P+C*X+S*V+T*fe,r[7]=y*b+C*D+S*Y+T*_e,r[11]=y*z+C*ge+S*W+T*ne,r[15]=y*oe+C*G+S*Z+T*ie,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],h=e[6],f=e[10],p=e[14],g=e[3],_=e[7],w=e[11],v=e[15];return g*(+r*c*h-s*l*h-r*a*f+i*l*f+s*a*p-i*c*p)+_*(+t*c*p-t*l*f+r*o*f-s*o*p+s*l*u-r*c*u)+w*(+t*l*h-t*a*p-r*o*h+i*o*p+r*a*u-i*l*u)+v*(-s*a*u-t*c*h+t*a*f+s*o*h-i*o*f+i*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],f=e[10],p=e[11],g=e[12],_=e[13],w=e[14],v=e[15],y=h*w*l-_*f*l+_*c*p-a*w*p-h*c*v+a*f*v,C=g*f*l-u*w*l-g*c*p+o*w*p+u*c*v-o*f*v,S=u*_*l-g*h*l+g*a*p-o*_*p-u*a*v+o*h*v,T=g*h*c-u*_*c-g*a*f+o*_*f+u*a*w-o*h*w,P=t*y+i*C+s*S+r*T;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/P;return e[0]=y*b,e[1]=(_*f*r-h*w*r-_*s*p+i*w*p+h*s*v-i*f*v)*b,e[2]=(a*w*r-_*c*r+_*s*l-i*w*l-a*s*v+i*c*v)*b,e[3]=(h*c*r-a*f*r-h*s*l+i*f*l+a*s*p-i*c*p)*b,e[4]=C*b,e[5]=(u*w*r-g*f*r+g*s*p-t*w*p-u*s*v+t*f*v)*b,e[6]=(g*c*r-o*w*r-g*s*l+t*w*l+o*s*v-t*c*v)*b,e[7]=(o*f*r-u*c*r+u*s*l-t*f*l-o*s*p+t*c*p)*b,e[8]=S*b,e[9]=(g*h*r-u*_*r-g*i*p+t*_*p+u*i*v-t*h*v)*b,e[10]=(o*_*r-g*a*r+g*i*l-t*_*l-o*i*v+t*a*v)*b,e[11]=(u*a*r-o*h*r-u*i*l+t*h*l+o*i*p-t*a*p)*b,e[12]=T*b,e[13]=(u*_*s-g*h*s+g*i*f-t*_*f-u*i*w+t*h*w)*b,e[14]=(g*a*s-o*_*s-g*i*c+t*_*c+o*i*w-t*a*w)*b,e[15]=(o*h*s-u*a*s+u*i*c-t*h*c-o*i*f+t*a*f)*b,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,c=e.z,l=r*o,u=r*a;return this.set(l*o+i,l*a-s*c,l*c+s*a,0,l*a+s*c,u*a+i,u*c-s*o,0,l*c-s*a,u*c+s*o,r*c*c+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,c=t._w,l=r+r,u=o+o,h=a+a,f=r*l,p=r*u,g=r*h,_=o*u,w=o*h,v=a*h,y=c*l,C=c*u,S=c*h,T=i.x,P=i.y,b=i.z;return s[0]=(1-(_+v))*T,s[1]=(p+S)*T,s[2]=(g-C)*T,s[3]=0,s[4]=(p-S)*P,s[5]=(1-(f+v))*P,s[6]=(w+y)*P,s[7]=0,s[8]=(g+C)*b,s[9]=(w-y)*b,s[10]=(1-(f+_))*b,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=bi.set(s[0],s[1],s[2]).length();const o=bi.set(s[4],s[5],s[6]).length(),a=bi.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],on.copy(this);const l=1/r,u=1/o,h=1/a;return on.elements[0]*=l,on.elements[1]*=l,on.elements[2]*=l,on.elements[4]*=u,on.elements[5]*=u,on.elements[6]*=u,on.elements[8]*=h,on.elements[9]*=h,on.elements[10]*=h,t.setFromRotationMatrix(on),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,c=2*r/(t-e),l=2*r/(i-s),u=(t+e)/(t-e),h=(i+s)/(i-s),f=-(o+r)/(o-r),p=-2*o*r/(o-r);return a[0]=c,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,s,r,o){const a=this.elements,c=1/(t-e),l=1/(i-s),u=1/(o-r),h=(t+e)*c,f=(i+s)*l,p=(o+r)*u;return a[0]=2*c,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}De.prototype.isMatrix4=!0;const bi=new L,on=new De,$p=new L(0,0,0),zp=new L(1,1,1),Dn=new L,Js=new L,jt=new L,kl=new De,Ll=new Ft;class rs{constructor(e=0,t=0,i=0,s=rs.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=s}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,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,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,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],c=s[1],l=s[5],u=s[9],h=s[2],f=s[6],p=s[10];switch(t){case"XYZ":this._y=Math.asin(Vt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Vt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Vt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,r));break;case"ZYX":this._y=Math.asin(-Vt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(c,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(Vt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Vt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return kl.makeRotationFromQuaternion(e),this.setFromRotationMatrix(kl,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ll.setFromEuler(this),this.setFromQuaternion(Ll,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new L(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}rs.prototype.isEuler=!0;rs.DefaultOrder="XYZ";rs.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Hp{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Up=0;const Rl=new L,Mi=new Ft,xn=new De,Qs=new L,ps=new L,Vp=new L,Gp=new Ft,Il=new L(1,0,0),Pl=new L(0,1,0),Dl=new L(0,0,1),Wp={type:"added"},Nl={type:"removed"};class st extends Zn{constructor(){super(),Object.defineProperty(this,"id",{value:Up++}),this.uuid=fn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=st.DefaultUp.clone();const e=new L,t=new rs,i=new Ft,s=new L(1,1,1);function r(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(r),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new De},normalMatrix:{value:new Pt}}),this.matrix=new De,this.matrixWorld=new De,this.matrixAutoUpdate=st.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Hp,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Mi.setFromAxisAngle(e,t),this.quaternion.multiply(Mi),this}rotateOnWorldAxis(e,t){return Mi.setFromAxisAngle(e,t),this.quaternion.premultiply(Mi),this}rotateX(e){return this.rotateOnAxis(Il,e)}rotateY(e){return this.rotateOnAxis(Pl,e)}rotateZ(e){return this.rotateOnAxis(Dl,e)}translateOnAxis(e,t){return Rl.copy(e).applyQuaternion(this.quaternion),this.position.add(Rl.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Il,e)}translateY(e){return this.translateOnAxis(Pl,e)}translateZ(e){return this.translateOnAxis(Dl,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(xn.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Qs.copy(e):Qs.set(e,t,i);const s=this.parent;this.updateWorldMatrix(!0,!1),ps.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?xn.lookAt(ps,Qs,this.up):xn.lookAt(Qs,ps,this.up),this.quaternion.setFromRotationMatrix(xn),s&&(xn.extractRotation(s.matrixWorld),Mi.setFromRotationMatrix(xn),this.quaternion.premultiply(Mi.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Wp)):console.error("THREE.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}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Nl)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(Nl)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),xn.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),xn.multiply(e.parent.matrixWorld)),e.applyMatrix4(xn),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,s=this.children.length;i<s;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ps,e,Vp),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ps,Gp,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,s=t.length;i<s;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,s=t.length;i<s;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,s=t.length;i<s;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const s=this.children;for(let r=0,o=s.length;r<o;r++)s[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON()));function r(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let l=0,u=c.length;l<u;l++){const h=c[l];r(e.shapes,h)}else r(e.shapes,c)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(r(e.materials,this.material[c]));s.material=a}else s.material=r(e.materials,this.material);if(this.children.length>0){s.children=[];for(let a=0;a<this.children.length;a++)s.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let a=0;a<this.animations.length;a++){const c=this.animations[a];s.animations.push(r(e.animations,c))}}if(t){const a=o(e.geometries),c=o(e.materials),l=o(e.textures),u=o(e.images),h=o(e.shapes),f=o(e.skeletons),p=o(e.animations);a.length>0&&(i.geometries=a),c.length>0&&(i.materials=c),l.length>0&&(i.textures=l),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p)}return i.object=s,i;function o(a){const c=[];for(const l in a){const u=a[l];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,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.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const s=e.children[i];this.add(s.clone())}return this}}st.DefaultUp=new L(0,1,0);st.DefaultMatrixAutoUpdate=!0;st.prototype.isObject3D=!0;const an=new L,wn=new L,bo=new L,bn=new L,Si=new L,Ci=new L,Ol=new L,Mo=new L,So=new L,Co=new L;class St{constructor(e=new L,t=new L,i=new L){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,s){s.subVectors(i,t),an.subVectors(e,t),s.cross(an);const r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){an.subVectors(s,t),wn.subVectors(i,t),bo.subVectors(e,t);const o=an.dot(an),a=an.dot(wn),c=an.dot(bo),l=wn.dot(wn),u=wn.dot(bo),h=o*l-a*a;if(h===0)return r.set(-2,-1,-1);const f=1/h,p=(l*c-a*u)*f,g=(o*u-a*c)*f;return r.set(1-p-g,g,p)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,bn),bn.x>=0&&bn.y>=0&&bn.x+bn.y<=1}static getUV(e,t,i,s,r,o,a,c){return this.getBarycoord(e,t,i,s,bn),c.set(0,0),c.addScaledVector(r,bn.x),c.addScaledVector(o,bn.y),c.addScaledVector(a,bn.z),c}static isFrontFacing(e,t,i,s){return an.subVectors(i,t),wn.subVectors(e,t),an.cross(wn).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return an.subVectors(this.c,this.b),wn.subVectors(this.a,this.b),an.cross(wn).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return St.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return St.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return St.getUV(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return St.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return St.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Si.subVectors(s,i),Ci.subVectors(r,i),Mo.subVectors(e,i);const c=Si.dot(Mo),l=Ci.dot(Mo);if(c<=0&&l<=0)return t.copy(i);So.subVectors(e,s);const u=Si.dot(So),h=Ci.dot(So);if(u>=0&&h<=u)return t.copy(s);const f=c*h-u*l;if(f<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(i).addScaledVector(Si,o);Co.subVectors(e,r);const p=Si.dot(Co),g=Ci.dot(Co);if(g>=0&&p<=g)return t.copy(r);const _=p*l-c*g;if(_<=0&&l>=0&&g<=0)return a=l/(l-g),t.copy(i).addScaledVector(Ci,a);const w=u*g-p*h;if(w<=0&&h-u>=0&&p-g>=0)return Ol.subVectors(r,s),a=(h-u)/(h-u+(p-g)),t.copy(s).addScaledVector(Ol,a);const v=1/(w+_+f);return o=_*v,a=f*v,t.copy(i).addScaledVector(Si,o).addScaledVector(Ci,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let qp=0;class kt extends Zn{constructor(){super(),Object.defineProperty(this,"id",{value:qp++}),this.uuid=fn(),this.name="",this.type="Material",this.fog=!0,this.blending=Ss,this.side=Xi,this.vertexColors=!1,this.opacity=1,this.format=Ht,this.transparent=!1,this.blendSrc=ud,this.blendDst=hd,this.blendEquation=Fi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Zo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Pp,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=co,this.stencilZFail=co,this.stencilZPass=co,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===dd;continue}const s=this[t];if(s===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ss&&(i.blending=this.blending),this.side!==Xi&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==Ht&&(i.format=this.format),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const c=r[a];delete c.metadata,o.push(c)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}kt.prototype.isMaterial=!0;const yd={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},ln={h:0,s:0,l:0},Ks={h:0,s:0,l:0};function To(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function Eo(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ao(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}class Re{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=Dp(e,1),t=Vt(t,0,1),i=Vt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,r=2*i-s;this.r=To(r,s,e+1/3),this.g=To(r,s,e),this.b=To(r,s,e-1/3)}return this}setStyle(e){function t(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let s;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,t(s[4]),this;if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,t(s[4]),this;break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const a=parseFloat(s[1])/360,c=parseInt(s[2],10)/100,l=parseInt(s[3],10)/100;return t(s[4]),this.setHSL(a,c,l)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],r=s.length;if(r===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,this;if(r===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=yd[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Eo(e.r),this.g=Eo(e.g),this.b=Eo(e.b),this}copyLinearToSRGB(e){return this.r=Ao(e.r),this.g=Ao(e.g),this.b=Ao(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,i=this.g,s=this.b,r=Math.max(t,i,s),o=Math.min(t,i,s);let a,c;const l=(o+r)/2;if(o===r)a=0,c=0;else{const u=r-o;switch(c=l<=.5?u/(r+o):u/(2-r-o),r){case t:a=(i-s)/u+(i<s?6:0);break;case i:a=(s-t)/u+2;break;case s:a=(t-i)/u+4;break}a/=6}return e.h=a,e.s=c,e.l=l,e}getStyle(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"}offsetHSL(e,t,i){return this.getHSL(ln),ln.h+=e,ln.s+=t,ln.l+=i,this.setHSL(ln.h,ln.s,ln.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(ln),e.getHSL(Ks);const i=ho(ln.h,Ks.h,t),s=ho(ln.s,Ks.s,t),r=ho(ln.l,Ks.l,t);return this.setHSL(i,s,r),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Re.NAMES=yd;Re.prototype.isColor=!0;Re.prototype.r=1;Re.prototype.g=1;Re.prototype.b=1;class Ea extends kt{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Re(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.combine=zr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Ea.prototype.isMeshBasicMaterial=!0;const dt=new L,er=new ce;class Ct{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i===!0,this.usage=ks,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[e+s]=t.array[i+s];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let i=0;for(let s=0,r=e.length;s<r;s++){let o=e[s];o===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",s),o=new Re),t[i++]=o.r,t[i++]=o.g,t[i++]=o.b}return this}copyVector2sArray(e){const t=this.array;let i=0;for(let s=0,r=e.length;s<r;s++){let o=e[s];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",s),o=new ce),t[i++]=o.x,t[i++]=o.y}return this}copyVector3sArray(e){const t=this.array;let i=0;for(let s=0,r=e.length;s<r;s++){let o=e[s];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",s),o=new L),t[i++]=o.x,t[i++]=o.y,t[i++]=o.z}return this}copyVector4sArray(e){const t=this.array;let i=0;for(let s=0,r=e.length;s<r;s++){let o=e[s];o===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",s),o=new lt),t[i++]=o.x,t[i++]=o.y,t[i++]=o.z,t[i++]=o.w}return this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)er.fromBufferAttribute(this,t),er.applyMatrix3(e),this.setXY(t,er.x,er.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)dt.fromBufferAttribute(this,t),dt.applyMatrix3(e),this.setXYZ(t,dt.x,dt.y,dt.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)dt.x=this.getX(t),dt.y=this.getY(t),dt.z=this.getZ(t),dt.applyMatrix4(e),this.setXYZ(t,dt.x,dt.y,dt.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)dt.x=this.getX(t),dt.y=this.getY(t),dt.z=this.getZ(t),dt.applyNormalMatrix(e),this.setXYZ(t,dt.x,dt.y,dt.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)dt.x=this.getX(t),dt.y=this.getY(t),dt.z=this.getZ(t),dt.transformDirection(e),this.setXYZ(t,dt.x,dt.y,dt.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,s){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=s,this}setXYZW(e,t,i,s,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=s,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==ks&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}Ct.prototype.isBufferAttribute=!0;class xd extends Ct{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class wd extends Ct{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class jp extends Ct{constructor(e,t,i){super(new Uint16Array(e),t,i)}}jp.prototype.isFloat16BufferAttribute=!0;class gt extends Ct{constructor(e,t,i){super(new Float32Array(e),t,i)}}let Xp=0;const Zt=new De,ko=new st,Ti=new L,Xt=new nn,ms=new nn,Et=new L;class ut extends Zn{constructor(){super(),Object.defineProperty(this,"id",{value:Xp++}),this.uuid=fn(),this.name="",this.type="BufferGeometry",this.index=null,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(e){return Array.isArray(e)?this.index=new(vd(e)>65535?wd:xd)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const r=new Pt().getNormalMatrix(e);i.applyNormalMatrix(r),i.needsUpdate=!0}const s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Zt.makeRotationFromQuaternion(e),this.applyMatrix4(Zt),this}rotateX(e){return Zt.makeRotationX(e),this.applyMatrix4(Zt),this}rotateY(e){return Zt.makeRotationY(e),this.applyMatrix4(Zt),this}rotateZ(e){return Zt.makeRotationZ(e),this.applyMatrix4(Zt),this}translate(e,t,i){return Zt.makeTranslation(e,t,i),this.applyMatrix4(Zt),this}scale(e,t,i){return Zt.makeScale(e,t,i),this.applyMatrix4(Zt),this}lookAt(e){return ko.lookAt(e),ko.updateMatrix(),this.applyMatrix4(ko.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ti).negate(),this.translate(Ti.x,Ti.y,Ti.z),this}setFromPoints(e){const t=[];for(let i=0,s=e.length;i<s;i++){const r=e[i];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new gt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new nn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i<s;i++){const r=t[i];Xt.setFromBufferAttribute(r),this.morphTargetsRelative?(Et.addVectors(this.boundingBox.min,Xt.min),this.boundingBox.expandByPoint(Et),Et.addVectors(this.boundingBox.max,Xt.max),this.boundingBox.expandByPoint(Et)):(this.boundingBox.expandByPoint(Xt.min),this.boundingBox.expandByPoint(Xt.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 is);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new L,1/0);return}if(e){const i=this.boundingSphere.center;if(Xt.setFromBufferAttribute(e),t)for(let r=0,o=t.length;r<o;r++){const a=t[r];ms.setFromBufferAttribute(a),this.morphTargetsRelative?(Et.addVectors(Xt.min,ms.min),Xt.expandByPoint(Et),Et.addVectors(Xt.max,ms.max),Xt.expandByPoint(Et)):(Xt.expandByPoint(ms.min),Xt.expandByPoint(ms.max))}Xt.getCenter(i);let s=0;for(let r=0,o=e.count;r<o;r++)Et.fromBufferAttribute(e,r),s=Math.max(s,i.distanceToSquared(Et));if(t)for(let r=0,o=t.length;r<o;r++){const a=t[r],c=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)Et.fromBufferAttribute(a,l),c&&(Ti.fromBufferAttribute(e,l),Et.add(Ti)),s=Math.max(s,i.distanceToSquared(Et))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=e.array,s=t.position.array,r=t.normal.array,o=t.uv.array,a=s.length/3;t.tangent===void 0&&this.setAttribute("tangent",new Ct(new Float32Array(4*a),4));const c=t.tangent.array,l=[],u=[];for(let X=0;X<a;X++)l[X]=new L,u[X]=new L;const h=new L,f=new L,p=new L,g=new ce,_=new ce,w=new ce,v=new L,y=new L;function C(X,D,ge){h.fromArray(s,X*3),f.fromArray(s,D*3),p.fromArray(s,ge*3),g.fromArray(o,X*2),_.fromArray(o,D*2),w.fromArray(o,ge*2),f.sub(h),p.sub(h),_.sub(g),w.sub(g);const G=1/(_.x*w.y-w.x*_.y);isFinite(G)&&(v.copy(f).multiplyScalar(w.y).addScaledVector(p,-_.y).multiplyScalar(G),y.copy(p).multiplyScalar(_.x).addScaledVector(f,-w.x).multiplyScalar(G),l[X].add(v),l[D].add(v),l[ge].add(v),u[X].add(y),u[D].add(y),u[ge].add(y))}let S=this.groups;S.length===0&&(S=[{start:0,count:i.length}]);for(let X=0,D=S.length;X<D;++X){const ge=S[X],G=ge.start,V=ge.count;for(let Y=G,W=G+V;Y<W;Y+=3)C(i[Y+0],i[Y+1],i[Y+2])}const T=new L,P=new L,b=new L,z=new L;function oe(X){b.fromArray(r,X*3),z.copy(b);const D=l[X];T.copy(D),T.sub(b.multiplyScalar(b.dot(D))).normalize(),P.crossVectors(z,D);const G=P.dot(u[X])<0?-1:1;c[X*4]=T.x,c[X*4+1]=T.y,c[X*4+2]=T.z,c[X*4+3]=G}for(let X=0,D=S.length;X<D;++X){const ge=S[X],G=ge.start,V=ge.count;for(let Y=G,W=G+V;Y<W;Y+=3)oe(i[Y+0]),oe(i[Y+1]),oe(i[Y+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Ct(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);const s=new L,r=new L,o=new L,a=new L,c=new L,l=new L,u=new L,h=new L;if(e)for(let f=0,p=e.count;f<p;f+=3){const g=e.getX(f+0),_=e.getX(f+1),w=e.getX(f+2);s.fromBufferAttribute(t,g),r.fromBufferAttribute(t,_),o.fromBufferAttribute(t,w),u.subVectors(o,r),h.subVectors(s,r),u.cross(h),a.fromBufferAttribute(i,g),c.fromBufferAttribute(i,_),l.fromBufferAttribute(i,w),a.add(u),c.add(u),l.add(u),i.setXYZ(g,a.x,a.y,a.z),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(w,l.x,l.y,l.z)}else for(let f=0,p=t.count;f<p;f+=3)s.fromBufferAttribute(t,f+0),r.fromBufferAttribute(t,f+1),o.fromBufferAttribute(t,f+2),u.subVectors(o,r),h.subVectors(s,r),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}t===void 0&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const s in i){if(e.attributes[s]===void 0)continue;const o=i[s].array,a=e.attributes[s],c=a.array,l=a.itemSize*t,u=Math.min(c.length,o.length-l);for(let h=0,f=l;h<u;h++,f++)o[f]=c[h]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Et.fromBufferAttribute(e,t),Et.normalize(),e.setXYZ(t,Et.x,Et.y,Et.z)}toNonIndexed(){function e(a,c){const l=a.array,u=a.itemSize,h=a.normalized,f=new l.constructor(c.length*u);let p=0,g=0;for(let _=0,w=c.length;_<w;_++){a.isInterleavedBufferAttribute?p=c[_]*a.data.stride+a.offset:p=c[_]*u;for(let v=0;v<u;v++)f[g++]=l[p++]}return new Ct(f,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ut,i=this.index.array,s=this.attributes;for(const a in s){const c=s[a],l=e(c,i);t.setAttribute(a,l)}const r=this.morphAttributes;for(const a in r){const c=[],l=r[a];for(let u=0,h=l.length;u<h;u++){const f=l[u],p=e(f,i);c.push(p)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,c=o.length;a<c;a++){const l=o[a];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const c in i){const l=i[c];e.data.attributes[c]=l.toJSON(e.data)}const s={};let r=!1;for(const c in this.morphAttributes){const l=this.morphAttributes[c],u=[];for(let h=0,f=l.length;h<f;h++){const p=l[h];u.push(p.toJSON(e.data))}u.length>0&&(s[c]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const l in s){const u=s[l];this.setAttribute(l,u.clone(t))}const r=e.morphAttributes;for(const l in r){const u=[],h=r[l];for(let f=0,p=h.length;f<p;f++)u.push(h[f].clone(t));this.morphAttributes[l]=u}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let l=0,u=o.length;l<u;l++){const h=o[l];this.addGroup(h.start,h.count,h.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}ut.prototype.isBufferGeometry=!0;const Fl=new De,Ei=new ss,Lo=new is,Nn=new L,On=new L,Fn=new L,Ro=new L,Io=new L,Po=new L,tr=new L,nr=new L,ir=new L,sr=new ce,rr=new ce,or=new ce,Do=new L,ar=new L;class Ot extends st{constructor(e=new ut,t=new Ea){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){const a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const i=this.geometry,s=this.material,r=this.matrixWorld;if(s===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),Lo.copy(i.boundingSphere),Lo.applyMatrix4(r),e.ray.intersectsSphere(Lo)===!1)||(Fl.copy(r).invert(),Ei.copy(e.ray).applyMatrix4(Fl),i.boundingBox!==null&&Ei.intersectsBox(i.boundingBox)===!1))return;let o;if(i.isBufferGeometry){const a=i.index,c=i.attributes.position,l=i.morphAttributes.position,u=i.morphTargetsRelative,h=i.attributes.uv,f=i.attributes.uv2,p=i.groups,g=i.drawRange;if(a!==null)if(Array.isArray(s))for(let _=0,w=p.length;_<w;_++){const v=p[_],y=s[v.materialIndex],C=Math.max(v.start,g.start),S=Math.min(a.count,Math.min(v.start+v.count,g.start+g.count));for(let T=C,P=S;T<P;T+=3){const b=a.getX(T),z=a.getX(T+1),oe=a.getX(T+2);o=lr(this,y,e,Ei,c,l,u,h,f,b,z,oe),o&&(o.faceIndex=Math.floor(T/3),o.face.materialIndex=v.materialIndex,t.push(o))}}else{const _=Math.max(0,g.start),w=Math.min(a.count,g.start+g.count);for(let v=_,y=w;v<y;v+=3){const C=a.getX(v),S=a.getX(v+1),T=a.getX(v+2);o=lr(this,s,e,Ei,c,l,u,h,f,C,S,T),o&&(o.faceIndex=Math.floor(v/3),t.push(o))}}else if(c!==void 0)if(Array.isArray(s))for(let _=0,w=p.length;_<w;_++){const v=p[_],y=s[v.materialIndex],C=Math.max(v.start,g.start),S=Math.min(c.count,Math.min(v.start+v.count,g.start+g.count));for(let T=C,P=S;T<P;T+=3){const b=T,z=T+1,oe=T+2;o=lr(this,y,e,Ei,c,l,u,h,f,b,z,oe),o&&(o.faceIndex=Math.floor(T/3),o.face.materialIndex=v.materialIndex,t.push(o))}}else{const _=Math.max(0,g.start),w=Math.min(c.count,g.start+g.count);for(let v=_,y=w;v<y;v+=3){const C=v,S=v+1,T=v+2;o=lr(this,s,e,Ei,c,l,u,h,f,C,S,T),o&&(o.faceIndex=Math.floor(v/3),t.push(o))}}}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}Ot.prototype.isMesh=!0;function Yp(n,e,t,i,s,r,o,a){let c;if(e.side===Mt?c=i.intersectTriangle(o,r,s,!0,a):c=i.intersectTriangle(s,r,o,e.side!==Yi,a),c===null)return null;ar.copy(a),ar.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(ar);return l<t.near||l>t.far?null:{distance:l,point:ar.clone(),object:n}}function lr(n,e,t,i,s,r,o,a,c,l,u,h){Nn.fromBufferAttribute(s,l),On.fromBufferAttribute(s,u),Fn.fromBufferAttribute(s,h);const f=n.morphTargetInfluences;if(r&&f){tr.set(0,0,0),nr.set(0,0,0),ir.set(0,0,0);for(let g=0,_=r.length;g<_;g++){const w=f[g],v=r[g];w!==0&&(Ro.fromBufferAttribute(v,l),Io.fromBufferAttribute(v,u),Po.fromBufferAttribute(v,h),o?(tr.addScaledVector(Ro,w),nr.addScaledVector(Io,w),ir.addScaledVector(Po,w)):(tr.addScaledVector(Ro.sub(Nn),w),nr.addScaledVector(Io.sub(On),w),ir.addScaledVector(Po.sub(Fn),w)))}Nn.add(tr),On.add(nr),Fn.add(ir)}n.isSkinnedMesh&&(n.boneTransform(l,Nn),n.boneTransform(u,On),n.boneTransform(h,Fn));const p=Yp(n,e,t,i,Nn,On,Fn,Do);if(p){a&&(sr.fromBufferAttribute(a,l),rr.fromBufferAttribute(a,u),or.fromBufferAttribute(a,h),p.uv=St.getUV(Do,Nn,On,Fn,sr,rr,or,new ce)),c&&(sr.fromBufferAttribute(c,l),rr.fromBufferAttribute(c,u),or.fromBufferAttribute(c,h),p.uv2=St.getUV(Do,Nn,On,Fn,sr,rr,or,new ce));const g={a:l,b:u,c:h,normal:new L,materialIndex:0};St.getNormal(Nn,On,Fn,g.normal),p.face=g}return p}class zs extends ut{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const c=[],l=[],u=[],h=[];let f=0,p=0;g("z","y","x",-1,-1,i,t,e,o,r,0),g("z","y","x",1,-1,i,t,-e,o,r,1),g("x","z","y",1,1,e,i,t,s,o,2),g("x","z","y",1,-1,e,i,-t,s,o,3),g("x","y","z",1,-1,e,t,i,s,r,4),g("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(c),this.setAttribute("position",new gt(l,3)),this.setAttribute("normal",new gt(u,3)),this.setAttribute("uv",new gt(h,2));function g(_,w,v,y,C,S,T,P,b,z,oe){const X=S/b,D=T/z,ge=S/2,G=T/2,V=P/2,Y=b+1,W=z+1;let Z=0,fe=0;const _e=new L;for(let ne=0;ne<W;ne++){const ie=ne*D-G;for(let xe=0;xe<Y;xe++){const ve=xe*X-ge;_e[_]=ve*y,_e[w]=ie*C,_e[v]=V,l.push(_e.x,_e.y,_e.z),_e[_]=0,_e[w]=0,_e[v]=P>0?1:-1,u.push(_e.x,_e.y,_e.z),h.push(xe/b),h.push(1-ne/z),Z+=1}}for(let ne=0;ne<z;ne++)for(let ie=0;ie<b;ie++){const xe=f+ie+Y*ne,ve=f+ie+Y*(ne+1),Ce=f+(ie+1)+Y*(ne+1),Ne=f+(ie+1)+Y*ne;c.push(xe,ve,Ne),c.push(ve,Ce,Ne),fe+=6}a.addGroup(p,fe,oe),p+=fe,f+=Z}}static fromJSON(e){return new zs(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ji(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const s=n[t][i];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?e[t][i]=s.clone():Array.isArray(s)?e[t][i]=s.slice():e[t][i]=s}}return e}function Nt(n){const e={};for(let t=0;t<n.length;t++){const i=Ji(n[t]);for(const s in i)e[s]=i[s]}return e}const Zp={clone:Ji,merge:Nt};var Jp=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,Qp=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class di extends kt{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Jp,this.fragmentShader=Qp,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ji(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}di.prototype.isShaderMaterial=!0;class Aa extends st{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new De,this.projectionMatrix=new De,this.projectionMatrixInverse=new De}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}Aa.prototype.isCamera=!0;class zt extends Aa{constructor(e=50,t=1,i=.1,s=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ea*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(uo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ea*2*Math.atan(Math.tan(uo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(uo*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,l=o.fullHeight;r+=o.offsetX*s/c,t-=o.offsetY*i/l,s*=o.width/c,i*=o.height/l}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}zt.prototype.isPerspectiveCamera=!0;const Ai=90,ki=1;class ka extends st{constructor(e,t,i){if(super(),this.type="CubeCamera",i.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=i;const s=new zt(Ai,ki,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new L(1,0,0)),this.add(s);const r=new zt(Ai,ki,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new L(-1,0,0)),this.add(r);const o=new zt(Ai,ki,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new L(0,1,0)),this.add(o);const a=new zt(Ai,ki,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new L(0,-1,0)),this.add(a);const c=new zt(Ai,ki,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new L(0,0,1)),this.add(c);const l=new zt(Ai,ki,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new L(0,0,-1)),this.add(l)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[s,r,o,a,c,l]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const f=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,s),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,c),i.texture.generateMipmaps=f,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(h),e.xr.enabled=u}}class Wr extends Dt{constructor(e,t,i,s,r,o,a,c,l,u){e=e!==void 0?e:[],t=t!==void 0?t:Bs,super(e,t,i,s,r,o,a,c,l,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Wr.prototype.isCubeTexture=!0;class bd extends Kt{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Wr(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Qt,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Ht,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={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 );

				}
			`},s=new zs(5,5,5),r=new di({name:"CubemapFromEquirect",uniforms:Ji(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Mt,blending:Hn});r.uniforms.tEquirect.value=t;const o=new Ot(s,r),a=t.minFilter;return t.minFilter===Ur&&(t.minFilter=Qt),new ka(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}bd.prototype.isWebGLCubeRenderTarget=!0;const No=new L,Kp=new L,em=new Pt;class Sn{constructor(e=new L(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,s){return this.normal.set(e,t,i),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const s=No.subVectors(i,t).cross(Kp.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const i=e.delta(No),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||em.getNormalMatrix(e),s=this.coplanarPoint(No).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}Sn.prototype.isPlane=!0;const Li=new is,cr=new L;class qr{constructor(e=new Sn,t=new Sn,i=new Sn,s=new Sn,r=new Sn,o=new Sn){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){const t=this.planes,i=e.elements,s=i[0],r=i[1],o=i[2],a=i[3],c=i[4],l=i[5],u=i[6],h=i[7],f=i[8],p=i[9],g=i[10],_=i[11],w=i[12],v=i[13],y=i[14],C=i[15];return t[0].setComponents(a-s,h-c,_-f,C-w).normalize(),t[1].setComponents(a+s,h+c,_+f,C+w).normalize(),t[2].setComponents(a+r,h+l,_+p,C+v).normalize(),t[3].setComponents(a-r,h-l,_-p,C-v).normalize(),t[4].setComponents(a-o,h-u,_-g,C-y).normalize(),t[5].setComponents(a+o,h+u,_+g,C+y).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Li.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Li)}intersectsSprite(e){return Li.center.set(0,0,0),Li.radius=.7071067811865476,Li.applyMatrix4(e.matrixWorld),this.intersectsSphere(Li)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const s=t[i];if(cr.x=s.normal.x>0?e.max.x:e.min.x,cr.y=s.normal.y>0?e.max.y:e.min.y,cr.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(cr)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Md(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function tm(n,e){const t=e.isWebGL2,i=new WeakMap;function s(l,u){const h=l.array,f=l.usage,p=n.createBuffer();n.bindBuffer(u,p),n.bufferData(u,h,f),l.onUploadCallback();let g=5126;return h instanceof Float32Array?g=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?l.isFloat16BufferAttribute?t?g=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):g=5123:h instanceof Int16Array?g=5122:h instanceof Uint32Array?g=5125:h instanceof Int32Array?g=5124:h instanceof Int8Array?g=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(g=5121),{buffer:p,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:l.version}}function r(l,u,h){const f=u.array,p=u.updateRange;n.bindBuffer(h,l),p.count===-1?n.bufferSubData(h,0,f):(t?n.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f,p.offset,p.count):n.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f.subarray(p.offset,p.offset+p.count)),p.count=-1)}function o(l){return l.isInterleavedBufferAttribute&&(l=l.data),i.get(l)}function a(l){l.isInterleavedBufferAttribute&&(l=l.data);const u=i.get(l);u&&(n.deleteBuffer(u.buffer),i.delete(l))}function c(l,u){if(l.isGLBufferAttribute){const f=i.get(l);(!f||f.version<l.version)&&i.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);const h=i.get(l);h===void 0?i.set(l,s(l,u)):h.version<l.version&&(r(h.buffer,l,u),h.version=l.version)}return{get:o,remove:a,update:c}}class La extends ut{constructor(e=1,t=1,i=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:s};const r=e/2,o=t/2,a=Math.floor(i),c=Math.floor(s),l=a+1,u=c+1,h=e/a,f=t/c,p=[],g=[],_=[],w=[];for(let v=0;v<u;v++){const y=v*f-o;for(let C=0;C<l;C++){const S=C*h-r;g.push(S,-y,0),_.push(0,0,1),w.push(C/a),w.push(1-v/c)}}for(let v=0;v<c;v++)for(let y=0;y<a;y++){const C=y+l*v,S=y+l*(v+1),T=y+1+l*(v+1),P=y+1+l*v;p.push(C,S,P),p.push(S,T,P)}this.setIndex(p),this.setAttribute("position",new gt(g,3)),this.setAttribute("normal",new gt(_,3)),this.setAttribute("uv",new gt(w,2))}static fromJSON(e){return new La(e.width,e.height,e.widthSegments,e.heightSegments)}}var nm=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`,im=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,sm=`#ifdef USE_ALPHATEST
	if ( diffuseColor.a < alphaTest ) discard;
#endif`,rm=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,om=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,am=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,lm="vec3 transformed = vec3( position );",cm=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,dm=`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 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 );
}
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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 );
	float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
	float D = D_GGX( alpha, dotNH );
	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 * transposeMat3( 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 );
}
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 );
}
#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`,um=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vUv );
		vec2 dSTdy = dFdy( vUv );
		float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
		vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
		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`,hm=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#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`,fm=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,pm=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,mm=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,gm=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,_m=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,vm=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	varying vec3 vColor;
#endif`,ym=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif`,xm=`#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; }
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 color ) { return dot( color, vec3( 0.3333 ) ); }
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;
};
struct GeometricContext {
	vec3 position;
	vec3 normal;
	vec3 viewDir;
#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal;
#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 );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
float linearToRelativeLuminance( const in vec3 color ) {
	vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );
	return dot( weights, color.rgb );
}
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 );
}`,wm=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_maxMipLevel 8.0
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_maxTileSize 256.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 );
		float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );
		vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );
		vec2 f = fract( uv );
		uv += 0.5 - f;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		if ( mipInt < cubeUV_maxMipLevel ) {
			uv.y += 2.0 * cubeUV_maxTileSize;
		}
		uv.y += filterInt * 2.0 * cubeUV_minTileSize;
		uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );
		uv *= texelSize;
		vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
		uv.x += texelSize;
		vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
		uv.y += texelSize;
		vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
		uv.x -= texelSize;
		vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;
		vec3 tm = mix( tl, tr, f.x );
		vec3 bm = mix( bl, br, f.x );
		return mix( tm, bm, f.y );
	}
	#define r0 1.0
	#define v0 0.339
	#define m0 - 2.0
	#define r1 0.8
	#define v1 0.276
	#define m1 - 1.0
	#define r4 0.4
	#define v4 0.046
	#define m4 2.0
	#define r5 0.305
	#define v5 0.016
	#define m5 3.0
	#define r6 0.21
	#define v6 0.0038
	#define m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= r1 ) {
			mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;
		} else if ( roughness >= r4 ) {
			mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;
		} else if ( roughness >= r5 ) {
			mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;
		} else if ( roughness >= r6 ) {
			mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );
		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`,bm=`vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
	mat3 m = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
	transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,Mm=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,Sm=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`,Cm=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vUv );
	emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,Tm=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,Em="gl_FragColor = linearToOutputTexel( gl_FragColor );",Am=`
vec4 LinearToLinear( in vec4 value ) {
	return value;
}
vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
	return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );
}
vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
	return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );
}
vec4 sRGBToLinear( 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 LinearTosRGB( 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 );
}
vec4 RGBEToLinear( in vec4 value ) {
	return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
}
vec4 LinearToRGBE( in vec4 value ) {
	float maxComponent = max( max( value.r, value.g ), value.b );
	float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
	return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
}
vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
	return vec4( value.rgb * value.a * maxRange, 1.0 );
}
vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
	float maxRGB = max( value.r, max( value.g, value.b ) );
	float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
	M = ceil( M * 255.0 ) / 255.0;
	return vec4( value.rgb / ( M * maxRange ), M );
}
vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
	return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
}
vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
	float maxRGB = max( value.r, max( value.g, value.b ) );
	float D = max( maxRange / maxRGB, 1.0 );
	D = clamp( floor( D ) / 255.0, 0.0, 1.0 );
	return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
}`,km=`#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
		envColor = envMapTexelToLinear( envColor );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#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`,Lm=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,Rm=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,Im=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,Pm=`#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`,Dm=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,Nm=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,Om=`#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`,Fm=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,Bm=`#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 texture2D( gradientMap, coord ).rgb;
	#else
		return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
	#endif
}`,$m=`#ifdef USE_LIGHTMAP
	vec4 lightMapTexel = texture2D( lightMap, vUv2 );
	vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
	#ifndef PHYSICALLY_CORRECT_LIGHTS
		lightMapIrradiance *= PI;
	#endif
	reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,zm=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,Hm=`vec3 diffuse = vec3( 1.0 );
GeometricContext geometry;
geometry.position = mvPosition.xyz;
geometry.normal = normalize( transformedNormal );
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );
GeometricContext backGeometry;
backGeometry.position = geometry.position;
backGeometry.normal = -geometry.normal;
backGeometry.viewDir = geometry.viewDir;
vLightFront = vec3( 0.0 );
vIndirectFront = vec3( 0.0 );
#ifdef DOUBLE_SIDED
	vLightBack = vec3( 0.0 );
	vIndirectBack = vec3( 0.0 );
#endif
IncidentLight directLight;
float dotNL;
vec3 directLightColor_Diffuse;
vIndirectFront += getAmbientLightIrradiance( ambientLightColor );
vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );
#ifdef DOUBLE_SIDED
	vIndirectBack += getAmbientLightIrradiance( ambientLightColor );
	vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );
#endif
#if NUM_POINT_LIGHTS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		getPointLightInfo( pointLights[ i ], geometry, directLight );
		dotNL = dot( geometry.normal, directLight.direction );
		directLightColor_Diffuse = directLight.color;
		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
		#ifdef DOUBLE_SIDED
			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
		#endif
	}
	#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHTS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		getSpotLightInfo( spotLights[ i ], geometry, directLight );
		dotNL = dot( geometry.normal, directLight.direction );
		directLightColor_Diffuse = directLight.color;
		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
		#ifdef DOUBLE_SIDED
			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
		#endif
	}
	#pragma unroll_loop_end
#endif
#if NUM_DIR_LIGHTS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );
		dotNL = dot( geometry.normal, directLight.direction );
		directLightColor_Diffuse = directLight.color;
		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
		#ifdef DOUBLE_SIDED
			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;
		#endif
	}
	#pragma unroll_loop_end
#endif
#if NUM_HEMI_LIGHTS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
		vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
		#ifdef DOUBLE_SIDED
			vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );
		#endif
	}
	#pragma unroll_loop_end
#endif`,Um=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
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 ) {
	#if defined ( PHYSICALLY_CORRECT_LIGHTS )
		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
		if ( cutoffDistance > 0.0 ) {
			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
		}
		return distanceFalloff;
	#else
		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
		}
		return 1.0;
	#endif
}
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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometry.position;
		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 GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometry.position;
		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`,Vm=`#if defined( USE_ENVMAP )
	#ifdef ENVMAP_MODE_REFRACTION
		uniform float refractionRatio;
	#endif
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#if defined( ENVMAP_TYPE_CUBE_UV )
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, 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 ) {
		#if defined( ENVMAP_TYPE_CUBE_UV )
			vec3 reflectVec;
			#ifdef ENVMAP_MODE_REFLECTION
				reflectVec = reflect( - viewDir, normal );
				reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			#else
				reflectVec = refract( - viewDir, normal, refractionRatio );
			#endif
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
#endif`,Gm=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,Wm=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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
#define Material_LightProbeLOD( material )	(0)`,qm=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,jm=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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
#define Material_LightProbeLOD( material )	(0)`,Xm=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
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
	#ifdef SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULARINTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
		#endif
		#ifdef USE_SPECULARCOLORMAP
			specularColorFactor *= specularColorMapTexelToLinear( texture2D( specularColorMap, vUv ) ).rgb;
		#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 = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), 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, vUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEENCOLORMAP
		material.sheenColor *= sheenColorMapTexelToLinear( texture2D( sheenColorMap, vUv ) ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEENROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
	#endif
#endif`,Ym=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
};
vec3 clearcoatSpecular = vec3( 0.0 );
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
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 ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometry.normal;
		vec3 viewDir = geometry.viewDir;
		vec3 position = geometry.position;
		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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		reflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#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 );
}`,Zm=`
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef USE_CLEARCOAT
	geometry.clearcoatNormal = clearcoatNormal;
#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, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	#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, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, 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, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, 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, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,Jm=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vUv2 );
		vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
		#ifndef PHYSICALLY_CORRECT_LIGHTS
			lightMapIrradiance *= PI;
		#endif
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometry.normal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,Qm=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`,Km=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,eg=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,tg=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		varying float vFragDepth;
		varying float vIsPerspective;
	#else
		uniform float logDepthBufFC;
	#endif
#endif`,ng=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		vFragDepth = 1.0 + gl_Position.w;
		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
	#else
		if ( isPerspectiveMatrix( projectionMatrix ) ) {
			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
			gl_Position.z *= gl_Position.w;
		}
	#endif
#endif`,ig=`#ifdef USE_MAP
	vec4 texelColor = texture2D( map, vUv );
	texelColor = mapTexelToLinear( texelColor );
	diffuseColor *= texelColor;
#endif`,sg=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,rg=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#ifdef USE_MAP
	vec4 mapTexel = texture2D( map, uv );
	diffuseColor *= mapTexelToLinear( mapTexel );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,og=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	uniform mat3 uvTransform;
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,ag=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vUv );
	metalnessFactor *= texelMetalness.b;
#endif`,lg=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,cg=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			if ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];
		}
	#else
		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
	#endif
#endif`,dg=`#ifdef USE_MORPHTARGETS
	uniform float morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
		uniform sampler2DArray morphTargetsTexture;
		uniform vec2 morphTargetsTextureSize;
		vec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {
			float texelIndex = float( vertexIndex * stride + offset );
			float y = floor( texelIndex / morphTargetsTextureSize.x );
			float x = texelIndex - y * morphTargetsTextureSize.x;
			vec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );
			return texture( morphTargetsTexture, morphUV ).xyz;
		}
	#else
		#ifndef USE_MORPHNORMALS
			uniform float morphTargetInfluences[ 8 ];
		#else
			uniform float morphTargetInfluences[ 4 ];
		#endif
	#endif
#endif`,ug=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			#ifndef USE_MORPHNORMALS
				if ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];
			#else
				if ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];
			#endif
		}
	#else
		transformed += morphTarget0 * morphTargetInfluences[ 0 ];
		transformed += morphTarget1 * morphTargetInfluences[ 1 ];
		transformed += morphTarget2 * morphTargetInfluences[ 2 ];
		transformed += morphTarget3 * morphTargetInfluences[ 3 ];
		#ifndef USE_MORPHNORMALS
			transformed += morphTarget4 * morphTargetInfluences[ 4 ];
			transformed += morphTarget5 * morphTargetInfluences[ 5 ];
			transformed += morphTarget6 * morphTargetInfluences[ 6 ];
			transformed += morphTarget7 * morphTargetInfluences[ 7 ];
		#endif
	#endif
#endif`,hg=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
	vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	#ifdef USE_TANGENT
		vec3 tangent = normalize( vTangent );
		vec3 bitangent = normalize( vBitangent );
		#ifdef DOUBLE_SIDED
			tangent = tangent * faceDirection;
			bitangent = bitangent * faceDirection;
		#endif
		#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
			mat3 vTBN = mat3( tangent, bitangent, normal );
		#endif
	#endif
#endif
vec3 geometryNormal = normal;`,fg=`#ifdef OBJECTSPACE_NORMALMAP
	normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( TANGENTSPACE_NORMALMAP )
	vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	#ifdef USE_TANGENT
		normal = normalize( vTBN * mapN );
	#else
		normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
	#endif
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,pg=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,mg=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,gg=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,_g=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef OBJECTSPACE_NORMALMAP
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
	vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
		vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
		vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
		vec2 st0 = dFdx( vUv.st );
		vec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );
		return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
	}
#endif`,vg=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = geometryNormal;
#endif`,yg=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	#ifdef USE_TANGENT
		clearcoatNormal = normalize( vTBN * clearcoatMapN );
	#else
		clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
	#endif
#endif`,xg=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif`,wg=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= transmissionAlpha + 0.1;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,bg=`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 vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
	vec4 r = vec4( fract( v * PackFactors ), v );
	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors );
}
vec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {
	return linearClipZ * ( near - far ) - near;
}
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 invClipZ, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * invClipZ - far );
}`,Mg=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,Sg=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,Cg=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,Tg=`#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`,Eg=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vUv );
	roughnessFactor *= texelRoughness.g;
#endif`,Ag=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,kg=`#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
		bool inFrustum = all( inFrustumVec );
		bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
		bool frustumTest = all( frustumTestVec );
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return shadow;
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
		vec3 lightToPosition = shadowCoord.xyz;
		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;
		vec3 bd3D = normalize( lightToPosition );
		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
			return (
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
			) * ( 1.0 / 9.0 );
		#else
			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
		#endif
	}
#endif`,Lg=`#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 shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			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 shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,Rg=`#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
		vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		vec4 shadowWorldPosition;
	#endif
	#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_SPOT_LIGHT_SHADOWS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );
		vSpotShadowCoord[ i ] = spotShadowMatrix[ 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`,Ig=`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.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.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	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.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,Pg=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,Dg=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	#ifdef BONE_TEXTURE
		uniform highp sampler2D boneTexture;
		uniform int boneTextureSize;
		mat4 getBoneMatrix( const in float i ) {
			float j = i * 4.0;
			float x = mod( j, float( boneTextureSize ) );
			float y = floor( j / float( boneTextureSize ) );
			float dx = 1.0 / float( boneTextureSize );
			float dy = 1.0 / float( boneTextureSize );
			y = dy * ( y + 0.5 );
			vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
			vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
			vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
			vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
			mat4 bone = mat4( v1, v2, v3, v4 );
			return bone;
		}
	#else
		uniform mat4 boneMatrices[ MAX_BONES ];
		mat4 getBoneMatrix( const in float i ) {
			mat4 bone = boneMatrices[ int(i) ];
			return bone;
		}
	#endif
#endif`,Ng=`#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`,Og=`#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`,Fg=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,Bg=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,$g=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,zg=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return toneMappingExposure * color;
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( 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 );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,Hg=`#ifdef USE_TRANSMISSION
	float transmissionAlpha = 1.0;
	float transmissionFactor = transmission;
	float thicknessFactor = thickness;
	#ifdef USE_TRANSMISSIONMAP
		transmissionFactor *= texture2D( transmissionMap, vUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		thicknessFactor *= texture2D( thicknessMap, vUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmission = getIBLVolumeRefraction(
		n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
		attenuationColor, attenuationDistance );
	totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );
	transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );
#endif`,Ug=`#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;
	vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, 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( float roughness, float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {
		float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		#ifdef TEXTURE_LOD_EXT
			return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
		#else
			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
		#endif
	}
	vec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {
		if ( attenuationDistance == 0.0 ) {
			return radiance;
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
		}
	}
	vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,
		vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,
		vec3 attenuationColor, float attenuationDistance ) {
		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;
		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
		vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
	}
#endif`,Vg=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
	varying vec2 vUv;
#endif`,Gg=`#ifdef USE_UV
	#ifdef UVS_VERTEX_ONLY
		vec2 vUv;
	#else
		varying vec2 vUv;
	#endif
	uniform mat3 uvTransform;
#endif`,Wg=`#ifdef USE_UV
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`,qg=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	varying vec2 vUv2;
#endif`,jg=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	attribute vec2 uv2;
	varying vec2 vUv2;
	uniform mat3 uv2Transform;
#endif`,Xg=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`,Yg=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const Zg=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Jg=`uniform sampler2D t2D;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	gl_FragColor = mapTexelToLinear( texColor );
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,Qg=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,Kg=`#include <envmap_common_pars_fragment>
uniform float opacity;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	vec3 vReflect = vWorldDirection;
	#include <envmap_fragment>
	gl_FragColor = envColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,e_=`#include <common>
#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 <skinbase_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;
}`,t_=`#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 <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#endif
}`,n_=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#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 <skinbase_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;
}`,i_=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,s_=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,r_=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	vec4 texColor = texture2D( tEquirect, sampleUV );
	gl_FragColor = mapTexelToLinear( texColor );
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,o_=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#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 <color_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,a_=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,l_=`#include <common>
#include <uv_pars_vertex>
#include <uv2_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 <uv2_vertex>
	#include <color_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>
}`,c_=`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 <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <cube_uv_reflection_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_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, vUv2 );
		reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,d_=`#define LAMBERT
varying vec3 vLightFront;
varying vec3 vIndirectFront;
#ifdef DOUBLE_SIDED
	varying vec3 vLightBack;
	varying vec3 vIndirectBack;
#endif
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <envmap_pars_vertex>
#include <bsdfs>
#include <lights_pars_begin>
#include <color_pars_vertex>
#include <fog_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 <uv2_vertex>
	#include <color_vertex>
	#include <beginnormal_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 <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <lights_lambert_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,u_=`uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
varying vec3 vLightFront;
varying vec3 vIndirectFront;
#ifdef DOUBLE_SIDED
	varying vec3 vLightBack;
	varying vec3 vIndirectBack;
#endif
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <cube_uv_reflection_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <fog_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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 <specularmap_fragment>
	#include <emissivemap_fragment>
	#ifdef DOUBLE_SIDED
		reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;
	#else
		reflectedLight.indirectDiffuse += vIndirectFront;
	#endif
	#include <lightmap_fragment>
	reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );
	#ifdef DOUBLE_SIDED
		reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
	#else
		reflectedLight.directDiffuse = vLightFront;
	#endif
	reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,h_=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#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 <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;
}`,f_=`#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 <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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_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 );
		matcapColor = matcapTexelToLinear( matcapColor );
	#else
		vec4 matcapColor = vec4( 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,p_=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	varying vec3 vViewPosition;
#endif
#include <common>
#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 <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>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	vViewPosition = - mvPosition.xyz;
#endif
}`,m_=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	varying vec3 vViewPosition;
#endif
#include <packing>
#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() {
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
}`,g_=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_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 <uv2_vertex>
	#include <color_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>
}`,__=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <cube_uv_reflection_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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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 <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 <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,v_=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <uv2_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 <uv2_vertex>
	#include <color_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
}`,y_=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULARINTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
	#ifdef USE_SPECULARCOLORMAP
		uniform sampler2D specularColorMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEENCOLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEENROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <bsdfs>
#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 <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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 <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_CLEARCOAT
		float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
	#endif
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,x_=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_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 <uv2_vertex>
	#include <color_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>
}`,w_=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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 <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 <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,b_=`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>
void main() {
	#include <color_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>
}`,M_=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,S_=`#include <common>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <beginnormal_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 <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,C_=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
}`,T_=`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 * vec4( 0.0, 0.0, 0.0, 1.0 );
	vec2 scale;
	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
	#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>
}`,E_=`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 <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
}`,je={alphamap_fragment:nm,alphamap_pars_fragment:im,alphatest_fragment:sm,alphatest_pars_fragment:rm,aomap_fragment:om,aomap_pars_fragment:am,begin_vertex:lm,beginnormal_vertex:cm,bsdfs:dm,bumpmap_pars_fragment:um,clipping_planes_fragment:hm,clipping_planes_pars_fragment:fm,clipping_planes_pars_vertex:pm,clipping_planes_vertex:mm,color_fragment:gm,color_pars_fragment:_m,color_pars_vertex:vm,color_vertex:ym,common:xm,cube_uv_reflection_fragment:wm,defaultnormal_vertex:bm,displacementmap_pars_vertex:Mm,displacementmap_vertex:Sm,emissivemap_fragment:Cm,emissivemap_pars_fragment:Tm,encodings_fragment:Em,encodings_pars_fragment:Am,envmap_fragment:km,envmap_common_pars_fragment:Lm,envmap_pars_fragment:Rm,envmap_pars_vertex:Im,envmap_physical_pars_fragment:Vm,envmap_vertex:Pm,fog_vertex:Dm,fog_pars_vertex:Nm,fog_fragment:Om,fog_pars_fragment:Fm,gradientmap_pars_fragment:Bm,lightmap_fragment:$m,lightmap_pars_fragment:zm,lights_lambert_vertex:Hm,lights_pars_begin:Um,lights_toon_fragment:Gm,lights_toon_pars_fragment:Wm,lights_phong_fragment:qm,lights_phong_pars_fragment:jm,lights_physical_fragment:Xm,lights_physical_pars_fragment:Ym,lights_fragment_begin:Zm,lights_fragment_maps:Jm,lights_fragment_end:Qm,logdepthbuf_fragment:Km,logdepthbuf_pars_fragment:eg,logdepthbuf_pars_vertex:tg,logdepthbuf_vertex:ng,map_fragment:ig,map_pars_fragment:sg,map_particle_fragment:rg,map_particle_pars_fragment:og,metalnessmap_fragment:ag,metalnessmap_pars_fragment:lg,morphnormal_vertex:cg,morphtarget_pars_vertex:dg,morphtarget_vertex:ug,normal_fragment_begin:hg,normal_fragment_maps:fg,normal_pars_fragment:pg,normal_pars_vertex:mg,normal_vertex:gg,normalmap_pars_fragment:_g,clearcoat_normal_fragment_begin:vg,clearcoat_normal_fragment_maps:yg,clearcoat_pars_fragment:xg,output_fragment:wg,packing:bg,premultiplied_alpha_fragment:Mg,project_vertex:Sg,dithering_fragment:Cg,dithering_pars_fragment:Tg,roughnessmap_fragment:Eg,roughnessmap_pars_fragment:Ag,shadowmap_pars_fragment:kg,shadowmap_pars_vertex:Lg,shadowmap_vertex:Rg,shadowmask_pars_fragment:Ig,skinbase_vertex:Pg,skinning_pars_vertex:Dg,skinning_vertex:Ng,skinnormal_vertex:Og,specularmap_fragment:Fg,specularmap_pars_fragment:Bg,tonemapping_fragment:$g,tonemapping_pars_fragment:zg,transmission_fragment:Hg,transmission_pars_fragment:Ug,uv_pars_fragment:Vg,uv_pars_vertex:Gg,uv_vertex:Wg,uv2_pars_fragment:qg,uv2_pars_vertex:jg,uv2_vertex:Xg,worldpos_vertex:Yg,background_vert:Zg,background_frag:Jg,cube_vert:Qg,cube_frag:Kg,depth_vert:e_,depth_frag:t_,distanceRGBA_vert:n_,distanceRGBA_frag:i_,equirect_vert:s_,equirect_frag:r_,linedashed_vert:o_,linedashed_frag:a_,meshbasic_vert:l_,meshbasic_frag:c_,meshlambert_vert:d_,meshlambert_frag:u_,meshmatcap_vert:h_,meshmatcap_frag:f_,meshnormal_vert:p_,meshnormal_frag:m_,meshphong_vert:g_,meshphong_frag:__,meshphysical_vert:v_,meshphysical_frag:y_,meshtoon_vert:x_,meshtoon_frag:w_,points_vert:b_,points_frag:M_,shadow_vert:S_,shadow_frag:C_,sprite_vert:T_,sprite_frag:E_},ye={common:{diffuse:{value:new Re(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Pt},uv2Transform:{value:new Pt},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ce(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Re(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Re(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pt}},sprite:{diffuse:{value:new Re(16777215)},opacity:{value:1},center:{value:new ce(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pt}}},hn={basic:{uniforms:Nt([ye.common,ye.specularmap,ye.envmap,ye.aomap,ye.lightmap,ye.fog]),vertexShader:je.meshbasic_vert,fragmentShader:je.meshbasic_frag},lambert:{uniforms:Nt([ye.common,ye.specularmap,ye.envmap,ye.aomap,ye.lightmap,ye.emissivemap,ye.fog,ye.lights,{emissive:{value:new Re(0)}}]),vertexShader:je.meshlambert_vert,fragmentShader:je.meshlambert_frag},phong:{uniforms:Nt([ye.common,ye.specularmap,ye.envmap,ye.aomap,ye.lightmap,ye.emissivemap,ye.bumpmap,ye.normalmap,ye.displacementmap,ye.fog,ye.lights,{emissive:{value:new Re(0)},specular:{value:new Re(1118481)},shininess:{value:30}}]),vertexShader:je.meshphong_vert,fragmentShader:je.meshphong_frag},standard:{uniforms:Nt([ye.common,ye.envmap,ye.aomap,ye.lightmap,ye.emissivemap,ye.bumpmap,ye.normalmap,ye.displacementmap,ye.roughnessmap,ye.metalnessmap,ye.fog,ye.lights,{emissive:{value:new Re(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag},toon:{uniforms:Nt([ye.common,ye.aomap,ye.lightmap,ye.emissivemap,ye.bumpmap,ye.normalmap,ye.displacementmap,ye.gradientmap,ye.fog,ye.lights,{emissive:{value:new Re(0)}}]),vertexShader:je.meshtoon_vert,fragmentShader:je.meshtoon_frag},matcap:{uniforms:Nt([ye.common,ye.bumpmap,ye.normalmap,ye.displacementmap,ye.fog,{matcap:{value:null}}]),vertexShader:je.meshmatcap_vert,fragmentShader:je.meshmatcap_frag},points:{uniforms:Nt([ye.points,ye.fog]),vertexShader:je.points_vert,fragmentShader:je.points_frag},dashed:{uniforms:Nt([ye.common,ye.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:je.linedashed_vert,fragmentShader:je.linedashed_frag},depth:{uniforms:Nt([ye.common,ye.displacementmap]),vertexShader:je.depth_vert,fragmentShader:je.depth_frag},normal:{uniforms:Nt([ye.common,ye.bumpmap,ye.normalmap,ye.displacementmap,{opacity:{value:1}}]),vertexShader:je.meshnormal_vert,fragmentShader:je.meshnormal_frag},sprite:{uniforms:Nt([ye.sprite,ye.fog]),vertexShader:je.sprite_vert,fragmentShader:je.sprite_frag},background:{uniforms:{uvTransform:{value:new Pt},t2D:{value:null}},vertexShader:je.background_vert,fragmentShader:je.background_frag},cube:{uniforms:Nt([ye.envmap,{opacity:{value:1}}]),vertexShader:je.cube_vert,fragmentShader:je.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:je.equirect_vert,fragmentShader:je.equirect_frag},distanceRGBA:{uniforms:Nt([ye.common,ye.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:je.distanceRGBA_vert,fragmentShader:je.distanceRGBA_frag},shadow:{uniforms:Nt([ye.lights,ye.fog,{color:{value:new Re(0)},opacity:{value:1}}]),vertexShader:je.shadow_vert,fragmentShader:je.shadow_frag}};hn.physical={uniforms:Nt([hn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ce(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Re(0)},sheenColorMap:{value:null},sheenRoughness:{value:0},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ce},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Re(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularColor:{value:new Re(1,1,1)},specularColorMap:{value:null}}]),vertexShader:je.meshphysical_vert,fragmentShader:je.meshphysical_frag};function A_(n,e,t,i,s){const r=new Re(0);let o=0,a,c,l=null,u=0,h=null;function f(g,_){let w=!1,v=_.isScene===!0?_.background:null;v&&v.isTexture&&(v=e.get(v));const y=n.xr,C=y.getSession&&y.getSession();C&&C.environmentBlendMode==="additive"&&(v=null),v===null?p(r,o):v&&v.isColor&&(p(v,1),w=!0),(n.autoClear||w)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Hr)?(c===void 0&&(c=new Ot(new zs(1,1,1),new di({name:"BackgroundCubeMaterial",uniforms:Ji(hn.cube.uniforms),vertexShader:hn.cube.vertexShader,fragmentShader:hn.cube.fragmentShader,side:Mt,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(S,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,(l!==v||u!==v.version||h!==n.toneMapping)&&(c.material.needsUpdate=!0,l=v,u=v.version,h=n.toneMapping),g.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(a===void 0&&(a=new Ot(new La(2,2),new di({name:"BackgroundMaterial",uniforms:Ji(hn.background.uniforms),vertexShader:hn.background.vertexShader,fragmentShader:hn.background.fragmentShader,side:Xi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=v,v.matrixAutoUpdate===!0&&v.updateMatrix(),a.material.uniforms.uvTransform.value.copy(v.matrix),(l!==v||u!==v.version||h!==n.toneMapping)&&(a.material.needsUpdate=!0,l=v,u=v.version,h=n.toneMapping),g.unshift(a,a.geometry,a.material,0,0,null))}function p(g,_){t.buffers.color.setClear(g.r,g.g,g.b,_,s)}return{getClearColor:function(){return r},setClearColor:function(g,_=1){r.set(g),o=_,p(r,o)},getClearAlpha:function(){return o},setClearAlpha:function(g){o=g,p(r,o)},render:f}}function k_(n,e,t,i){const s=n.getParameter(34921),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},c=_(null);let l=c;function u(G,V,Y,W,Z){let fe=!1;if(o){const _e=g(W,Y,V);l!==_e&&(l=_e,f(l.object)),fe=w(W,Z),fe&&v(W,Z)}else{const _e=V.wireframe===!0;(l.geometry!==W.id||l.program!==Y.id||l.wireframe!==_e)&&(l.geometry=W.id,l.program=Y.id,l.wireframe=_e,fe=!0)}G.isInstancedMesh===!0&&(fe=!0),Z!==null&&t.update(Z,34963),fe&&(b(G,V,Y,W),Z!==null&&n.bindBuffer(34963,t.get(Z).buffer))}function h(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function f(G){return i.isWebGL2?n.bindVertexArray(G):r.bindVertexArrayOES(G)}function p(G){return i.isWebGL2?n.deleteVertexArray(G):r.deleteVertexArrayOES(G)}function g(G,V,Y){const W=Y.wireframe===!0;let Z=a[G.id];Z===void 0&&(Z={},a[G.id]=Z);let fe=Z[V.id];fe===void 0&&(fe={},Z[V.id]=fe);let _e=fe[W];return _e===void 0&&(_e=_(h()),fe[W]=_e),_e}function _(G){const V=[],Y=[],W=[];for(let Z=0;Z<s;Z++)V[Z]=0,Y[Z]=0,W[Z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:V,enabledAttributes:Y,attributeDivisors:W,object:G,attributes:{},index:null}}function w(G,V){const Y=l.attributes,W=G.attributes;let Z=0;for(const fe in W){const _e=Y[fe],ne=W[fe];if(_e===void 0||_e.attribute!==ne||_e.data!==ne.data)return!0;Z++}return l.attributesNum!==Z||l.index!==V}function v(G,V){const Y={},W=G.attributes;let Z=0;for(const fe in W){const _e=W[fe],ne={};ne.attribute=_e,_e.data&&(ne.data=_e.data),Y[fe]=ne,Z++}l.attributes=Y,l.attributesNum=Z,l.index=V}function y(){const G=l.newAttributes;for(let V=0,Y=G.length;V<Y;V++)G[V]=0}function C(G){S(G,0)}function S(G,V){const Y=l.newAttributes,W=l.enabledAttributes,Z=l.attributeDivisors;Y[G]=1,W[G]===0&&(n.enableVertexAttribArray(G),W[G]=1),Z[G]!==V&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](G,V),Z[G]=V)}function T(){const G=l.newAttributes,V=l.enabledAttributes;for(let Y=0,W=V.length;Y<W;Y++)V[Y]!==G[Y]&&(n.disableVertexAttribArray(Y),V[Y]=0)}function P(G,V,Y,W,Z,fe){i.isWebGL2===!0&&(Y===5124||Y===5125)?n.vertexAttribIPointer(G,V,Y,Z,fe):n.vertexAttribPointer(G,V,Y,W,Z,fe)}function b(G,V,Y,W){if(i.isWebGL2===!1&&(G.isInstancedMesh||W.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();const Z=W.attributes,fe=Y.getAttributes(),_e=V.defaultAttributeValues;for(const ne in fe){const ie=fe[ne];if(ie.location>=0){let xe=Z[ne];if(xe===void 0&&(ne==="instanceMatrix"&&G.instanceMatrix&&(xe=G.instanceMatrix),ne==="instanceColor"&&G.instanceColor&&(xe=G.instanceColor)),xe!==void 0){const ve=xe.normalized,Ce=xe.itemSize,Ne=t.get(xe);if(Ne===void 0)continue;const le=Ne.buffer,Be=Ne.type,Ie=Ne.bytesPerElement;if(xe.isInterleavedBufferAttribute){const Se=xe.data,q=Se.stride,ke=xe.offset;if(Se&&Se.isInstancedInterleavedBuffer){for(let K=0;K<ie.locationSize;K++)S(ie.location+K,Se.meshPerAttribute);G.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let K=0;K<ie.locationSize;K++)C(ie.location+K);n.bindBuffer(34962,le);for(let K=0;K<ie.locationSize;K++)P(ie.location+K,Ce/ie.locationSize,Be,ve,q*Ie,(ke+Ce/ie.locationSize*K)*Ie)}else{if(xe.isInstancedBufferAttribute){for(let Se=0;Se<ie.locationSize;Se++)S(ie.location+Se,xe.meshPerAttribute);G.isInstancedMesh!==!0&&W._maxInstanceCount===void 0&&(W._maxInstanceCount=xe.meshPerAttribute*xe.count)}else for(let Se=0;Se<ie.locationSize;Se++)C(ie.location+Se);n.bindBuffer(34962,le);for(let Se=0;Se<ie.locationSize;Se++)P(ie.location+Se,Ce/ie.locationSize,Be,ve,Ce*Ie,Ce/ie.locationSize*Se*Ie)}}else if(_e!==void 0){const ve=_e[ne];if(ve!==void 0)switch(ve.length){case 2:n.vertexAttrib2fv(ie.location,ve);break;case 3:n.vertexAttrib3fv(ie.location,ve);break;case 4:n.vertexAttrib4fv(ie.location,ve);break;default:n.vertexAttrib1fv(ie.location,ve)}}}}T()}function z(){D();for(const G in a){const V=a[G];for(const Y in V){const W=V[Y];for(const Z in W)p(W[Z].object),delete W[Z];delete V[Y]}delete a[G]}}function oe(G){if(a[G.id]===void 0)return;const V=a[G.id];for(const Y in V){const W=V[Y];for(const Z in W)p(W[Z].object),delete W[Z];delete V[Y]}delete a[G.id]}function X(G){for(const V in a){const Y=a[V];if(Y[G.id]===void 0)continue;const W=Y[G.id];for(const Z in W)p(W[Z].object),delete W[Z];delete Y[G.id]}}function D(){ge(),l!==c&&(l=c,f(l.object))}function ge(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:u,reset:D,resetDefaultState:ge,dispose:z,releaseStatesOfGeometry:oe,releaseStatesOfProgram:X,initAttributes:y,enableAttribute:C,disableUnusedAttributes:T}}function L_(n,e,t,i){const s=i.isWebGL2;let r;function o(l){r=l}function a(l,u){n.drawArrays(r,l,u),t.update(u,r,1)}function c(l,u,h){if(h===0)return;let f,p;if(s)f=n,p="drawArraysInstanced";else if(f=e.get("ANGLE_instanced_arrays"),p="drawArraysInstancedANGLE",f===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}f[p](r,l,u,h),t.update(u,r,h)}this.setMode=o,this.render=a,this.renderInstances=c}function R_(n,e,t){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const b=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function r(b){if(b==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";b="mediump"}return b==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let a=t.precision!==void 0?t.precision:"highp";const c=r(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);const l=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=n.getParameter(34930),f=n.getParameter(35660),p=n.getParameter(3379),g=n.getParameter(34076),_=n.getParameter(34921),w=n.getParameter(36347),v=n.getParameter(36348),y=n.getParameter(36349),C=f>0,S=o||e.has("OES_texture_float"),T=C&&S,P=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:f,maxTextureSize:p,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:w,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:C,floatFragmentTextures:S,floatVertexTextures:T,maxSamples:P}}function I_(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Sn,a=new Pt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f,p){const g=h.length!==0||f||i!==0||s;return s=f,t=u(h,p,0),i=h.length,g},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,l()},this.setState=function(h,f,p){const g=h.clippingPlanes,_=h.clipIntersection,w=h.clipShadows,v=n.get(h);if(!s||g===null||g.length===0||r&&!w)r?u(null):l();else{const y=r?0:i,C=y*4;let S=v.clippingState||null;c.value=S,S=u(g,f,C,p);for(let T=0;T!==C;++T)S[T]=t[T];v.clippingState=S,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function l(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,f,p,g){const _=h!==null?h.length:0;let w=null;if(_!==0){if(w=c.value,g!==!0||w===null){const v=p+_*4,y=f.matrixWorldInverse;a.getNormalMatrix(y),(w===null||w.length<v)&&(w=new Float32Array(v));for(let C=0,S=p;C!==_;++C,S+=4)o.copy(h[C]).applyMatrix4(y,a),o.normal.toArray(w,S),w[S+3]=o.constant}c.value=w,c.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,w}}function P_(n){let e=new WeakMap;function t(o,a){return a===Jo?o.mapping=Bs:a===Qo&&(o.mapping=$s),o}function i(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===Jo||a===Qo)if(e.has(o)){const c=e.get(o).texture;return t(c,o.mapping)}else{const c=o.image;if(c&&c.height>0){const l=n.getRenderTarget(),u=new bd(c.height/2);return u.fromEquirectangularTexture(n,o),e.set(o,u),n.setRenderTarget(l),o.addEventListener("dispose",s),t(u.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class Ra extends Aa{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,s,r,o){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=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,c=s-t;if(this.view!==null&&this.view.enabled){const l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=l*this.view.offsetX,o=r+l*this.view.width,a-=u*this.view.offsetY,c=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,c,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}Ra.prototype.isOrthographicCamera=!0;class jr extends di{constructor(e){super(e),this.type="RawShaderMaterial"}}jr.prototype.isRawShaderMaterial=!0;const qi=4,Un=8,un=Math.pow(2,Un),Sd=[.125,.215,.35,.446,.526,.582],Cd=Un-qi+1+Sd.length,Ri=20,ui={[Gt]:0,[Vr]:1,[Ca]:2,[md]:3,[gd]:4,[_d]:5,[Sa]:6},Oo=new Ra,{_lodPlanes:gs,_sizeLods:Bl,_sigmas:dr}=O_(),$l=new Re;let Fo=null;const ri=(1+Math.sqrt(5))/2,Ii=1/ri,zl=[new L(1,1,1),new L(-1,1,1),new L(1,1,-1),new L(-1,1,-1),new L(0,ri,Ii),new L(0,ri,-Ii),new L(Ii,0,ri),new L(-Ii,0,ri),new L(ri,Ii,0),new L(-ri,Ii,0)];class D_{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=F_(Ri),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100){Fo=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Vl(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=Ul(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<gs.length;e++)gs[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Fo),e.scissorTest=!1,ur(e,0,0,e.width,e.height)}_fromTexture(e){Fo=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:At,minFilter:At,generateMipmaps:!1,type:qn,format:Vf,encoding:N_(e)?e.encoding:Ca,depthBuffer:!1},i=Hl(t);return i.depthBuffer=!e,this._pingPongRenderTarget=Hl(t),i}_compileMaterial(e){const t=new Ot(gs[0],e);this._renderer.compile(t,Oo)}_sceneToCubeUV(e,t,i,s){const a=new zt(90,1,t,i),c=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,f=u.outputEncoding,p=u.toneMapping;u.getClearColor($l),u.toneMapping=oi,u.outputEncoding=Gt,u.autoClear=!1;const g=new Ea({name:"PMREM.Background",side:Mt,depthWrite:!1,depthTest:!1}),_=new Ot(new zs,g);let w=!1;const v=e.background;v?v.isColor&&(g.color.copy(v),e.background=null,w=!0):(g.color.copy($l),w=!0);for(let y=0;y<6;y++){const C=y%3;C==0?(a.up.set(0,c[y],0),a.lookAt(l[y],0,0)):C==1?(a.up.set(0,0,c[y]),a.lookAt(0,l[y],0)):(a.up.set(0,c[y],0),a.lookAt(0,0,l[y])),ur(s,C*un,y>2?un:0,un,un),u.setRenderTarget(s),w&&u.render(_,a),u.render(e,a)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=p,u.outputEncoding=f,u.autoClear=h,e.background=v}_setEncoding(e,t){e.value=ui[t.encoding]}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===Bs||e.mapping===$s;s?this._cubemapShader==null&&(this._cubemapShader=Vl()):this._equirectShader==null&&(this._equirectShader=Ul());const r=s?this._cubemapShader:this._equirectShader,o=new Ot(gs[0],r),a=r.uniforms;a.envMap.value=e,s||a.texelSize.value.set(1/e.image.width,1/e.image.height),this._setEncoding(a.inputEncoding,e),this._setEncoding(a.outputEncoding,t.texture),ur(t,0,0,3*un,2*un),i.setRenderTarget(t),i.render(o,Oo)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;s<Cd;s++){const r=Math.sqrt(dr[s]*dr[s]-dr[s-1]*dr[s-1]),o=zl[(s-1)%zl.length];this._blur(e,s-1,s,r,o)}t.autoClear=i}_blur(e,t,i,s,r){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,s,"latitudinal",r),this._halfBlur(o,e,i,i,s,"longitudinal",r)}_halfBlur(e,t,i,s,r,o,a){const c=this._renderer,l=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,h=new Ot(gs[s],l),f=l.uniforms,p=Bl[i]-1,g=isFinite(r)?Math.PI/(2*p):2*Math.PI/(2*Ri-1),_=r/g,w=isFinite(r)?1+Math.floor(u*_):Ri;w>Ri&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${Ri}`);const v=[];let y=0;for(let P=0;P<Ri;++P){const b=P/_,z=Math.exp(-b*b/2);v.push(z),P==0?y+=z:P<w&&(y+=2*z)}for(let P=0;P<v.length;P++)v[P]=v[P]/y;f.envMap.value=e.texture,f.samples.value=w,f.weights.value=v,f.latitudinal.value=o==="latitudinal",a&&(f.poleAxis.value=a),f.dTheta.value=g,f.mipInt.value=Un-i,this._setEncoding(f.inputEncoding,e.texture),this._setEncoding(f.outputEncoding,e.texture);const C=Bl[s],S=3*Math.max(0,un-2*C),T=(s===0?0:2*un)+2*C*(s>Un-qi?s-Un+qi:0);ur(t,S,T,3*C,2*C),c.setRenderTarget(t),c.render(h,Oo)}}function N_(n){return n===void 0||n.type!==qn?!1:n.encoding===Gt||n.encoding===Vr||n.encoding===Sa}function O_(){const n=[],e=[],t=[];let i=Un;for(let s=0;s<Cd;s++){const r=Math.pow(2,i);e.push(r);let o=1/r;s>Un-qi?o=Sd[s-Un+qi-1]:s==0&&(o=0),t.push(o);const a=1/(r-1),c=-a/2,l=1+a/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=6,f=6,p=3,g=2,_=1,w=new Float32Array(p*f*h),v=new Float32Array(g*f*h),y=new Float32Array(_*f*h);for(let S=0;S<h;S++){const T=S%3*2/3-1,P=S>2?0:-1,b=[T,P,0,T+2/3,P,0,T+2/3,P+1,0,T,P,0,T+2/3,P+1,0,T,P+1,0];w.set(b,p*f*S),v.set(u,g*f*S);const z=[S,S,S,S,S,S];y.set(z,_*f*S)}const C=new ut;C.setAttribute("position",new Ct(w,p)),C.setAttribute("uv",new Ct(v,g)),C.setAttribute("faceIndex",new Ct(y,_)),n.push(C),i>qi&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function Hl(n){const e=new Kt(3*un,3*un,n);return e.texture.mapping=Hr,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function ur(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function F_(n){const e=new Float32Array(n),t=new L(0,1,0);return new jr({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:ui[Gt]},outputEncoding:{value:ui[Gt]}},vertexShader:Ia(),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;

			${Pa()}

			#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 );

				}

				gl_FragColor = linearToOutputTexel( gl_FragColor );

			}
		`,blending:Hn,depthTest:!1,depthWrite:!1})}function Ul(){const n=new ce(1,1);return new jr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n},inputEncoding:{value:ui[Gt]},outputEncoding:{value:ui[Gt]}},vertexShader:Ia(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform vec2 texelSize;

			${Pa()}

			#include <common>

			void main() {

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				vec2 f = fract( uv / texelSize - 0.5 );
				uv -= f * texelSize;
				vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
				uv.x += texelSize.x;
				vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
				uv.y += texelSize.y;
				vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;
				uv.x -= texelSize.x;
				vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;

				vec3 tm = mix( tl, tr, f.x );
				vec3 bm = mix( bl, br, f.x );
				gl_FragColor.rgb = mix( tm, bm, f.y );

				gl_FragColor = linearToOutputTexel( gl_FragColor );

			}
		`,blending:Hn,depthTest:!1,depthWrite:!1})}function Vl(){return new jr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ui[Gt]},outputEncoding:{value:ui[Gt]}},vertexShader:Ia(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			${Pa()}

			void main() {

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;
				gl_FragColor = linearToOutputTexel( gl_FragColor );

			}
		`,blending:Hn,depthTest:!1,depthWrite:!1})}function Ia(){return`

		precision mediump float;
		precision mediump int;

		attribute vec3 position;
		attribute vec2 uv;
		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 );

		}
	`}function Pa(){return`

		uniform int inputEncoding;
		uniform int outputEncoding;

		#include <encodings_pars_fragment>

		vec4 inputTexelToLinear( vec4 value ) {

			if ( inputEncoding == 0 ) {

				return value;

			} else if ( inputEncoding == 1 ) {

				return sRGBToLinear( value );

			} else if ( inputEncoding == 2 ) {

				return RGBEToLinear( value );

			} else if ( inputEncoding == 3 ) {

				return RGBMToLinear( value, 7.0 );

			} else if ( inputEncoding == 4 ) {

				return RGBMToLinear( value, 16.0 );

			} else if ( inputEncoding == 5 ) {

				return RGBDToLinear( value, 256.0 );

			} else {

				return GammaToLinear( value, 2.2 );

			}

		}

		vec4 linearToOutputTexel( vec4 value ) {

			if ( outputEncoding == 0 ) {

				return value;

			} else if ( outputEncoding == 1 ) {

				return LinearTosRGB( value );

			} else if ( outputEncoding == 2 ) {

				return LinearToRGBE( value );

			} else if ( outputEncoding == 3 ) {

				return LinearToRGBM( value, 7.0 );

			} else if ( outputEncoding == 4 ) {

				return LinearToRGBM( value, 16.0 );

			} else if ( outputEncoding == 5 ) {

				return LinearToRGBD( value, 256.0 );

			} else {

				return LinearToGamma( value, 2.2 );

			}

		}

		vec4 envMapTexelToLinear( vec4 color ) {

			return inputTexelToLinear( color );

		}
	`}function B_(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){const c=a.mapping,l=c===Jo||c===Qo,u=c===Bs||c===$s;if(l||u){if(e.has(a))return e.get(a).texture;{const h=a.image;if(l&&h&&h.height>0||u&&h&&s(h)){const f=n.getRenderTarget();t===null&&(t=new D_(n));const p=l?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),n.setRenderTarget(f),a.addEventListener("dispose",r),p.texture}else return null}}}return a}function s(a){let c=0;const l=6;for(let u=0;u<l;u++)a[u]!==void 0&&c++;return c===l}function r(a){const c=a.target;c.removeEventListener("dispose",r);const l=e.get(c);l!==void 0&&(e.delete(c),l.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function $_(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let s;switch(i){case"WEBGL_depth_texture":s=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":s=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":s=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=n.getExtension(i)}return e[i]=s,s}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){const s=t(i);return s===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),s}}}function z_(n,e,t,i){const s={},r=new WeakMap;function o(h){const f=h.target;f.index!==null&&e.remove(f.index);for(const g in f.attributes)e.remove(f.attributes[g]);f.removeEventListener("dispose",o),delete s[f.id];const p=r.get(f);p&&(e.remove(p),r.delete(f)),i.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function a(h,f){return s[f.id]===!0||(f.addEventListener("dispose",o),s[f.id]=!0,t.memory.geometries++),f}function c(h){const f=h.attributes;for(const g in f)e.update(f[g],34962);const p=h.morphAttributes;for(const g in p){const _=p[g];for(let w=0,v=_.length;w<v;w++)e.update(_[w],34962)}}function l(h){const f=[],p=h.index,g=h.attributes.position;let _=0;if(p!==null){const y=p.array;_=p.version;for(let C=0,S=y.length;C<S;C+=3){const T=y[C+0],P=y[C+1],b=y[C+2];f.push(T,P,P,b,b,T)}}else{const y=g.array;_=g.version;for(let C=0,S=y.length/3-1;C<S;C+=3){const T=C+0,P=C+1,b=C+2;f.push(T,P,P,b,b,T)}}const w=new(vd(f)>65535?wd:xd)(f,1);w.version=_;const v=r.get(h);v&&e.remove(v),r.set(h,w)}function u(h){const f=r.get(h);if(f){const p=h.index;p!==null&&f.version<p.version&&l(h)}else l(h);return r.get(h)}return{get:a,update:c,getWireframeAttribute:u}}function H_(n,e,t,i){const s=i.isWebGL2;let r;function o(f){r=f}let a,c;function l(f){a=f.type,c=f.bytesPerElement}function u(f,p){n.drawElements(r,p,a,f*c),t.update(p,r,1)}function h(f,p,g){if(g===0)return;let _,w;if(s)_=n,w="drawElementsInstanced";else if(_=e.get("ANGLE_instanced_arrays"),w="drawElementsInstancedANGLE",_===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}_[w](r,p,a,f*c,g),t.update(p,r,g)}this.setMode=o,this.setIndex=l,this.render=u,this.renderInstances=h}function U_(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(r,o,a){switch(t.calls++,o){case 4:t.triangles+=a*(r/3);break;case 1:t.lines+=a*(r/2);break;case 3:t.lines+=a*(r-1);break;case 2:t.lines+=a*r;break;case 0:t.points+=a*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function s(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:i}}class Da extends Dt{constructor(e=null,t=1,i=1,s=1){super(null),this.image={data:e,width:t,height:i,depth:s},this.magFilter=At,this.minFilter=At,this.wrapR=Yt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Da.prototype.isDataTexture2DArray=!0;function V_(n,e){return n[0]-e[0]}function G_(n,e){return Math.abs(e[1])-Math.abs(n[1])}function Gl(n,e){let t=1;const i=e.isInterleavedBufferAttribute?e.data.array:e.array;i instanceof Int8Array?t=127:i instanceof Int16Array?t=32767:i instanceof Int32Array?t=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",i),n.divideScalar(t)}function W_(n,e,t){const i={},s=new Float32Array(8),r=new WeakMap,o=new L,a=[];for(let l=0;l<8;l++)a[l]=[l,0];function c(l,u,h,f){const p=l.morphTargetInfluences;if(e.isWebGL2===!0){const g=u.morphAttributes.position.length;let _=r.get(u);if(_===void 0||_.count!==g){_!==void 0&&_.texture.dispose();const y=u.morphAttributes.normal!==void 0,C=u.morphAttributes.position,S=u.morphAttributes.normal||[],T=u.attributes.position.count,P=y===!0?2:1;let b=T*P,z=1;b>e.maxTextureSize&&(z=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const oe=new Float32Array(b*z*4*g),X=new Da(oe,b,z,g);X.format=Ht,X.type=zn;const D=P*4;for(let ge=0;ge<g;ge++){const G=C[ge],V=S[ge],Y=b*z*4*ge;for(let W=0;W<G.count;W++){o.fromBufferAttribute(G,W),G.normalized===!0&&Gl(o,G);const Z=W*D;oe[Y+Z+0]=o.x,oe[Y+Z+1]=o.y,oe[Y+Z+2]=o.z,oe[Y+Z+3]=0,y===!0&&(o.fromBufferAttribute(V,W),V.normalized===!0&&Gl(o,V),oe[Y+Z+4]=o.x,oe[Y+Z+5]=o.y,oe[Y+Z+6]=o.z,oe[Y+Z+7]=0)}}_={count:g,texture:X,size:new ce(b,z)},r.set(u,_)}let w=0;for(let y=0;y<p.length;y++)w+=p[y];const v=u.morphTargetsRelative?1:1-w;f.getUniforms().setValue(n,"morphTargetBaseInfluence",v),f.getUniforms().setValue(n,"morphTargetInfluences",p),f.getUniforms().setValue(n,"morphTargetsTexture",_.texture,t),f.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}else{const g=p===void 0?0:p.length;let _=i[u.id];if(_===void 0||_.length!==g){_=[];for(let S=0;S<g;S++)_[S]=[S,0];i[u.id]=_}for(let S=0;S<g;S++){const T=_[S];T[0]=S,T[1]=p[S]}_.sort(G_);for(let S=0;S<8;S++)S<g&&_[S][1]?(a[S][0]=_[S][0],a[S][1]=_[S][1]):(a[S][0]=Number.MAX_SAFE_INTEGER,a[S][1]=0);a.sort(V_);const w=u.morphAttributes.position,v=u.morphAttributes.normal;let y=0;for(let S=0;S<8;S++){const T=a[S],P=T[0],b=T[1];P!==Number.MAX_SAFE_INTEGER&&b?(w&&u.getAttribute("morphTarget"+S)!==w[P]&&u.setAttribute("morphTarget"+S,w[P]),v&&u.getAttribute("morphNormal"+S)!==v[P]&&u.setAttribute("morphNormal"+S,v[P]),s[S]=b,y+=b):(w&&u.hasAttribute("morphTarget"+S)===!0&&u.deleteAttribute("morphTarget"+S),v&&u.hasAttribute("morphNormal"+S)===!0&&u.deleteAttribute("morphNormal"+S),s[S]=0)}const C=u.morphTargetsRelative?1:1-y;f.getUniforms().setValue(n,"morphTargetBaseInfluence",C),f.getUniforms().setValue(n,"morphTargetInfluences",s)}}return{update:c}}function q_(n,e,t,i){let s=new WeakMap;function r(c){const l=i.render.frame,u=c.geometry,h=e.get(c,u);return s.get(h)!==l&&(e.update(h),s.set(h,l)),c.isInstancedMesh&&(c.hasEventListener("dispose",a)===!1&&c.addEventListener("dispose",a),t.update(c.instanceMatrix,34962),c.instanceColor!==null&&t.update(c.instanceColor,34962)),h}function o(){s=new WeakMap}function a(c){const l=c.target;l.removeEventListener("dispose",a),t.remove(l.instanceMatrix),l.instanceColor!==null&&t.remove(l.instanceColor)}return{update:r,dispose:o}}class Td extends Dt{constructor(e=null,t=1,i=1,s=1){super(null),this.image={data:e,width:t,height:i,depth:s},this.magFilter=At,this.minFilter=At,this.wrapR=Yt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Td.prototype.isDataTexture3D=!0;const Ed=new Dt,Ad=new Da,kd=new Td,Ld=new Wr,Wl=[],ql=[],jl=new Float32Array(16),Xl=new Float32Array(9),Yl=new Float32Array(4);function os(n,e,t){const i=n[0];if(i<=0||i>0)return n;const s=e*t;let r=Wl[s];if(r===void 0&&(r=new Float32Array(s),Wl[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function Ut(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Bt(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Xr(n,e){let t=ql[e];t===void 0&&(t=new Int32Array(e),ql[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function j_(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function X_(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Ut(t,e))return;n.uniform2fv(this.addr,e),Bt(t,e)}}function Y_(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Ut(t,e))return;n.uniform3fv(this.addr,e),Bt(t,e)}}function Z_(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Ut(t,e))return;n.uniform4fv(this.addr,e),Bt(t,e)}}function J_(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Ut(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Bt(t,e)}else{if(Ut(t,i))return;Yl.set(i),n.uniformMatrix2fv(this.addr,!1,Yl),Bt(t,i)}}function Q_(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Ut(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Bt(t,e)}else{if(Ut(t,i))return;Xl.set(i),n.uniformMatrix3fv(this.addr,!1,Xl),Bt(t,i)}}function K_(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(Ut(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Bt(t,e)}else{if(Ut(t,i))return;jl.set(i),n.uniformMatrix4fv(this.addr,!1,jl),Bt(t,i)}}function e0(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function t0(n,e){const t=this.cache;Ut(t,e)||(n.uniform2iv(this.addr,e),Bt(t,e))}function n0(n,e){const t=this.cache;Ut(t,e)||(n.uniform3iv(this.addr,e),Bt(t,e))}function i0(n,e){const t=this.cache;Ut(t,e)||(n.uniform4iv(this.addr,e),Bt(t,e))}function s0(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function r0(n,e){const t=this.cache;Ut(t,e)||(n.uniform2uiv(this.addr,e),Bt(t,e))}function o0(n,e){const t=this.cache;Ut(t,e)||(n.uniform3uiv(this.addr,e),Bt(t,e))}function a0(n,e){const t=this.cache;Ut(t,e)||(n.uniform4uiv(this.addr,e),Bt(t,e))}function l0(n,e,t){const i=this.cache,s=t.allocateTextureUnit();i[0]!==s&&(n.uniform1i(this.addr,s),i[0]=s),t.safeSetTexture2D(e||Ed,s)}function c0(n,e,t){const i=this.cache,s=t.allocateTextureUnit();i[0]!==s&&(n.uniform1i(this.addr,s),i[0]=s),t.setTexture3D(e||kd,s)}function d0(n,e,t){const i=this.cache,s=t.allocateTextureUnit();i[0]!==s&&(n.uniform1i(this.addr,s),i[0]=s),t.safeSetTextureCube(e||Ld,s)}function u0(n,e,t){const i=this.cache,s=t.allocateTextureUnit();i[0]!==s&&(n.uniform1i(this.addr,s),i[0]=s),t.setTexture2DArray(e||Ad,s)}function h0(n){switch(n){case 5126:return j_;case 35664:return X_;case 35665:return Y_;case 35666:return Z_;case 35674:return J_;case 35675:return Q_;case 35676:return K_;case 5124:case 35670:return e0;case 35667:case 35671:return t0;case 35668:case 35672:return n0;case 35669:case 35673:return i0;case 5125:return s0;case 36294:return r0;case 36295:return o0;case 36296:return a0;case 35678:case 36198:case 36298:case 36306:case 35682:return l0;case 35679:case 36299:case 36307:return c0;case 35680:case 36300:case 36308:case 36293:return d0;case 36289:case 36303:case 36311:case 36292:return u0}}function f0(n,e){n.uniform1fv(this.addr,e)}function p0(n,e){const t=os(e,this.size,2);n.uniform2fv(this.addr,t)}function m0(n,e){const t=os(e,this.size,3);n.uniform3fv(this.addr,t)}function g0(n,e){const t=os(e,this.size,4);n.uniform4fv(this.addr,t)}function _0(n,e){const t=os(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function v0(n,e){const t=os(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function y0(n,e){const t=os(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function x0(n,e){n.uniform1iv(this.addr,e)}function w0(n,e){n.uniform2iv(this.addr,e)}function b0(n,e){n.uniform3iv(this.addr,e)}function M0(n,e){n.uniform4iv(this.addr,e)}function S0(n,e){n.uniform1uiv(this.addr,e)}function C0(n,e){n.uniform2uiv(this.addr,e)}function T0(n,e){n.uniform3uiv(this.addr,e)}function E0(n,e){n.uniform4uiv(this.addr,e)}function A0(n,e,t){const i=e.length,s=Xr(t,i);n.uniform1iv(this.addr,s);for(let r=0;r!==i;++r)t.safeSetTexture2D(e[r]||Ed,s[r])}function k0(n,e,t){const i=e.length,s=Xr(t,i);n.uniform1iv(this.addr,s);for(let r=0;r!==i;++r)t.setTexture3D(e[r]||kd,s[r])}function L0(n,e,t){const i=e.length,s=Xr(t,i);n.uniform1iv(this.addr,s);for(let r=0;r!==i;++r)t.safeSetTextureCube(e[r]||Ld,s[r])}function R0(n,e,t){const i=e.length,s=Xr(t,i);n.uniform1iv(this.addr,s);for(let r=0;r!==i;++r)t.setTexture2DArray(e[r]||Ad,s[r])}function I0(n){switch(n){case 5126:return f0;case 35664:return p0;case 35665:return m0;case 35666:return g0;case 35674:return _0;case 35675:return v0;case 35676:return y0;case 5124:case 35670:return x0;case 35667:case 35671:return w0;case 35668:case 35672:return b0;case 35669:case 35673:return M0;case 5125:return S0;case 36294:return C0;case 36295:return T0;case 36296:return E0;case 35678:case 36198:case 36298:case 36306:case 35682:return A0;case 35679:case 36299:case 36307:return k0;case 35680:case 36300:case 36308:case 36293:return L0;case 36289:case 36303:case 36311:case 36292:return R0}}function P0(n,e,t){this.id=n,this.addr=t,this.cache=[],this.setValue=h0(e.type)}function Rd(n,e,t){this.id=n,this.addr=t,this.cache=[],this.size=e.size,this.setValue=I0(e.type)}Rd.prototype.updateCache=function(n){const e=this.cache;n instanceof Float32Array&&e.length!==n.length&&(this.cache=new Float32Array(n.length)),Bt(e,n)};function Id(n){this.id=n,this.seq=[],this.map={}}Id.prototype.setValue=function(n,e,t){const i=this.seq;for(let s=0,r=i.length;s!==r;++s){const o=i[s];o.setValue(n,e[o.id],t)}};const Bo=/(\w+)(\])?(\[|\.)?/g;function Zl(n,e){n.seq.push(e),n.map[e.id]=e}function D0(n,e,t){const i=n.name,s=i.length;for(Bo.lastIndex=0;;){const r=Bo.exec(i),o=Bo.lastIndex;let a=r[1];const c=r[2]==="]",l=r[3];if(c&&(a=a|0),l===void 0||l==="["&&o+2===s){Zl(t,l===void 0?new P0(a,n,e):new Rd(a,n,e));break}else{let h=t.map[a];h===void 0&&(h=new Id(a),Zl(t,h)),t=h}}}function Vn(n,e){this.seq=[],this.map={};const t=n.getProgramParameter(e,35718);for(let i=0;i<t;++i){const s=n.getActiveUniform(e,i),r=n.getUniformLocation(e,s.name);D0(s,r,this)}}Vn.prototype.setValue=function(n,e,t,i){const s=this.map[e];s!==void 0&&s.setValue(n,t,i)};Vn.prototype.setOptional=function(n,e,t){const i=e[t];i!==void 0&&this.setValue(n,t,i)};Vn.upload=function(n,e,t,i){for(let s=0,r=e.length;s!==r;++s){const o=e[s],a=t[o.id];a.needsUpdate!==!1&&o.setValue(n,a.value,i)}};Vn.seqWithValue=function(n,e){const t=[];for(let i=0,s=n.length;i!==s;++i){const r=n[i];r.id in e&&t.push(r)}return t};function Jl(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let N0=0;function O0(n){const e=n.split(`
`);for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
`)}function Pd(n){switch(n){case Gt:return["Linear","( value )"];case Vr:return["sRGB","( value )"];case Ca:return["RGBE","( value )"];case md:return["RGBM","( value, 7.0 )"];case gd:return["RGBM","( value, 16.0 )"];case _d:return["RGBD","( value, 256.0 )"];case Sa:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function Ql(n,e,t){const i=n.getShaderParameter(e,35713),s=n.getShaderInfoLog(e).trim();return i&&s===""?"":t.toUpperCase()+`

`+s+`

`+O0(n.getShaderSource(e))}function si(n,e){const t=Pd(e);return"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function F0(n,e){const t=Pd(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function B0(n,e){let t;switch(e){case Af:t="Linear";break;case kf:t="Reinhard";break;case Lf:t="OptimizedCineon";break;case Rf:t="ACESFilmic";break;case If:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function $0(n){return[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ms).join(`
`)}function z0(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
`)}function H0(n,e){const t={},i=n.getProgramParameter(e,35721);for(let s=0;s<i;s++){const r=n.getActiveAttrib(e,s),o=r.name;let a=1;r.type===35674&&(a=2),r.type===35675&&(a=3),r.type===35676&&(a=4),t[o]={type:r.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function Ms(n){return n!==""}function Kl(n,e){return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ec(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const U0=/^[ \t]*#include +<([\w\d./]+)>/gm;function ta(n){return n.replace(U0,V0)}function V0(n,e){const t=je[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return ta(t)}const G0=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,W0=/#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 tc(n){return n.replace(W0,Dd).replace(G0,q0)}function q0(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Dd(n,e,t,i)}function Dd(n,e,t,i){let s="";for(let r=parseInt(e);r<parseInt(t);r++)s+=i.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return s}function nc(n){let e="precision "+n.precision+` float;
precision `+n.precision+" int;";return n.precision==="highp"?e+=`
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function j0(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===cd?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===of?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===bs&&(e="SHADOWMAP_TYPE_VSM"),e}function X0(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Bs:case $s:e="ENVMAP_TYPE_CUBE";break;case Hr:case ba:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Y0(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case $s:case ba:e="ENVMAP_MODE_REFRACTION";break}return e}function Z0(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case zr:e="ENVMAP_BLENDING_MULTIPLY";break;case Tf:e="ENVMAP_BLENDING_MIX";break;case Ef:e="ENVMAP_BLENDING_ADD";break}return e}function J0(n,e,t,i){const s=n.getContext(),r=t.defines;let o=t.vertexShader,a=t.fragmentShader;const c=j0(t),l=X0(t),u=Y0(t),h=Z0(t),f=n.gammaFactor>0?n.gammaFactor:1,p=t.isWebGL2?"":$0(t),g=z0(r),_=s.createProgram();let w,v,y=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(w=[g].filter(Ms).join(`
`),w.length>0&&(w+=`
`),v=[p,g].filter(Ms).join(`
`),v.length>0&&(v+=`
`)):(w=[nc(t),"#define SHADER_NAME "+t.shaderName,g,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(Ms).join(`
`),v=[p,nc(t),"#define SHADER_NAME "+t.shaderName,g,"#define GAMMA_FACTOR "+f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+l:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==oi?"#define TONE_MAPPING":"",t.toneMapping!==oi?je.tonemapping_pars_fragment:"",t.toneMapping!==oi?B0("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.format===ai?"#define OPAQUE":"",je.encodings_pars_fragment,t.map?si("mapTexelToLinear",t.mapEncoding):"",t.matcap?si("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?si("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?si("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularColorMap?si("specularColorMapTexelToLinear",t.specularColorMapEncoding):"",t.sheenColorMap?si("sheenColorMapTexelToLinear",t.sheenColorMapEncoding):"",t.lightMap?si("lightMapTexelToLinear",t.lightMapEncoding):"",F0("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(Ms).join(`
`)),o=ta(o),o=Kl(o,t),o=ec(o,t),a=ta(a),a=Kl(a,t),a=ec(a,t),o=tc(o),a=tc(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es
`,w=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+w,v=["#define varying in",t.glslVersion===Sl?"":"out highp vec4 pc_fragColor;",t.glslVersion===Sl?"":"#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(`
`)+`
`+v);const C=y+w+o,S=y+v+a,T=Jl(s,35633,C),P=Jl(s,35632,S);if(s.attachShader(_,T),s.attachShader(_,P),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_),n.debug.checkShaderErrors){const oe=s.getProgramInfoLog(_).trim(),X=s.getShaderInfoLog(T).trim(),D=s.getShaderInfoLog(P).trim();let ge=!0,G=!0;if(s.getProgramParameter(_,35714)===!1){ge=!1;const V=Ql(s,T,"vertex"),Y=Ql(s,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,35715)+`

Program Info Log: `+oe+`
`+V+`
`+Y)}else oe!==""?console.warn("THREE.WebGLProgram: Program Info Log:",oe):(X===""||D==="")&&(G=!1);G&&(this.diagnostics={runnable:ge,programLog:oe,vertexShader:{log:X,prefix:w},fragmentShader:{log:D,prefix:v}})}s.deleteShader(T),s.deleteShader(P);let b;this.getUniforms=function(){return b===void 0&&(b=new Vn(s,_)),b};let z;return this.getAttributes=function(){return z===void 0&&(z=H0(s,_)),z},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.name=t.shaderName,this.id=N0++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=P,this}function Q0(n,e,t,i,s,r,o){const a=[],c=s.isWebGL2,l=s.logarithmicDepthBuffer,u=s.floatVertexTextures,h=s.maxVertexUniforms,f=s.vertexTextures;let p=s.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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"},_=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap",,"roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","morphTargetsCount","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","specularIntensityMap","specularColorMap","specularColorMapEncoding","transmission","transmissionMap","thicknessMap","sheen","sheenColorMap","sheenColorMapEncoding","sheenRoughnessMap"];function w(b){const oe=b.skeleton.bones;if(u)return 1024;{const D=Math.floor((h-20)/4),ge=Math.min(D,oe.length);return ge<oe.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+oe.length+" bones. This GPU supports "+ge+"."),0):ge}}function v(b){let z;return b&&b.isTexture?z=b.encoding:b&&b.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),z=b.texture.encoding):z=Gt,z}function y(b,z,oe,X,D){const ge=X.fog,G=b.isMeshStandardMaterial?X.environment:null,V=(b.isMeshStandardMaterial?t:e).get(b.envMap||G),Y=g[b.type],W=D.isSkinnedMesh?w(D):0;b.precision!==null&&(p=s.getMaxPrecision(b.precision),p!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",p,"instead."));let Z,fe;if(Y){const ve=hn[Y];Z=ve.vertexShader,fe=ve.fragmentShader}else Z=b.vertexShader,fe=b.fragmentShader;const _e=n.getRenderTarget(),ne=b.alphaTest>0,ie=b.clearcoat>0;return{isWebGL2:c,shaderID:Y,shaderName:b.type,vertexShader:Z,fragmentShader:fe,defines:b.defines,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:p,instancing:D.isInstancedMesh===!0,instancingColor:D.isInstancedMesh===!0&&D.instanceColor!==null,supportsVertexTextures:f,outputEncoding:_e!==null?v(_e.texture):n.outputEncoding,map:!!b.map,mapEncoding:v(b.map),matcap:!!b.matcap,matcapEncoding:v(b.matcap),envMap:!!V,envMapMode:V&&V.mapping,envMapEncoding:v(V),envMapCubeUV:!!V&&(V.mapping===Hr||V.mapping===ba),lightMap:!!b.lightMap,lightMapEncoding:v(b.lightMap),aoMap:!!b.aoMap,emissiveMap:!!b.emissiveMap,emissiveMapEncoding:v(b.emissiveMap),bumpMap:!!b.bumpMap,normalMap:!!b.normalMap,objectSpaceNormalMap:b.normalMapType===Ip,tangentSpaceNormalMap:b.normalMapType===ts,clearcoat:ie,clearcoatMap:ie&&!!b.clearcoatMap,clearcoatRoughnessMap:ie&&!!b.clearcoatRoughnessMap,clearcoatNormalMap:ie&&!!b.clearcoatNormalMap,displacementMap:!!b.displacementMap,roughnessMap:!!b.roughnessMap,metalnessMap:!!b.metalnessMap,specularMap:!!b.specularMap,specularIntensityMap:!!b.specularIntensityMap,specularColorMap:!!b.specularColorMap,specularColorMapEncoding:v(b.specularColorMap),alphaMap:!!b.alphaMap,alphaTest:ne,gradientMap:!!b.gradientMap,sheen:b.sheen>0,sheenColorMap:!!b.sheenColorMap,sheenColorMapEncoding:v(b.sheenColorMap),sheenRoughnessMap:!!b.sheenRoughnessMap,transmission:b.transmission>0,transmissionMap:!!b.transmissionMap,thicknessMap:!!b.thicknessMap,combine:b.combine,vertexTangents:!!b.normalMap&&!!D.geometry&&!!D.geometry.attributes.tangent,vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!D.geometry&&!!D.geometry.attributes.color&&D.geometry.attributes.color.itemSize===4,vertexUvs:!!b.map||!!b.bumpMap||!!b.normalMap||!!b.specularMap||!!b.alphaMap||!!b.emissiveMap||!!b.roughnessMap||!!b.metalnessMap||!!b.clearcoatMap||!!b.clearcoatRoughnessMap||!!b.clearcoatNormalMap||!!b.displacementMap||!!b.transmissionMap||!!b.thicknessMap||!!b.specularIntensityMap||!!b.specularColorMap||!!b.sheenColorMap||b.sheenRoughnessMap,uvsVertexOnly:!(b.map||b.bumpMap||b.normalMap||b.specularMap||b.alphaMap||b.emissiveMap||b.roughnessMap||b.metalnessMap||b.clearcoatNormalMap||b.transmission>0||b.transmissionMap||b.thicknessMap||b.specularIntensityMap||b.specularColorMap||b.sheen>0||b.sheenColorMap||b.sheenRoughnessMap)&&!!b.displacementMap,fog:!!ge,useFog:b.fog,fogExp2:ge&&ge.isFogExp2,flatShading:!!b.flatShading,sizeAttenuation:b.sizeAttenuation,logarithmicDepthBuffer:l,skinning:D.isSkinnedMesh===!0&&W>0,maxBones:W,useVertexTexture:u,morphTargets:!!D.geometry&&!!D.geometry.morphAttributes.position,morphNormals:!!D.geometry&&!!D.geometry.morphAttributes.normal,morphTargetsCount:D.geometry&&D.geometry.morphAttributes.position?D.geometry.morphAttributes.position.length:0,numDirLights:z.directional.length,numPointLights:z.point.length,numSpotLights:z.spot.length,numRectAreaLights:z.rectArea.length,numHemiLights:z.hemi.length,numDirLightShadows:z.directionalShadowMap.length,numPointLightShadows:z.pointShadowMap.length,numSpotLightShadows:z.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,format:b.format,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&oe.length>0,shadowMapType:n.shadowMap.type,toneMapping:b.toneMapped?n.toneMapping:oi,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Yi,flipSided:b.side===Mt,depthPacking:b.depthPacking!==void 0?b.depthPacking:!1,index0AttributeName:b.index0AttributeName,extensionDerivatives:b.extensions&&b.extensions.derivatives,extensionFragDepth:b.extensions&&b.extensions.fragDepth,extensionDrawBuffers:b.extensions&&b.extensions.drawBuffers,extensionShaderTextureLOD:b.extensions&&b.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||i.has("EXT_shader_texture_lod"),customProgramCacheKey:b.customProgramCacheKey()}}function C(b){const z=[];if(b.shaderID?z.push(b.shaderID):(z.push(Tl(b.fragmentShader)),z.push(Tl(b.vertexShader))),b.defines!==void 0)for(const oe in b.defines)z.push(oe),z.push(b.defines[oe]);if(b.isRawShaderMaterial===!1){for(let oe=0;oe<_.length;oe++)z.push(b[_[oe]]);z.push(n.outputEncoding),z.push(n.gammaFactor)}return z.push(b.customProgramCacheKey),z.join()}function S(b){const z=g[b.type];let oe;if(z){const X=hn[z];oe=Zp.clone(X.uniforms)}else oe=b.uniforms;return oe}function T(b,z){let oe;for(let X=0,D=a.length;X<D;X++){const ge=a[X];if(ge.cacheKey===z){oe=ge,++oe.usedTimes;break}}return oe===void 0&&(oe=new J0(n,z,b,r),a.push(oe)),oe}function P(b){if(--b.usedTimes===0){const z=a.indexOf(b);a[z]=a[a.length-1],a.pop(),b.destroy()}}return{getParameters:y,getProgramCacheKey:C,getUniforms:S,acquireProgram:T,releaseProgram:P,programs:a}}function K0(){let n=new WeakMap;function e(r){let o=n.get(r);return o===void 0&&(o={},n.set(r,o)),o}function t(r){n.delete(r)}function i(r,o,a){n.get(r)[o]=a}function s(){n=new WeakMap}return{get:e,remove:t,update:i,dispose:s}}function e1(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.program!==e.program?n.program.id-e.program.id:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function ic(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function sc(n){const e=[];let t=0;const i=[],s=[],r=[],o={id:-1};function a(){t=0,i.length=0,s.length=0,r.length=0}function c(p,g,_,w,v,y){let C=e[t];const S=n.get(_);return C===void 0?(C={id:p.id,object:p,geometry:g,material:_,program:S.program||o,groupOrder:w,renderOrder:p.renderOrder,z:v,group:y},e[t]=C):(C.id=p.id,C.object=p,C.geometry=g,C.material=_,C.program=S.program||o,C.groupOrder=w,C.renderOrder=p.renderOrder,C.z=v,C.group=y),t++,C}function l(p,g,_,w,v,y){const C=c(p,g,_,w,v,y);_.transmission>0?s.push(C):_.transparent===!0?r.push(C):i.push(C)}function u(p,g,_,w,v,y){const C=c(p,g,_,w,v,y);_.transmission>0?s.unshift(C):_.transparent===!0?r.unshift(C):i.unshift(C)}function h(p,g){i.length>1&&i.sort(p||e1),s.length>1&&s.sort(g||ic),r.length>1&&r.sort(g||ic)}function f(){for(let p=t,g=e.length;p<g;p++){const _=e[p];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.program=null,_.group=null}}return{opaque:i,transmissive:s,transparent:r,init:a,push:l,unshift:u,finish:f,sort:h}}function t1(n){let e=new WeakMap;function t(s,r){let o;return e.has(s)===!1?(o=new sc(n),e.set(s,[o])):r>=e.get(s).length?(o=new sc(n),e.get(s).push(o)):o=e.get(s)[r],o}function i(){e=new WeakMap}return{get:t,dispose:i}}function n1(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new L,color:new Re};break;case"SpotLight":t={position:new L,direction:new L,color:new Re,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new L,color:new Re,distance:0,decay:0};break;case"HemisphereLight":t={direction:new L,skyColor:new Re,groundColor:new Re};break;case"RectAreaLight":t={color:new Re,position:new L,halfWidth:new L,halfHeight:new L};break}return n[e.id]=t,t}}}function i1(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ce,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let s1=0;function r1(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function o1(n,e){const t=new n1,i=i1(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)s.probe.push(new L);const r=new L,o=new De,a=new De;function c(u,h){let f=0,p=0,g=0;for(let oe=0;oe<9;oe++)s.probe[oe].set(0,0,0);let _=0,w=0,v=0,y=0,C=0,S=0,T=0,P=0;u.sort(r1);const b=h!==!0?Math.PI:1;for(let oe=0,X=u.length;oe<X;oe++){const D=u[oe],ge=D.color,G=D.intensity,V=D.distance,Y=D.shadow&&D.shadow.map?D.shadow.map.texture:null;if(D.isAmbientLight)f+=ge.r*G*b,p+=ge.g*G*b,g+=ge.b*G*b;else if(D.isLightProbe)for(let W=0;W<9;W++)s.probe[W].addScaledVector(D.sh.coefficients[W],G);else if(D.isDirectionalLight){const W=t.get(D);if(W.color.copy(D.color).multiplyScalar(D.intensity*b),D.castShadow){const Z=D.shadow,fe=i.get(D);fe.shadowBias=Z.bias,fe.shadowNormalBias=Z.normalBias,fe.shadowRadius=Z.radius,fe.shadowMapSize=Z.mapSize,s.directionalShadow[_]=fe,s.directionalShadowMap[_]=Y,s.directionalShadowMatrix[_]=D.shadow.matrix,S++}s.directional[_]=W,_++}else if(D.isSpotLight){const W=t.get(D);if(W.position.setFromMatrixPosition(D.matrixWorld),W.color.copy(ge).multiplyScalar(G*b),W.distance=V,W.coneCos=Math.cos(D.angle),W.penumbraCos=Math.cos(D.angle*(1-D.penumbra)),W.decay=D.decay,D.castShadow){const Z=D.shadow,fe=i.get(D);fe.shadowBias=Z.bias,fe.shadowNormalBias=Z.normalBias,fe.shadowRadius=Z.radius,fe.shadowMapSize=Z.mapSize,s.spotShadow[v]=fe,s.spotShadowMap[v]=Y,s.spotShadowMatrix[v]=D.shadow.matrix,P++}s.spot[v]=W,v++}else if(D.isRectAreaLight){const W=t.get(D);W.color.copy(ge).multiplyScalar(G),W.halfWidth.set(D.width*.5,0,0),W.halfHeight.set(0,D.height*.5,0),s.rectArea[y]=W,y++}else if(D.isPointLight){const W=t.get(D);if(W.color.copy(D.color).multiplyScalar(D.intensity*b),W.distance=D.distance,W.decay=D.decay,D.castShadow){const Z=D.shadow,fe=i.get(D);fe.shadowBias=Z.bias,fe.shadowNormalBias=Z.normalBias,fe.shadowRadius=Z.radius,fe.shadowMapSize=Z.mapSize,fe.shadowCameraNear=Z.camera.near,fe.shadowCameraFar=Z.camera.far,s.pointShadow[w]=fe,s.pointShadowMap[w]=Y,s.pointShadowMatrix[w]=D.shadow.matrix,T++}s.point[w]=W,w++}else if(D.isHemisphereLight){const W=t.get(D);W.skyColor.copy(D.color).multiplyScalar(G*b),W.groundColor.copy(D.groundColor).multiplyScalar(G*b),s.hemi[C]=W,C++}}y>0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=ye.LTC_FLOAT_1,s.rectAreaLTC2=ye.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=ye.LTC_HALF_1,s.rectAreaLTC2=ye.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=f,s.ambient[1]=p,s.ambient[2]=g;const z=s.hash;(z.directionalLength!==_||z.pointLength!==w||z.spotLength!==v||z.rectAreaLength!==y||z.hemiLength!==C||z.numDirectionalShadows!==S||z.numPointShadows!==T||z.numSpotShadows!==P)&&(s.directional.length=_,s.spot.length=v,s.rectArea.length=y,s.point.length=w,s.hemi.length=C,s.directionalShadow.length=S,s.directionalShadowMap.length=S,s.pointShadow.length=T,s.pointShadowMap.length=T,s.spotShadow.length=P,s.spotShadowMap.length=P,s.directionalShadowMatrix.length=S,s.pointShadowMatrix.length=T,s.spotShadowMatrix.length=P,z.directionalLength=_,z.pointLength=w,z.spotLength=v,z.rectAreaLength=y,z.hemiLength=C,z.numDirectionalShadows=S,z.numPointShadows=T,z.numSpotShadows=P,s.version=s1++)}function l(u,h){let f=0,p=0,g=0,_=0,w=0;const v=h.matrixWorldInverse;for(let y=0,C=u.length;y<C;y++){const S=u[y];if(S.isDirectionalLight){const T=s.directional[f];T.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),f++}else if(S.isSpotLight){const T=s.spot[g];T.position.setFromMatrixPosition(S.matrixWorld),T.position.applyMatrix4(v),T.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),g++}else if(S.isRectAreaLight){const T=s.rectArea[_];T.position.setFromMatrixPosition(S.matrixWorld),T.position.applyMatrix4(v),a.identity(),o.copy(S.matrixWorld),o.premultiply(v),a.extractRotation(o),T.halfWidth.set(S.width*.5,0,0),T.halfHeight.set(0,S.height*.5,0),T.halfWidth.applyMatrix4(a),T.halfHeight.applyMatrix4(a),_++}else if(S.isPointLight){const T=s.point[p];T.position.setFromMatrixPosition(S.matrixWorld),T.position.applyMatrix4(v),p++}else if(S.isHemisphereLight){const T=s.hemi[w];T.direction.setFromMatrixPosition(S.matrixWorld),T.direction.transformDirection(v),T.direction.normalize(),w++}}}return{setup:c,setupView:l,state:s}}function rc(n,e){const t=new o1(n,e),i=[],s=[];function r(){i.length=0,s.length=0}function o(h){i.push(h)}function a(h){s.push(h)}function c(h){t.setup(i,h)}function l(h){t.setupView(i,h)}return{init:r,state:{lightsArray:i,shadowsArray:s,lights:t},setupLights:c,setupLightsView:l,pushLight:o,pushShadow:a}}function a1(n,e){let t=new WeakMap;function i(r,o=0){let a;return t.has(r)===!1?(a=new rc(n,e),t.set(r,[a])):o>=t.get(r).length?(a=new rc(n,e),t.get(r).push(a)):a=t.get(r)[o],a}function s(){t=new WeakMap}return{get:i,dispose:s}}class Nd extends kt{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Lp,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}Nd.prototype.isMeshDepthMaterial=!0;class Od extends kt{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new L,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}Od.prototype.isMeshDistanceMaterial=!0;const l1=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,c1=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function Fd(n,e,t){let i=new qr;const s=new ce,r=new ce,o=new lt,a=new Nd({depthPacking:Rp}),c=new Od,l={},u=t.maxTextureSize,h={0:Mt,1:Xi,2:Yi},f=new di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ce},radius:{value:4}},vertexShader:l1,fragmentShader:c1}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new ut;g.setAttribute("position",new Ct(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Ot(g,f),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=cd,this.render=function(S,T,P){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||S.length===0)return;const b=n.getRenderTarget(),z=n.getActiveCubeFace(),oe=n.getActiveMipmapLevel(),X=n.state;X.setBlending(Hn),X.buffers.color.setClear(1,1,1,1),X.buffers.depth.setTest(!0),X.setScissorTest(!1);for(let D=0,ge=S.length;D<ge;D++){const G=S[D],V=G.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",G,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;s.copy(V.mapSize);const Y=V.getFrameExtents();if(s.multiply(Y),r.copy(V.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/Y.x),s.x=r.x*Y.x,V.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/Y.y),s.y=r.y*Y.y,V.mapSize.y=r.y)),V.map===null&&!V.isPointLightShadow&&this.type===bs){const Z={minFilter:Qt,magFilter:Qt,format:Ht};V.map=new Kt(s.x,s.y,Z),V.map.texture.name=G.name+".shadowMap",V.mapPass=new Kt(s.x,s.y,Z),V.camera.updateProjectionMatrix()}if(V.map===null){const Z={minFilter:At,magFilter:At,format:Ht};V.map=new Kt(s.x,s.y,Z),V.map.texture.name=G.name+".shadowMap",V.camera.updateProjectionMatrix()}n.setRenderTarget(V.map),n.clear();const W=V.getViewportCount();for(let Z=0;Z<W;Z++){const fe=V.getViewport(Z);o.set(r.x*fe.x,r.y*fe.y,r.x*fe.z,r.y*fe.w),X.viewport(o),V.updateMatrices(G,Z),i=V.getFrustum(),C(T,P,V.camera,G,this.type)}!V.isPointLightShadow&&this.type===bs&&v(V,P),V.needsUpdate=!1}w.needsUpdate=!1,n.setRenderTarget(b,z,oe)};function v(S,T){const P=e.update(_);f.defines.VSM_SAMPLES!==S.blurSamples&&(f.defines.VSM_SAMPLES=S.blurSamples,p.defines.VSM_SAMPLES=S.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),f.uniforms.shadow_pass.value=S.map.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(T,null,P,f,_,null),p.uniforms.shadow_pass.value=S.mapPass.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(T,null,P,p,_,null)}function y(S,T,P,b,z,oe,X){let D=null;const ge=b.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(ge!==void 0?D=ge:D=b.isPointLight===!0?c:a,n.localClippingEnabled&&P.clipShadows===!0&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0){const G=D.uuid,V=P.uuid;let Y=l[G];Y===void 0&&(Y={},l[G]=Y);let W=Y[V];W===void 0&&(W=D.clone(),Y[V]=W),D=W}return D.visible=P.visible,D.wireframe=P.wireframe,X===bs?D.side=P.shadowSide!==null?P.shadowSide:P.side:D.side=P.shadowSide!==null?P.shadowSide:h[P.side],D.alphaMap=P.alphaMap,D.alphaTest=P.alphaTest,D.clipShadows=P.clipShadows,D.clippingPlanes=P.clippingPlanes,D.clipIntersection=P.clipIntersection,D.displacementMap=P.displacementMap,D.displacementScale=P.displacementScale,D.displacementBias=P.displacementBias,D.wireframeLinewidth=P.wireframeLinewidth,D.linewidth=P.linewidth,b.isPointLight===!0&&D.isMeshDistanceMaterial===!0&&(D.referencePosition.setFromMatrixPosition(b.matrixWorld),D.nearDistance=z,D.farDistance=oe),D}function C(S,T,P,b,z){if(S.visible===!1)return;if(S.layers.test(T.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&z===bs)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,S.matrixWorld);const D=e.update(S),ge=S.material;if(Array.isArray(ge)){const G=D.groups;for(let V=0,Y=G.length;V<Y;V++){const W=G[V],Z=ge[W.materialIndex];if(Z&&Z.visible){const fe=y(S,D,Z,b,P.near,P.far,z);n.renderBufferDirect(P,null,D,fe,S,W)}}}else if(ge.visible){const G=y(S,D,ge,b,P.near,P.far,z);n.renderBufferDirect(P,null,D,G,S,null)}}const X=S.children;for(let D=0,ge=X.length;D<ge;D++)C(X[D],T,P,b,z)}}function d1(n,e,t){const i=t.isWebGL2;function s(){let F=!1;const pe=new lt;let k=null;const ee=new lt(0,0,0,0);return{setMask:function(de){k!==de&&!F&&(n.colorMask(de,de,de,de),k=de)},setLocked:function(de){F=de},setClear:function(de,me,we,Fe,ct){ct===!0&&(de*=Fe,me*=Fe,we*=Fe),pe.set(de,me,we,Fe),ee.equals(pe)===!1&&(n.clearColor(de,me,we,Fe),ee.copy(pe))},reset:function(){F=!1,k=null,ee.set(-1,0,0,0)}}}function r(){let F=!1,pe=null,k=null,ee=null;return{setTest:function(de){de?ve(2929):Ce(2929)},setMask:function(de){pe!==de&&!F&&(n.depthMask(de),pe=de)},setFunc:function(de){if(k!==de){if(de)switch(de){case yf:n.depthFunc(512);break;case xf:n.depthFunc(519);break;case wf:n.depthFunc(513);break;case Zo:n.depthFunc(515);break;case bf:n.depthFunc(514);break;case Mf:n.depthFunc(518);break;case Sf:n.depthFunc(516);break;case Cf:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);k=de}},setLocked:function(de){F=de},setClear:function(de){ee!==de&&(n.clearDepth(de),ee=de)},reset:function(){F=!1,pe=null,k=null,ee=null}}}function o(){let F=!1,pe=null,k=null,ee=null,de=null,me=null,we=null,Fe=null,ct=null;return{setTest:function(Qe){F||(Qe?ve(2960):Ce(2960))},setMask:function(Qe){pe!==Qe&&!F&&(n.stencilMask(Qe),pe=Qe)},setFunc:function(Qe,xt,wt){(k!==Qe||ee!==xt||de!==wt)&&(n.stencilFunc(Qe,xt,wt),k=Qe,ee=xt,de=wt)},setOp:function(Qe,xt,wt){(me!==Qe||we!==xt||Fe!==wt)&&(n.stencilOp(Qe,xt,wt),me=Qe,we=xt,Fe=wt)},setLocked:function(Qe){F=Qe},setClear:function(Qe){ct!==Qe&&(n.clearStencil(Qe),ct=Qe)},reset:function(){F=!1,pe=null,k=null,ee=null,de=null,me=null,we=null,Fe=null,ct=null}}}const a=new s,c=new r,l=new o;let u={},h={},f=null,p=!1,g=null,_=null,w=null,v=null,y=null,C=null,S=null,T=!1,P=null,b=null,z=null,oe=null,X=null;const D=n.getParameter(35661);let ge=!1,G=0;const V=n.getParameter(7938);V.indexOf("WebGL")!==-1?(G=parseFloat(/^WebGL (\d)/.exec(V)[1]),ge=G>=1):V.indexOf("OpenGL ES")!==-1&&(G=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),ge=G>=2);let Y=null,W={};const Z=n.getParameter(3088),fe=n.getParameter(2978),_e=new lt().fromArray(Z),ne=new lt().fromArray(fe);function ie(F,pe,k){const ee=new Uint8Array(4),de=n.createTexture();n.bindTexture(F,de),n.texParameteri(F,10241,9728),n.texParameteri(F,10240,9728);for(let me=0;me<k;me++)n.texImage2D(pe+me,0,6408,1,1,0,6408,5121,ee);return de}const xe={};xe[3553]=ie(3553,3553,1),xe[34067]=ie(34067,34069,6),a.setClear(0,0,0,1),c.setClear(1),l.setClear(0),ve(2929),c.setFunc(Zo),ke(!1),K(ol),ve(2884),Se(Hn);function ve(F){u[F]!==!0&&(n.enable(F),u[F]=!0)}function Ce(F){u[F]!==!1&&(n.disable(F),u[F]=!1)}function Ne(F,pe){return h[F]!==pe?(n.bindFramebuffer(F,pe),h[F]=pe,i&&(F===36009&&(h[36160]=pe),F===36160&&(h[36009]=pe)),!0):!1}function le(F){return f!==F?(n.useProgram(F),f=F,!0):!1}const Be={[Fi]:32774,[lf]:32778,[cf]:32779};if(i)Be[dl]=32775,Be[ul]=32776;else{const F=e.get("EXT_blend_minmax");F!==null&&(Be[dl]=F.MIN_EXT,Be[ul]=F.MAX_EXT)}const Ie={[df]:0,[uf]:1,[hf]:768,[ud]:770,[vf]:776,[gf]:774,[pf]:772,[ff]:769,[hd]:771,[_f]:775,[mf]:773};function Se(F,pe,k,ee,de,me,we,Fe){if(F===Hn){p===!0&&(Ce(3042),p=!1);return}if(p===!1&&(ve(3042),p=!0),F!==af){if(F!==g||Fe!==T){if((_!==Fi||y!==Fi)&&(n.blendEquation(32774),_=Fi,y=Fi),Fe)switch(F){case Ss:n.blendFuncSeparate(1,771,1,771);break;case al:n.blendFunc(1,1);break;case ll:n.blendFuncSeparate(0,0,769,771);break;case cl:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}else switch(F){case Ss:n.blendFuncSeparate(770,771,1,771);break;case al:n.blendFunc(770,1);break;case ll:n.blendFunc(0,769);break;case cl:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}w=null,v=null,C=null,S=null,g=F,T=Fe}return}de=de||pe,me=me||k,we=we||ee,(pe!==_||de!==y)&&(n.blendEquationSeparate(Be[pe],Be[de]),_=pe,y=de),(k!==w||ee!==v||me!==C||we!==S)&&(n.blendFuncSeparate(Ie[k],Ie[ee],Ie[me],Ie[we]),w=k,v=ee,C=me,S=we),g=F,T=null}function q(F,pe){F.side===Yi?Ce(2884):ve(2884);let k=F.side===Mt;pe&&(k=!k),ke(k),F.blending===Ss&&F.transparent===!1?Se(Hn):Se(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.premultipliedAlpha),c.setFunc(F.depthFunc),c.setTest(F.depthTest),c.setMask(F.depthWrite),a.setMask(F.colorWrite);const ee=F.stencilWrite;l.setTest(ee),ee&&(l.setMask(F.stencilWriteMask),l.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),l.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),he(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),F.alphaToCoverage===!0?ve(32926):Ce(32926)}function ke(F){P!==F&&(F?n.frontFace(2304):n.frontFace(2305),P=F)}function K(F){F!==sf?(ve(2884),F!==b&&(F===ol?n.cullFace(1029):F===rf?n.cullFace(1028):n.cullFace(1032))):Ce(2884),b=F}function ue(F){F!==z&&(ge&&n.lineWidth(F),z=F)}function he(F,pe,k){F?(ve(32823),(oe!==pe||X!==k)&&(n.polygonOffset(pe,k),oe=pe,X=k)):Ce(32823)}function be(F){F?ve(3089):Ce(3089)}function $(F){F===void 0&&(F=33984+D-1),Y!==F&&(n.activeTexture(F),Y=F)}function Me(F,pe){Y===null&&$();let k=W[Y];k===void 0&&(k={type:void 0,texture:void 0},W[Y]=k),(k.type!==F||k.texture!==pe)&&(n.bindTexture(F,pe||xe[F]),k.type=F,k.texture=pe)}function Pe(){const F=W[Y];F!==void 0&&F.type!==void 0&&(n.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)}function Ge(){try{n.compressedTexImage2D.apply(n,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ot(){try{n.texSubImage2D.apply(n,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function R(){try{n.texStorage2D.apply(n,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function A(){try{n.texImage2D.apply(n,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ae(){try{n.texImage3D.apply(n,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function re(F){_e.equals(F)===!1&&(n.scissor(F.x,F.y,F.z,F.w),_e.copy(F))}function Le(F){ne.equals(F)===!1&&(n.viewport(F.x,F.y,F.z,F.w),ne.copy(F))}function Te(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),u={},Y=null,W={},h={},f=null,p=!1,g=null,_=null,w=null,v=null,y=null,C=null,S=null,T=!1,P=null,b=null,z=null,oe=null,X=null,_e.set(0,0,n.canvas.width,n.canvas.height),ne.set(0,0,n.canvas.width,n.canvas.height),a.reset(),c.reset(),l.reset()}return{buffers:{color:a,depth:c,stencil:l},enable:ve,disable:Ce,bindFramebuffer:Ne,useProgram:le,setBlending:Se,setMaterial:q,setFlipSided:ke,setCullFace:K,setLineWidth:ue,setPolygonOffset:he,setScissorTest:be,activeTexture:$,bindTexture:Me,unbindTexture:Pe,compressedTexImage2D:Ge,texImage2D:A,texImage3D:ae,texStorage2D:R,texSubImage2D:ot,scissor:re,viewport:Le,reset:Te}}function u1(n,e,t,i,s,r,o){const a=s.isWebGL2,c=s.maxTextures,l=s.maxCubemapSize,u=s.maxTextureSize,h=s.maxSamples,p=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):void 0,g=new WeakMap;let _,w=!1;try{w=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(R,A){return w?new OffscreenCanvas(R,A):Gr("canvas")}function y(R,A,ae,re){let Le=1;if((R.width>re||R.height>re)&&(Le=re/Math.max(R.width,R.height)),Le<1||A===!0)if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap){const Te=A?Np:Math.floor,F=Te(Le*R.width),pe=Te(Le*R.height);_===void 0&&(_=v(F,pe));const k=ae?v(F,pe):_;return k.width=F,k.height=pe,k.getContext("2d").drawImage(R,0,0,F,pe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+R.width+"x"+R.height+") to ("+F+"x"+pe+")."),k}else return"data"in R&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+R.width+"x"+R.height+")."),R;return R}function C(R){return Cl(R.width)&&Cl(R.height)}function S(R){return a?!1:R.wrapS!==Yt||R.wrapT!==Yt||R.minFilter!==At&&R.minFilter!==Qt}function T(R,A){return R.generateMipmaps&&A&&R.minFilter!==At&&R.minFilter!==Qt}function P(R){n.generateMipmap(R)}function b(R,A,ae){if(a===!1)return A;if(R!==null){if(n[R]!==void 0)return n[R];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let re=A;return A===6403&&(ae===5126&&(re=33326),ae===5131&&(re=33325),ae===5121&&(re=33321)),A===6407&&(ae===5126&&(re=34837),ae===5131&&(re=34843),ae===5121&&(re=32849)),A===6408&&(ae===5126&&(re=34836),ae===5131&&(re=34842),ae===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function z(R,A,ae){return T(R,ae)===!0?Math.log2(Math.max(A.width,A.height))+1:R.mipmaps.length>0?R.mipmaps.length:1}function oe(R){return R===At||R===hl||R===fl?9728:9729}function X(R){const A=R.target;A.removeEventListener("dispose",X),ge(A),A.isVideoTexture&&g.delete(A),o.memory.textures--}function D(R){const A=R.target;A.removeEventListener("dispose",D),G(A)}function ge(R){const A=i.get(R);A.__webglInit!==void 0&&(n.deleteTexture(A.__webglTexture),i.remove(R))}function G(R){const A=R.texture,ae=i.get(R),re=i.get(A);if(R){if(re.__webglTexture!==void 0&&(n.deleteTexture(re.__webglTexture),o.memory.textures--),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLCubeRenderTarget)for(let Le=0;Le<6;Le++)n.deleteFramebuffer(ae.__webglFramebuffer[Le]),ae.__webglDepthbuffer&&n.deleteRenderbuffer(ae.__webglDepthbuffer[Le]);else n.deleteFramebuffer(ae.__webglFramebuffer),ae.__webglDepthbuffer&&n.deleteRenderbuffer(ae.__webglDepthbuffer),ae.__webglMultisampledFramebuffer&&n.deleteFramebuffer(ae.__webglMultisampledFramebuffer),ae.__webglColorRenderbuffer&&n.deleteRenderbuffer(ae.__webglColorRenderbuffer),ae.__webglDepthRenderbuffer&&n.deleteRenderbuffer(ae.__webglDepthRenderbuffer);if(R.isWebGLMultipleRenderTargets)for(let Le=0,Te=A.length;Le<Te;Le++){const F=i.get(A[Le]);F.__webglTexture&&(n.deleteTexture(F.__webglTexture),o.memory.textures--),i.remove(A[Le])}i.remove(A),i.remove(R)}}let V=0;function Y(){V=0}function W(){const R=V;return R>=c&&console.warn("THREE.WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+c),V+=1,R}function Z(R,A){const ae=i.get(R);if(R.isVideoTexture&&$(R),R.version>0&&ae.__version!==R.version){const re=R.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(ae,R,A);return}}t.activeTexture(33984+A),t.bindTexture(3553,ae.__webglTexture)}function fe(R,A){const ae=i.get(R);if(R.version>0&&ae.__version!==R.version){Ne(ae,R,A);return}t.activeTexture(33984+A),t.bindTexture(35866,ae.__webglTexture)}function _e(R,A){const ae=i.get(R);if(R.version>0&&ae.__version!==R.version){Ne(ae,R,A);return}t.activeTexture(33984+A),t.bindTexture(32879,ae.__webglTexture)}function ne(R,A){const ae=i.get(R);if(R.version>0&&ae.__version!==R.version){le(ae,R,A);return}t.activeTexture(33984+A),t.bindTexture(34067,ae.__webglTexture)}const ie={[kr]:10497,[Yt]:33071,[Ko]:33648},xe={[At]:9728,[hl]:9984,[fl]:9986,[Qt]:9729,[Pf]:9985,[Ur]:9987};function ve(R,A,ae){if(ae?(n.texParameteri(R,10242,ie[A.wrapS]),n.texParameteri(R,10243,ie[A.wrapT]),(R===32879||R===35866)&&n.texParameteri(R,32882,ie[A.wrapR]),n.texParameteri(R,10240,xe[A.magFilter]),n.texParameteri(R,10241,xe[A.minFilter])):(n.texParameteri(R,10242,33071),n.texParameteri(R,10243,33071),(R===32879||R===35866)&&n.texParameteri(R,32882,33071),(A.wrapS!==Yt||A.wrapT!==Yt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(R,10240,oe(A.magFilter)),n.texParameteri(R,10241,oe(A.minFilter)),A.minFilter!==At&&A.minFilter!==Qt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const re=e.get("EXT_texture_filter_anisotropic");if(A.type===zn&&e.has("OES_texture_float_linear")===!1||a===!1&&A.type===Gi&&e.has("OES_texture_half_float_linear")===!1)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(n.texParameterf(R,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,s.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function Ce(R,A){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",X),R.__webglTexture=n.createTexture(),o.memory.textures++)}function Ne(R,A,ae){let re=3553;A.isDataTexture2DArray&&(re=35866),A.isDataTexture3D&&(re=32879),Ce(R,A),t.activeTexture(33984+ae),t.bindTexture(re,R.__webglTexture),n.pixelStorei(37440,A.flipY),n.pixelStorei(37441,A.premultiplyAlpha),n.pixelStorei(3317,A.unpackAlignment),n.pixelStorei(37443,0);const Le=S(A)&&C(A.image)===!1,Te=y(A.image,Le,!1,u),F=C(Te)||a,pe=r.convert(A.format);let k=r.convert(A.type),ee=b(A.internalFormat,pe,k,A.encoding);ve(re,A,F);let de;const me=A.mipmaps;if(A.isDepthTexture)ee=6402,a?A.type===zn?ee=36012:A.type===Sr?ee=33190:A.type===Wi?ee=35056:ee=33189:A.type===zn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),A.format===li&&ee===6402&&A.type!==As&&A.type!==Sr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=As,k=r.convert(A.type)),A.format===Zi&&ee===6402&&(ee=34041,A.type!==Wi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=Wi,k=r.convert(A.type))),t.texImage2D(3553,0,ee,Te.width,Te.height,0,pe,k,null);else if(A.isDataTexture)if(me.length>0&&F){for(let we=0,Fe=me.length;we<Fe;we++)de=me[we],t.texImage2D(3553,we,ee,de.width,de.height,0,pe,k,de.data);A.generateMipmaps=!1}else t.texImage2D(3553,0,ee,Te.width,Te.height,0,pe,k,Te.data);else if(A.isCompressedTexture)for(let we=0,Fe=me.length;we<Fe;we++)de=me[we],A.format!==Ht&&A.format!==ai?pe!==null?t.compressedTexImage2D(3553,we,ee,de.width,de.height,0,de.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,we,ee,de.width,de.height,0,pe,k,de.data);else if(A.isDataTexture2DArray)t.texImage3D(35866,0,ee,Te.width,Te.height,Te.depth,0,pe,k,Te.data);else if(A.isDataTexture3D)t.texImage3D(32879,0,ee,Te.width,Te.height,Te.depth,0,pe,k,Te.data);else{const we=z(A,Te,F),Fe=a&&A.isVideoTexture!==!0,ct=R.__version===void 0;if(me.length>0&&F){Fe&&ct&&t.texStorage2D(3553,we,ee,me[0].width,me[0].height);for(let Qe=0,xt=me.length;Qe<xt;Qe++)de=me[Qe],Fe?t.texSubImage2D(3553,Qe,0,0,pe,k,de):t.texImage2D(3553,Qe,ee,pe,k,de);A.generateMipmaps=!1}else Fe?(ct&&t.texStorage2D(3553,we,ee,Te.width,Te.height),t.texSubImage2D(3553,0,0,0,pe,k,Te)):t.texImage2D(3553,0,ee,pe,k,Te)}T(A,F)&&P(re),R.__version=A.version,A.onUpdate&&A.onUpdate(A)}function le(R,A,ae){if(A.image.length!==6)return;Ce(R,A),t.activeTexture(33984+ae),t.bindTexture(34067,R.__webglTexture),n.pixelStorei(37440,A.flipY),n.pixelStorei(37441,A.premultiplyAlpha),n.pixelStorei(3317,A.unpackAlignment),n.pixelStorei(37443,0);const re=A&&(A.isCompressedTexture||A.image[0].isCompressedTexture),Le=A.image[0]&&A.image[0].isDataTexture,Te=[];for(let we=0;we<6;we++)!re&&!Le?Te[we]=y(A.image[we],!1,!0,l):Te[we]=Le?A.image[we].image:A.image[we];const F=Te[0],pe=C(F)||a,k=r.convert(A.format),ee=r.convert(A.type),de=b(A.internalFormat,k,ee,A.encoding);ve(34067,A,pe);let me;if(re)for(let we=0;we<6;we++){me=Te[we].mipmaps;for(let Fe=0;Fe<me.length;Fe++){const ct=me[Fe];A.format!==Ht&&A.format!==ai?k!==null?t.compressedTexImage2D(34069+we,Fe,de,ct.width,ct.height,0,ct.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+we,Fe,de,ct.width,ct.height,0,k,ee,ct.data)}}else{me=A.mipmaps;for(let we=0;we<6;we++)if(Le){t.texImage2D(34069+we,0,de,Te[we].width,Te[we].height,0,k,ee,Te[we].data);for(let Fe=0;Fe<me.length;Fe++){const Qe=me[Fe].image[we].image;t.texImage2D(34069+we,Fe+1,de,Qe.width,Qe.height,0,k,ee,Qe.data)}}else{t.texImage2D(34069+we,0,de,k,ee,Te[we]);for(let Fe=0;Fe<me.length;Fe++){const ct=me[Fe];t.texImage2D(34069+we,Fe+1,de,k,ee,ct.image[we])}}}T(A,pe)&&P(34067),R.__version=A.version,A.onUpdate&&A.onUpdate(A)}function Be(R,A,ae,re,Le){const Te=r.convert(ae.format),F=r.convert(ae.type),pe=b(ae.internalFormat,Te,F,ae.encoding);i.get(A).__hasExternalTextures||(Le===32879||Le===35866?t.texImage3D(Le,0,pe,A.width,A.height,A.depth,0,Te,F,null):t.texImage2D(Le,0,pe,A.width,A.height,0,Te,F,null)),t.bindFramebuffer(36160,R),A.useRenderToTexture?p.framebufferTexture2DMultisampleEXT(36160,re,Le,i.get(ae).__webglTexture,0,be(A)):n.framebufferTexture2D(36160,re,Le,i.get(ae).__webglTexture,0),t.bindFramebuffer(36160,null)}function Ie(R,A,ae){if(n.bindRenderbuffer(36161,R),A.depthBuffer&&!A.stencilBuffer){let re=33189;if(ae||A.useRenderToTexture){const Le=A.depthTexture;Le&&Le.isDepthTexture&&(Le.type===zn?re=36012:Le.type===Sr&&(re=33190));const Te=be(A);A.useRenderToTexture?p.renderbufferStorageMultisampleEXT(36161,Te,re,A.width,A.height):n.renderbufferStorageMultisample(36161,Te,re,A.width,A.height)}else n.renderbufferStorage(36161,re,A.width,A.height);n.framebufferRenderbuffer(36160,36096,36161,R)}else if(A.depthBuffer&&A.stencilBuffer){const re=be(A);ae&&A.useRenderbuffer?n.renderbufferStorageMultisample(36161,re,35056,A.width,A.height):A.useRenderToTexture?p.renderbufferStorageMultisampleEXT(36161,re,35056,A.width,A.height):n.renderbufferStorage(36161,34041,A.width,A.height),n.framebufferRenderbuffer(36160,33306,36161,R)}else{const re=A.isWebGLMultipleRenderTargets===!0?A.texture[0]:A.texture,Le=r.convert(re.format),Te=r.convert(re.type),F=b(re.internalFormat,Le,Te,re.encoding),pe=be(A);ae&&A.useRenderbuffer?n.renderbufferStorageMultisample(36161,pe,F,A.width,A.height):A.useRenderToTexture?p.renderbufferStorageMultisampleEXT(36161,pe,F,A.width,A.height):n.renderbufferStorage(36161,F,A.width,A.height)}n.bindRenderbuffer(36161,null)}function Se(R,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,R),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(A.depthTexture).__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),Z(A.depthTexture,0);const re=i.get(A.depthTexture).__webglTexture,Le=be(A);if(A.depthTexture.format===li)A.useRenderToTexture?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,re,0,Le):n.framebufferTexture2D(36160,36096,3553,re,0);else if(A.depthTexture.format===Zi)A.useRenderToTexture?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,re,0,Le):n.framebufferTexture2D(36160,33306,3553,re,0);else throw new Error("Unknown depthTexture format")}function q(R){const A=i.get(R),ae=R.isWebGLCubeRenderTarget===!0;if(R.depthTexture&&!A.__autoAllocateDepthBuffer){if(ae)throw new Error("target.depthTexture not supported in Cube render targets");Se(A.__webglFramebuffer,R)}else if(ae){A.__webglDepthbuffer=[];for(let re=0;re<6;re++)t.bindFramebuffer(36160,A.__webglFramebuffer[re]),A.__webglDepthbuffer[re]=n.createRenderbuffer(),Ie(A.__webglDepthbuffer[re],R,!1)}else t.bindFramebuffer(36160,A.__webglFramebuffer),A.__webglDepthbuffer=n.createRenderbuffer(),Ie(A.__webglDepthbuffer,R,!1);t.bindFramebuffer(36160,null)}function ke(R,A,ae){const re=i.get(R);A!==void 0&&Be(re.__webglFramebuffer,R,R.texture,36064,3553),ae!==void 0&&q(R)}function K(R){const A=R.texture,ae=i.get(R),re=i.get(A);R.addEventListener("dispose",D),R.isWebGLMultipleRenderTargets!==!0&&(re.__webglTexture===void 0&&(re.__webglTexture=n.createTexture()),re.__version=A.version,o.memory.textures++);const Le=R.isWebGLCubeRenderTarget===!0,Te=R.isWebGLMultipleRenderTargets===!0,F=A.isDataTexture3D||A.isDataTexture2DArray,pe=C(R)||a;if(a&&A.format===ai&&(A.type===zn||A.type===Gi)&&(A.format=Ht,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),Le){ae.__webglFramebuffer=[];for(let k=0;k<6;k++)ae.__webglFramebuffer[k]=n.createFramebuffer()}else if(ae.__webglFramebuffer=n.createFramebuffer(),Te)if(s.drawBuffers){const k=R.texture;for(let ee=0,de=k.length;ee<de;ee++){const me=i.get(k[ee]);me.__webglTexture===void 0&&(me.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(R.useRenderbuffer)if(a){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,ae.__webglColorRenderbuffer);const k=r.convert(A.format),ee=r.convert(A.type),de=b(A.internalFormat,k,ee,A.encoding),me=be(R);n.renderbufferStorageMultisample(36161,me,de,R.width,R.height),t.bindFramebuffer(36160,ae.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,ae.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),R.depthBuffer&&(ae.__webglDepthRenderbuffer=n.createRenderbuffer(),Ie(ae.__webglDepthRenderbuffer,R,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(Le){t.bindTexture(34067,re.__webglTexture),ve(34067,A,pe);for(let k=0;k<6;k++)Be(ae.__webglFramebuffer[k],R,A,36064,34069+k);T(A,pe)&&P(34067),t.unbindTexture()}else if(Te){const k=R.texture;for(let ee=0,de=k.length;ee<de;ee++){const me=k[ee],we=i.get(me);t.bindTexture(3553,we.__webglTexture),ve(3553,me,pe),Be(ae.__webglFramebuffer,R,me,36064+ee,3553),T(me,pe)&&P(3553)}t.unbindTexture()}else{let k=3553;F&&(a?k=A.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(k,re.__webglTexture),ve(k,A,pe),Be(ae.__webglFramebuffer,R,A,36064,k),T(A,pe)&&P(k),t.unbindTexture()}R.depthBuffer&&q(R)}function ue(R){const A=C(R)||a,ae=R.isWebGLMultipleRenderTargets===!0?R.texture:[R.texture];for(let re=0,Le=ae.length;re<Le;re++){const Te=ae[re];if(T(Te,A)){const F=R.isWebGLCubeRenderTarget?34067:3553,pe=i.get(Te).__webglTexture;t.bindTexture(F,pe),P(F),t.unbindTexture()}}}function he(R){if(R.useRenderbuffer)if(a){const A=R.width,ae=R.height;let re=16384;const Le=[36064],Te=R.stencilBuffer?33306:36096;R.depthBuffer&&Le.push(Te),R.ignoreDepthForMultisampleCopy||(R.depthBuffer&&(re|=256),R.stencilBuffer&&(re|=1024));const F=i.get(R);t.bindFramebuffer(36008,F.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,F.__webglFramebuffer),R.ignoreDepthForMultisampleCopy&&(n.invalidateFramebuffer(36008,[Te]),n.invalidateFramebuffer(36009,[Te])),n.blitFramebuffer(0,0,A,ae,0,0,A,ae,re,9728),n.invalidateFramebuffer(36008,Le),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,F.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function be(R){return a&&(R.useRenderbuffer||R.useRenderToTexture)?Math.min(h,R.samples):0}function $(R){const A=o.render.frame;g.get(R)!==A&&(g.set(R,A),R.update())}let Me=!1,Pe=!1;function Ge(R,A){R&&R.isWebGLRenderTarget&&(Me===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Me=!0),R=R.texture),Z(R,A)}function ot(R,A){R&&R.isWebGLCubeRenderTarget&&(Pe===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),Pe=!0),R=R.texture),ne(R,A)}this.allocateTextureUnit=W,this.resetTextureUnits=Y,this.setTexture2D=Z,this.setTexture2DArray=fe,this.setTexture3D=_e,this.setTextureCube=ne,this.rebindTextures=ke,this.setupRenderTarget=K,this.updateRenderTargetMipmap=ue,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=Be,this.safeSetTexture2D=Ge,this.safeSetTextureCube=ot}function h1(n,e,t){const i=t.isWebGL2;function s(r){let o;if(r===qn)return 5121;if(r===Ff)return 32819;if(r===Bf)return 32820;if(r===$f)return 33635;if(r===Df)return 5120;if(r===Nf)return 5122;if(r===As)return 5123;if(r===Of)return 5124;if(r===Sr)return 5125;if(r===zn)return 5126;if(r===Gi)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(r===zf)return 6406;if(r===ai)return 6407;if(r===Ht)return 6408;if(r===Hf)return 6409;if(r===Uf)return 6410;if(r===li)return 6402;if(r===Zi)return 34041;if(r===Gf)return 6403;if(r===Wf)return 36244;if(r===qf)return 33319;if(r===jf)return 33320;if(r===Xf)return 36248;if(r===Yf)return 36249;if(r===pl||r===ml||r===gl||r===_l)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===pl)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===ml)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===gl)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===_l)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===vl||r===yl||r===xl||r===wl)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===vl)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===yl)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===xl)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===wl)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===Zf)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((r===bl||r===Ml)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(r===bl)return o.COMPRESSED_RGB8_ETC2;if(r===Ml)return o.COMPRESSED_RGBA8_ETC2_EAC}if(r===Jf||r===Qf||r===Kf||r===ep||r===tp||r===np||r===ip||r===sp||r===rp||r===op||r===ap||r===lp||r===cp||r===dp||r===hp||r===fp||r===pp||r===mp||r===gp||r===_p||r===vp||r===yp||r===xp||r===wp||r===bp||r===Mp||r===Sp||r===Cp)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?r:null;if(r===up)return o=e.get("EXT_texture_compression_bptc"),o!==null?r:null;if(r===Wi)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:s}}class Bd extends zt{constructor(e=[]){super(),this.cameras=e}}Bd.prototype.isArrayCamera=!0;class zi extends st{constructor(){super(),this.type="Group"}}zi.prototype.isGroup=!0;const f1={type:"move"};class $o{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zi,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 zi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(s=t.getPose(e.targetRaySpace,i),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(f1))),l&&e.hand){o=!0;for(const _ of e.hand.values()){const w=t.getJointPose(_,i);if(l.joints[_.jointName]===void 0){const y=new zi;y.matrixAutoUpdate=!1,y.visible=!1,l.joints[_.jointName]=y,l.add(y)}const v=l.joints[_.jointName];w!==null&&(v.matrix.fromArray(w.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=w.radius),v.visible=w!==null}const u=l.joints["index-finger-tip"],h=l.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,g=.005;l.inputState.pinching&&f>p+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&f<=p-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));return a!==null&&(a.visible=s!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=o!==null),this}}class na extends Dt{constructor(e,t,i,s,r,o,a,c,l,u){if(u=u!==void 0?u:li,u!==li&&u!==Zi)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===li&&(i=As),i===void 0&&u===Zi&&(i=Wi),super(null,s,r,o,a,c,u,i,l),this.image={width:e,height:t},this.magFilter=a!==void 0?a:At,this.minFilter=c!==void 0?c:At,this.flipY=!1,this.generateMipmaps=!1}}na.prototype.isDepthTexture=!0;class p1 extends Zn{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor";const c=e.extensions.has("WEBGL_multisampled_render_to_texture");let l=null,u=null,h=null,f=null,p=!1,g=null;const _=t.getContextAttributes();let w=null,v=null;const y=[],C=new Map,S=new zt;S.layers.enable(1),S.viewport=new lt;const T=new zt;T.layers.enable(2),T.viewport=new lt;const P=[S,T],b=new Bd;b.layers.enable(1),b.layers.enable(2);let z=null,oe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ne){let ie=y[ne];return ie===void 0&&(ie=new $o,y[ne]=ie),ie.getTargetRaySpace()},this.getControllerGrip=function(ne){let ie=y[ne];return ie===void 0&&(ie=new $o,y[ne]=ie),ie.getGripSpace()},this.getHand=function(ne){let ie=y[ne];return ie===void 0&&(ie=new $o,y[ne]=ie),ie.getHandSpace()};function X(ne){const ie=C.get(ne.inputSource);ie&&ie.dispatchEvent({type:ne.type,data:ne.inputSource})}function D(){C.forEach(function(ne,ie){ne.disconnect(ie)}),C.clear(),z=null,oe=null,e.setRenderTarget(w),f=null,h=null,u=null,s=null,v=null,_e.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ne){r=ne,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ne){a=ne,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:f},this.getBinding=function(){return u},this.getFrame=function(){return g},this.getSession=function(){return s},this.setSession=async function(ne){if(s=ne,s!==null){if(w=e.getRenderTarget(),s.addEventListener("select",X),s.addEventListener("selectstart",X),s.addEventListener("selectend",X),s.addEventListener("squeeze",X),s.addEventListener("squeezestart",X),s.addEventListener("squeezeend",X),s.addEventListener("end",D),s.addEventListener("inputsourceschange",ge),_.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ie={antialias:s.renderState.layers===void 0?_.antialias:!0,alpha:_.alpha,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(s,t,ie),s.updateRenderState({baseLayer:f}),v=new Kt(f.framebufferWidth,f.framebufferHeight)}else{p=_.antialias;let ie=null,xe=null,ve=null;_.depth&&(ve=_.stencil?35056:33189,ie=_.stencil?Zi:li,xe=_.stencil?Wi:As);const Ce={colorFormat:_.alpha||p?32856:32849,depthFormat:ve,scaleFactor:r};u=new XRWebGLBinding(s,t),h=u.createProjectionLayer(Ce),s.updateRenderState({layers:[h]}),p?v=new Ta(h.textureWidth,h.textureHeight,{format:Ht,type:qn,depthTexture:new na(h.textureWidth,h.textureHeight,xe,void 0,void 0,void 0,void 0,void 0,void 0,ie),stencilBuffer:_.stencil,ignoreDepth:h.ignoreDepthValues,useRenderToTexture:c}):v=new Kt(h.textureWidth,h.textureHeight,{format:_.alpha?Ht:ai,type:qn,depthTexture:new na(h.textureWidth,h.textureHeight,xe,void 0,void 0,void 0,void 0,void 0,void 0,ie),stencilBuffer:_.stencil,ignoreDepth:h.ignoreDepthValues})}this.setFoveation(0),o=await s.requestReferenceSpace(a),_e.setContext(s),_e.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function ge(ne){const ie=s.inputSources;for(let xe=0;xe<y.length;xe++)C.set(ie[xe],y[xe]);for(let xe=0;xe<ne.removed.length;xe++){const ve=ne.removed[xe],Ce=C.get(ve);Ce&&(Ce.dispatchEvent({type:"disconnected",data:ve}),C.delete(ve))}for(let xe=0;xe<ne.added.length;xe++){const ve=ne.added[xe],Ce=C.get(ve);Ce&&Ce.dispatchEvent({type:"connected",data:ve})}}const G=new L,V=new L;function Y(ne,ie,xe){G.setFromMatrixPosition(ie.matrixWorld),V.setFromMatrixPosition(xe.matrixWorld);const ve=G.distanceTo(V),Ce=ie.projectionMatrix.elements,Ne=xe.projectionMatrix.elements,le=Ce[14]/(Ce[10]-1),Be=Ce[14]/(Ce[10]+1),Ie=(Ce[9]+1)/Ce[5],Se=(Ce[9]-1)/Ce[5],q=(Ce[8]-1)/Ce[0],ke=(Ne[8]+1)/Ne[0],K=le*q,ue=le*ke,he=ve/(-q+ke),be=he*-q;ie.matrixWorld.decompose(ne.position,ne.quaternion,ne.scale),ne.translateX(be),ne.translateZ(he),ne.matrixWorld.compose(ne.position,ne.quaternion,ne.scale),ne.matrixWorldInverse.copy(ne.matrixWorld).invert();const $=le+he,Me=Be+he,Pe=K-be,Ge=ue+(ve-be),ot=Ie*Be/Me*$,R=Se*Be/Me*$;ne.projectionMatrix.makePerspective(Pe,Ge,ot,R,$,Me)}function W(ne,ie){ie===null?ne.matrixWorld.copy(ne.matrix):ne.matrixWorld.multiplyMatrices(ie.matrixWorld,ne.matrix),ne.matrixWorldInverse.copy(ne.matrixWorld).invert()}this.updateCamera=function(ne){if(s===null)return;b.near=T.near=S.near=ne.near,b.far=T.far=S.far=ne.far,(z!==b.near||oe!==b.far)&&(s.updateRenderState({depthNear:b.near,depthFar:b.far}),z=b.near,oe=b.far);const ie=ne.parent,xe=b.cameras;W(b,ie);for(let Ce=0;Ce<xe.length;Ce++)W(xe[Ce],ie);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),ne.position.copy(b.position),ne.quaternion.copy(b.quaternion),ne.scale.copy(b.scale),ne.matrix.copy(b.matrix),ne.matrixWorld.copy(b.matrixWorld);const ve=ne.children;for(let Ce=0,Ne=ve.length;Ce<Ne;Ce++)ve[Ce].updateMatrixWorld(!0);xe.length===2?Y(b,S,T):b.projectionMatrix.copy(S.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){if(h!==null)return h.fixedFoveation;if(f!==null)return f.fixedFoveation},this.setFoveation=function(ne){h!==null&&(h.fixedFoveation=ne),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=ne)};let Z=null;function fe(ne,ie){if(l=ie.getViewerPose(o),g=ie,l!==null){const ve=l.views;f!==null&&(e.setRenderTargetFramebuffer(v,f.framebuffer),e.setRenderTarget(v));let Ce=!1;ve.length!==b.cameras.length&&(b.cameras.length=0,Ce=!0);for(let Ne=0;Ne<ve.length;Ne++){const le=ve[Ne];let Be=null;if(f!==null)Be=f.getViewport(le);else{const Se=u.getViewSubImage(h,le);Be=Se.viewport,Ne===0&&(e.setRenderTargetTextures(v,Se.colorTexture,h.ignoreDepthValues?void 0:Se.depthStencilTexture),e.setRenderTarget(v))}const Ie=P[Ne];Ie.matrix.fromArray(le.transform.matrix),Ie.projectionMatrix.fromArray(le.projectionMatrix),Ie.viewport.set(Be.x,Be.y,Be.width,Be.height),Ne===0&&b.matrix.copy(Ie.matrix),Ce===!0&&b.cameras.push(Ie)}}const xe=s.inputSources;for(let ve=0;ve<y.length;ve++){const Ce=y[ve],Ne=xe[ve];Ce.update(Ne,ie,o)}Z&&Z(ne,ie),g=null}const _e=new Md;_e.setAnimationLoop(fe),this.setAnimationLoop=function(ne){Z=ne},this.dispose=function(){}}}function m1(n){function e(v,y){v.fogColor.value.copy(y.color),y.isFog?(v.fogNear.value=y.near,v.fogFar.value=y.far):y.isFogExp2&&(v.fogDensity.value=y.density)}function t(v,y,C,S,T){y.isMeshBasicMaterial?i(v,y):y.isMeshLambertMaterial?(i(v,y),c(v,y)):y.isMeshToonMaterial?(i(v,y),u(v,y)):y.isMeshPhongMaterial?(i(v,y),l(v,y)):y.isMeshStandardMaterial?(i(v,y),y.isMeshPhysicalMaterial?f(v,y,T):h(v,y)):y.isMeshMatcapMaterial?(i(v,y),p(v,y)):y.isMeshDepthMaterial?(i(v,y),g(v,y)):y.isMeshDistanceMaterial?(i(v,y),_(v,y)):y.isMeshNormalMaterial?(i(v,y),w(v,y)):y.isLineBasicMaterial?(s(v,y),y.isLineDashedMaterial&&r(v,y)):y.isPointsMaterial?o(v,y,C,S):y.isSpriteMaterial?a(v,y):y.isShadowMaterial?(v.color.value.copy(y.color),v.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function i(v,y){v.opacity.value=y.opacity,y.color&&v.diffuse.value.copy(y.color),y.emissive&&v.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.specularMap&&(v.specularMap.value=y.specularMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);const C=n.get(y).envMap;C&&(v.envMap.value=C,v.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=y.reflectivity,v.ior.value=y.ior,v.refractionRatio.value=y.refractionRatio),y.lightMap&&(v.lightMap.value=y.lightMap,v.lightMapIntensity.value=y.lightMapIntensity),y.aoMap&&(v.aoMap.value=y.aoMap,v.aoMapIntensity.value=y.aoMapIntensity);let S;y.map?S=y.map:y.specularMap?S=y.specularMap:y.displacementMap?S=y.displacementMap:y.normalMap?S=y.normalMap:y.bumpMap?S=y.bumpMap:y.roughnessMap?S=y.roughnessMap:y.metalnessMap?S=y.metalnessMap:y.alphaMap?S=y.alphaMap:y.emissiveMap?S=y.emissiveMap:y.clearcoatMap?S=y.clearcoatMap:y.clearcoatNormalMap?S=y.clearcoatNormalMap:y.clearcoatRoughnessMap?S=y.clearcoatRoughnessMap:y.specularIntensityMap?S=y.specularIntensityMap:y.specularColorMap?S=y.specularColorMap:y.transmissionMap?S=y.transmissionMap:y.thicknessMap?S=y.thicknessMap:y.sheenColorMap?S=y.sheenColorMap:y.sheenRoughnessMap&&(S=y.sheenRoughnessMap),S!==void 0&&(S.isWebGLRenderTarget&&(S=S.texture),S.matrixAutoUpdate===!0&&S.updateMatrix(),v.uvTransform.value.copy(S.matrix));let T;y.aoMap?T=y.aoMap:y.lightMap&&(T=y.lightMap),T!==void 0&&(T.isWebGLRenderTarget&&(T=T.texture),T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uv2Transform.value.copy(T.matrix))}function s(v,y){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity}function r(v,y){v.dashSize.value=y.dashSize,v.totalSize.value=y.dashSize+y.gapSize,v.scale.value=y.scale}function o(v,y,C,S){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity,v.size.value=y.size*C,v.scale.value=S*.5,y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);let T;y.map?T=y.map:y.alphaMap&&(T=y.alphaMap),T!==void 0&&(T.matrixAutoUpdate===!0&&T.updateMatrix(),v.uvTransform.value.copy(T.matrix))}function a(v,y){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity,v.rotation.value=y.rotation,y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);let C;y.map?C=y.map:y.alphaMap&&(C=y.alphaMap),C!==void 0&&(C.matrixAutoUpdate===!0&&C.updateMatrix(),v.uvTransform.value.copy(C.matrix))}function c(v,y){y.emissiveMap&&(v.emissiveMap.value=y.emissiveMap)}function l(v,y){v.specular.value.copy(y.specular),v.shininess.value=Math.max(y.shininess,1e-4),y.emissiveMap&&(v.emissiveMap.value=y.emissiveMap),y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===Mt&&(v.bumpScale.value*=-1)),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===Mt&&v.normalScale.value.negate()),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)}function u(v,y){y.gradientMap&&(v.gradientMap.value=y.gradientMap),y.emissiveMap&&(v.emissiveMap.value=y.emissiveMap),y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===Mt&&(v.bumpScale.value*=-1)),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===Mt&&v.normalScale.value.negate()),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)}function h(v,y){v.roughness.value=y.roughness,v.metalness.value=y.metalness,y.roughnessMap&&(v.roughnessMap.value=y.roughnessMap),y.metalnessMap&&(v.metalnessMap.value=y.metalnessMap),y.emissiveMap&&(v.emissiveMap.value=y.emissiveMap),y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===Mt&&(v.bumpScale.value*=-1)),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===Mt&&v.normalScale.value.negate()),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias),n.get(y).envMap&&(v.envMapIntensity.value=y.envMapIntensity)}function f(v,y,C){h(v,y),v.ior.value=y.ior,y.sheen>0&&(v.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),v.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(v.sheenColorMap.value=y.sheenColorMap),y.sheenRoughnessMap&&(v.sheenRoughnessMap.value=y.sheenRoughnessMap)),y.clearcoat>0&&(v.clearcoat.value=y.clearcoat,v.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(v.clearcoatMap.value=y.clearcoatMap),y.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap),y.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),v.clearcoatNormalMap.value=y.clearcoatNormalMap,y.side===Mt&&v.clearcoatNormalScale.value.negate())),y.transmission>0&&(v.transmission.value=y.transmission,v.transmissionSamplerMap.value=C.texture,v.transmissionSamplerSize.value.set(C.width,C.height),y.transmissionMap&&(v.transmissionMap.value=y.transmissionMap),v.thickness.value=y.thickness,y.thicknessMap&&(v.thicknessMap.value=y.thicknessMap),v.attenuationDistance.value=y.attenuationDistance,v.attenuationColor.value.copy(y.attenuationColor)),v.specularIntensity.value=y.specularIntensity,v.specularColor.value.copy(y.specularColor),y.specularIntensityMap&&(v.specularIntensityMap.value=y.specularIntensityMap),y.specularColorMap&&(v.specularColorMap.value=y.specularColorMap)}function p(v,y){y.matcap&&(v.matcap.value=y.matcap),y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===Mt&&(v.bumpScale.value*=-1)),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===Mt&&v.normalScale.value.negate()),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)}function g(v,y){y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)}function _(v,y){y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias),v.referencePosition.value.copy(y.referencePosition),v.nearDistance.value=y.nearDistance,v.farDistance.value=y.farDistance}function w(v,y){y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===Mt&&(v.bumpScale.value*=-1)),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===Mt&&v.normalScale.value.negate()),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function g1(){const n=Gr("canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:g1(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,s=n.depth!==void 0?n.depth:!0,r=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,a=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,c=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,l=n.powerPreference!==void 0?n.powerPreference:"default",u=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,f=null;const p=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Gt,this.physicallyCorrectLights=!1,this.toneMapping=oi,this.toneMappingExposure=1;const _=this;let w=!1,v=0,y=0,C=null,S=-1,T=null;const P=new lt,b=new lt;let z=null,oe=e.width,X=e.height,D=1,ge=null,G=null;const V=new lt(0,0,oe,X),Y=new lt(0,0,oe,X);let W=!1;const Z=[],fe=new qr;let _e=!1,ne=!1,ie=null;const xe=new De,ve=new L,Ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ne(){return C===null?D:1}let le=t;function Be(E,H){for(let J=0;J<E.length;J++){const j=E[J],se=e.getContext(j,H);if(se!==null)return se}return null}try{const E={alpha:i,depth:s,stencil:r,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${wa}`),e.addEventListener("webglcontextlost",we,!1),e.addEventListener("webglcontextrestored",Fe,!1),le===null){const H=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&H.shift(),le=Be(H,E),le===null)throw Be(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}le.getShaderPrecisionFormat===void 0&&(le.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let Ie,Se,q,ke,K,ue,he,be,$,Me,Pe,Ge,ot,R,A,ae,re,Le,Te,F,pe,k,ee;function de(){Ie=new $_(le),Se=new R_(le,Ie,n),Ie.init(Se),k=new h1(le,Ie,Se),q=new d1(le,Ie,Se),Z[0]=1029,ke=new U_,K=new K0,ue=new u1(le,Ie,q,K,Se,k,ke),he=new P_(_),be=new B_(_),$=new tm(le,Se),ee=new k_(le,Ie,$,Se),Me=new z_(le,$,ke,ee),Pe=new q_(le,Me,$,ke),Te=new W_(le,Se,ue),ae=new I_(K),Ge=new Q0(_,he,be,Ie,Se,ee,ae),ot=new m1(K),R=new t1(K),A=new a1(Ie,Se),Le=new A_(_,he,q,Pe,a),re=new Fd(_,Pe,Se),F=new L_(le,Ie,ke,Se),pe=new H_(le,Ie,ke,Se),ke.programs=Ge.programs,_.capabilities=Se,_.extensions=Ie,_.properties=K,_.renderLists=R,_.shadowMap=re,_.state=q,_.info=ke}de();const me=new p1(_,le);this.xr=me,this.getContext=function(){return le},this.getContextAttributes=function(){return le.getContextAttributes()},this.forceContextLoss=function(){const E=Ie.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=Ie.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return D},this.setPixelRatio=function(E){E!==void 0&&(D=E,this.setSize(oe,X,!1))},this.getSize=function(E){return E.set(oe,X)},this.setSize=function(E,H,J){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}oe=E,X=H,e.width=Math.floor(E*D),e.height=Math.floor(H*D),J!==!1&&(e.style.width=E+"px",e.style.height=H+"px"),this.setViewport(0,0,E,H)},this.getDrawingBufferSize=function(E){return E.set(oe*D,X*D).floor()},this.setDrawingBufferSize=function(E,H,J){oe=E,X=H,D=J,e.width=Math.floor(E*J),e.height=Math.floor(H*J),this.setViewport(0,0,E,H)},this.getCurrentViewport=function(E){return E.copy(P)},this.getViewport=function(E){return E.copy(V)},this.setViewport=function(E,H,J,j){E.isVector4?V.set(E.x,E.y,E.z,E.w):V.set(E,H,J,j),q.viewport(P.copy(V).multiplyScalar(D).floor())},this.getScissor=function(E){return E.copy(Y)},this.setScissor=function(E,H,J,j){E.isVector4?Y.set(E.x,E.y,E.z,E.w):Y.set(E,H,J,j),q.scissor(b.copy(Y).multiplyScalar(D).floor())},this.getScissorTest=function(){return W},this.setScissorTest=function(E){q.setScissorTest(W=E)},this.setOpaqueSort=function(E){ge=E},this.setTransparentSort=function(E){G=E},this.getClearColor=function(E){return E.copy(Le.getClearColor())},this.setClearColor=function(){Le.setClearColor.apply(Le,arguments)},this.getClearAlpha=function(){return Le.getClearAlpha()},this.setClearAlpha=function(){Le.setClearAlpha.apply(Le,arguments)},this.clear=function(E,H,J){let j=0;(E===void 0||E)&&(j|=16384),(H===void 0||H)&&(j|=256),(J===void 0||J)&&(j|=1024),le.clear(j)},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.dispose=function(){e.removeEventListener("webglcontextlost",we,!1),e.removeEventListener("webglcontextrestored",Fe,!1),R.dispose(),A.dispose(),K.dispose(),he.dispose(),be.dispose(),Pe.dispose(),ee.dispose(),me.dispose(),me.removeEventListener("sessionstart",tl),me.removeEventListener("sessionend",nl),ie&&(ie.dispose(),ie=null),Jn.stop()};function we(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function Fe(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const E=ke.autoReset,H=re.enabled,J=re.autoUpdate,j=re.needsUpdate,se=re.type;de(),ke.autoReset=E,re.enabled=H,re.autoUpdate=J,re.needsUpdate=j,re.type=se}function ct(E){const H=E.target;H.removeEventListener("dispose",ct),Qe(H)}function Qe(E){xt(E),K.remove(E)}function xt(E){const H=K.get(E).programs;H!==void 0&&H.forEach(function(J){Ge.releaseProgram(J)})}this.renderBufferDirect=function(E,H,J,j,se,ze){H===null&&(H=Ce);const Oe=se.isMesh&&se.matrixWorld.determinant()<0,We=Vu(E,H,J,j,se);q.setMaterial(j,Oe);let He=J.index;const et=J.attributes.position;if(He===null){if(et===void 0||et.count===0)return}else if(He.count===0)return;let qe=1;j.wireframe===!0&&(He=Me.getWireframeAttribute(J),qe=2),ee.setup(se,j,We,J,He);let Ke,vt=F;He!==null&&(Ke=$.get(He),vt=pe,vt.setIndex(Ke));const Qn=He!==null?He.count:et.count,nt=J.drawRange.start*qe,ds=J.drawRange.count*qe,ft=ze!==null?ze.start*qe:0,Kn=ze!==null?ze.count*qe:1/0,ei=Math.max(nt,ft),ti=Math.min(Qn,nt+ds,ft+Kn)-1,Ln=Math.max(0,ti-ei+1);if(Ln!==0){if(se.isMesh)j.wireframe===!0?(q.setLineWidth(j.wireframeLinewidth*Ne()),vt.setMode(1)):vt.setMode(4);else if(se.isLine){let yt=j.linewidth;yt===void 0&&(yt=1),q.setLineWidth(yt*Ne()),se.isLineSegments?vt.setMode(1):se.isLineLoop?vt.setMode(2):vt.setMode(3)}else se.isPoints?vt.setMode(0):se.isSprite&&vt.setMode(4);if(se.isInstancedMesh)vt.renderInstances(ei,Ln,se.count);else if(J.isInstancedBufferGeometry){const yt=Math.min(J.instanceCount,J._maxInstanceCount);vt.renderInstances(ei,Ln,yt)}else vt.render(ei,Ln)}},this.compile=function(E,H){f=A.get(E),f.init(),g.push(f),E.traverseVisible(function(J){J.isLight&&J.layers.test(H.layers)&&(f.pushLight(J),J.castShadow&&f.pushShadow(J))}),f.setupLights(_.physicallyCorrectLights),E.traverse(function(J){const j=J.material;if(j)if(Array.isArray(j))for(let se=0;se<j.length;se++){const ze=j[se];ro(ze,E,J)}else ro(j,E,J)}),g.pop(),f=null};let wt=null;function zu(E){wt&&wt(E)}function tl(){Jn.stop()}function nl(){Jn.start()}const Jn=new Md;Jn.setAnimationLoop(zu),typeof window<"u"&&Jn.setContext(window),this.setAnimationLoop=function(E){wt=E,me.setAnimationLoop(E),E===null?Jn.stop():Jn.start()},me.addEventListener("sessionstart",tl),me.addEventListener("sessionend",nl),this.render=function(E,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;E.autoUpdate===!0&&E.updateMatrixWorld(),H.parent===null&&H.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(H),H=me.getCamera()),E.isScene===!0&&E.onBeforeRender(_,E,H,C),f=A.get(E,g.length),f.init(),g.push(f),xe.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),fe.setFromProjectionMatrix(xe),ne=this.localClippingEnabled,_e=ae.init(this.clippingPlanes,ne,H),h=R.get(E,p.length),h.init(),p.push(h),il(E,H,0,_.sortObjects),h.finish(),_.sortObjects===!0&&h.sort(ge,G),_e===!0&&ae.beginShadows();const J=f.state.shadowsArray;if(re.render(J,E,H),_e===!0&&ae.endShadows(),this.info.autoReset===!0&&this.info.reset(),Le.render(h,E),f.setupLights(_.physicallyCorrectLights),H.isArrayCamera){const j=H.cameras;for(let se=0,ze=j.length;se<ze;se++){const Oe=j[se];sl(h,E,Oe,Oe.viewport)}}else sl(h,E,H);C!==null&&(ue.updateMultisampleRenderTarget(C),ue.updateRenderTargetMipmap(C)),E.isScene===!0&&E.onAfterRender(_,E,H),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1),ee.resetDefaultState(),S=-1,T=null,g.pop(),g.length>0?f=g[g.length-1]:f=null,p.pop(),p.length>0?h=p[p.length-1]:h=null};function il(E,H,J,j){if(E.visible===!1)return;if(E.layers.test(H.layers)){if(E.isGroup)J=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(H);else if(E.isLight)f.pushLight(E),E.castShadow&&f.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||fe.intersectsSprite(E)){j&&ve.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xe);const Oe=Pe.update(E),We=E.material;We.visible&&h.push(E,Oe,We,J,ve.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(E.isSkinnedMesh&&E.skeleton.frame!==ke.render.frame&&(E.skeleton.update(),E.skeleton.frame=ke.render.frame),!E.frustumCulled||fe.intersectsObject(E))){j&&ve.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xe);const Oe=Pe.update(E),We=E.material;if(Array.isArray(We)){const He=Oe.groups;for(let et=0,qe=He.length;et<qe;et++){const Ke=He[et],vt=We[Ke.materialIndex];vt&&vt.visible&&h.push(E,Oe,vt,J,ve.z,Ke)}}else We.visible&&h.push(E,Oe,We,J,ve.z,null)}}const ze=E.children;for(let Oe=0,We=ze.length;Oe<We;Oe++)il(ze[Oe],H,J,j)}function sl(E,H,J,j){const se=E.opaque,ze=E.transmissive,Oe=E.transparent;f.setupLightsView(J),ze.length>0&&Hu(se,H,J),j&&q.viewport(P.copy(j)),se.length>0&&qs(se,H,J),ze.length>0&&qs(ze,H,J),Oe.length>0&&qs(Oe,H,J)}function Hu(E,H,J){if(ie===null){const Oe=o===!0&&Se.isWebGL2===!0?Ta:Kt;ie=new Oe(1024,1024,{generateMipmaps:!0,type:k.convert(Gi)!==null?Gi:qn,minFilter:Ur,magFilter:At,wrapS:Yt,wrapT:Yt,useRenderToTexture:Ie.has("WEBGL_multisampled_render_to_texture")})}const j=_.getRenderTarget();_.setRenderTarget(ie),_.clear();const se=_.toneMapping;_.toneMapping=oi,qs(E,H,J),_.toneMapping=se,ue.updateMultisampleRenderTarget(ie),ue.updateRenderTargetMipmap(ie),_.setRenderTarget(j)}function qs(E,H,J){const j=H.isScene===!0?H.overrideMaterial:null;for(let se=0,ze=E.length;se<ze;se++){const Oe=E[se],We=Oe.object,He=Oe.geometry,et=j===null?Oe.material:j,qe=Oe.group;We.layers.test(J.layers)&&Uu(We,H,J,He,et,qe)}}function Uu(E,H,J,j,se,ze){E.onBeforeRender(_,H,J,j,se,ze),E.modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),se.onBeforeRender(_,H,J,j,E,ze),se.transparent===!0&&se.side===Yi?(se.side=Mt,se.needsUpdate=!0,_.renderBufferDirect(J,H,j,se,E,ze),se.side=Xi,se.needsUpdate=!0,_.renderBufferDirect(J,H,j,se,E,ze),se.side=Yi):_.renderBufferDirect(J,H,j,se,E,ze),E.onAfterRender(_,H,J,j,se,ze)}function ro(E,H,J){H.isScene!==!0&&(H=Ce);const j=K.get(E),se=f.state.lights,ze=f.state.shadowsArray,Oe=se.state.version,We=Ge.getParameters(E,se.state,ze,H,J),He=Ge.getProgramCacheKey(We);let et=j.programs;j.environment=E.isMeshStandardMaterial?H.environment:null,j.fog=H.fog,j.envMap=(E.isMeshStandardMaterial?be:he).get(E.envMap||j.environment),et===void 0&&(E.addEventListener("dispose",ct),et=new Map,j.programs=et);let qe=et.get(He);if(qe!==void 0){if(j.currentProgram===qe&&j.lightsStateVersion===Oe)return rl(E,We),qe}else We.uniforms=Ge.getUniforms(E),E.onBuild(J,We,_),E.onBeforeCompile(We,_),qe=Ge.acquireProgram(We,He),et.set(He,qe),j.uniforms=We.uniforms;const Ke=j.uniforms;(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Ke.clippingPlanes=ae.uniform),rl(E,We),j.needsLights=Wu(E),j.lightsStateVersion=Oe,j.needsLights&&(Ke.ambientLightColor.value=se.state.ambient,Ke.lightProbe.value=se.state.probe,Ke.directionalLights.value=se.state.directional,Ke.directionalLightShadows.value=se.state.directionalShadow,Ke.spotLights.value=se.state.spot,Ke.spotLightShadows.value=se.state.spotShadow,Ke.rectAreaLights.value=se.state.rectArea,Ke.ltc_1.value=se.state.rectAreaLTC1,Ke.ltc_2.value=se.state.rectAreaLTC2,Ke.pointLights.value=se.state.point,Ke.pointLightShadows.value=se.state.pointShadow,Ke.hemisphereLights.value=se.state.hemi,Ke.directionalShadowMap.value=se.state.directionalShadowMap,Ke.directionalShadowMatrix.value=se.state.directionalShadowMatrix,Ke.spotShadowMap.value=se.state.spotShadowMap,Ke.spotShadowMatrix.value=se.state.spotShadowMatrix,Ke.pointShadowMap.value=se.state.pointShadowMap,Ke.pointShadowMatrix.value=se.state.pointShadowMatrix);const vt=qe.getUniforms(),Qn=Vn.seqWithValue(vt.seq,Ke);return j.currentProgram=qe,j.uniformsList=Qn,qe}function rl(E,H){const J=K.get(E);J.outputEncoding=H.outputEncoding,J.instancing=H.instancing,J.skinning=H.skinning,J.morphTargets=H.morphTargets,J.morphNormals=H.morphNormals,J.morphTargetsCount=H.morphTargetsCount,J.numClippingPlanes=H.numClippingPlanes,J.numIntersection=H.numClipIntersection,J.vertexAlphas=H.vertexAlphas,J.vertexTangents=H.vertexTangents}function Vu(E,H,J,j,se){H.isScene!==!0&&(H=Ce),ue.resetTextureUnits();const ze=H.fog,Oe=j.isMeshStandardMaterial?H.environment:null,We=C===null?_.outputEncoding:C.texture.encoding,He=(j.isMeshStandardMaterial?be:he).get(j.envMap||Oe),et=j.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,qe=!!j.normalMap&&!!J.attributes.tangent,Ke=!!J.morphAttributes.position,vt=!!J.morphAttributes.normal,Qn=J.morphAttributes.position?J.morphAttributes.position.length:0,nt=K.get(j),ds=f.state.lights;if(_e===!0&&(ne===!0||E!==T)){const rn=E===T&&j.id===S;ae.setState(j,E,rn)}let ft=!1;j.version===nt.__version?(nt.needsLights&&nt.lightsStateVersion!==ds.state.version||nt.outputEncoding!==We||se.isInstancedMesh&&nt.instancing===!1||!se.isInstancedMesh&&nt.instancing===!0||se.isSkinnedMesh&&nt.skinning===!1||!se.isSkinnedMesh&&nt.skinning===!0||nt.envMap!==He||j.fog&&nt.fog!==ze||nt.numClippingPlanes!==void 0&&(nt.numClippingPlanes!==ae.numPlanes||nt.numIntersection!==ae.numIntersection)||nt.vertexAlphas!==et||nt.vertexTangents!==qe||nt.morphTargets!==Ke||nt.morphNormals!==vt||Se.isWebGL2===!0&&nt.morphTargetsCount!==Qn)&&(ft=!0):(ft=!0,nt.__version=j.version);let Kn=nt.currentProgram;ft===!0&&(Kn=ro(j,H,se));let ei=!1,ti=!1,Ln=!1;const yt=Kn.getUniforms(),us=nt.uniforms;if(q.useProgram(Kn.program)&&(ei=!0,ti=!0,Ln=!0),j.id!==S&&(S=j.id,ti=!0),ei||T!==E){if(yt.setValue(le,"projectionMatrix",E.projectionMatrix),Se.logarithmicDepthBuffer&&yt.setValue(le,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),T!==E&&(T=E,ti=!0,Ln=!0),j.isShaderMaterial||j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshStandardMaterial||j.envMap){const rn=yt.map.cameraPosition;rn!==void 0&&rn.setValue(le,ve.setFromMatrixPosition(E.matrixWorld))}(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&yt.setValue(le,"isOrthographic",E.isOrthographicCamera===!0),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial||j.isShadowMaterial||se.isSkinnedMesh)&&yt.setValue(le,"viewMatrix",E.matrixWorldInverse)}if(se.isSkinnedMesh){yt.setOptional(le,se,"bindMatrix"),yt.setOptional(le,se,"bindMatrixInverse");const rn=se.skeleton;rn&&(Se.floatVertexTextures?(rn.boneTexture===null&&rn.computeBoneTexture(),yt.setValue(le,"boneTexture",rn.boneTexture,ue),yt.setValue(le,"boneTextureSize",rn.boneTextureSize)):yt.setOptional(le,rn,"boneMatrices"))}return J&&(J.morphAttributes.position!==void 0||J.morphAttributes.normal!==void 0)&&Te.update(se,J,j,Kn),(ti||nt.receiveShadow!==se.receiveShadow)&&(nt.receiveShadow=se.receiveShadow,yt.setValue(le,"receiveShadow",se.receiveShadow)),ti&&(yt.setValue(le,"toneMappingExposure",_.toneMappingExposure),nt.needsLights&&Gu(us,Ln),ze&&j.fog&&ot.refreshFogUniforms(us,ze),ot.refreshMaterialUniforms(us,j,D,X,ie),Vn.upload(le,nt.uniformsList,us,ue)),j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(Vn.upload(le,nt.uniformsList,us,ue),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&yt.setValue(le,"center",se.center),yt.setValue(le,"modelViewMatrix",se.modelViewMatrix),yt.setValue(le,"normalMatrix",se.normalMatrix),yt.setValue(le,"modelMatrix",se.matrixWorld),Kn}function Gu(E,H){E.ambientLightColor.needsUpdate=H,E.lightProbe.needsUpdate=H,E.directionalLights.needsUpdate=H,E.directionalLightShadows.needsUpdate=H,E.pointLights.needsUpdate=H,E.pointLightShadows.needsUpdate=H,E.spotLights.needsUpdate=H,E.spotLightShadows.needsUpdate=H,E.rectAreaLights.needsUpdate=H,E.hemisphereLights.needsUpdate=H}function Wu(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return C},this.setRenderTargetTextures=function(E,H,J){K.get(E.texture).__webglTexture=H,K.get(E.depthTexture).__webglTexture=J;const j=K.get(E);j.__hasExternalTextures=!0,j.__hasExternalTextures&&(j.__autoAllocateDepthBuffer=J===void 0,j.__autoAllocateDepthBuffer||E.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),E.useRenderToTexture=!1,E.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(E,H){const J=K.get(E);J.__webglFramebuffer=H,J.__useDefaultFramebuffer=H===void 0},this.setRenderTarget=function(E,H=0,J=0){C=E,v=H,y=J;let j=!0;if(E){const He=K.get(E);He.__useDefaultFramebuffer!==void 0?(q.bindFramebuffer(36160,null),j=!1):He.__webglFramebuffer===void 0?ue.setupRenderTarget(E):He.__hasExternalTextures&&ue.rebindTextures(E,K.get(E.texture).__webglTexture,K.get(E.depthTexture).__webglTexture)}let se=null,ze=!1,Oe=!1;if(E){const He=E.texture;(He.isDataTexture3D||He.isDataTexture2DArray)&&(Oe=!0);const et=K.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(se=et[H],ze=!0):E.useRenderbuffer?se=K.get(E).__webglMultisampledFramebuffer:se=et,P.copy(E.viewport),b.copy(E.scissor),z=E.scissorTest}else P.copy(V).multiplyScalar(D).floor(),b.copy(Y).multiplyScalar(D).floor(),z=W;if(q.bindFramebuffer(36160,se)&&Se.drawBuffers&&j){let He=!1;if(E)if(E.isWebGLMultipleRenderTargets){const et=E.texture;if(Z.length!==et.length||Z[0]!==36064){for(let qe=0,Ke=et.length;qe<Ke;qe++)Z[qe]=36064+qe;Z.length=et.length,He=!0}}else(Z.length!==1||Z[0]!==36064)&&(Z[0]=36064,Z.length=1,He=!0);else(Z.length!==1||Z[0]!==1029)&&(Z[0]=1029,Z.length=1,He=!0);He&&(Se.isWebGL2?le.drawBuffers(Z):Ie.get("WEBGL_draw_buffers").drawBuffersWEBGL(Z))}if(q.viewport(P),q.scissor(b),q.setScissorTest(z),ze){const He=K.get(E.texture);le.framebufferTexture2D(36160,36064,34069+H,He.__webglTexture,J)}else if(Oe){const He=K.get(E.texture),et=H||0;le.framebufferTextureLayer(36160,36064,He.__webglTexture,J||0,et)}S=-1},this.readRenderTargetPixels=function(E,H,J,j,se,ze,Oe){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=K.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Oe!==void 0&&(We=We[Oe]),We){q.bindFramebuffer(36160,We);try{const He=E.texture,et=He.format,qe=He.type;if(et!==Ht&&k.convert(et)!==le.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Ke=qe===Gi&&(Ie.has("EXT_color_buffer_half_float")||Se.isWebGL2&&Ie.has("EXT_color_buffer_float"));if(qe!==qn&&k.convert(qe)!==le.getParameter(35738)&&!(qe===zn&&(Se.isWebGL2||Ie.has("OES_texture_float")||Ie.has("WEBGL_color_buffer_float")))&&!Ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}le.checkFramebufferStatus(36160)===36053?H>=0&&H<=E.width-j&&J>=0&&J<=E.height-se&&le.readPixels(H,J,j,se,k.convert(et),k.convert(qe),ze):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const He=C!==null?K.get(C).__webglFramebuffer:null;q.bindFramebuffer(36160,He)}}},this.copyFramebufferToTexture=function(E,H,J=0){const j=Math.pow(2,-J),se=Math.floor(H.image.width*j),ze=Math.floor(H.image.height*j);let Oe=k.convert(H.format);Se.isWebGL2&&(Oe===6407&&(Oe=32849),Oe===6408&&(Oe=32856)),ue.setTexture2D(H,0),le.copyTexImage2D(3553,J,Oe,E.x,E.y,se,ze,0),q.unbindTexture()},this.copyTextureToTexture=function(E,H,J,j=0){const se=H.image.width,ze=H.image.height,Oe=k.convert(J.format),We=k.convert(J.type);ue.setTexture2D(J,0),le.pixelStorei(37440,J.flipY),le.pixelStorei(37441,J.premultiplyAlpha),le.pixelStorei(3317,J.unpackAlignment),H.isDataTexture?le.texSubImage2D(3553,j,E.x,E.y,se,ze,Oe,We,H.image.data):H.isCompressedTexture?le.compressedTexSubImage2D(3553,j,E.x,E.y,H.mipmaps[0].width,H.mipmaps[0].height,Oe,H.mipmaps[0].data):le.texSubImage2D(3553,j,E.x,E.y,Oe,We,H.image),j===0&&J.generateMipmaps&&le.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(E,H,J,j,se=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ze=E.max.x-E.min.x+1,Oe=E.max.y-E.min.y+1,We=E.max.z-E.min.z+1,He=k.convert(j.format),et=k.convert(j.type);let qe;if(j.isDataTexture3D)ue.setTexture3D(j,0),qe=32879;else if(j.isDataTexture2DArray)ue.setTexture2DArray(j,0),qe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}le.pixelStorei(37440,j.flipY),le.pixelStorei(37441,j.premultiplyAlpha),le.pixelStorei(3317,j.unpackAlignment);const Ke=le.getParameter(3314),vt=le.getParameter(32878),Qn=le.getParameter(3316),nt=le.getParameter(3315),ds=le.getParameter(32877),ft=J.isCompressedTexture?J.mipmaps[0]:J.image;le.pixelStorei(3314,ft.width),le.pixelStorei(32878,ft.height),le.pixelStorei(3316,E.min.x),le.pixelStorei(3315,E.min.y),le.pixelStorei(32877,E.min.z),J.isDataTexture||J.isDataTexture3D?le.texSubImage3D(qe,se,H.x,H.y,H.z,ze,Oe,We,He,et,ft.data):J.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),le.compressedTexSubImage3D(qe,se,H.x,H.y,H.z,ze,Oe,We,He,ft.data)):le.texSubImage3D(qe,se,H.x,H.y,H.z,ze,Oe,We,He,et,ft),le.pixelStorei(3314,Ke),le.pixelStorei(32878,vt),le.pixelStorei(3316,Qn),le.pixelStorei(3315,nt),le.pixelStorei(32877,ds),se===0&&j.generateMipmaps&&le.generateMipmap(qe),q.unbindTexture()},this.initTexture=function(E){ue.setTexture2D(E,0),q.unbindTexture()},this.resetState=function(){v=0,y=0,C=null,q.reset(),ee.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}rt.prototype.isWebGLRenderer=!0;class _1 extends rt{}_1.prototype.isWebGL1Renderer=!0;class Na extends st{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}Na.prototype.isScene=!0;class Hs{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ks,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;s<r;s++)this.array[e+s]=t.array[i+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}Hs.prototype.isInterleavedBuffer=!0;const bt=new L;class Ls{constructor(e,t,i,s=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=s===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)bt.x=this.getX(t),bt.y=this.getY(t),bt.z=this.getZ(t),bt.applyMatrix4(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)bt.x=this.getX(t),bt.y=this.getY(t),bt.z=this.getZ(t),bt.applyNormalMatrix(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)bt.x=this.getX(t),bt.y=this.getY(t),bt.z=this.getZ(t),bt.transformDirection(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=s,this}setXYZW(e,t,i,s,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=s,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const s=i*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return new Ct(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ls(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const s=i*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Ls.prototype.isInterleavedBufferAttribute=!0;class $d extends kt{constructor(e){super(),this.type="SpriteMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}$d.prototype.isSpriteMaterial=!0;let Pi;const _s=new L,Di=new L,Ni=new L,Oi=new ce,vs=new ce,zd=new De,hr=new L,ys=new L,fr=new L,oc=new ce,zo=new ce,ac=new ce;class v1 extends st{constructor(e){if(super(),this.type="Sprite",Pi===void 0){Pi=new ut;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Hs(t,5);Pi.setIndex([0,1,2,0,2,3]),Pi.setAttribute("position",new Ls(i,3,0,!1)),Pi.setAttribute("uv",new Ls(i,2,3,!1))}this.geometry=Pi,this.material=e!==void 0?e:new $d,this.center=new ce(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Di.setFromMatrixScale(this.matrixWorld),zd.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ni.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Di.multiplyScalar(-Ni.z);const i=this.material.rotation;let s,r;i!==0&&(r=Math.cos(i),s=Math.sin(i));const o=this.center;pr(hr.set(-.5,-.5,0),Ni,o,Di,s,r),pr(ys.set(.5,-.5,0),Ni,o,Di,s,r),pr(fr.set(.5,.5,0),Ni,o,Di,s,r),oc.set(0,0),zo.set(1,0),ac.set(1,1);let a=e.ray.intersectTriangle(hr,ys,fr,!1,_s);if(a===null&&(pr(ys.set(-.5,.5,0),Ni,o,Di,s,r),zo.set(0,1),a=e.ray.intersectTriangle(hr,fr,ys,!1,_s),a===null))return;const c=e.ray.origin.distanceTo(_s);c<e.near||c>e.far||t.push({distance:c,point:_s.clone(),uv:St.getUV(_s,hr,ys,fr,oc,zo,ac,new ce),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}v1.prototype.isSprite=!0;function pr(n,e,t,i,s,r){Oi.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(vs.x=r*Oi.x-s*Oi.y,vs.y=s*Oi.x+r*Oi.y):vs.copy(Oi),n.copy(e),n.x+=vs.x,n.y+=vs.y,n.applyMatrix4(zd)}const lc=new L,cc=new lt,dc=new lt,y1=new L,uc=new De;class Hd extends Ot{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new De,this.bindMatrixInverse=new De}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new lt,t=this.geometry.attributes.skinWeight;for(let i=0,s=t.count;i<s;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,s=this.geometry;cc.fromBufferAttribute(s.attributes.skinIndex,e),dc.fromBufferAttribute(s.attributes.skinWeight,e),lc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const o=dc.getComponent(r);if(o!==0){const a=cc.getComponent(r);uc.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(y1.copy(lc).applyMatrix4(uc),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}Hd.prototype.isSkinnedMesh=!0;class x1 extends st{constructor(){super(),this.type="Bone"}}x1.prototype.isBone=!0;class w1 extends Dt{constructor(e=null,t=1,i=1,s,r,o,a,c,l=At,u=At,h,f){super(null,o,a,c,l,u,s,r,h,f),this.image={data:e,width:t,height:i},this.magFilter=l,this.minFilter=u,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}w1.prototype.isDataTexture=!0;class ia extends Ct{constructor(e,t,i,s=1){typeof i=="number"&&(s=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}ia.prototype.isInstancedBufferAttribute=!0;const hc=new De,fc=new De,mr=[],xs=new Ot;class b1 extends Ot{constructor(e,t,i){super(e,t),this.instanceMatrix=new ia(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,s=this.count;if(xs.geometry=this.geometry,xs.material=this.material,xs.material!==void 0)for(let r=0;r<s;r++){this.getMatrixAt(r,hc),fc.multiplyMatrices(i,hc),xs.matrixWorld=fc,xs.raycast(e,mr);for(let o=0,a=mr.length;o<a;o++){const c=mr[o];c.instanceId=r,c.object=this,t.push(c)}mr.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new ia(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}b1.prototype.isInstancedMesh=!0;class Gn extends kt{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Re(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}Gn.prototype.isLineBasicMaterial=!0;const pc=new L,mc=new L,gc=new De,Ho=new ss,gr=new is;class Oa extends st{constructor(e=new ut,t=new Gn){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let s=1,r=t.count;s<r;s++)pc.fromBufferAttribute(t,s-1),mc.fromBufferAttribute(t,s),i[s]=i[s-1],i[s]+=pc.distanceTo(mc);e.setAttribute("lineDistance",new gt(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,s=this.matrixWorld,r=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),gr.copy(i.boundingSphere),gr.applyMatrix4(s),gr.radius+=r,e.ray.intersectsSphere(gr)===!1)return;gc.copy(s).invert(),Ho.copy(e.ray).applyMatrix4(gc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a,l=new L,u=new L,h=new L,f=new L,p=this.isLineSegments?2:1;if(i.isBufferGeometry){const g=i.index,w=i.attributes.position;if(g!==null){const v=Math.max(0,o.start),y=Math.min(g.count,o.start+o.count);for(let C=v,S=y-1;C<S;C+=p){const T=g.getX(C),P=g.getX(C+1);if(l.fromBufferAttribute(w,T),u.fromBufferAttribute(w,P),Ho.distanceSqToSegment(l,u,f,h)>c)continue;f.applyMatrix4(this.matrixWorld);const z=e.ray.origin.distanceTo(f);z<e.near||z>e.far||t.push({distance:z,point:h.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),y=Math.min(w.count,o.start+o.count);for(let C=v,S=y-1;C<S;C+=p){if(l.fromBufferAttribute(w,C),u.fromBufferAttribute(w,C+1),Ho.distanceSqToSegment(l,u,f,h)>c)continue;f.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(f);P<e.near||P>e.far||t.push({distance:P,point:h.clone().applyMatrix4(this.matrixWorld),index:C,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){const a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Oa.prototype.isLine=!0;const _c=new L,vc=new L;class Rs extends Oa{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s<r;s+=2)_c.fromBufferAttribute(t,s),vc.fromBufferAttribute(t,s+1),i[s]=s===0?0:i[s-1],i[s+1]=i[s]+_c.distanceTo(vc);e.setAttribute("lineDistance",new gt(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Rs.prototype.isLineSegments=!0;class M1 extends Oa{constructor(e,t){super(e,t),this.type="LineLoop"}}M1.prototype.isLineLoop=!0;class Hi extends kt{constructor(e){super(),this.type="PointsMaterial",this.color=new Re(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}Hi.prototype.isPointsMaterial=!0;const yc=new De,sa=new ss,_r=new is,vr=new L;class Cr extends st{constructor(e=new ut,t=new Hi){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,s=this.matrixWorld,r=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),_r.copy(i.boundingSphere),_r.applyMatrix4(s),_r.radius+=r,e.ray.intersectsSphere(_r)===!1)return;yc.copy(s).invert(),sa.copy(e.ray).applyMatrix4(yc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),c=a*a;if(i.isBufferGeometry){const l=i.index,h=i.attributes.position;if(l!==null){const f=Math.max(0,o.start),p=Math.min(l.count,o.start+o.count);for(let g=f,_=p;g<_;g++){const w=l.getX(g);vr.fromBufferAttribute(h,w),xc(vr,w,c,s,e,t,this)}}else{const f=Math.max(0,o.start),p=Math.min(h.count,o.start+o.count);for(let g=f,_=p;g<_;g++)vr.fromBufferAttribute(h,g),xc(vr,g,c,s,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r<o;r++){const a=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Cr.prototype.isPoints=!0;function xc(n,e,t,i,s,r,o){const a=sa.distanceSqToPoint(n);if(a<t){const c=new L;sa.closestPointToPoint(n,c),c.applyMatrix4(i);const l=s.ray.origin.distanceTo(c);if(l<s.near||l>s.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class S1 extends Dt{constructor(e,t,i,s,r,o,a,c,l){super(e,t,i,s,r,o,a,c,l),this.format=a!==void 0?a:ai,this.minFilter=o!==void 0?o:Qt,this.magFilter=r!==void 0?r:Qt,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}S1.prototype.isVideoTexture=!0;class C1 extends Dt{constructor(e,t,i,s,r,o,a,c,l,u,h,f){super(null,o,a,c,l,u,s,r,h,f),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}C1.prototype.isCompressedTexture=!0;class T1 extends Dt{constructor(e,t,i,s,r,o,a,c,l){super(e,t,i,s,r,o,a,c,l),this.needsUpdate=!0}}T1.prototype.isCanvasTexture=!0;class tn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,c=r-1,l;for(;a<=c;)if(s=Math.floor(a+(c-a)/2),l=i[s]-o,l<0)a=s+1;else if(l>0)c=s-1;else{c=s;break}if(s=c,i[s]===o)return s/(r-1);const u=i[s],f=i[s+1]-u,p=(o-u)/f;return(s+p)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),c=t||(o.isVector2?new ce:new L);return c.copy(a).sub(o).normalize(),c}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new L,s=[],r=[],o=[],a=new L,c=new De;for(let p=0;p<=e;p++){const g=p/e;s[p]=this.getTangentAt(g,new L)}r[0]=new L,o[0]=new L;let l=Number.MAX_VALUE;const u=Math.abs(s[0].x),h=Math.abs(s[0].y),f=Math.abs(s[0].z);u<=l&&(l=u,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),f<=l&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let p=1;p<=e;p++){if(r[p]=r[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(s[p-1],s[p]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(Vt(s[p-1].dot(s[p]),-1,1));r[p].applyMatrix4(c.makeRotationAxis(a,g))}o[p].crossVectors(s[p],r[p])}if(t===!0){let p=Math.acos(Vt(r[0].dot(r[e]),-1,1));p/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(p=-p);for(let g=1;g<=e;g++)r[g].applyMatrix4(c.makeRotationAxis(s[g],p*g)),o[g].crossVectors(s[g],r[g])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Yr extends tn{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,c=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(e,t){const i=t||new ce,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=s;for(;r>s;)r-=s;r<Number.EPSILON&&(o?r=0:r=s),this.aClockwise===!0&&!o&&(r===s?r=-s:r=r-s);const a=this.aStartAngle+e*r;let c=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),f=c-this.aX,p=l-this.aY;c=f*u-p*h+this.aX,l=f*h+p*u+this.aY}return i.set(c,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}Yr.prototype.isEllipseCurve=!0;class Ud extends Yr{constructor(e,t,i,s,r,o){super(e,t,i,i,s,r,o),this.type="ArcCurve"}}Ud.prototype.isArcCurve=!0;function Fa(){let n=0,e=0,t=0,i=0;function s(r,o,a,c){n=r,e=a,t=-3*r+3*o-2*a-c,i=2*r-2*o+a+c}return{initCatmullRom:function(r,o,a,c,l){s(o,a,l*(a-r),l*(c-o))},initNonuniformCatmullRom:function(r,o,a,c,l,u,h){let f=(o-r)/l-(a-r)/(l+u)+(a-o)/u,p=(a-o)/u-(c-o)/(u+h)+(c-a)/h;f*=u,p*=u,s(o,a,f,p)},calc:function(r){const o=r*r,a=o*r;return n+e*r+t*o+i*a}}}const yr=new L,Uo=new Fa,Vo=new Fa,Go=new Fa;class Vd extends tn{constructor(e=[],t=!1,i="centripetal",s=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=s}getPoint(e,t=new L){const i=t,s=this.points,r=s.length,o=(r-(this.closed?0:1))*e;let a=Math.floor(o),c=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:c===0&&a===r-1&&(a=r-2,c=1);let l,u;this.closed||a>0?l=s[(a-1)%r]:(yr.subVectors(s[0],s[1]).add(s[0]),l=yr);const h=s[a%r],f=s[(a+1)%r];if(this.closed||a+2<r?u=s[(a+2)%r]:(yr.subVectors(s[r-1],s[r-2]).add(s[r-1]),u=yr),this.curveType==="centripetal"||this.curveType==="chordal"){const p=this.curveType==="chordal"?.5:.25;let g=Math.pow(l.distanceToSquared(h),p),_=Math.pow(h.distanceToSquared(f),p),w=Math.pow(f.distanceToSquared(u),p);_<1e-4&&(_=1),g<1e-4&&(g=_),w<1e-4&&(w=_),Uo.initNonuniformCatmullRom(l.x,h.x,f.x,u.x,g,_,w),Vo.initNonuniformCatmullRom(l.y,h.y,f.y,u.y,g,_,w),Go.initNonuniformCatmullRom(l.z,h.z,f.z,u.z,g,_,w)}else this.curveType==="catmullrom"&&(Uo.initCatmullRom(l.x,h.x,f.x,u.x,this.tension),Vo.initCatmullRom(l.y,h.y,f.y,u.y,this.tension),Go.initCatmullRom(l.z,h.z,f.z,u.z,this.tension));return i.set(Uo.calc(c),Vo.calc(c),Go.calc(c)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const s=e.points[t];this.points.push(s.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const s=this.points[t];e.points.push(s.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const s=e.points[t];this.points.push(new L().fromArray(s))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}Vd.prototype.isCatmullRomCurve3=!0;function wc(n,e,t,i,s){const r=(i-e)*.5,o=(s-t)*.5,a=n*n,c=n*a;return(2*t-2*i+r+o)*c+(-3*t+3*i-2*r-o)*a+r*n+t}function E1(n,e){const t=1-n;return t*t*e}function A1(n,e){return 2*(1-n)*n*e}function k1(n,e){return n*n*e}function Cs(n,e,t,i){return E1(n,e)+A1(n,t)+k1(n,i)}function L1(n,e){const t=1-n;return t*t*t*e}function R1(n,e){const t=1-n;return 3*t*t*n*e}function I1(n,e){return 3*(1-n)*n*n*e}function P1(n,e){return n*n*n*e}function Ts(n,e,t,i,s){return L1(n,e)+R1(n,t)+I1(n,i)+P1(n,s)}class Ba extends tn{constructor(e=new ce,t=new ce,i=new ce,s=new ce){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=s}getPoint(e,t=new ce){const i=t,s=this.v0,r=this.v1,o=this.v2,a=this.v3;return i.set(Ts(e,s.x,r.x,o.x,a.x),Ts(e,s.y,r.y,o.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Ba.prototype.isCubicBezierCurve=!0;class Gd extends tn{constructor(e=new L,t=new L,i=new L,s=new L){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=s}getPoint(e,t=new L){const i=t,s=this.v0,r=this.v1,o=this.v2,a=this.v3;return i.set(Ts(e,s.x,r.x,o.x,a.x),Ts(e,s.y,r.y,o.y,a.y),Ts(e,s.z,r.z,o.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}Gd.prototype.isCubicBezierCurve3=!0;class Zr extends tn{constructor(e=new ce,t=new ce){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ce){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new ce;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Zr.prototype.isLineCurve=!0;class D1 extends tn{constructor(e=new L,t=new L){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new L){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class $a extends tn{constructor(e=new ce,t=new ce,i=new ce){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ce){const i=t,s=this.v0,r=this.v1,o=this.v2;return i.set(Cs(e,s.x,r.x,o.x),Cs(e,s.y,r.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}$a.prototype.isQuadraticBezierCurve=!0;class Wd extends tn{constructor(e=new L,t=new L,i=new L){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new L){const i=t,s=this.v0,r=this.v1,o=this.v2;return i.set(Cs(e,s.x,r.x,o.x),Cs(e,s.y,r.y,o.y),Cs(e,s.z,r.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Wd.prototype.isQuadraticBezierCurve3=!0;class za extends tn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new ce){const i=t,s=this.points,r=(s.length-1)*e,o=Math.floor(r),a=r-o,c=s[o===0?o:o-1],l=s[o],u=s[o>s.length-2?s.length-1:o+1],h=s[o>s.length-3?s.length-1:o+2];return i.set(wc(a,c.x,l.x,u.x,h.x),wc(a,c.y,l.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const s=e.points[t];this.points.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const s=this.points[t];e.points.push(s.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const s=e.points[t];this.points.push(new ce().fromArray(s))}return this}}za.prototype.isSplineCurve=!0;var qd=Object.freeze({__proto__:null,ArcCurve:Ud,CatmullRomCurve3:Vd,CubicBezierCurve:Ba,CubicBezierCurve3:Gd,EllipseCurve:Yr,LineCurve:Zr,LineCurve3:D1,QuadraticBezierCurve:$a,QuadraticBezierCurve3:Wd,SplineCurve:za});class N1 extends tn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Zr(t,e))}getPoint(e,t){const i=e*this.getLength(),s=this.getCurveLengths();let r=0;for(;r<s.length;){if(s[r]>=i){const o=s[r]-i,a=this.curves[r],c=a.getLength(),l=c===0?0:1-o/c;return a.getPointAt(l,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i<s;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let s=0,r=this.curves;s<r.length;s++){const o=r[s],a=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,c=o.getPoints(a);for(let l=0;l<c.length;l++){const u=c[l];i&&i.equals(u)||(t.push(u),i=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const s=e.curves[t];this.curves.push(s.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const s=this.curves[t];e.curves.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const s=e.curves[t];this.curves.push(new qd[s.type]().fromJSON(s))}return this}}class ra extends N1{constructor(e){super(),this.type="Path",this.currentPoint=new ce,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Zr(this.currentPoint.clone(),new ce(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,s){const r=new $a(this.currentPoint.clone(),new ce(e,t),new ce(i,s));return this.curves.push(r),this.currentPoint.set(i,s),this}bezierCurveTo(e,t,i,s,r,o){const a=new Ba(this.currentPoint.clone(),new ce(e,t),new ce(i,s),new ce(r,o));return this.curves.push(a),this.currentPoint.set(r,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new za(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,s,r,o){const a=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+a,t+c,i,s,r,o),this}absarc(e,t,i,s,r,o){return this.absellipse(e,t,i,i,s,r,o),this}ellipse(e,t,i,s,r,o,a,c){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,i,s,r,o,a,c),this}absellipse(e,t,i,s,r,o,a,c){const l=new Yr(e,t,i,s,r,o,a,c);if(this.curves.length>0){const h=l.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Us extends ra{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,s=this.holes.length;i<s;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const s=e.holes[t];this.holes.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const s=this.holes[t];e.holes.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const s=e.holes[t];this.holes.push(new ra().fromJSON(s))}return this}}const O1={triangulate:function(n,e,t=2){const i=e&&e.length,s=i?e[0]*t:n.length;let r=jd(n,0,s,t,!0);const o=[];if(!r||r.next===r.prev)return o;let a,c,l,u,h,f,p;if(i&&(r=H1(n,e,r,t)),n.length>80*t){a=l=n[0],c=u=n[1];for(let g=t;g<s;g+=t)h=n[g],f=n[g+1],h<a&&(a=h),f<c&&(c=f),h>l&&(l=h),f>u&&(u=f);p=Math.max(l-a,u-c),p=p!==0?1/p:0}return Is(r,o,t,a,c,p),o}};function jd(n,e,t,i,s){let r,o;if(s===Q1(n,e,t,i)>0)for(r=e;r<t;r+=i)o=bc(r,n[r],n[r+1],o);else for(r=t-i;r>=e;r-=i)o=bc(r,n[r],n[r+1],o);return o&&Jr(o,o.next)&&(Ds(o),o=o.next),o}function jn(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Jr(t,t.next)||_t(t.prev,t,t.next)===0)){if(Ds(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Is(n,e,t,i,s,r,o){if(!n)return;!o&&r&&q1(n,i,s,r);let a=n,c,l;for(;n.prev!==n.next;){if(c=n.prev,l=n.next,r?B1(n,i,s,r):F1(n)){e.push(c.i/t),e.push(n.i/t),e.push(l.i/t),Ds(n),n=l.next,a=l.next;continue}if(n=l,n===a){o?o===1?(n=$1(jn(n),e,t),Is(n,e,t,i,s,r,2)):o===2&&z1(n,e,t,i,s,r):Is(jn(n),e,t,i,s,r,1);break}}}function F1(n){const e=n.prev,t=n,i=n.next;if(_t(e,t,i)>=0)return!1;let s=n.next.next;for(;s!==n.prev;){if(Ui(e.x,e.y,t.x,t.y,i.x,i.y,s.x,s.y)&&_t(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function B1(n,e,t,i){const s=n.prev,r=n,o=n.next;if(_t(s,r,o)>=0)return!1;const a=s.x<r.x?s.x<o.x?s.x:o.x:r.x<o.x?r.x:o.x,c=s.y<r.y?s.y<o.y?s.y:o.y:r.y<o.y?r.y:o.y,l=s.x>r.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,h=oa(a,c,e,t,i),f=oa(l,u,e,t,i);let p=n.prevZ,g=n.nextZ;for(;p&&p.z>=h&&g&&g.z<=f;){if(p!==n.prev&&p!==n.next&&Ui(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&_t(p.prev,p,p.next)>=0||(p=p.prevZ,g!==n.prev&&g!==n.next&&Ui(s.x,s.y,r.x,r.y,o.x,o.y,g.x,g.y)&&_t(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;p&&p.z>=h;){if(p!==n.prev&&p!==n.next&&Ui(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&_t(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=f;){if(g!==n.prev&&g!==n.next&&Ui(s.x,s.y,r.x,r.y,o.x,o.y,g.x,g.y)&&_t(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function $1(n,e,t){let i=n;do{const s=i.prev,r=i.next.next;!Jr(s,r)&&Xd(s,i,i.next,r)&&Ps(s,r)&&Ps(r,s)&&(e.push(s.i/t),e.push(i.i/t),e.push(r.i/t),Ds(i),Ds(i.next),i=n=r),i=i.next}while(i!==n);return jn(i)}function z1(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Y1(o,a)){let c=Yd(o,a);o=jn(o,o.next),c=jn(c,c.next),Is(o,e,t,i,s,r),Is(c,e,t,i,s,r);return}a=a.next}o=o.next}while(o!==n)}function H1(n,e,t,i){const s=[];let r,o,a,c,l;for(r=0,o=e.length;r<o;r++)a=e[r]*i,c=r<o-1?e[r+1]*i:n.length,l=jd(n,a,c,i,!1),l===l.next&&(l.steiner=!0),s.push(X1(l));for(s.sort(U1),r=0;r<s.length;r++)V1(s[r],t),t=jn(t,t.next);return t}function U1(n,e){return n.x-e.x}function V1(n,e){if(e=G1(n,e),e){const t=Yd(e,n);jn(e,e.next),jn(t,t.next)}}function G1(n,e){let t=e;const i=n.x,s=n.y;let r=-1/0,o;do{if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>r){if(r=f,f===i){if(s===t.y)return t;if(s===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===r)return o;const a=o,c=o.x,l=o.y;let u=1/0,h;t=o;do i>=t.x&&t.x>=c&&i!==t.x&&Ui(s<l?i:r,s,c,l,s<l?r:i,s,t.x,t.y)&&(h=Math.abs(s-t.y)/(i-t.x),Ps(t,n)&&(h<u||h===u&&(t.x>o.x||t.x===o.x&&W1(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function W1(n,e){return _t(n.prev,n,e.prev)<0&&_t(e.next,n,n.next)<0}function q1(n,e,t,i){let s=n;do s.z===null&&(s.z=oa(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,j1(s)}function j1(n){let e,t,i,s,r,o,a,c,l=1;do{for(t=n,n=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e<l&&(a++,i=i.nextZ,!!i);e++);for(c=l;a>0||c>0&&i;)a!==0&&(c===0||!i||t.z<=i.z)?(s=t,t=t.nextZ,a--):(s=i,i=i.nextZ,c--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;t=i}r.nextZ=null,l*=2}while(o>1);return n}function oa(n,e,t,i,s){return n=32767*(n-t)*s,e=32767*(e-i)*s,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function X1(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function Ui(n,e,t,i,s,r,o,a){return(s-o)*(e-a)-(n-o)*(r-a)>=0&&(n-o)*(i-a)-(t-o)*(e-a)>=0&&(t-o)*(r-a)-(s-o)*(i-a)>=0}function Y1(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Z1(n,e)&&(Ps(n,e)&&Ps(e,n)&&J1(n,e)&&(_t(n.prev,n,e.prev)||_t(n,e.prev,e))||Jr(n,e)&&_t(n.prev,n,n.next)>0&&_t(e.prev,e,e.next)>0)}function _t(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Jr(n,e){return n.x===e.x&&n.y===e.y}function Xd(n,e,t,i){const s=wr(_t(n,e,t)),r=wr(_t(n,e,i)),o=wr(_t(t,i,n)),a=wr(_t(t,i,e));return!!(s!==r&&o!==a||s===0&&xr(n,t,e)||r===0&&xr(n,i,e)||o===0&&xr(t,n,i)||a===0&&xr(t,e,i))}function xr(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function wr(n){return n>0?1:n<0?-1:0}function Z1(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Xd(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Ps(n,e){return _t(n.prev,n,n.next)<0?_t(n,e,n.next)>=0&&_t(n,n.prev,e)>=0:_t(n,e,n.prev)<0||_t(n,n.next,e)<0}function J1(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Yd(n,e){const t=new aa(n.i,n.x,n.y),i=new aa(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function bc(n,e,t,i){const s=new aa(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Ds(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function aa(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Q1(n,e,t,i){let s=0;for(let r=e,o=t-i;r<t;r+=i)s+=(n[o]-n[r])*(n[r+1]+n[o+1]),o=r;return s}class Wn{static area(e){const t=e.length;let i=0;for(let s=t-1,r=0;r<t;s=r++)i+=e[s].x*e[r].y-e[r].x*e[s].y;return i*.5}static isClockWise(e){return Wn.area(e)<0}static triangulateShape(e,t){const i=[],s=[],r=[];Mc(e),Sc(i,e);let o=e.length;t.forEach(Mc);for(let c=0;c<t.length;c++)s.push(o),o+=t[c].length,Sc(i,t[c]);const a=O1.triangulate(i,s);for(let c=0;c<a.length;c+=3)r.push(a.slice(c,c+3));return r}}function Mc(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Sc(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class as extends ut{constructor(e=new Us([new ce(.5,.5),new ce(-.5,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,s=[],r=[];for(let a=0,c=e.length;a<c;a++){const l=e[a];o(l)}this.setAttribute("position",new gt(s,3)),this.setAttribute("uv",new gt(r,2)),this.computeVertexNormals();function o(a){const c=[],l=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:1,f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,p=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:p-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,w=t.bevelSegments!==void 0?t.bevelSegments:3;const v=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:K1;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let C,S=!1,T,P,b,z;v&&(C=v.getSpacedPoints(u),S=!0,f=!1,T=v.computeFrenetFrames(u,!1),P=new L,b=new L,z=new L),f||(w=0,p=0,g=0,_=0);const oe=a.extractPoints(l);let X=oe.shape;const D=oe.holes;if(!Wn.isClockWise(X)){X=X.reverse();for(let K=0,ue=D.length;K<ue;K++){const he=D[K];Wn.isClockWise(he)&&(D[K]=he.reverse())}}const G=Wn.triangulateShape(X,D),V=X;for(let K=0,ue=D.length;K<ue;K++){const he=D[K];X=X.concat(he)}function Y(K,ue,he){return ue||console.error("THREE.ExtrudeGeometry: vec does not exist"),ue.clone().multiplyScalar(he).add(K)}const W=X.length,Z=G.length;function fe(K,ue,he){let be,$,Me;const Pe=K.x-ue.x,Ge=K.y-ue.y,ot=he.x-K.x,R=he.y-K.y,A=Pe*Pe+Ge*Ge,ae=Pe*R-Ge*ot;if(Math.abs(ae)>Number.EPSILON){const re=Math.sqrt(A),Le=Math.sqrt(ot*ot+R*R),Te=ue.x-Ge/re,F=ue.y+Pe/re,pe=he.x-R/Le,k=he.y+ot/Le,ee=((pe-Te)*R-(k-F)*ot)/(Pe*R-Ge*ot);be=Te+Pe*ee-K.x,$=F+Ge*ee-K.y;const de=be*be+$*$;if(de<=2)return new ce(be,$);Me=Math.sqrt(de/2)}else{let re=!1;Pe>Number.EPSILON?ot>Number.EPSILON&&(re=!0):Pe<-Number.EPSILON?ot<-Number.EPSILON&&(re=!0):Math.sign(Ge)===Math.sign(R)&&(re=!0),re?(be=-Ge,$=Pe,Me=Math.sqrt(A)):(be=Pe,$=Ge,Me=Math.sqrt(A/2))}return new ce(be/Me,$/Me)}const _e=[];for(let K=0,ue=V.length,he=ue-1,be=K+1;K<ue;K++,he++,be++)he===ue&&(he=0),be===ue&&(be=0),_e[K]=fe(V[K],V[he],V[be]);const ne=[];let ie,xe=_e.concat();for(let K=0,ue=D.length;K<ue;K++){const he=D[K];ie=[];for(let be=0,$=he.length,Me=$-1,Pe=be+1;be<$;be++,Me++,Pe++)Me===$&&(Me=0),Pe===$&&(Pe=0),ie[be]=fe(he[be],he[Me],he[Pe]);ne.push(ie),xe=xe.concat(ie)}for(let K=0;K<w;K++){const ue=K/w,he=p*Math.cos(ue*Math.PI/2),be=g*Math.sin(ue*Math.PI/2)+_;for(let $=0,Me=V.length;$<Me;$++){const Pe=Y(V[$],_e[$],be);Be(Pe.x,Pe.y,-he)}for(let $=0,Me=D.length;$<Me;$++){const Pe=D[$];ie=ne[$];for(let Ge=0,ot=Pe.length;Ge<ot;Ge++){const R=Y(Pe[Ge],ie[Ge],be);Be(R.x,R.y,-he)}}}const ve=g+_;for(let K=0;K<W;K++){const ue=f?Y(X[K],xe[K],ve):X[K];S?(b.copy(T.normals[0]).multiplyScalar(ue.x),P.copy(T.binormals[0]).multiplyScalar(ue.y),z.copy(C[0]).add(b).add(P),Be(z.x,z.y,z.z)):Be(ue.x,ue.y,0)}for(let K=1;K<=u;K++)for(let ue=0;ue<W;ue++){const he=f?Y(X[ue],xe[ue],ve):X[ue];S?(b.copy(T.normals[K]).multiplyScalar(he.x),P.copy(T.binormals[K]).multiplyScalar(he.y),z.copy(C[K]).add(b).add(P),Be(z.x,z.y,z.z)):Be(he.x,he.y,h/u*K)}for(let K=w-1;K>=0;K--){const ue=K/w,he=p*Math.cos(ue*Math.PI/2),be=g*Math.sin(ue*Math.PI/2)+_;for(let $=0,Me=V.length;$<Me;$++){const Pe=Y(V[$],_e[$],be);Be(Pe.x,Pe.y,h+he)}for(let $=0,Me=D.length;$<Me;$++){const Pe=D[$];ie=ne[$];for(let Ge=0,ot=Pe.length;Ge<ot;Ge++){const R=Y(Pe[Ge],ie[Ge],be);S?Be(R.x,R.y+C[u-1].y,C[u-1].x+he):Be(R.x,R.y,h+he)}}}Ce(),Ne();function Ce(){const K=s.length/3;if(f){let ue=0,he=W*ue;for(let be=0;be<Z;be++){const $=G[be];Ie($[2]+he,$[1]+he,$[0]+he)}ue=u+w*2,he=W*ue;for(let be=0;be<Z;be++){const $=G[be];Ie($[0]+he,$[1]+he,$[2]+he)}}else{for(let ue=0;ue<Z;ue++){const he=G[ue];Ie(he[2],he[1],he[0])}for(let ue=0;ue<Z;ue++){const he=G[ue];Ie(he[0]+W*u,he[1]+W*u,he[2]+W*u)}}i.addGroup(K,s.length/3-K,0)}function Ne(){const K=s.length/3;let ue=0;le(V,ue),ue+=V.length;for(let he=0,be=D.length;he<be;he++){const $=D[he];le($,ue),ue+=$.length}i.addGroup(K,s.length/3-K,1)}function le(K,ue){let he=K.length;for(;--he>=0;){const be=he;let $=he-1;$<0&&($=K.length-1);for(let Me=0,Pe=u+w*2;Me<Pe;Me++){const Ge=W*Me,ot=W*(Me+1),R=ue+be+Ge,A=ue+$+Ge,ae=ue+$+ot,re=ue+be+ot;Se(R,A,ae,re)}}}function Be(K,ue,he){c.push(K),c.push(ue),c.push(he)}function Ie(K,ue,he){q(K),q(ue),q(he);const be=s.length/3,$=y.generateTopUV(i,s,be-3,be-2,be-1);ke($[0]),ke($[1]),ke($[2])}function Se(K,ue,he,be){q(K),q(ue),q(be),q(ue),q(he),q(be);const $=s.length/3,Me=y.generateSideWallUV(i,s,$-6,$-3,$-2,$-1);ke(Me[0]),ke(Me[1]),ke(Me[3]),ke(Me[1]),ke(Me[2]),ke(Me[3])}function q(K){s.push(c[K*3+0]),s.push(c[K*3+1]),s.push(c[K*3+2])}function ke(K){r.push(K.x),r.push(K.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return ev(t,i,e)}static fromJSON(e,t){const i=[];for(let r=0,o=e.shapes.length;r<o;r++){const a=t[e.shapes[r]];i.push(a)}const s=e.options.extrudePath;return s!==void 0&&(e.options.extrudePath=new qd[s.type]().fromJSON(s)),new as(i,e.options)}}const K1={generateTopUV:function(n,e,t,i,s){const r=e[t*3],o=e[t*3+1],a=e[i*3],c=e[i*3+1],l=e[s*3],u=e[s*3+1];return[new ce(r,o),new ce(a,c),new ce(l,u)]},generateSideWallUV:function(n,e,t,i,s,r){const o=e[t*3],a=e[t*3+1],c=e[t*3+2],l=e[i*3],u=e[i*3+1],h=e[i*3+2],f=e[s*3],p=e[s*3+1],g=e[s*3+2],_=e[r*3],w=e[r*3+1],v=e[r*3+2];return Math.abs(a-u)<Math.abs(o-l)?[new ce(o,1-c),new ce(l,1-h),new ce(f,1-g),new ce(_,1-v)]:[new ce(a,1-c),new ce(u,1-h),new ce(p,1-g),new ce(w,1-v)]}};function ev(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,s=n.length;i<s;i++){const r=n[i];t.shapes.push(r.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Ha extends ut{constructor(e=new Us([new ce(0,.5),new ce(-.5,-.5),new ce(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],s=[],r=[],o=[];let a=0,c=0;if(Array.isArray(e)===!1)l(e);else for(let u=0;u<e.length;u++)l(e[u]),this.addGroup(a,c,u),a+=c,c=0;this.setIndex(i),this.setAttribute("position",new gt(s,3)),this.setAttribute("normal",new gt(r,3)),this.setAttribute("uv",new gt(o,2));function l(u){const h=s.length/3,f=u.extractPoints(t);let p=f.shape;const g=f.holes;Wn.isClockWise(p)===!1&&(p=p.reverse());for(let w=0,v=g.length;w<v;w++){const y=g[w];Wn.isClockWise(y)===!0&&(g[w]=y.reverse())}const _=Wn.triangulateShape(p,g);for(let w=0,v=g.length;w<v;w++){const y=g[w];p=p.concat(y)}for(let w=0,v=p.length;w<v;w++){const y=p[w];s.push(y.x,y.y,0),r.push(0,0,1),o.push(y.x,y.y)}for(let w=0,v=_.length;w<v;w++){const y=_[w],C=y[0]+h,S=y[1]+h,T=y[2]+h;i.push(C,S,T),c+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return tv(t,e)}static fromJSON(e,t){const i=[];for(let s=0,r=e.shapes.length;s<r;s++){const o=t[e.shapes[s]];i.push(o)}return new Ha(i,e.curveSegments)}}function tv(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const s=n[t];e.shapes.push(s.uuid)}else e.shapes.push(n.uuid);return e}class nv extends kt{constructor(e){super(),this.type="ShadowMaterial",this.color=new Re(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}nv.prototype.isShadowMaterial=!0;class Zd extends kt{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Re(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 Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ts,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Zd.prototype.isMeshStandardMaterial=!0;class iv extends Zd{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ce(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Vt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new Re(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Re(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Re(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}iv.prototype.isMeshPhysicalMaterial=!0;class Ua extends kt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Re(16777215),this.specular=new Re(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ts,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Ua.prototype.isMeshPhongMaterial=!0;class sv extends kt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Re(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ts,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}sv.prototype.isMeshToonMaterial=!0;class rv extends kt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ts,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}rv.prototype.isMeshNormalMaterial=!0;class ov extends kt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Re(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Re(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ov.prototype.isMeshLambertMaterial=!0;class av extends kt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Re(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ts,this.normalScale=new ce(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}av.prototype.isMeshMatcapMaterial=!0;class lv extends Gn{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}lv.prototype.isLineDashedMaterial=!0;const mt={arraySlice:function(n,e,t){return mt.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i},sortedArray:function(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let c=0;c!==e;++c)s[o++]=n[a+c]}return s},flattenJSON:function(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)},subclip:function(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let c=0;c<r.tracks.length;++c){const l=r.tracks[c],u=l.getValueSize(),h=[],f=[];for(let p=0;p<l.times.length;++p){const g=l.times[p]*s;if(!(g<t||g>=i)){h.push(l.times[p]);for(let _=0;_<u;++_)f.push(l.values[p*u+_])}}h.length!==0&&(l.times=mt.convertArray(h,l.times.constructor),l.values=mt.convertArray(f,l.values.constructor),o.push(l))}r.tracks=o;let a=1/0;for(let c=0;c<r.tracks.length;++c)a>r.tracks[c].times[0]&&(a=r.tracks[c].times[0]);for(let c=0;c<r.tracks.length;++c)r.tracks[c].shift(-1*a);return r.resetDuration(),r},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const s=t.tracks.length,r=e/i;for(let o=0;o<s;++o){const a=t.tracks[o],c=a.ValueTypeName;if(c==="bool"||c==="string")continue;const l=n.tracks.find(function(v){return v.name===a.name&&v.ValueTypeName===c});if(l===void 0)continue;let u=0;const h=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=h/3);let f=0;const p=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=p/3);const g=a.times.length-1;let _;if(r<=a.times[0]){const v=u,y=h-u;_=mt.arraySlice(a.values,v,y)}else if(r>=a.times[g]){const v=g*h+u,y=v+h-u;_=mt.arraySlice(a.values,v,y)}else{const v=a.createInterpolant(),y=u,C=h-u;v.evaluate(r),_=mt.arraySlice(v.resultBuffer,y,C)}c==="quaternion"&&new Ft().fromArray(_).normalize().conjugate().toArray(_);const w=l.times.length;for(let v=0;v<w;++v){const y=v*p+f;if(c==="quaternion")Ft.multiplyQuaternionsFlat(l.values,y,_,0,l.values,y);else{const C=p-f*2;for(let S=0;S<C;++S)l.values[y+S]-=_[S]}}}return n.blendMode=pd,n}};class Xn{constructor(e,t,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,s=t[i],r=t[i-1];e:{t:{let o;n:{i:if(!(e<s)){for(let a=i+2;;){if(s===void 0){if(e<r)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,r)}if(i===a)break;if(r=s,s=t[++i],e<s)break t}o=t.length;break n}if(!(e>=r)){const a=t[1];e<a&&(i=2,r=a);for(let c=i-2;;){if(r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,s);if(i===c)break;if(s=r,r=t[--i-1],e>=r)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(s=t[i],r=t[i-1],r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,s);if(s===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,r,e)}this._cachedIndex=i,this.intervalChanged_(i,r,s)}return this.interpolate_(i,r,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=e*s;for(let o=0;o!==s;++o)t[o]=i[r+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Xn.prototype.beforeStart_=Xn.prototype.copySampleValue_;Xn.prototype.afterEnd_=Xn.prototype.copySampleValue_;class cv extends Xn{constructor(e,t,i,s){super(e,t,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Bi,endingEnd:Bi}}intervalChanged_(e,t,i){const s=this.parameterPositions;let r=e-2,o=e+1,a=s[r],c=s[o];if(a===void 0)switch(this.getSettings_().endingStart){case $i:r=e,a=2*t-i;break;case Ir:r=s.length-2,a=t+s[r]-s[r+1];break;default:r=e,a=i}if(c===void 0)switch(this.getSettings_().endingEnd){case $i:o=e,c=2*i-t;break;case Ir:o=1,c=i+s[1]-s[0];break;default:o=e-1,c=t}const l=(i-t)*.5,u=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(c-i),this._offsetPrev=r*u,this._offsetNext=o*u}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,u=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,p=this._weightNext,g=(i-t)/(s-t),_=g*g,w=_*g,v=-f*w+2*f*_-f*g,y=(1+f)*w+(-1.5-2*f)*_+(-.5+f)*g+1,C=(-1-p)*w+(1.5+p)*_+.5*g,S=p*w-p*_;for(let T=0;T!==a;++T)r[T]=v*o[u+T]+y*o[l+T]+C*o[c+T]+S*o[h+T];return r}}class Jd extends Xn{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,u=(i-t)/(s-t),h=1-u;for(let f=0;f!==a;++f)r[f]=o[l+f]*h+o[c+f]*u;return r}}class dv extends Xn{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class gn{constructor(e,t,i,s){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=mt.convertArray(t,this.TimeBufferType),this.values=mt.convertArray(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:mt.convertArray(e.times,Array),values:mt.convertArray(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(i.interpolation=s)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new dv(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Jd(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new cv(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Lr:t=this.InterpolantFactoryMethodDiscrete;break;case Rr:t=this.InterpolantFactoryMethodLinear;break;case lo:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Lr;case this.InterpolantFactoryMethodLinear:return Rr;case this.InterpolantFactoryMethodSmooth:return lo}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,s=t.length;i!==s;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,s=t.length;i!==s;++i)t[i]*=e}return this}trim(e,t){const i=this.times,s=i.length;let r=0,o=s-1;for(;r!==s&&i[r]<e;)++r;for(;o!==-1&&i[o]>t;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=mt.arraySlice(i,r,o),this.values=mt.arraySlice(this.values,r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const c=i[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(s!==void 0&&mt.isTypedArray(s))for(let a=0,c=s.length;a!==c;++a){const l=s[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}return e}optimize(){const e=mt.arraySlice(this.times),t=mt.arraySlice(this.values),i=this.getValueSize(),s=this.getInterpolation()===lo,r=e.length-1;let o=1;for(let a=1;a<r;++a){let c=!1;const l=e[a],u=e[a+1];if(l!==u&&(a!==1||l!==e[0]))if(s)c=!0;else{const h=a*i,f=h-i,p=h+i;for(let g=0;g!==i;++g){const _=t[h+g];if(_!==t[f+g]||_!==t[p+g]){c=!0;break}}}if(c){if(a!==o){e[o]=e[a];const h=a*i,f=o*i;for(let p=0;p!==i;++p)t[f+p]=t[h+p]}++o}}if(r>0){e[o]=e[r];for(let a=r*i,c=o*i,l=0;l!==i;++l)t[c+l]=t[a+l];++o}return o!==e.length?(this.times=mt.arraySlice(e,0,o),this.values=mt.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=mt.arraySlice(this.times,0),t=mt.arraySlice(this.values,0),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}gn.prototype.TimeBufferType=Float32Array;gn.prototype.ValueBufferType=Float32Array;gn.prototype.DefaultInterpolation=Rr;class ls extends gn{}ls.prototype.ValueTypeName="bool";ls.prototype.ValueBufferType=Array;ls.prototype.DefaultInterpolation=Lr;ls.prototype.InterpolantFactoryMethodLinear=void 0;ls.prototype.InterpolantFactoryMethodSmooth=void 0;class Qd extends gn{}Qd.prototype.ValueTypeName="color";class Dr extends gn{}Dr.prototype.ValueTypeName="number";class uv extends Xn{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(i-t)/(s-t);let l=e*a;for(let u=l+a;l!==u;l+=4)Ft.slerpFlat(r,0,o,l-a,o,l,c);return r}}class Vs extends gn{InterpolantFactoryMethodLinear(e){return new uv(this.times,this.values,this.getValueSize(),e)}}Vs.prototype.ValueTypeName="quaternion";Vs.prototype.DefaultInterpolation=Rr;Vs.prototype.InterpolantFactoryMethodSmooth=void 0;class cs extends gn{}cs.prototype.ValueTypeName="string";cs.prototype.ValueBufferType=Array;cs.prototype.DefaultInterpolation=Lr;cs.prototype.InterpolantFactoryMethodLinear=void 0;cs.prototype.InterpolantFactoryMethodSmooth=void 0;class Nr extends gn{}Nr.prototype.ValueTypeName="vector";class Cc{constructor(e,t=-1,i,s=Ma){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(fv(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(gn.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a<r;a++){let c=[],l=[];c.push((a+r-1)%r,a,(a+1)%r),l.push(0,1,0);const u=mt.getKeyframeOrder(c);c=mt.sortedArray(c,1,u),l=mt.sortedArray(l,1,u),!s&&c[0]===0&&(c.push(r),l.push(l[0])),o.push(new Dr(".morphTargetInfluences["+t[a].name+"]",c,l).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const s=e;i=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<i.length;s++)if(i[s].name===t)return i[s];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const s={},r=/^([\w-]*?)([\d]+)$/;for(let a=0,c=e.length;a<c;a++){const l=e[a],u=l.name.match(r);if(u&&u.length>1){const h=u[1];let f=s[h];f||(s[h]=f=[]),f.push(l)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,f,p,g,_){if(p.length!==0){const w=[],v=[];mt.flattenJSON(p,w,v,g),w.length!==0&&_.push(new h(f,w,v))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const l=e.hierarchy||[];for(let h=0;h<l.length;h++){const f=l[h].keys;if(!(!f||f.length===0))if(f[0].morphTargets){const p={};let g;for(g=0;g<f.length;g++)if(f[g].morphTargets)for(let _=0;_<f[g].morphTargets.length;_++)p[f[g].morphTargets[_]]=-1;for(const _ in p){const w=[],v=[];for(let y=0;y!==f[g].morphTargets.length;++y){const C=f[g];w.push(C.time),v.push(C.morphTarget===_?1:0)}s.push(new Dr(".morphTargetInfluence["+_+"]",w,v))}c=p.length*(o||1)}else{const p=".bones["+t[h].name+"]";i(Nr,p+".position",f,"pos",s),i(Vs,p+".quaternion",f,"rot",s),i(Nr,p+".scale",f,"scl",s)}}return s.length===0?null:new this(r,c,s,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,s=e.length;i!==s;++i){const r=this.tracks[i];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function hv(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Dr;case"vector":case"vector2":case"vector3":case"vector4":return Nr;case"color":return Qd;case"quaternion":return Vs;case"bool":case"boolean":return ls;case"string":return cs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function fv(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=hv(n.type);if(n.times===void 0){const t=[],i=[];mt.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Qi={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class pv{constructor(e,t,i){const s=this;let r=!1,o=0,a=0,c;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(u){a++,r===!1&&s.onStart!==void 0&&s.onStart(u,o,a),r=!0},this.itemEnd=function(u){o++,s.onProgress!==void 0&&s.onProgress(u,o,a),o===a&&(r=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(u){s.onError!==void 0&&s.onError(u)},this.resolveURL=function(u){return c?c(u):u},this.setURLModifier=function(u){return c=u,this},this.addHandler=function(u,h){return l.push(u,h),this},this.removeHandler=function(u){const h=l.indexOf(u);return h!==-1&&l.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=l.length;h<f;h+=2){const p=l[h],g=l[h+1];if(p.global&&(p.lastIndex=0),p.test(u))return g}return null}}}const Kd=new pv;class _n{constructor(e){this.manager=e!==void 0?e:Kd,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(s,r){i.load(e,s,t,r)})}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}}const Mn={};class Va extends _n{constructor(e){super(e)}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=Qi.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(Mn[e]!==void 0){Mn[e].push({onLoad:t,onProgress:i,onError:s});return}Mn[e]=[],Mn[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(o).then(a=>{if(a.status===200||a.status===0){a.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received.");const c=Mn[e],l=a.body.getReader(),u=a.headers.get("Content-Length"),h=u?parseInt(u):0,f=h!==0;let p=0;return new ReadableStream({start(g){_();function _(){l.read().then(({done:w,value:v})=>{if(w)g.close();else{p+=v.byteLength;const y=new ProgressEvent("progress",{lengthComputable:f,loaded:p,total:h});for(let C=0,S=c.length;C<S;C++){const T=c[C];T.onProgress&&T.onProgress(y)}g.enqueue(v),_()}})}}})}else throw Error(`fetch for "${a.url}" responded with ${a.status}: ${a.statusText}`)}).then(a=>{const c=new Response(a);switch(this.responseType){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(l=>new DOMParser().parseFromString(l,this.mimeType));case"json":return c.json();default:return c.text()}}).then(a=>{Qi.add(e,a);const c=Mn[e];delete Mn[e];for(let l=0,u=c.length;l<u;l++){const h=c[l];h.onLoad&&h.onLoad(a)}this.manager.itemEnd(e)}).catch(a=>{const c=Mn[e];delete Mn[e];for(let l=0,u=c.length;l<u;l++){const h=c[l];h.onError&&h.onError(a)}this.manager.itemError(e),this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class eu extends _n{constructor(e){super(e)}load(e,t,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Qi.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Gr("img");function c(){u(),Qi.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(h){u(),s&&s(h),r.manager.itemError(e),r.manager.itemEnd(e)}function u(){a.removeEventListener("load",c,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",l,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class mv extends _n{constructor(e){super(e)}load(e,t,i,s){const r=new Wr,o=new eu(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function c(l){o.load(e[l],function(u){r.images[l]=u,a++,a===6&&(r.needsUpdate=!0,t&&t(r))},void 0,s)}for(let l=0;l<e.length;++l)c(l);return r}}class tu extends _n{constructor(e){super(e)}load(e,t,i,s){const r=new Dt,o=new eu(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},i,s),r}}class pn extends st{constructor(e,t=1){super(),this.type="Light",this.color=new Re(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}pn.prototype.isLight=!0;class gv extends pn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(st.DefaultUp),this.updateMatrix(),this.groundColor=new Re(t)}copy(e){return pn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}gv.prototype.isHemisphereLight=!0;const Tc=new De,Ec=new L,Ac=new L;class Ga{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ce(512,512),this.map=null,this.mapPass=null,this.matrix=new De,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new qr,this._frameExtents=new ce(1,1),this._viewportCount=1,this._viewports=[new lt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Ec.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ec),Ac.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ac),t.updateMatrixWorld(),Tc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Tc),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nu extends Ga{constructor(){super(new zt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=ea*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}nu.prototype.isSpotLightShadow=!0;class _v extends pn{constructor(e,t,i=0,s=Math.PI/3,r=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(st.DefaultUp),this.updateMatrix(),this.target=new st,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.shadow=new nu}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}_v.prototype.isSpotLight=!0;const kc=new De,ws=new L,Wo=new L;class iu extends Ga{constructor(){super(new zt(90,1,.5,500)),this._frameExtents=new ce(4,2),this._viewportCount=6,this._viewports=[new lt(2,1,1,1),new lt(0,1,1,1),new lt(3,1,1,1),new lt(1,1,1,1),new lt(3,0,1,1),new lt(1,0,1,1)],this._cubeDirections=[new L(1,0,0),new L(-1,0,0),new L(0,0,1),new L(0,0,-1),new L(0,1,0),new L(0,-1,0)],this._cubeUps=[new L(0,1,0),new L(0,1,0),new L(0,1,0),new L(0,1,0),new L(0,0,1),new L(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),ws.setFromMatrixPosition(e.matrixWorld),i.position.copy(ws),Wo.copy(i.position),Wo.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Wo),i.updateMatrixWorld(),s.makeTranslation(-ws.x,-ws.y,-ws.z),kc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kc)}}iu.prototype.isPointLightShadow=!0;class vv extends pn{constructor(e,t,i=0,s=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new iu}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}vv.prototype.isPointLight=!0;class su extends Ga{constructor(){super(new Ra(-5,5,5,-5,.5,500))}}su.prototype.isDirectionalLightShadow=!0;class Tr extends pn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(st.DefaultUp),this.updateMatrix(),this.target=new st,this.shadow=new su}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Tr.prototype.isDirectionalLight=!0;class yv extends pn{constructor(e,t){super(e,t),this.type="AmbientLight"}}yv.prototype.isAmbientLight=!0;class xv extends pn{constructor(e,t,i=10,s=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=s}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}xv.prototype.isRectAreaLight=!0;class ru{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new L)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,s=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*s),t.addScaledVector(o[2],.488603*r),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*s)),t.addScaledVector(o[5],1.092548*(s*r)),t.addScaledVector(o[6],.315392*(3*r*r-1)),t.addScaledVector(o[7],1.092548*(i*r)),t.addScaledVector(o[8],.546274*(i*i-s*s)),t}getIrradianceAt(e,t){const i=e.x,s=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*s),t.addScaledVector(o[2],2*.511664*r),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*s),t.addScaledVector(o[5],2*.429043*s*r),t.addScaledVector(o[6],.743125*r*r-.247708),t.addScaledVector(o[7],2*.429043*i*r),t.addScaledVector(o[8],.429043*(i*i-s*s)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let s=0;s<9;s++)i[s].fromArray(e,t+s*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let s=0;s<9;s++)i[s].toArray(e,t+s*3);return e}static getBasisAt(e,t){const i=e.x,s=e.y,r=e.z;t[0]=.282095,t[1]=.488603*s,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*s,t[5]=1.092548*s*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-s*s)}}ru.prototype.isSphericalHarmonics3=!0;class Wa extends pn{constructor(e=new ru,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Wa.prototype.isLightProbe=!0;class ou{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i<s;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class wv extends ut{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}wv.prototype.isInstancedBufferGeometry=!0;class bv extends _n{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Qi.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){Qi.add(e,c),t&&t(c),r.manager.itemEnd(e)}).catch(function(c){s&&s(c),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}bv.prototype.isImageBitmapLoader=!0;let br;const Mv={getContext:function(){return br===void 0&&(br=new(window.AudioContext||window.webkitAudioContext)),br},setContext:function(n){br=n}};class Sv extends _n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Va(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const c=a.slice(0);Mv.getContext().decodeAudioData(c,function(u){t(u)})}catch(c){s?s(c):console.error(c),r.manager.itemError(e)}},i,s)}}class Cv extends Wa{constructor(e,t,i=1){super(void 0,i);const s=new Re().set(e),r=new Re().set(t),o=new L(s.r,s.g,s.b),a=new L(r.r,r.g,r.b),c=Math.sqrt(Math.PI),l=c*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(c),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l)}}Cv.prototype.isHemisphereLightProbe=!0;class Tv extends Wa{constructor(e,t=1){super(void 0,t);const i=new Re().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Tv.prototype.isAmbientLightProbe=!0;class Ev extends st{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}class Av{constructor(e,t,i){this.binding=e,this.valueSize=i;let s,r,o;switch(t){case"quaternion":s=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":s=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:s=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,s=this.valueSize,r=e*s+s;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==s;++a)i[r+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,r,0,a,s)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,s=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,s=e*t+t,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const c=t*this._origIndex;this._mixBufferRegion(i,s,c,1-r,t)}o>0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let c=t,l=t+t;c!==l;++c)if(i[c]!==i[c+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,s,r){if(s>=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Ft.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Ft.multiplyQuaternionsFlat(e,o,e,t,e,i),Ft.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const c=t+a;e[c]=e[c]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const qa="\\[\\]\\.:\\/",kv=new RegExp("["+qa+"]","g"),ja="[^"+qa+"]",Lv="[^"+qa.replace("\\.","")+"]",Rv=/((?:WC+[\/:])*)/.source.replace("WC",ja),Iv=/(WCOD+)?/.source.replace("WCOD",Lv),Pv=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ja),Dv=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ja),Nv=new RegExp("^"+Rv+Iv+Pv+Dv+"$"),Ov=["material","materials","bones"];class Fv{constructor(e,t,i){const s=i||it.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class it{constructor(e,t,i){this.path=t,this.parsedPath=i||it.parseTrackName(t),this.node=it.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new it.Composite(e,t,i):new it(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kv,"")}static parseTrackName(e){const t=Nv.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);Ov.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o<r.length;o++){const a=r[o];if(a.name===t||a.uuid===t)return a;const c=i(a.children);if(c)return c}return null},s=i(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)e[t++]=i[s]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,s=t.propertyName;let r=t.propertyIndex;if(e||(e=it.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let l=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.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){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===l){l=u;break}break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}const o=e[s];if(o===void 0){const l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+s+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(r!==void 0){if(s==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=s;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}it.Composite=Fv;it.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};it.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};it.prototype.GetterByBindingType=[it.prototype._getValue_direct,it.prototype._getValue_array,it.prototype._getValue_arrayElement,it.prototype._getValue_toArray];it.prototype.SetterByBindingTypeAndVersioning=[[it.prototype._setValue_direct,it.prototype._setValue_direct_setNeedsUpdate,it.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[it.prototype._setValue_array,it.prototype._setValue_array_setNeedsUpdate,it.prototype._setValue_array_setMatrixWorldNeedsUpdate],[it.prototype._setValue_arrayElement,it.prototype._setValue_arrayElement_setNeedsUpdate,it.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[it.prototype._setValue_fromArray,it.prototype._setValue_fromArray_setNeedsUpdate,it.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Bv{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),c={endingStart:Bi,endingEnd:Bi};for(let l=0;l!==o;++l){const u=r[l].createInterpolant(null);a[l]=u,u.settings=c}this._interpolantSettings=c,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ep,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const c=a.parameterPositions,l=a.sampleValues;return c[0]=r,c[1]=r+i,l[0]=e/o,l[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const c=(e-r)*i;if(c<0||i===0)return;this._startTime=null,t=i*c}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case pd:for(let u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulateAdditive(a);break;case Ma:default:for(let u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===Ap;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===Tp){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const c=this.repetitions-r;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const l=e<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=$i,s.endingEnd=$i):(e?s.endingStart=this.zeroSlopeAtStart?$i:Bi:s.endingStart=Ir,t?s.endingEnd=this.zeroSlopeAtEnd?$i:Bi:s.endingEnd=Ir)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,c=o.sampleValues;return a[0]=r,c[0]=t,a[1]=r+e,c[1]=i,this}}class $v extends Zn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,c=i.uuid,l=this._bindingsByRootAndName;let u=l[c];u===void 0&&(u={},l[c]=u);for(let h=0;h!==r;++h){const f=s[h],p=f.name;let g=u[p];if(g!==void 0)o[h]=g;else{if(g=o[h],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,c,p));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;g=new Av(it.create(i,p,_),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,c,p),o[h]=g}a[h].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const s=this._actions,r=this._actionsByClip;let o=r[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=s.length,s.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],s=e._cacheIndex;i._cacheIndex=s,t[s]=i,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,o=this._actionsByClip,a=o[r],c=a.knownActions,l=c[c.length-1],u=e._byClipCacheIndex;l._byClipCacheIndex=u,c[u]=l,c.pop(),e._byClipCacheIndex=null;const h=a.actionByRoot,f=(e._localRoot||this._root).uuid;delete h[f],c.length===0&&delete o[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,s=this._nActiveActions++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=i,t[i]=r}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,s=--this._nActiveActions,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=i,t[i]=r}_addInactiveBinding(e,t,i){const s=this._bindingsByRootAndName,r=this._bindings;let o=s[t];o===void 0&&(o={},s[t]=o),o[i]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,s=i.rootNode.uuid,r=i.path,o=this._bindingsByRootAndName,a=o[s],c=t[t.length-1],l=e._cacheIndex;c._cacheIndex=l,t[l]=c,t.pop(),delete a[r],Object.keys(a).length===0&&delete o[s]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,s=this._nActiveBindings++,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=i,t[i]=r}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,s=--this._nActiveBindings,r=t[s];e._cacheIndex=s,t[s]=e,r._cacheIndex=i,t[i]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new Jd(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,s=--this._nActiveControlInterpolants,r=t[s];e.__cacheIndex=s,t[s]=e,r.__cacheIndex=i,t[i]=r}clipAction(e,t,i){const s=t||this._root,r=s.uuid;let o=typeof e=="string"?Cc.findByName(s,e):e;const a=o!==null?o.uuid:e,c=this._actionsByClip[a];let l=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Ma),c!==void 0){const h=c.actionByRoot[r];if(h!==void 0&&h.blendMode===i)return h;l=c.knownActions[0],o===null&&(o=l._clip)}if(o===null)return null;const u=new Bv(this,o,t,i);return this._bindAction(u,l),this._addInactiveAction(u,a,r),u}existingAction(e,t){const i=t||this._root,s=i.uuid,r=typeof e=="string"?Cc.findByName(i,e):e,o=r?r.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[s]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let l=0;l!==i;++l)t[l]._update(s,e,r,o);const a=this._bindings,c=this._nActiveBindings;for(let l=0;l!==c;++l)a[l].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,s=this._actionsByClip,r=s[i];if(r!==void 0){const o=r.knownActions;for(let a=0,c=o.length;a!==c;++a){const l=o[a];this._deactivateAction(l);const u=l._cacheIndex,h=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,h._cacheIndex=u,t[u]=h,t.pop(),this._removeInactiveBindingsForAction(l)}delete s[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,c=a[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const s=this._bindingsByRootAndName,r=s[t];if(r!==void 0)for(const o in r){const a=r[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}$v.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class zv extends Hs{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}zv.prototype.isInstancedInterleavedBuffer=!0;class Lc{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Vt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Bn=new L,Mr=new De,qo=new De;class Hv extends Rs{constructor(e){const t=au(e),i=new ut,s=[],r=[],o=new Re(0,0,1),a=new Re(0,1,0);for(let l=0;l<t.length;l++){const u=t[l];u.parent&&u.parent.isBone&&(s.push(0,0,0),s.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}i.setAttribute("position",new gt(s,3)),i.setAttribute("color",new gt(r,3));const c=new Gn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,c),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,s=i.getAttribute("position");qo.copy(this.root.matrixWorld).invert();for(let r=0,o=0;r<t.length;r++){const a=t[r];a.parent&&a.parent.isBone&&(Mr.multiplyMatrices(qo,a.matrixWorld),Bn.setFromMatrixPosition(Mr),s.setXYZ(o,Bn.x,Bn.y,Bn.z),Mr.multiplyMatrices(qo,a.parent.matrixWorld),Bn.setFromMatrixPosition(Mr),s.setXYZ(o+1,Bn.x,Bn.y,Bn.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function au(n){const e=[];n&&n.isBone&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,au(n.children[t]));return e}class Uv extends Rs{constructor(e=10,t=10,i=4473924,s=8947848){i=new Re(i),s=new Re(s);const r=t/2,o=e/t,a=e/2,c=[],l=[];for(let f=0,p=0,g=-a;f<=t;f++,g+=o){c.push(-a,0,g,a,0,g),c.push(g,0,-a,g,0,a);const _=f===r?i:s;_.toArray(l,p),p+=3,_.toArray(l,p),p+=3,_.toArray(l,p),p+=3,_.toArray(l,p),p+=3}const u=new ut;u.setAttribute("position",new gt(c,3)),u.setAttribute("color",new gt(l,3));const h=new Gn({vertexColors:!0,toneMapped:!1});super(u,h),this.type="GridHelper"}}const Vv=new Float32Array(1);new Int32Array(Vv.buffer);tn.create=function(n,e){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(tn.prototype),n.prototype.constructor=n,n.prototype.getPoint=e,n};ra.prototype.fromPoints=function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)};Uv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Hv.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};_n.prototype.extractUrlBase=function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),ou.extractUrlBase(n)};_n.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};nn.prototype.center=function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)};nn.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};nn.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};nn.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};nn.prototype.size=function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)};is.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};qr.prototype.setFromMatrix=function(n){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(n)};Pt.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};Pt.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};Pt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};Pt.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};Pt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};Pt.prototype.getInverse=function(n){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};De.prototype.extractPosition=function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)};De.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};De.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new L().setFromMatrixColumn(this,3)};De.prototype.setRotationFromQuaternion=function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)};De.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};De.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};De.prototype.multiplyVector4=function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};De.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};De.prototype.rotateAxis=function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)};De.prototype.crossVector=function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};De.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};De.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};De.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};De.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};De.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};De.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};De.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};De.prototype.makeFrustum=function(n,e,t,i,s,r){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,e,i,t,s,r)};De.prototype.getInverse=function(n){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};Sn.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)};Ft.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)};Ft.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};ss.prototype.isIntersectionBox=function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};ss.prototype.isIntersectionPlane=function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)};ss.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};St.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};St.prototype.barycoordFromPoint=function(n,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,e)};St.prototype.midpoint=function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)};St.prototypenormal=function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)};St.prototype.plane=function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)};St.barycoordFromPoint=function(n,e,t,i,s){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),St.getBarycoord(n,e,t,i,s)};St.normal=function(n,e,t,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),St.getNormal(n,e,t,i)};Us.prototype.extractAllPoints=function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)};Us.prototype.extrude=function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new as(this,n)};Us.prototype.makeGeometry=function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ha(this,n)};ce.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};ce.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};ce.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};L.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};L.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};L.prototype.getPositionFromMatrix=function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)};L.prototype.getScaleFromMatrix=function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)};L.prototype.getColumnFromMatrix=function(n,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,n)};L.prototype.applyProjection=function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)};L.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};L.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};L.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};lt.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};lt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};st.prototype.getChildByName=function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)};st.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};st.prototype.translate=function(n,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,n)};st.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};st.prototype.applyMatrix=function(n){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(st.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Ot.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(Ot.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),kp},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});Hd.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};zt.prototype.setLens=function(n,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(n)};Object.defineProperties(pn.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}});Object.defineProperties(Ct.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Pr},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Pr)}}});Ct.prototype.setDynamic=function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Pr:ks),this};Ct.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ct.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};ut.prototype.addIndex=function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)};ut.prototype.addAttribute=function(n,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(n,new Ct(arguments[1],arguments[2]))):n==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(n,e)};ut.prototype.addDrawCall=function(n,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,e)};ut.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};ut.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};ut.prototype.removeAttribute=function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)};ut.prototype.applyMatrix=function(n){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(ut.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});Hs.prototype.setDynamic=function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Pr:ks),this};Hs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};as.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};as.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};as.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};Na.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Object.defineProperties(kt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Re}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===dd}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(n){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=n}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(di.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}});rt.prototype.clearTarget=function(n,e,t,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(n),this.clear(e,t,i)};rt.prototype.animate=function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)};rt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};rt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};rt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};rt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};rt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};rt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};rt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};rt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};rt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};rt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};rt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};rt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};rt.prototype.enableScissorTest=function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)};rt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};rt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};rt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};rt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};rt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};rt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};rt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};rt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};rt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};rt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(rt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(n){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=n===!0?Vr:Gt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}});Object.defineProperties(Fd.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(Kt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}});Ev.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new Sv().load(n,function(i){e.setBuffer(i)}),this};ka.prototype.updateCubeMap=function(n,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,e)};ka.prototype.clear=function(n,e,t,i){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(n,e,t,i)};ns.crossOrigin=void 0;ns.loadTexture=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const s=new tu;s.setCrossOrigin(this.crossOrigin);const r=s.load(n,t,void 0,i);return e&&(r.mapping=e),r};ns.loadTextureCube=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const s=new mv;s.setCrossOrigin(this.crossOrigin);const r=s.load(n,t,void 0,i);return e&&(r.mapping=e),r};ns.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ns.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:wa}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=wa);const Gv=/^[og]\s*(.+)?/,Wv=/^mtllib /,qv=/^usemtl /,jv=/^usemap /,Rc=new L,jo=new L,Ic=new L,Pc=new L,Jt=new L;function Xv(){const n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(s,r){const o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);const a={index:this.materials.length,name:s||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(c){const l={index:typeof c=="number"?c:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(s){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),s&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return s&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},i&&i.name&&typeof i.clone=="function"){const s=i.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(e,t,i){const s=this.vertices,r=this.object.geometry.vertices;r.push(s[e+0],s[e+1],s[e+2]),r.push(s[t+0],s[t+1],s[t+2]),r.push(s[i+0],s[i+1],s[i+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){const s=this.normals,r=this.object.geometry.normals;r.push(s[e+0],s[e+1],s[e+2]),r.push(s[t+0],s[t+1],s[t+2]),r.push(s[i+0],s[i+1],s[i+2])},addFaceNormal:function(e,t,i){const s=this.vertices,r=this.object.geometry.normals;Rc.fromArray(s,e),jo.fromArray(s,t),Ic.fromArray(s,i),Jt.subVectors(Ic,jo),Pc.subVectors(Rc,jo),Jt.cross(Pc),Jt.normalize(),r.push(Jt.x,Jt.y,Jt.z),r.push(Jt.x,Jt.y,Jt.z),r.push(Jt.x,Jt.y,Jt.z)},addColor:function(e,t,i){const s=this.colors,r=this.object.geometry.colors;s[e]!==void 0&&r.push(s[e+0],s[e+1],s[e+2]),s[t]!==void 0&&r.push(s[t+0],s[t+1],s[t+2]),s[i]!==void 0&&r.push(s[i+0],s[i+1],s[i+2])},addUV:function(e,t,i){const s=this.uvs,r=this.object.geometry.uvs;r.push(s[e+0],s[e+1]),r.push(s[t+0],s[t+1]),r.push(s[i+0],s[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,s,r,o,a,c,l){const u=this.vertices.length;let h=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),p=this.parseVertexIndex(i,u);if(this.addVertex(h,f,p),this.addColor(h,f,p),a!==void 0&&a!==""){const g=this.normals.length;h=this.parseNormalIndex(a,g),f=this.parseNormalIndex(c,g),p=this.parseNormalIndex(l,g),this.addNormal(h,f,p)}else this.addFaceNormal(h,f,p);if(s!==void 0&&s!==""){const g=this.uvs.length;h=this.parseUVIndex(s,g),f=this.parseUVIndex(r,g),p=this.parseUVIndex(o,g),this.addUV(h,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let i=0,s=e.length;i<s;i++){const r=this.parseVertexIndex(e[i],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const i=this.vertices.length,s=this.uvs.length;for(let r=0,o=e.length;r<o;r++)this.addVertexLine(this.parseVertexIndex(e[r],i));for(let r=0,o=t.length;r<o;r++)this.addUVLine(this.parseUVIndex(t[r],s))}};return n.startObject("",!1),n}class Yv extends _n{constructor(e){super(e),this.materials=null}load(e,t,i,s){const r=this,o=new Va(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(a))}catch(c){s?s(c):console.error(c),r.manager.itemError(e)}},i,s)}setMaterials(e){return this.materials=e,this}parse(e){const t=new Xv;e.indexOf(`\r
`)!==-1&&(e=e.replace(/\r\n/g,`
`)),e.indexOf(`\\
`)!==-1&&(e=e.replace(/\\\n/g,""));const i=e.split(`
`);let s="",r="",o=0,a=[];const c=typeof"".trimLeft=="function";for(let h=0,f=i.length;h<f;h++)if(s=i[h],s=c?s.trimLeft():s.trim(),o=s.length,o!==0&&(r=s.charAt(0),r!=="#"))if(r==="v"){const p=s.split(/\s+/);switch(p[0]){case"v":t.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),p.length>=7?t.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":t.uvs.push(parseFloat(p[1]),parseFloat(p[2]));break}}else if(r==="f"){const g=s.substr(1).trim().split(/\s+/),_=[];for(let v=0,y=g.length;v<y;v++){const C=g[v];if(C.length>0){const S=C.split("/");_.push(S)}}const w=_[0];for(let v=1,y=_.length-1;v<y;v++){const C=_[v],S=_[v+1];t.addFace(w[0],C[0],S[0],w[1],C[1],S[1],w[2],C[2],S[2])}}else if(r==="l"){const p=s.substring(1).trim().split(" ");let g=[];const _=[];if(s.indexOf("/")===-1)g=p;else for(let w=0,v=p.length;w<v;w++){const y=p[w].split("/");y[0]!==""&&g.push(y[0]),y[1]!==""&&_.push(y[1])}t.addLineGeometry(g,_)}else if(r==="p"){const g=s.substr(1).trim().split(" ");t.addPointGeometry(g)}else if((a=Gv.exec(s))!==null){const p=(" "+a[0].substr(1).trim()).substr(1);t.startObject(p)}else if(qv.test(s))t.object.startMaterial(s.substring(7).trim(),t.materialLibraries);else if(Wv.test(s))t.materialLibraries.push(s.substring(7).trim());else if(jv.test(s))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(r==="s"){if(a=s.split(" "),a.length>1){const g=a[1].trim().toLowerCase();t.object.smooth=g!=="0"&&g!=="off"}else t.object.smooth=!0;const p=t.object.currentMaterial();p&&(p.smooth=t.object.smooth)}else{if(s==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+s+'"')}t.finalize();const l=new zi;if(l.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let h=0,f=t.objects.length;h<f;h++){const p=t.objects[h],g=p.geometry,_=p.materials,w=g.type==="Line",v=g.type==="Points";let y=!1;if(g.vertices.length===0)continue;const C=new ut;C.setAttribute("position",new gt(g.vertices,3)),g.normals.length>0&&C.setAttribute("normal",new gt(g.normals,3)),g.colors.length>0&&(y=!0,C.setAttribute("color",new gt(g.colors,3))),g.hasUVIndices===!0&&C.setAttribute("uv",new gt(g.uvs,2));const S=[];for(let P=0,b=_.length;P<b;P++){const z=_[P],oe=z.name+"_"+z.smooth+"_"+y;let X=t.materials[oe];if(this.materials!==null){if(X=this.materials.create(z.name),w&&X&&!(X instanceof Gn)){const D=new Gn;kt.prototype.copy.call(D,X),D.color.copy(X.color),X=D}else if(v&&X&&!(X instanceof Hi)){const D=new Hi({size:10,sizeAttenuation:!1});kt.prototype.copy.call(D,X),D.color.copy(X.color),D.map=X.map,X=D}}X===void 0&&(w?X=new Gn:v?X=new Hi({size:1,sizeAttenuation:!1}):X=new Ua,X.name=z.name,X.flatShading=!z.smooth,X.vertexColors=y,t.materials[oe]=X),S.push(X)}let T;if(S.length>1){for(let P=0,b=_.length;P<b;P++){const z=_[P];C.addGroup(z.groupStart,z.groupCount,P)}w?T=new Rs(C,S):v?T=new Cr(C,S):T=new Ot(C,S)}else w?T=new Rs(C,S[0]):v?T=new Cr(C,S[0]):T=new Ot(C,S[0]);T.name=p.name,l.add(T)}else if(t.vertices.length>0){const h=new Hi({size:1,sizeAttenuation:!1}),f=new ut;f.setAttribute("position",new gt(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(f.setAttribute("color",new gt(t.colors,3)),h.vertexColors=!0);const p=new Cr(f,h);l.add(p)}return l}}class Zv extends _n{constructor(e){super(e)}load(e,t,i,s){const r=this,o=this.path===""?ou.extractUrlBase(e):this.path,a=new Va(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(c){try{t(r.parse(c,o))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
`);let s={};const r=/\s+/,o={};for(let c=0;c<i.length;c++){let l=i[c];if(l=l.trim(),l.length===0||l.charAt(0)==="#")continue;const u=l.indexOf(" ");let h=u>=0?l.substring(0,u):l;h=h.toLowerCase();let f=u>=0?l.substring(u+1):"";if(f=f.trim(),h==="newmtl")s={name:f},o[f]=s;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){const p=f.split(r,3);s[h]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else s[h]=f}const a=new Jv(this.resourcePath||t,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(o),a}}class Jv{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Xi,this.wrap=this.options.wrap!==void 0?this.options.wrap:kr}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const i in e){const s=e[i],r={};t[i]=r;for(const o in s){let a=!0,c=s[o];const l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(c=[c[0]/255,c[1]/255,c[2]/255]),this.options&&this.options.ignoreZeroRGBs&&c[0]===0&&c[1]===0&&c[2]===0&&(a=!1);break}a&&(r[l]=c)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,i=this.materialsInfo[e],s={name:e,side:this.side};function r(a,c){return typeof c!="string"||c===""?"":/^https?:\/\//i.test(c)?c:a+c}function o(a,c){if(s[a])return;const l=t.getTextureParams(c,s),u=t.loadTexture(r(t.baseUrl,l.url));u.repeat.copy(l.scale),u.offset.copy(l.offset),u.wrapS=t.wrap,u.wrapT=t.wrap,s[a]=u}for(const a in i){const c=i[a];let l;if(c!=="")switch(a.toLowerCase()){case"kd":s.color=new Re().fromArray(c);break;case"ks":s.specular=new Re().fromArray(c);break;case"ke":s.emissive=new Re().fromArray(c);break;case"map_kd":o("map",c);break;case"map_ks":o("specularMap",c);break;case"map_ke":o("emissiveMap",c);break;case"norm":o("normalMap",c);break;case"map_bump":case"bump":o("bumpMap",c);break;case"map_d":o("alphaMap",c),s.transparent=!0;break;case"ns":s.shininess=parseFloat(c);break;case"d":l=parseFloat(c),l<1&&(s.opacity=l,s.transparent=!0);break;case"tr":l=parseFloat(c),this.options&&this.options.invertTrProperty&&(l=1-l),l>0&&(s.opacity=1-l,s.transparent=!0);break}}return this.materials[e]=new Ua(s),this.materials[e]}getTextureParams(e,t){const i={scale:new ce(1,1),offset:new ce(0,0)},s=e.split(/\s+/);let r;return r=s.indexOf("-bm"),r>=0&&(t.bumpScale=parseFloat(s[r+1]),s.splice(r,2)),r=s.indexOf("-s"),r>=0&&(i.scale.set(parseFloat(s[r+1]),parseFloat(s[r+2])),s.splice(r,4)),r=s.indexOf("-o"),r>=0&&(i.offset.set(parseFloat(s[r+1]),parseFloat(s[r+2])),s.splice(r,4)),i.url=s.join(" ").trim(),i}loadTexture(e,t,i,s,r){const o=this.manager!==void 0?this.manager:Kd;let a=o.getHandler(e);a===null&&(a=new tu(o)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);const c=a.load(e,i,s,r);return t!==void 0&&(c.mapping=t),c}}const Dc={type:"change"},Xo={type:"start"},Nc={type:"end"};class Qv extends Zn{constructor(e,t){super(),t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new L,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:gi.ROTATE,MIDDLE:gi.DOLLY,RIGHT:gi.PAN},this.touches={ONE:_i.ROTATE,TWO:_i.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(k){k.addEventListener("keydown",R),this._domElementKeyEvents=k},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(Dc),i.update(),r=s.NONE},this.update=function(){const k=new L,ee=new Ft().setFromUnitVectors(e.up,new L(0,1,0)),de=ee.clone().invert(),me=new L,we=new Ft,Fe=2*Math.PI;return function(){const Qe=i.object.position;k.copy(Qe).sub(i.target),k.applyQuaternion(ee),a.setFromVector3(k),i.autoRotate&&r===s.NONE&&oe(b()),i.enableDamping?(a.theta+=c.theta*i.dampingFactor,a.phi+=c.phi*i.dampingFactor):(a.theta+=c.theta,a.phi+=c.phi);let xt=i.minAzimuthAngle,wt=i.maxAzimuthAngle;return isFinite(xt)&&isFinite(wt)&&(xt<-Math.PI?xt+=Fe:xt>Math.PI&&(xt-=Fe),wt<-Math.PI?wt+=Fe:wt>Math.PI&&(wt-=Fe),xt<=wt?a.theta=Math.max(xt,Math.min(wt,a.theta)):a.theta=a.theta>(xt+wt)/2?Math.max(xt,a.theta):Math.min(wt,a.theta)),a.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=l,a.radius=Math.max(i.minDistance,Math.min(i.maxDistance,a.radius)),i.enableDamping===!0?i.target.addScaledVector(u,i.dampingFactor):i.target.add(u),k.setFromSpherical(a),k.applyQuaternion(de),Qe.copy(i.target).add(k),i.object.lookAt(i.target),i.enableDamping===!0?(c.theta*=1-i.dampingFactor,c.phi*=1-i.dampingFactor,u.multiplyScalar(1-i.dampingFactor)):(c.set(0,0,0),u.set(0,0,0)),l=1,h||me.distanceToSquared(i.object.position)>o||8*(1-we.dot(i.object.quaternion))>o?(i.dispatchEvent(Dc),me.copy(i.object.position),we.copy(i.object.quaternion),h=!1,!0):!1}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",re),i.domElement.removeEventListener("pointerdown",he),i.domElement.removeEventListener("pointercancel",Me),i.domElement.removeEventListener("wheel",ot),i.domElement.removeEventListener("pointermove",be),i.domElement.removeEventListener("pointerup",$),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",R)};const i=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=s.NONE;const o=1e-6,a=new Lc,c=new Lc;let l=1;const u=new L;let h=!1;const f=new ce,p=new ce,g=new ce,_=new ce,w=new ce,v=new ce,y=new ce,C=new ce,S=new ce,T=[],P={};function b(){return 2*Math.PI/60/60*i.autoRotateSpeed}function z(){return Math.pow(.95,i.zoomSpeed)}function oe(k){c.theta-=k}function X(k){c.phi-=k}const D=function(){const k=new L;return function(de,me){k.setFromMatrixColumn(me,0),k.multiplyScalar(-de),u.add(k)}}(),ge=function(){const k=new L;return function(de,me){i.screenSpacePanning===!0?k.setFromMatrixColumn(me,1):(k.setFromMatrixColumn(me,0),k.crossVectors(i.object.up,k)),k.multiplyScalar(de),u.add(k)}}(),G=function(){const k=new L;return function(de,me){const we=i.domElement;if(i.object.isPerspectiveCamera){const Fe=i.object.position;k.copy(Fe).sub(i.target);let ct=k.length();ct*=Math.tan(i.object.fov/2*Math.PI/180),D(2*de*ct/we.clientHeight,i.object.matrix),ge(2*me*ct/we.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(D(de*(i.object.right-i.object.left)/i.object.zoom/we.clientWidth,i.object.matrix),ge(me*(i.object.top-i.object.bottom)/i.object.zoom/we.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function V(k){i.object.isPerspectiveCamera?l/=k:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*k)),i.object.updateProjectionMatrix(),h=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Y(k){i.object.isPerspectiveCamera?l*=k:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/k)),i.object.updateProjectionMatrix(),h=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function W(k){f.set(k.clientX,k.clientY)}function Z(k){y.set(k.clientX,k.clientY)}function fe(k){_.set(k.clientX,k.clientY)}function _e(k){p.set(k.clientX,k.clientY),g.subVectors(p,f).multiplyScalar(i.rotateSpeed);const ee=i.domElement;oe(2*Math.PI*g.x/ee.clientHeight),X(2*Math.PI*g.y/ee.clientHeight),f.copy(p),i.update()}function ne(k){C.set(k.clientX,k.clientY),S.subVectors(C,y),S.y>0?V(z()):S.y<0&&Y(z()),y.copy(C),i.update()}function ie(k){w.set(k.clientX,k.clientY),v.subVectors(w,_).multiplyScalar(i.panSpeed),G(v.x,v.y),_.copy(w),i.update()}function xe(k){k.deltaY<0?Y(z()):k.deltaY>0&&V(z()),i.update()}function ve(k){let ee=!1;switch(k.code){case i.keys.UP:G(0,i.keyPanSpeed),ee=!0;break;case i.keys.BOTTOM:G(0,-i.keyPanSpeed),ee=!0;break;case i.keys.LEFT:G(i.keyPanSpeed,0),ee=!0;break;case i.keys.RIGHT:G(-i.keyPanSpeed,0),ee=!0;break}ee&&(k.preventDefault(),i.update())}function Ce(){if(T.length===1)f.set(T[0].pageX,T[0].pageY);else{const k=.5*(T[0].pageX+T[1].pageX),ee=.5*(T[0].pageY+T[1].pageY);f.set(k,ee)}}function Ne(){if(T.length===1)_.set(T[0].pageX,T[0].pageY);else{const k=.5*(T[0].pageX+T[1].pageX),ee=.5*(T[0].pageY+T[1].pageY);_.set(k,ee)}}function le(){const k=T[0].pageX-T[1].pageX,ee=T[0].pageY-T[1].pageY,de=Math.sqrt(k*k+ee*ee);y.set(0,de)}function Be(){i.enableZoom&&le(),i.enablePan&&Ne()}function Ie(){i.enableZoom&&le(),i.enableRotate&&Ce()}function Se(k){if(T.length==1)p.set(k.pageX,k.pageY);else{const de=pe(k),me=.5*(k.pageX+de.x),we=.5*(k.pageY+de.y);p.set(me,we)}g.subVectors(p,f).multiplyScalar(i.rotateSpeed);const ee=i.domElement;oe(2*Math.PI*g.x/ee.clientHeight),X(2*Math.PI*g.y/ee.clientHeight),f.copy(p)}function q(k){if(T.length===1)w.set(k.pageX,k.pageY);else{const ee=pe(k),de=.5*(k.pageX+ee.x),me=.5*(k.pageY+ee.y);w.set(de,me)}v.subVectors(w,_).multiplyScalar(i.panSpeed),G(v.x,v.y),_.copy(w)}function ke(k){const ee=pe(k),de=k.pageX-ee.x,me=k.pageY-ee.y,we=Math.sqrt(de*de+me*me);C.set(0,we),S.set(0,Math.pow(C.y/y.y,i.zoomSpeed)),V(S.y),y.copy(C)}function K(k){i.enableZoom&&ke(k),i.enablePan&&q(k)}function ue(k){i.enableZoom&&ke(k),i.enableRotate&&Se(k)}function he(k){i.enabled!==!1&&(T.length===0&&(i.domElement.setPointerCapture(k.pointerId),i.domElement.addEventListener("pointermove",be),i.domElement.addEventListener("pointerup",$)),Le(k),k.pointerType==="touch"?A(k):Pe(k))}function be(k){i.enabled!==!1&&(k.pointerType==="touch"?ae(k):Ge(k))}function $(k){Te(k),T.length===0&&(i.domElement.releasePointerCapture(k.pointerId),i.domElement.removeEventListener("pointermove",be),i.domElement.removeEventListener("pointerup",$)),i.dispatchEvent(Nc),r=s.NONE}function Me(k){Te(k)}function Pe(k){let ee;switch(k.button){case 0:ee=i.mouseButtons.LEFT;break;case 1:ee=i.mouseButtons.MIDDLE;break;case 2:ee=i.mouseButtons.RIGHT;break;default:ee=-1}switch(ee){case gi.DOLLY:if(i.enableZoom===!1)return;Z(k),r=s.DOLLY;break;case gi.ROTATE:if(k.ctrlKey||k.metaKey||k.shiftKey){if(i.enablePan===!1)return;fe(k),r=s.PAN}else{if(i.enableRotate===!1)return;W(k),r=s.ROTATE}break;case gi.PAN:if(k.ctrlKey||k.metaKey||k.shiftKey){if(i.enableRotate===!1)return;W(k),r=s.ROTATE}else{if(i.enablePan===!1)return;fe(k),r=s.PAN}break;default:r=s.NONE}r!==s.NONE&&i.dispatchEvent(Xo)}function Ge(k){if(i.enabled!==!1)switch(r){case s.ROTATE:if(i.enableRotate===!1)return;_e(k);break;case s.DOLLY:if(i.enableZoom===!1)return;ne(k);break;case s.PAN:if(i.enablePan===!1)return;ie(k);break}}function ot(k){i.enabled===!1||i.enableZoom===!1||r!==s.NONE||(k.preventDefault(),i.dispatchEvent(Xo),xe(k),i.dispatchEvent(Nc))}function R(k){i.enabled===!1||i.enablePan===!1||ve(k)}function A(k){switch(F(k),T.length){case 1:switch(i.touches.ONE){case _i.ROTATE:if(i.enableRotate===!1)return;Ce(),r=s.TOUCH_ROTATE;break;case _i.PAN:if(i.enablePan===!1)return;Ne(),r=s.TOUCH_PAN;break;default:r=s.NONE}break;case 2:switch(i.touches.TWO){case _i.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Be(),r=s.TOUCH_DOLLY_PAN;break;case _i.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ie(),r=s.TOUCH_DOLLY_ROTATE;break;default:r=s.NONE}break;default:r=s.NONE}r!==s.NONE&&i.dispatchEvent(Xo)}function ae(k){switch(F(k),r){case s.TOUCH_ROTATE:if(i.enableRotate===!1)return;Se(k),i.update();break;case s.TOUCH_PAN:if(i.enablePan===!1)return;q(k),i.update();break;case s.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;K(k),i.update();break;case s.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;ue(k),i.update();break;default:r=s.NONE}}function re(k){i.enabled!==!1&&k.preventDefault()}function Le(k){T.push(k)}function Te(k){delete P[k.pointerId];for(let ee=0;ee<T.length;ee++)if(T[ee].pointerId==k.pointerId){T.splice(ee,1);return}}function F(k){let ee=P[k.pointerId];ee===void 0&&(ee=new ce,P[k.pointerId]=ee),ee.set(k.pageX,k.pageY)}function pe(k){const ee=k.pointerId===T[0].pointerId?T[1]:T[0];return P[ee.pointerId]}i.domElement.addEventListener("contextmenu",re),i.domElement.addEventListener("pointerdown",he),i.domElement.addEventListener("pointercancel",Me),i.domElement.addEventListener("wheel",ot,{passive:!1}),this.update()}}const Kv={props:{model:{type:String,default:""},material:{type:String,default:""},autoInit:{type:Boolean,default:!1}},data(){return{camera:null,scene:null,renderer:null,mesh:null,load:!1,error:""}},methods:{init:function(){const n=this.model,e=this.material;this.scene=new Na;let t=document.getElementsByClassName("modal-outer-3d")[0].getBoundingClientRect();this.scene.background=new Re("white"),this.camera=new zt(75,window.innerWidth/window.innerHeight,1,1e4);var i=document.getElementsByClassName("3d_view_new")[0];this.renderer=new rt({antialias:!0,canvas:i}),this.renderer.setSize(t.width,t.height);var s=new Tr(new Re("hsl(30, 100%, 75%)"),1);s.position.set(-100,0,100);var r=new Tr(new Re("hsl(240, 100%, 75%)"),.75);r.position.set(100,0,100);var o=new Tr(16777215,1);o.position.set(100,0,-100).normalize(),this.scene.add(s),this.scene.add(r),this.scene.add(o);var a=new Zv,c=new Yv;e&&a.load(e,function(u){u.preload(),c.setMaterials(u)});const l=this;c.load(n,function(u){const h=new nn().setFromObject(u);if(l.scene.add(u),h){let p=[];p.x=h.max.x-h.min.x,p.y=h.max.y-h.min.y,p.z=h.max.z-h.min.z,p.max=Math.max(p.x,p.y,p.z);let g=1.1;l.camera.position.x=p.x*g,l.camera.position.y=p.y*g,l.camera.position.z=p.z*g}let f=new Qv(l.camera,l.renderer.domElement);f.enableDamping=!0,f.dampingFactor=.25,f.enableZoom=!0,f.update()});try{this.load=!0,requestAnimationFrame(this.render)}catch{this.error="Извините, что-то пошло не так, попробуйте повторить позднее"}},resizeRendererToDisplaySize(n){const e=n.domElement,t=e.clientWidth,i=e.clientHeight,s=e.width!==t||e.height!==i;return s&&n.setSize(t,i,!1),s},render(){const n=this.renderer.domElement;this.camera.aspect=n.clientWidth/n.clientHeight,this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera),requestAnimationFrame(this.render)}},mounted(){this.autoInit&&this.init()}},ey=n=>(Ze("data-v-1fd71c1c"),n=n(),Je(),n),ty={id:"modal-outer-3d",class:"modal-outer-3d"},ny={class:"load"},iy={xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",background:"rgb(255, 255, 255)",display:"block","shape-rendering":"auto"},width:"150px",height:"150px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},sy=ey(()=>d("path",{d:"M20 50A30 30 0 0 0 80 50A30 32.7 0 0 1 20 50",fill:"#fad65d",stroke:"none"},[d("animateTransform",{attributeName:"transform",type:"rotate",dur:"1s",repeatCount:"indefinite",keyTimes:"0;1",values:"0 50 51.35;360 50 51.35"})],-1)),ry=[sy],oy={id:"my_canvas",class:"3d_view_new",style:{width:"100%",height:"100%"}};function ay(n,e,t,i,s,r){return m(),x("div",ty,[$e(d("div",ny,[(m(),x("svg",iy,ry))],512),[[Ye,!s.load]]),$e(d("div",null,[$e(d("canvas",oy,null,512),[[Ye,s.error===""]]),$e(d("div",{class:"load"},B(s.error),513),[[Ye,s.error!==""]])],512),[[Ye,s.load]])])}const Gs=Ae(Kv,[["render",ay],["__scopeId","data-v-1fd71c1c"]]),ly=Object.freeze(Object.defineProperty({__proto__:null,default:Gs},Symbol.toStringTag,{value:"Module"})),cy={props:{imgSrc:{type:String,default:"",required:!0},imgAlt:{type:String,default:""}},data:()=>({showModal:!1}),methods:{openModal(){this.$nextTick(()=>{this.showModal=!0})},closeModal(){this.showModal=!1},getDummyUrl(n){n.target.src="/images/dummy/no-image.webp"}}},dy={class:"clickable"},uy=["src","alt"],hy={class:"modal-content"},fy={class:"image"},py=["src","alt"];function my(n,e,t,i,s,r){return m(),x("div",dy,[d("img",{src:t.imgSrc,onClick:e[0]||(e[0]=(...o)=>r.openModal&&r.openModal(...o)),alt:t.imgAlt,onError:e[1]||(e[1]=(...o)=>r.getDummyUrl&&r.getDummyUrl(...o))},null,40,uy),I(Ku,{name:"fade"},{default:O(()=>[$e(d("div",{onClick:e[3]||(e[3]=(...o)=>r.closeModal&&r.closeModal(...o)),class:"modal"},[d("div",hy,[d("div",fy,[d("img",{src:t.imgSrc,alt:t.imgAlt,onError:e[2]||(e[2]=(...o)=>r.getDummyUrl&&r.getDummyUrl(...o))},null,40,py)])])],512),[[Ye,n.showModal]])]),_:1})])}const Qr=Ae(cy,[["render",my],["__scopeId","data-v-cac0e38f"]]);function lu(n){return Object.values(n).map(e=>e.VALUE).filter(e=>e).join(" • ")}const gy={components:{IconBase:Ki}},_y=d("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.80105 3.87816e-07C6.01315 5.66674e-08 -2.4693e-06 7.61041 -2.85719e-06 12.0474C-3.10533e-06 14.8858 6.66901 23 9.80104 23L44.6448 23C47.1932 23 49 21.1825 49 18.6201L49 4.55642C48.5476 1.76056 47.3815 3.6732e-06 44.6448 3.43395e-06L9.80105 3.87816e-07ZM5.76222 11.6188C5.76222 10.5566 6.67011 9.69563 7.79006 9.69563C8.91 9.69563 9.81789 10.5566 9.81789 11.6188C9.81789 12.6809 8.91 13.5419 7.79006 13.5419C6.67011 13.5419 5.76222 12.6809 5.76222 11.6188Z",fill:"#F95353"},null,-1);function vy(n,e,t,i,s,r){const o=Ki;return m(),N(o,{viewBoxWidth:"49",viewBoxHeight:"23"},{default:O(()=>[_y]),_:1})}const Kr=Ae(gy,[["render",vy]]),cu={computed:{showHiddenBlocks(){return this.$store.getters.getShowHiddenBlocksStatus},isShowTime(){return this.$store.getters.getRegionData.SHOW_TIME_SHIPPING==="Y"||this.$store.getters.getShowHiddenBlocksStatus},currentRegion(){return this.$store.getters.getRegionData.NAME},product(){return this.$store.getters["product/getData"]},izNotKzNotEmployee(){return!((this.$store.state.regionData.kz||document.location.origin.includes("1hmm.kz"))&&!this.$store.getters.getShowHiddenBlocksStatus)}},methods:{getPicture(n){var e,t,i,s;return((t=(e=n==null?void 0:n.detail)==null?void 0:e.small)==null?void 0:t.src)||((s=(i=n==null?void 0:n.preview)==null?void 0:i.small)==null?void 0:s.src)||this.product.pictures[0].medium},inStockCount(n){let e=!1,t=!1;n==null||n.remains.forEach(s=>{(!t||s.daysTo<t)&&s.quantity&&(t=s.daysTo,e=s)}),e||n==null||n.remains.forEach(s=>{(!t||s.daysTo<t)&&(t=s.daysTo,e=s)});let i="";return(this.$store.getters.getRegionData.IP==="87.249.214.51"||this.$store.getters.getRegionData.OWN_SHOP==="Y"||this.showHiddenBlocks)&&e.quantity&&(i=`${e.quantity} шт.`),this.product.vendor.name==="Стендмебель"&&this.$store.getters.getRegionData.ID=="76934"&&(e.quantity=!1),{stockText:e.quantity?`В наличии ${i}`:!1,deliveryText:e.daysTo===1?e.daysText:`Доставим в течение ${e.daysText}`,pickupText:e.daysTo===1?"Можно забрать сегодня":`Самовывоз через ${e.daysText}`}},showWarehouseRemains(n){let e="";return n>3&&(this.$store.getters.getRegionData.IP==="87.249.214.51"||this.$store.getters.getRegionData.OWN_SHOP=="Y"||this.showHiddenBlocks)||n<=3?e=n+" шт.":e="много",e},getDummyUrl(n){n.target.src="/nuxt/releases/develop/assets/images/dummy/no-image.webp"},warehouseSaleRemains(n){return this.offers[n].isSaleRemains&&this.offers[n].inStock&&this.offers[n].inStock<=10?this.offers[n].inStock:!1}}},yy={components:{ClickableImageZoom:Qr,IconSaleBig:Kr,Button:tt,Skeleton:Lt,Price:ht,Window:Wt,Shield:Tt},props:["productId","offers","productIcons"],mixins:[cu],data(){return{store:this.$store.state,addToBasketStarted:!1,currentDetailImage:!1}},computed:{offerList(){var t,i;let n=[];Object.assign(n,this.$store.getters["warehouse/getWarehouses"]);const e=Number.parseInt((i=(t=this._.provides[at]||this.$route)==null?void 0:t.query)==null?void 0:i.offer_id);return n.sort(function(s,r){const o=s.remains.reduce((c,l)=>c+l.quantity,0);return r.remains.reduce((c,l)=>c+l.quantity,0)-o}),n.sort(function(s,r){if(s.id===e)return-1}),n},product(){return this.$store.getters["product/getData"]},isShow(){return this.$parent.$parent.visibility}},beforeDestroy(){this.$store.dispatch("warehouse/clearWarehouses")},created(){},methods:{categorizationCurrent(n,e){var s,r;let t=this.$store.getters["product/getCategorization"],i=e;if(i||(i=(r=(s=this._.provides[at]||this.$route)==null?void 0:s.query)==null?void 0:r.offer_id),t[n]){for(let[o,a]of Object.entries(t[n]))if(o==i)return"categorization"+a}},getPropertiesString:lu,async getWarehouses(){await this.$store.dispatch("warehouse/getWarehouses",{productId:this.productId,section:(this._.provides[at]||this.$route).params.section})},onAddToBasket(n=!1){let e={};this.isComplect?this.getComplects.forEach(t=>{t.CNT>0&&(e[t.ID]=t.CNT)}):n?e[n]=1:e[this.product.currentOffer]=1,(async()=>{var t,i,s,r;this.addToBasketStarted=n,await this.$store.dispatch("basket/addProduct",{offers:e,productId:this.productId}),this.addToBasketStarted=!1,await this.$store.dispatch("basket/setLastProduct",{name:this.$store.state.product.offers[n].name,image:this.$store.state.product.offers[n].image||((r=(s=(i=(t=this.$store.state.product)==null?void 0:t.product)==null?void 0:i.pictures)==null?void 0:s[0])==null?void 0:r.medium)}),await this.$store.dispatch("lPop/openWindow","addedBasket")})()},showDetailImage(n){this.currentDetailImage=n.PICTURE.REAL.SRC??!1,this.currentDetailImage&&this.$store.dispatch("lPop/openWindow","detailImage")},joinValues(n){return n?n.join("/"):""}}},dn=n=>(Ze("data-v-6c64351a"),n=n(),Je(),n),xy={key:0,class:"warehouses_list"},wy=dn(()=>d("div",{class:"warehouse__title"},[d("div",null,"Вариант исполнения"),d("div",{class:"stock"},"Наличие")],-1)),by=["onClick"],My={class:"warehouse__col",style:{display:"flex","flex-direction":"column"}},Sy={class:"warehouse__name"},Cy={style:{"margin-bottom":"4px"}},Ty={class:"name"},Ey={key:0,class:"categorization"},Ay={class:"warehouse__props"},ky={key:0,class:"condition"},Ly={class:"warehouse__col"},Ry={class:"warehouse__stock"},Iy={key:0,class:"count"},Py={key:0,class:"icon-i"},Dy=dn(()=>d("img",{src:mi,alt:""},null,-1)),Ny={class:"warehouse-hidden"},Oy={key:0,class:"warehouse__places"},Fy={class:"warehouse__place-name"},By={class:"warehouse__place-amount warehouse__place-amount_green"},$y=["innerHTML"],zy={key:0,class:"warehouse__places"},Hy={class:"warehouse__place flex"},Uy=dn(()=>d("div",{class:"warehouse__place-name"},"Склад поставщика",-1)),Vy=dn(()=>d("div",{class:"warehouse__place-amount"},"под заказ",-1)),Gy=["innerHTML"],Wy={class:"pickup"},qy={class:"delivery"},jy={class:"warehouse__col"},Xy={key:0,class:"warehouse__buy"},Yy={class:"price-block"},Zy={key:1},Jy=dn(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"60",height:"40"},null,-1)),Qy=dn(()=>d("rect",{x:"80",y:"0",rx:"3",ry:"3",width:"280",height:"160"},null,-1)),Ky=dn(()=>d("rect",{x:"380",y:"0",rx:"3",ry:"3",width:"120",height:"18"},null,-1)),e2=dn(()=>d("rect",{x:"510",y:"0",rx:"3",ry:"3",width:"60",height:"18"},null,-1)),t2=dn(()=>d("rect",{x:"670",y:"0",rx:"3",ry:"3",width:"70",height:"18"},null,-1)),n2=dn(()=>d("rect",{x:"865",y:"5",rx:"3",ry:"3",width:"70",height:"22"},null,-1)),i2=dn(()=>d("rect",{x:"830",y:"75",rx:"3",ry:"3",width:"108",height:"44"},null,-1));function s2(n,e,t,i,s,r){const o=Qr,a=ht,c=tt,l=Wt,u=Lt;return Object.keys(r.offerList).length>0?(m(),x("div",xy,[wy,(m(!0),x(U,null,te(r.offerList,h=>(m(),x("div",{class:"warehouse flex",key:h.id},[d("div",{class:"warehouse__col picture-preview",onClick:f=>r.showDetailImage(h)},[I(o,{"img-src":n.getPicture(h.images),"img-alt":r.product.name,onError:n.getDummyUrl},null,8,["img-src","img-alt","onError"])],8,by),d("div",My,[d("div",Sy,[d("div",Cy,[(m(!0),x(U,null,te(h.icons,(f,p)=>(m(),x("div",{key:p},[f.code==="sale"?(m(),x("div",{key:0,style:en({color:f.textColor,background:f.backgroundColor}),class:"shield"},B(f.text),5)):M("",!0)]))),128))]),d("div",Ty,[n.showHiddenBlocks?(m(),x("div",Ey,[d("span",{class:Ee(r.categorizationCurrent(r.product.id,h.id))},null,2)])):M("",!0),Q(" "+B(r.product.name),1)])]),d("div",Ay,[(m(!0),x(U,null,te(h.properties,(f,p)=>(m(),x("div",{key:p},B(f.propertyName)+": "+B(r.joinValues(f.propertyValues)),1))),128))]),n.warehouseSaleRemains(h.id)?(m(),x("div",ky," Распродажа остатков. Доступно: "+B(n.warehouseSaleRemains(h.id))+" шт. ",1)):M("",!0)]),d("div",Ly,[d("div",Ry,[n.inStockCount(h).stockText?(m(),x("div",Iy,[Q(B(n.inStockCount(h).stockText)+" ",1),n.isShowTime?(m(),x("div",Py,[Dy,d("div",Ny,[(m(!0),x(U,null,te(h.remains,(f,p)=>(m(),x(U,{key:`stock-${p}`},[f.quantity>0&&h.remains?(m(),x("div",Oy,[d("div",{class:Ee(["warehouse__place flex",{warehouse__place_current:f.name===n.currentRegion}])},[d("div",Fy,B(f.name),1),d("div",By,B(n.showWarehouseRemains(f.quantity)),1),d("div",{class:"warehouse__place-text",innerHTML:f.daysText},null,8,$y)],2)])):M("",!0)],64))),128)),(m(!0),x(U,null,te(h.remains,(f,p)=>(m(),x(U,{key:`off-${p}`},[f.quantity===0&&h.remains?(m(),x("div",zy,[d("div",Hy,[Uy,Vy,n.isShowTime?(m(),x("div",{key:0,class:"warehouse__place-text",innerHTML:f.daysText},null,8,Gy)):M("",!0)])])):M("",!0)],64))),128))])])):M("",!0)])):M("",!0),d("div",null,[d("div",Wy,B(h.remainsReady.pickupText),1),d("div",qy,B(n.inStockCount(h).deliveryText),1)])])]),d("div",jy,[Object.keys(h.price).length>0?(m(),x("div",Xy,[d("div",Yy,[I(a,{"price-new":h.price.new,"line-break":!0,"price-old":h.price.new!==h.price.old?h.price.old:!1,isHit:r.product.isHit,"big-small":"medium"},null,8,["price-new","price-old","isHit"])]),r.product.isForbidden?M("",!0):(m(),N(c,{key:0,class:"in-cart",theme:"yellow",onClick:f=>r.onAddToBasket(h.id),loading:s.addToBasketStarted==h.id},{default:O(()=>[Q("В корзину")]),_:2},1032,["onClick","loading"]))])):M("",!0)])]))),128)),I(l,{"pop-id":"detailImage",size:"big"},{default:O(()=>[d("div",{class:"detail-image",style:en(`background-image: url(${s.currentDetailImage})`)},null,4)]),_:1})])):(m(),x("div",Zy,[(m(),x(U,null,te(2,h=>I(u,{class:"skeleton-warehouse",width:"940",height:"160",key:h},{default:O(()=>[Jy,Qy,Ky,e2,t2,n2,i2]),_:2},1024)),64))]))}const r2=Ae(yy,[["render",s2],["__scopeId","data-v-6c64351a"]]),o2={components:{IconBase:Ki}},a2=d("rect",{x:"7",y:"6.10352e-05",width:"31",height:"18",rx:"2",fill:"#F95353"},null,-1),l2=d("rect",{x:"-2.82495",y:"8.97107",width:"16.7994",height:"16.8196",rx:"7",transform:"rotate(-44.7995 -2.82495 8.97107)",fill:"#F95353"},null,-1),c2=d("rect",{x:"3",y:"8.89807",width:"2.69371",height:"2.7157",rx:"1.34685",transform:"rotate(-44.7995 3 8.89807)",fill:"white"},null,-1);function d2(n,e,t,i,s,r){const o=Ki;return m(),N(o,{viewBoxWidth:"38",viewBoxHeight:"19"},{default:O(()=>[a2,l2,c2]),_:1})}const u2=Ae(o2,[["render",d2]]),h2={mixins:[cu],components:{ClickableImageZoom:Qr,Price:ht,IconSale:u2,Button:tt,Skeleton:Lt,Window:Wt,Shield:Tt},props:["productId","offers","productIcons"],data(){return{store:this.$store.state,addToBasketStarted:!1,currentDetailImage:!1,visibleStock:!1}},methods:{categorizationCurrent(n,e){var s,r;let t=this.$store.getters["product/getCategorization"],i=e;if(i||(i=(r=(s=this._.provides[at]||this.$route)==null?void 0:s.query)==null?void 0:r.offer_id),t[n]){for(let[o,a]of Object.entries(t[n]))if(o==i)return"categorization"+a}},getPropertiesString:lu,setVisibleStock(n){n===this.visibleStock?this.visibleStock=!1:this.visibleStock=n},getQuantityValue(n){return n>0?n<3?n+" шт.":"Много":"Под заказ"},onAddToBasket(n=!1){let e={};this.isComplect?this.getComplects.forEach(t=>{t.CNT>0&&(e[t.ID]=t.CNT)}):n?e[n]=1:e[this.product.currentOffer]=1,(async()=>{var t,i,s,r;this.addToBasketStarted=n,await this.$store.dispatch("basket/addProduct",{offers:e,productId:this.productId}),this.addToBasketStarted=!1,await this.$store.dispatch("basket/setLastProduct",{name:this.$store.state.product.offers[n].name,image:this.$store.state.product.offers[n].image||((r=(s=(i=(t=this.$store.state.product)==null?void 0:t.product)==null?void 0:i.pictures)==null?void 0:s[0])==null?void 0:r.medium)}),await this.$store.dispatch("lPop/openWindow","addedBasket")})()},showDetailImage(n){this.currentDetailImage=n.PICTURE.REAL.SRC??!1,this.currentDetailImage&&this.$store.dispatch("lPop/openWindow","detailImage")},joinValues(n){return n?n.join("/"):""}},computed:{offerList(){var t,i;let n=[];Object.assign(n,this.$store.getters["warehouse/getWarehouses"]);const e=Number.parseInt((i=(t=this._.provides[at]||this.$route)==null?void 0:t.query)==null?void 0:i.offer_id);return n.sort(function(s,r){const o=s.remains.reduce((c,l)=>c+l.quantity,0);return r.remains.reduce((c,l)=>c+l.quantity,0)-o}),n.sort(function(s,r){if(s.id===e)return-1}),n},product(){return this.$store.getters["product/getData"]},isShowTime(){return this.$store.getters.getRegionData.SHOW_TIME_SHIPPING=="Y"}}},qt=n=>(Ze("data-v-c463604e"),n=n(),Je(),n),f2={key:0,class:"warehouses_list"},p2={class:"flex"},m2={class:"warehouse__col"},g2=["onClick"],_2={class:"warehouse__col"},v2={class:"warehouse__name"},y2={key:0,style:{"margin-bottom":"4px"}},x2={class:"name"},w2={key:0,class:"categorization"},b2={class:"warehouse__props"},M2={key:0,class:"condition"},S2={class:"cols-parent"},C2={class:"warehouse__col d-flex"},T2={class:"warehouse__stock"},E2={key:0,class:"count"},A2=["onClick"],k2=qt(()=>d("img",{src:mi,alt:""},null,-1)),L2={key:0,class:"warehouse-hidden"},R2={key:0,class:"warehouse__places"},I2={class:"warehouse__place-name"},P2={class:"warehouse__place-amount warehouse__place-amount_green"},D2=["innerHTML"],N2={key:0,class:"warehouse__places"},O2={class:"warehouse__place flex"},F2=qt(()=>d("div",{class:"warehouse__place-name"},"Склад поставщика",-1)),B2=qt(()=>d("div",{class:"warehouse__place-amount"},"под заказ",-1)),$2=["innerHTML"],z2={class:"pickup"},H2={class:"delivery"},U2={key:0,class:"warehouse__buy"},V2={class:"detail-image"},G2=["src"],W2={key:1},q2=qt(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"70",height:"45"},null,-1)),j2=qt(()=>d("rect",{x:"90",y:"0",rx:"3",ry:"3",width:"180",height:"16"},null,-1)),X2=qt(()=>d("rect",{x:"0",y:"70",rx:"3",ry:"3",width:"100%",height:"20"},null,-1)),Y2=qt(()=>d("rect",{x:"0",y:"105",rx:"3",ry:"3",width:"100%",height:"20"},null,-1)),Z2=qt(()=>d("rect",{x:"0",y:"140",rx:"3",ry:"3",width:"100%",height:"20"},null,-1)),J2=qt(()=>d("rect",{x:"0",y:"175",rx:"3",ry:"3",width:"100%",height:"20"},null,-1)),Q2=qt(()=>d("rect",{x:"0",y:"220",rx:"3",ry:"3",width:"128",height:"40"},null,-1)),K2=qt(()=>d("rect",{x:"133",y:"220",rx:"3",ry:"3",width:"99",height:"40"},null,-1)),ex=qt(()=>d("rect",{x:"236",y:"220",rx:"3",ry:"3",width:"99",height:"40"},null,-1)),tx=qt(()=>d("rect",{x:"0",y:"280",rx:"3",ry:"3",width:"60",height:"20"},null,-1)),nx=qt(()=>d("rect",{x:"231",y:"280",rx:"3",ry:"3",width:"99",height:"44"},null,-1));function ix(n,e,t,i,s,r){const o=Qr,a=Tt,c=ht,l=tt,u=Wt,h=Lt;return Object.keys(r.offerList).length>0?(m(),x("div",f2,[(m(!0),x(U,null,te(r.offerList,f=>(m(),x("div",{class:"warehouse",key:f.id},[d("div",p2,[d("div",m2,[d("div",{class:"warehouse__image",onClick:p=>r.showDetailImage(f)},[I(o,{"img-src":n.getPicture(f.images),"img-alt":f.name,onError:n.getDummyUrl},null,8,["img-src","img-alt","onError"])],8,g2)]),d("div",_2,[d("div",v2,[f.icons?(m(),x("div",y2,[(m(!0),x(U,null,te(f.icons.filter(p=>p.text==="Распродажа"),(p,g)=>(m(),N(a,{key:g,bgColor:p.backgroundColor,color:p.textColor,icon:p.icon,gradient:p.lineaGradient,code:p.code,style:{width:"max-content"}},{default:O(()=>[Q(B(p.text),1)]),_:2},1032,["bgColor","color","icon","gradient","code"]))),128))])):M("",!0),d("div",x2,[n.showHiddenBlocks?(m(),x("div",w2,[d("span",{class:Ee(r.categorizationCurrent(r.product.id,f.id))},null,2)])):M("",!0),Q(" "+B(r.product.name),1)])]),d("div",b2,[(m(!0),x(U,null,te(f.properties,(p,g)=>(m(),x("div",{key:g},B(p.propertyName)+": "+B(r.joinValues(p.propertyValues)),1))),128))]),n.warehouseSaleRemains(f.id)?(m(),x("div",M2," Распродажа остатков. Доступно: "+B(n.warehouseSaleRemains(f.id))+" шт. ",1)):M("",!0)])]),d("div",S2,[d("div",C2,[d("div",T2,[n.inStockCount(f).stockText?(m(),x("div",E2,[Q(B(n.inStockCount(f).stockText)+" ",1),n.showHiddenBlocks?(m(),x("div",{key:0,class:"icon-i",onClick:p=>s.visibleStock=f.id,tabindex:"0",onFocusout:e[0]||(e[0]=Vi(p=>s.visibleStock=!1,["prevent"]))},[k2,s.visibleStock===f.id?(m(),x("div",L2,[(m(!0),x(U,null,te(f.remains,(p,g)=>(m(),x(U,{key:`stock-${g}`},[f.remains&&p.quantity>0?(m(),x("div",R2,[d("div",{class:Ee(["warehouse__place flex",{warehouse__place_current:p.name===n.currentRegion}])},[d("div",I2,B(p.name),1),d("div",P2,B(n.showWarehouseRemains(p.quantity)),1),d("div",{class:"warehouse__place-text",innerHTML:p.daysText},null,8,D2)],2)])):M("",!0)],64))),128)),(m(!0),x(U,null,te(f.remains,(p,g)=>(m(),x(U,{key:`off-${g}`},[f.remains&&p.quantity===0?(m(),x("div",N2,[d("div",O2,[F2,B2,r.isShowTime?(m(),x("div",{key:0,class:"warehouse__place-text",innerHTML:p.daysText},null,8,$2)):M("",!0)])])):M("",!0)],64))),128))])):M("",!0)],40,A2)):M("",!0)])):M("",!0),d("div",null,[d("div",z2,B(n.inStockCount(f).pickupText),1),d("div",H2,B(n.inStockCount(f).deliveryText),1)])]),Object.keys(f.price).length>0?(m(),x("div",U2,[I(c,{"price-new":f.price.new,"price-old":f.price.new!==f.price.old?f.price.old:!1,"is-hit":r.product.isHit,"big-small":"small"},null,8,["price-new","price-old","is-hit"]),r.product.isForbidden?M("",!0):(m(),N(l,{key:0,size:"small",class:"btn-buy",theme:"yellow",onClick:p=>r.onAddToBasket(f.id),loading:s.addToBasketStarted==f.id},{default:O(()=>[Q("В корзину ")]),_:2},1032,["onClick","loading"]))])):M("",!0)])])]))),128)),I(u,{"pop-id":"detailImage",size:"big"},{default:O(()=>[d("div",V2,[d("img",{loading:"lazy",src:s.currentDetailImage,alt:"Детальное изображение"},null,8,G2)])]),_:1})])):(m(),x("div",W2,[(m(),x(U,null,te(2,f=>I(h,{class:"skeleton-warehouse",width:"330",height:"325",key:f},{default:O(()=>[q2,j2,X2,Y2,Z2,J2,Q2,K2,ex,tx,nx]),_:2},1024)),64))]))}const sx=Ae(h2,[["render",ix],["__scopeId","data-v-c463604e"]]),rx={props:["productId","offers","productIcons"]};function ox(n,e,t,i,s,r){const o=r2,a=sx;return n.$device.isDesktop?(m(),N(o,{key:0,productId:t.productId,offers:t.offers,productIcons:t.productIcons},null,8,["productId","offers","productIcons"])):n.$device.isMobile?(m(),N(a,{key:1,productId:t.productId,offers:t.offers,productIcons:t.productIcons},null,8,["productId","offers","productIcons"])):M("",!0)}const du=Ae(rx,[["render",ox]]),ax={name:"ShowMore",methods:{onClick(){this.$emit("click")}}},lx={class:"show-more"};function cx(n,e,t,i,s,r){return m(),x("div",lx,[d("div",{onClick:e[0]||(e[0]=(...o)=>r.onClick&&r.onClick(...o)),class:"show-more__inner"}," Показать еще ")])}const eo=Ae(ax,[["render",cx],["__scopeId","data-v-337a3b14"]]),dx={components:{Window:Wt,Skeleton:Lt,Button:tt,Input:mn,ShowMore:eo},props:["productId"],data(){return{questionForm:{name:"",email:"",phone:"",text:""},dataProcessed:!1,errorMessage:"",questionSucceed:!1,questionProcessed:!1,limit:7}},computed:{questions(){return this.$store.getters["questions/getQuestions"]},questionsShow(){return this.questions.filter((n,e)=>e<this.limit)},questionName:{set(n){this.questionForm.name=n},get(){return this.questionForm.name}},questionEmail:{set(n){this.questionForm.email=n},get(){return this.questionForm.email}},questionPhone:{set(n){this.questionForm.phone=n},get(){return this.questionForm.phone}},questionText:{set(n){this.questionForm.text=n},get(){return this.questionForm.text}},isShow(){return this.$parent.$parent.visibility}},methods:{showMore(){this.limit+=7},addQuestion(){this.$store.dispatch("lPop/openWindow","addQuestion")},async getQuestions(){await(async()=>{this.dataProcessed=!0})()},sendAsk(){if(this.questionForm.name!=""&&this.questionForm.email!=""&&this.questionForm.phone!=""&&this.questionForm.text!=""&&!this.questionProcessed){if(!new Er("email").isValid(this.questionForm.email)){this.showError("Введена некорректная почта");return}if(!new Er("phone").isValid(this.questionForm.phone)){this.showError("Введен некорректный телефон");return}if(this.questionForm.text.length>1e3){this.showError("Количество символов не должно превышать 1000");return}const n=this.$store.getters.getRegionData.NAME;this.questionProcessed=!0,this.$store.dispatch("questions/sendQuestion",{name:this.questionForm.name,phone:this.questionForm.phone,email:this.questionForm.email,question:this.questionForm.text,productId:this.productId,regionName:n}).then(e=>{e.status?this.questionSucceed=!0:this.showError(e.message??"Возникла ошибка при отправке вопроса"),this.questionProcessed=!1})}else this.showError("Заполнены не все поля")},showError(n){this.errorMessage=n,setTimeout(()=>{this.errorMessage=""},3e3)},textAreaAdjust(n){n.target.style.height="110px",n.target.style.height=25+n.target.scrollHeight+"px"},showTerms(){this.$store.getters.getRegionData.kz?this.$store.dispatch("lPop/openWindow","privacyPolicyKZ"):this.$store.dispatch("lPop/openWindow","privacyPolicy")}},async beforeMount(){await this.getQuestions()}},Xa=n=>(Ze("data-v-03a08c51"),n=n(),Je(),n),ux={key:0,class:"desktop-form"},hx={key:0,class:"desktop-form__inner"},fx=Xa(()=>d("div",{class:"heading"}," Задайте вопрос о товаре ",-1)),px={class:"inputs"},mx={class:"question-textarea"},gx={class:"symbols-counter"},_x=["innerHTML"],vx={class:"question-rules"},yx={key:1,class:"desktop-form__inner completed"},xx={class:"questions__form"},wx={class:"questions__field"},bx={class:"questions__field"},Mx={class:"questions__field"},Sx={class:"questions__field"},Cx={class:"questions__field"},Tx=["innerHTML"],Ex={class:"question"},Ax={class:"question__ask"},kx={style:{display:"flex"}},Lx=["innerHTML"],Rx=["innerHTML"],Ix=["innerHTML"],Px={key:0,class:"question__answer"},Dx=Xa(()=>d("span",{class:"type"},"Ответ от магазина",-1)),Nx=["innerHTML"],Ox={key:1,class:"question__answer"},Fx=Xa(()=>d("span",{class:"type"},"Ответ от производителя",-1)),Bx=["innerHTML"],$x={key:2,class:"line"};function zx(n,e,t,i,s,r){const o=mn,a=tt,c=Wt,l=eo;return m(),x("div",{class:Ee(["questions",`${n.$device.isDesktop?"desktop":"mobile"}`])},[n.$device.isDesktop?(m(),x("div",ux,[s.questionSucceed?(m(),x("div",yx," Вопрос успешно отправлен! ")):(m(),x("div",hx,[fx,d("div",px,[I(o,{background:"#ffffff",onFocusout:e[0]||(e[0]=u=>r.questionName=u.target.value),modelValue:r.questionName,"onUpdate:modelValue":e[1]||(e[1]=u=>r.questionName=u),type:"text",placeholder:"Ваше имя"},null,8,["modelValue"]),I(o,{background:"#ffffff",onFocusout:e[2]||(e[2]=u=>r.questionEmail=u.target.value),modelValue:r.questionEmail,"onUpdate:modelValue":e[3]||(e[3]=u=>r.questionEmail=u),type:"text",placeholder:"Ваш Email"},null,8,["modelValue"]),I(o,{background:"#ffffff",onFocusout:e[4]||(e[4]=u=>r.questionPhone=u.target.value),modelValue:r.questionPhone,"onUpdate:modelValue":e[5]||(e[5]=u=>r.questionPhone=u),type:"text",validator:"phone",placeholder:"Ваш Телефон"},null,8,["modelValue"])]),d("div",mx,[$e(d("textarea",{onKeyup:e[6]||(e[6]=(...u)=>r.textAreaAdjust&&r.textAreaAdjust(...u)),"onUpdate:modelValue":e[7]||(e[7]=u=>r.questionText=u),name:"MESSAGE",placeholder:"Текст вопроса"},null,544),[[ji,r.questionText]]),d("div",gx," Количество символов "+B(r.questionText.length)+"/1000 ",1),I(a,{loading:s.questionProcessed,theme:"peach",class:"submit-desktop",onClick:r.sendAsk},{default:O(()=>[Q("Отправить вопрос")]),_:1},8,["loading","onClick"])]),$e(d("div",{class:"error-text",innerHTML:s.errorMessage},null,8,_x),[[Ye,s.errorMessage.length]]),d("div",vx,[Q(" Ознакомьтесь с "),d("span",{class:"popup",onClick:e[8]||(e[8]=(...u)=>r.showTerms&&r.showTerms(...u))},"правилами публикации")])]))])):(m(),N(a,{key:1,theme:"yellow",onClick:r.addQuestion,class:"add-btn"},{default:O(()=>[Q("Задать вопрос")]),_:1},8,["onClick"])),I(c,{"pop-id":"addQuestion","pop-name":"Задать вопрос"},{default:O(()=>[d("div",xx,[d("div",wx,[I(o,{onFocusout:e[9]||(e[9]=u=>r.questionName=u.target.value),modelValue:r.questionName,"onUpdate:modelValue":e[10]||(e[10]=u=>r.questionName=u),type:"text",placeholder:"Ваше имя"},null,8,["modelValue"])]),d("div",bx,[I(o,{onFocusout:e[11]||(e[11]=u=>r.questionPhone=u.target.value),modelValue:r.questionPhone,"onUpdate:modelValue":e[12]||(e[12]=u=>r.questionPhone=u),type:"text",placeholder:"Укажите Ваш телефон"},null,8,["modelValue"])]),d("div",Mx,[I(o,{onFocusout:e[13]||(e[13]=u=>r.questionEmail=u.target.value),modelValue:r.questionEmail,"onUpdate:modelValue":e[14]||(e[14]=u=>r.questionEmail=u),type:"text",placeholder:"Укажите Ваш e-mail"},null,8,["modelValue"])]),d("div",Sx,[I(o,{modelValue:r.questionText,"onUpdate:modelValue":e[15]||(e[15]=u=>r.questionText=u),type:"text",placeholder:"Ваш вопрос"},null,8,["modelValue"])]),d("div",Cx,[I(a,{class:"w-full",onClick:r.sendAsk,theme:"yellow",align:"center"},{default:O(()=>[Q("Отправить вопрос")]),_:1},8,["onClick"])]),$e(d("div",{class:"error-text",innerHTML:s.errorMessage},null,8,Tx),[[Ye,s.errorMessage.length]])])]),_:1}),r.questions.length>0?(m(),x(U,{key:2},[(m(!0),x(U,null,te(r.questionsShow,u=>(m(),x("div",Ex,[d("div",Ax,[d("span",kx,[n.$device.isDesktop?(m(),x("span",{key:0,class:"letter",innerHTML:u.authorName[0]},null,8,Lx)):M("",!0),d("span",{class:"author-name",innerHTML:u.authorName},null,8,Rx)]),d("span",{class:"question__text",innerHTML:u.ask},null,8,Ix)]),u.answer_shop?(m(),x("div",Px,[Dx,Q(),d("span",{innerHTML:u.answer_shop},null,8,Nx)])):M("",!0),u.answer_manufacturer?(m(),x("div",Ox,[Fx,Q(),d("span",{innerHTML:u.answer_manufacturer},null,8,Bx)])):M("",!0),n.$device.isDesktop?(m(),x("hr",$x)):M("",!0)]))),256)),s.limit<r.questions.length?(m(),N(l,{key:0,onClick:r.showMore},null,8,["onClick"])):M("",!0)],64)):M("",!0)],2)}const Hx=Ae(dx,[["render",zx],["__scopeId","data-v-03a08c51"]]),Ux={components:{Window:Wt,Skeleton:Lt,Button:tt,Input:mn},props:["productId"],data(){return{questionForm:{name:"",email:"",phone:"",text:""},dataProcessed:!1,errorMessage:"",questionSucceed:!1,questionProcessed:!1,load:!1}},computed:{questions(){return this.$store.getters["questions/getQuestions"]},questionName:{set(n){this.questionForm.name=n},get(){return this.questionForm.name}},questionEmail:{set(n){this.questionForm.email=n},get(){return this.questionForm.email}},questionPhone:{set(n){this.questionForm.phone=n},get(){return this.questionForm.phone}},questionText:{set(n){this.questionForm.text=n},get(){return this.questionForm.text}}},mounted(){setTimeout(()=>{this.load=!0},1e3)},methods:{addQuestion(){this.$store.dispatch("lPop/openWindow","addQuestion")},async getQuestions(){await(async()=>{this.dataProcessed=!0})()},sendAsk(){if(console.log(this.questionForm),this.questionForm.name!=""&&this.questionForm.email!=""&&this.questionForm.phone!=""&&this.questionForm.text!=""&&!this.questionProcessed){if(!new Er("email").isValid(this.questionForm.email)){this.showError("Введена некорректная почта");return}if(!new Er("phone").isValid(this.questionForm.phone)){this.showError("Введен некорректный телефон");return}const n=this.$store.getters.getRegionData.NAME;this.questionProcessed=!0,this.$store.dispatch("questions/sendQuestion",{name:this.questionForm.name,phone:this.questionForm.phone,email:this.questionForm.email,question:this.questionForm.text,productId:this.productId,regionName:n}).then(e=>{e.status?(this.questionSucceed=!0,this.$store.dispatch("lPop/closeWindow","addQuestion"),setTimeout(()=>{this.questionSucceed=!1},15e3)):this.showError(e.message??"Возникла ошибка при отправке вопроса"),this.questionProcessed=!1})}else this.showError("Заполнены не все поля")},showError(n){this.errorMessage=n,setTimeout(()=>{this.errorMessage=""},3e3)},showTerms(){this.$store.getters.getRegionData.kz?this.$store.dispatch("lPop/openWindow","privacyPolicyKZ"):this.$store.dispatch("lPop/openWindow","privacyPolicy")}},async beforeMount(){await this.getQuestions()}},Ya=n=>(Ze("data-v-52a4854b"),n=n(),Je(),n),Vx={class:"questions__form"},Gx={class:"questions__field"},Wx={class:"questions__field"},qx={class:"questions__field"},jx={class:"questions__field"},Xx={class:"questions__field"},Yx=["innerHTML"],Zx={class:"question-rules"},Jx={class:"question"},Qx={class:"question__ask"},Kx={class:"question__head"},ew=Ya(()=>d("div",{class:"question__icon"},[d("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M12 0C5.37328 0 0 5.37222 0 11.9995C0 18.6267 5.37275 23.9989 12 23.9989C18.6278 23.9989 24 18.6267 24 11.9995C24 5.37222 18.6278 0 12 0ZM12 3.58798C14.1927 3.58798 15.9696 5.36537 15.9696 7.55706C15.9696 9.74927 14.1927 11.5261 12 11.5261C9.80831 11.5261 8.03145 9.74927 8.03145 7.55706C8.03145 5.36537 9.80831 3.58798 12 3.58798ZM11.9974 20.8616C9.81042 20.8616 7.80743 20.0652 6.2625 18.7469C5.88615 18.4259 5.66898 17.9552 5.66898 17.4613C5.66898 15.2385 7.46798 13.4595 9.69129 13.4595H14.3098C16.5336 13.4595 18.3257 15.2385 18.3257 17.4613C18.3257 17.9557 18.1096 18.4254 17.7328 18.7464C16.1884 20.0652 14.1848 20.8616 11.9974 20.8616Z",fill:"#DFD6D0"})])],-1)),tw={class:"question__author"},nw={class:"question__text"},iw={key:0,class:"question__answer"},sw=Wc('<div class="question__head" data-v-52a4854b><div class="question__icon" data-v-52a4854b><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-52a4854b><circle cx="12" cy="12" r="12" fill="#F9D86D" data-v-52a4854b></circle><path d="M19.4576 14.033C19.8192 14.033 20 13.7665 20 13.4111C20 13.1445 19.8192 12.878 19.4576 12.878C18.9153 12.878 18.4633 12.9668 18.0113 13.1445C17.6497 13.3222 17.3785 13.5888 17.1073 13.8553C16.7458 14.2107 16.565 14.7438 16.4746 15.277C16.113 15.0104 15.7514 14.7438 15.2994 14.5661L16.8362 7.63571C16.8362 7.458 16.7458 7.19145 16.565 7.1026C16.3842 6.92489 16.113 7.01375 15.9322 7.1026L12.3164 9.94585C12.1356 10.1236 11.8644 10.1236 11.6836 9.94585L8.0678 7.1026C7.88701 7.01375 7.61582 6.92489 7.43503 7.1026C7.25424 7.19145 7.16384 7.458 7.16384 7.63571L8.70056 14.5661C8.24859 14.7438 7.88701 15.0104 7.52542 15.277C7.43503 14.7438 7.25424 14.2107 6.89266 13.8553C6.71186 13.5888 6.35028 13.3222 5.9887 13.1445C5.53672 12.9668 5.08475 12.878 4.54237 12.878C4.18079 12.878 4 13.1445 4 13.4111C4 13.7665 4.18079 14.033 4.54237 14.033C5.26554 14.033 5.71751 14.2107 6.0791 14.5661C6.62147 15.1881 6.35028 16.3432 6.35028 16.3432C6.35028 16.6097 6.44068 16.7874 6.62147 16.9651C6.71186 16.9651 6.80226 16.9651 6.89266 16.9651C7.07345 16.9651 7.16384 16.9651 7.34463 16.8763C8.51977 15.5435 10.2373 14.9216 12.0452 14.9216C13.7627 14.9216 15.4802 15.5435 16.6554 16.7874C16.8362 16.9651 17.0169 17.054 17.1977 16.9651C17.3785 16.9651 17.5593 16.8763 17.6497 16.6097C17.6497 16.5209 17.6497 16.432 17.6497 16.3432C17.6497 16.2543 17.4689 15.1881 17.9209 14.5661C18.2825 14.2107 18.7345 14.033 19.4576 14.033ZM12.0452 13.7665C11.2316 13.7665 10.4181 13.9442 9.69492 14.1219L8.61017 8.87963L11.0508 10.8344C11.322 11.0121 11.6836 11.1898 12.0452 11.1898C12.3164 11.1898 12.678 11.0121 12.9492 10.8344L15.3898 8.87963L14.3051 14.1219C13.5819 13.9442 12.7684 13.7665 12.0452 13.7665Z" fill="#543328" data-v-52a4854b></path></svg></div><div class="question__author" data-v-52a4854b>Ответ магазина</div></div>',1),rw=["innerHTML"],ow={key:1,class:"question__answer"},aw=Wc('<div class="question__head" data-v-52a4854b><div class="question__icon" data-v-52a4854b><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-52a4854b><circle cx="12" cy="12" r="12" fill="#F9D86D" data-v-52a4854b></circle><path d="M19.4576 14.033C19.8192 14.033 20 13.7665 20 13.4111C20 13.1445 19.8192 12.878 19.4576 12.878C18.9153 12.878 18.4633 12.9668 18.0113 13.1445C17.6497 13.3222 17.3785 13.5888 17.1073 13.8553C16.7458 14.2107 16.565 14.7438 16.4746 15.277C16.113 15.0104 15.7514 14.7438 15.2994 14.5661L16.8362 7.63571C16.8362 7.458 16.7458 7.19145 16.565 7.1026C16.3842 6.92489 16.113 7.01375 15.9322 7.1026L12.3164 9.94585C12.1356 10.1236 11.8644 10.1236 11.6836 9.94585L8.0678 7.1026C7.88701 7.01375 7.61582 6.92489 7.43503 7.1026C7.25424 7.19145 7.16384 7.458 7.16384 7.63571L8.70056 14.5661C8.24859 14.7438 7.88701 15.0104 7.52542 15.277C7.43503 14.7438 7.25424 14.2107 6.89266 13.8553C6.71186 13.5888 6.35028 13.3222 5.9887 13.1445C5.53672 12.9668 5.08475 12.878 4.54237 12.878C4.18079 12.878 4 13.1445 4 13.4111C4 13.7665 4.18079 14.033 4.54237 14.033C5.26554 14.033 5.71751 14.2107 6.0791 14.5661C6.62147 15.1881 6.35028 16.3432 6.35028 16.3432C6.35028 16.6097 6.44068 16.7874 6.62147 16.9651C6.71186 16.9651 6.80226 16.9651 6.89266 16.9651C7.07345 16.9651 7.16384 16.9651 7.34463 16.8763C8.51977 15.5435 10.2373 14.9216 12.0452 14.9216C13.7627 14.9216 15.4802 15.5435 16.6554 16.7874C16.8362 16.9651 17.0169 17.054 17.1977 16.9651C17.3785 16.9651 17.5593 16.8763 17.6497 16.6097C17.6497 16.5209 17.6497 16.432 17.6497 16.3432C17.6497 16.2543 17.4689 15.1881 17.9209 14.5661C18.2825 14.2107 18.7345 14.033 19.4576 14.033ZM12.0452 13.7665C11.2316 13.7665 10.4181 13.9442 9.69492 14.1219L8.61017 8.87963L11.0508 10.8344C11.322 11.0121 11.6836 11.1898 12.0452 11.1898C12.3164 11.1898 12.678 11.0121 12.9492 10.8344L15.3898 8.87963L14.3051 14.1219C13.5819 13.9442 12.7684 13.7665 12.0452 13.7665Z" fill="#543328" data-v-52a4854b></path></svg></div><div class="question__author" data-v-52a4854b>Ответ производителя</div></div>',1),lw=["innerHTML"],cw=Ya(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"50%",height:"21"},null,-1)),dw=Ya(()=>d("rect",{x:"0",y:"25",rx:"3",ry:"3",width:"100%",height:"65"},null,-1));function uw(n,e,t,i,s,r){const o=tt,a=mn,c=Wt,l=Lt;return m(),x("div",{class:Ee(["questions",{mobile:!n.$device.isDesktop}])},[I(o,{theme:"peach",onClick:r.addQuestion,class:"add-btn"},{default:O(()=>[Q("Задать вопрос")]),_:1},8,["onClick"]),d("div",{class:"succeed",style:en(`display:${s.questionSucceed?"block":"none"};`)},"Ваш вопрос успешно отправлен!",4),I(c,{"pop-id":"addQuestion","pop-name":"Задать вопрос"},{default:O(()=>[d("div",Vx,[d("div",Gx,[I(a,{onFocusout:e[0]||(e[0]=u=>r.questionName=u.target.value),modelValue:r.questionName,"onUpdate:modelValue":e[1]||(e[1]=u=>r.questionName=u),type:"text",placeholder:"Имя"},null,8,["modelValue"])]),d("div",Wx,[I(a,{onFocusout:e[2]||(e[2]=u=>r.questionPhone=u.target.value),modelValue:r.questionPhone,"onUpdate:modelValue":e[3]||(e[3]=u=>r.questionPhone=u),type:"text",validator:"phone",placeholder:"Укажите Ваш телефон"},null,8,["modelValue"])]),d("div",qx,[I(a,{onFocusout:e[4]||(e[4]=u=>r.questionEmail=u.target.value),modelValue:r.questionEmail,"onUpdate:modelValue":e[5]||(e[5]=u=>r.questionEmail=u),type:"text",validator:"email",placeholder:"Укажите Ваш e-mail"},null,8,["modelValue"])]),d("div",jx,[I(a,{onFocusout:e[6]||(e[6]=u=>r.questionText=u.target.value),modelValue:r.questionText,"onUpdate:modelValue":e[7]||(e[7]=u=>r.questionText=u),type:"text",placeholder:"Ваш вопрос"},null,8,["modelValue"])]),d("div",Xx,[I(o,{class:"w-full",loading:s.questionProcessed,onClick:r.sendAsk,theme:"yellow",align:"center"},{default:O(()=>[Q("Опубликовать")]),_:1},8,["loading","onClick"])]),$e(d("div",{class:"error-text",innerHTML:s.errorMessage},null,8,Yx),[[Ye,s.errorMessage.length]]),d("div",Zx,[Q(" Ознакомьтесь с "),d("span",{class:"popup",onClick:e[8]||(e[8]=(...u)=>r.showTerms&&r.showTerms(...u))},"правилами публикации")])])]),_:1}),r.questions.length>0?(m(!0),x(U,{key:0},te(r.questions,u=>(m(),x("div",Jx,[d("div",Qx,[d("div",Kx,[ew,d("div",tw,B(u.authorName),1)]),d("div",nw,B(u.ask),1)]),u.answer_shop?(m(),x("div",iw,[sw,d("div",{class:"question__text",innerHTML:u.answer_shop},null,8,rw)])):M("",!0),u.answer_manufacturer?(m(),x("div",ow,[aw,d("div",{class:"question__text",innerHTML:u.answer_manufacturer},null,8,lw)])):M("",!0)]))),256)):(m(),x(U,{key:1},[s.load?M("",!0):(m(),x(U,{key:0},te(2,u=>I(l,{class:"skeleton-faq",width:n.$device.isDesktop?"940":"330",height:"90",key:u},{default:O(()=>[cw,dw]),_:2},1032,["width"])),64))],64))],2)}const hw=Ae(Ux,[["render",uw],["__scopeId","data-v-52a4854b"]]),fw={props:["productId"]};function pw(n,e,t,i,s,r){const o=Hx,a=hw;return n.$device.isDesktop?(m(),N(o,{key:0,productId:t.productId},null,8,["productId"])):(m(),N(a,{key:1,productId:t.productId},null,8,["productId"]))}const uu=Ae(fw,[["render",pw]]),mw={components:{Skeleton:Lt,Input:mn,Textarea:Zc,InputRating:Xc,Window:Wt,InputDropzone:Yc,Button:tt,IconStar:An,ShowMore:eo,ReviewWindow:Br},props:["productId"],data:function(){return{formName:"",formNameError:"",formCity:"",formCityError:"",formOrderNumber:"",formOrderNumberError:"",formRating:!1,formDignity:"",formDisadvantage:"",formMessage:"",formMessageError:!1,formFiles:[],response:!1,limit:5,isWaiting:!1}},computed:{reviews(){return this.$store.getters["productReviews/getReviews"]},product(){return this.$store.getters["product/getData"]},reviewsShow(){return this.$store.getters["productReviews/getReviews"].filter(n=>n.authorName.toLowerCase()!=="сборка мебели").filter((n,e)=>e<this.limit)},reviewsLength(){return this.$store.getters["productReviews/getReviews"].filter(n=>n.authorName.toLowerCase()!=="сборка мебели").length},isLoaded(){return this.$store.getters["productReviews/getLoadedStatus"]},countReviews(){return this.reviews.length},isModerator(){const n=this.$store.getters["authentication/getUserGroups"]??[];return n.includes("2")||n.includes("28")},averageRating(){let n=this.reviews,e=0,t=0;return n.forEach(i=>{Number(i.rating)>0&&(t+=Number(i.rating),e++)}),e?(t/e).toFixed(1):0},recomends(){let n=this.reviews,e=0,t=0;return n.forEach(i=>{Number(i.rating)>0&&(Number(i.rating)>3&&e++,t++)}),t?parseInt(100/t*e):0},isShow(){return this.$parent.$parent.visibility}},methods:{showMore(){this.limit=this.limit+5},voteYes(n){this.$store.dispatch("productReviews/voteYes",{reviewId:n})},voteNo(n){this.$store.dispatch("productReviews/voteNo",{reviewId:n})},writeReview(){this.$store.dispatch("lPop/openWindow","writeReview")},reviewAuthorName(n){return n.replace(/[^0-9]/g,"").length<7?n:"Имя скрыто"},clickOnImageInReview(n){this.$emit("clickOnImageInReview",n)}}},Rt=n=>(Ze("data-v-584c5b65"),n=n(),Je(),n),gw={class:"reviews"},_w={class:"rating-block"},vw={class:"rating-group"},yw=Rt(()=>d("div",{class:"reviews-title"},"Отзывы о товаре",-1)),xw={class:"stars-block"},ww={class:"stars"},bw={key:0,class:"rating-value"},Mw={key:0,class:"reviews-stat"},Sw={key:0,class:"reviews-none"},Cw={key:1,class:"reviews__list"},Tw={class:"review__col"},Ew={class:"review__avatar"},Aw={class:"review__col"},kw={class:"review__head"},Lw={class:"review__name"},Rw={class:"review__bar"},Iw={class:"review__date"},Pw={class:"review__rating"},Dw={key:0,class:"review__rating-value"},Nw=["href"],Ow={class:"review__body"},Fw={key:0,class:"review__text"},Bw=Rt(()=>d("div",{class:"review__section"},"Преимущества",-1)),$w=["innerHTML"],zw={key:1,class:"review__text"},Hw=Rt(()=>d("div",{class:"review__section"},"Недостатки",-1)),Uw=["innerHTML"],Vw={key:2,class:"review__text"},Gw=Rt(()=>d("div",{class:"review__section"},"Комментарий",-1)),Ww=["innerHTML"],qw={key:3,class:"review__answer"},jw={class:"review__section"},Xw=["href"],Yw=["innerHTML"],Zw={key:4,class:"review__images"},Jw=["src","onClick"],Qw={class:"review__help"},Kw=Rt(()=>d("div",{class:"review__help-text"},"Вам помог этот отзыв?",-1)),e3={key:2},t3=Rt(()=>d("circle",{cx:"64",cy:"32",r:"32"},null,-1)),n3=Rt(()=>d("rect",{x:"128",y:"0",width:"90",height:"20"},null,-1)),i3=Rt(()=>d("rect",{x:"228",y:"0",width:"80",height:"20"},null,-1)),s3=Rt(()=>d("rect",{x:"340",y:"0",width:"100",height:"20"},null,-1)),r3=Rt(()=>d("rect",{x:"128",y:"64",width:"150",height:"20"},null,-1)),o3=Rt(()=>d("rect",{x:"128",y:"94",width:"190",height:"20"},null,-1)),a3=Rt(()=>d("rect",{x:"128",y:"144",width:"130",height:"20"},null,-1)),l3=Rt(()=>d("rect",{x:"128",y:"174",width:"40",height:"20"},null,-1)),c3=Rt(()=>d("rect",{x:"128",y:"224",width:"145",height:"20"},null,-1)),d3=Rt(()=>d("rect",{x:"128",y:"254",width:"450",height:"20"},null,-1)),u3=Rt(()=>d("rect",{x:"128",y:"310",width:"162",height:"20"},null,-1)),h3=Rt(()=>d("rect",{x:"323",y:"301",width:"90",height:"36"},null,-1)),f3=Rt(()=>d("rect",{x:"423",y:"301",width:"90",height:"36"},null,-1));function p3(n,e,t,i,s,r){const o=Br,a=An,c=tt,l=eo,u=Lt;return m(),x("div",gw,[I(o,{productId:t.productId,productName:r.product.name},null,8,["productId","productName"]),d("div",_w,[d("div",vw,[yw,d("div",xw,[d("div",ww,[(m(),x(U,null,te(5,h=>I(a,{class:"star",height:"12",width:"12",color:h<=r.averageRating?"#00BC78":"#AAAAAA",key:h},null,8,["color"])),64))]),r.averageRating?(m(),x("div",bw,B(r.averageRating),1)):M("",!0)]),r.countReviews?(m(),x("div",Mw,[d("span",null,B(r.recomends)+"%",1),Q(" покупателей рекомендуют этот товар")])):M("",!0)]),I(c,{onClick:r.writeReview,theme:"peach",align:"center"},{default:O(()=>[Q("Оставить отзыв")]),_:1},8,["onClick"])]),r.countReviews?M("",!0):(m(),x("div",Sw,"Помогите другим пользователям с выбором — будьте первым, кто поделится своим мнением об этом товаре.")),r.isLoaded?(m(),x("div",Cw,[r.reviewsLength>0?(m(!0),x(U,{key:0},te(r.reviewsShow,h=>(m(),x("div",{class:"review",key:h.ID},[d("div",Tw,[d("div",Ew,B(h.authorName.charAt(0)),1)]),d("div",Aw,[d("div",kw,[d("div",Lw,B(r.reviewAuthorName(h.authorName)),1),d("div",Rw,[d("div",Iw,B(h.date),1),d("div",Pw,[(m(),x(U,null,te(5,f=>I(a,{height:"12",width:"12",color:f<=h.rating?"#FFC633":"#AAAAAA",class:"star",key:f},null,8,["color"])),64))]),h.rating?(m(),x("div",Dw,B(h.rating),1)):M("",!0),r.isModerator?(m(),x("div",{key:1,class:"review_moderator",style:en(`color: ${h.approved?"green":"red"}`)},[d("a",{href:h.url,target:"_blank"},B(h.approved?"Проверен":"Не проверен"),9,Nw)],4)):M("",!0)])]),d("div",Ow,[h.dignity!=""?(m(),x("div",Fw,[Bw,d("div",{innerHTML:h.dignity},null,8,$w)])):M("",!0),h.disadvantage!=""?(m(),x("div",zw,[Hw,Q(),d("div",{innerHTML:h.disadvantage},null,8,Uw)])):M("",!0),h.text!=""?(m(),x("div",Vw,[Gw,Q(),d("div",{innerHTML:h.text},null,8,Ww)])):M("",!0),h.answer.message.length?(m(),x("div",qw,[d("div",jw,[Q("Ответ поставщика "),r.isModerator?(m(),x("div",{key:0,class:"review_moderator",style:en(`color: ${h.answer.approved?"green":"red"}`)},[d("a",{href:h.answer.url,target:"_blank"},B(h.answer.approved?"Проверен":"Не проверен"),9,Xw)],4)):M("",!0)]),d("div",{class:"review__answer__text",innerHTML:h.answer.message},null,8,Yw)])):M("",!0),h.files.length?(m(),x("div",Zw,[(m(!0),x(U,null,te(h.files,(f,p)=>(m(),x("div",{key:p},[d("img",{src:f.miniature,alt:"",loading:"lazy",onClick:g=>r.clickOnImageInReview(f)},null,8,Jw)]))),128))])):M("",!0)]),d("div",Qw,[Kw,I(c,{theme:"peach",size:"small",count:parseInt(h.vote_yes),radius:"30px",onClick:f=>r.voteYes(h.id)},{default:O(()=>[Q("Да")]),_:2},1032,["count","onClick"]),I(c,{theme:"gray",size:"small",count:parseInt(h.vote_no),radius:"30px",onClick:f=>r.voteNo(h.id)},{default:O(()=>[Q("Нет")]),_:2},1032,["count","onClick"])])])]))),128)):M("",!0),$e(I(l,{onClick:r.showMore},null,8,["onClick"]),[[Ye,n.limit<r.reviewsLength]])])):(m(),x("div",e3,[I(u,{class:"skeleton-reviews",width:"941",height:"338"},{default:O(()=>[t3,n3,i3,s3,r3,o3,a3,l3,c3,d3,u3,h3,f3]),_:1})]))])}const m3=Ae(mw,[["render",p3],["__scopeId","data-v-584c5b65"]]),g3={components:{ReviewMobile:ma,Textarea:Zc,Input:mn,InputRating:Xc,InputDropzone:Yc,Window:Wt,Button:tt,IconStar:An,ReviewWindow:Br,Skeleton:Lt},props:["productId"],data:function(){return{formName:"",formNameError:"",formCity:"",formCityError:"",formOrderNumber:"",formOrderNumberError:"",formRating:!1,formDignity:"",formDisadvantage:"",formMessage:"",formMessageError:!1,formFiles:[],response:!1}},computed:{recomends(){let n=this.reviews,e=0,t=0;return n.forEach(i=>{Number(i.rating)>0&&(Number(i.rating)>3&&e++,t++)}),t?parseInt(100/t*e):0},reviews(){return this.$store.getters["productReviews/getReviews"]},ratingTotal(){let n=0,e=0;return this.reviews.forEach(t=>{parseInt(t.rating)!==0&&(n+=parseInt(t.rating),e++)}),(n/e).toFixed(1)},isLoaded(){return this.$store.getters["productReviews/getLoadedStatus"]},product(){return this.$store.getters["product/getData"]}},methods:{getFormatDate(n){let e=n.split(".");return new Date(e[1]+" "+e[0]+" "+e[2]).toLocaleString("ru",{year:"numeric",month:"long",day:"numeric"})},clickOnImageInReview(n){this.$emit("clickOnImageInReview",n)},async sendNewReview(){let n=!1;if(this.response=!1,this.formNameError=!1,this.formCityError=!1,this.formOrderNumberError=!1,this.formMessageError=!1,this.formName.length<2&&(this.formNameError=!0,n=!0),this.formCity<=2&&(this.formCityError=!0,n=!0),this.formOrderNumber<6&&(this.formOrderNumberError=!0,n=!0),this.formMessage<5&&(this.formMessageError=!0,n=!0),this.formRating===!1&&(n=!0),n)this.response={message:"Заполните все поля отмеченные красным и оцените товар."};else{let e=await this.$store.dispatch("productReviews/createReview",{productId:this.productId,name:this.formName,city:this.formCity,orderNumber:this.formOrderNumber,rating:this.formRating,dignity:this.formDignity,disadvantage:this.formDisadvantage,message:this.formMessage,files:this.formFiles,productName:this.product.name});this.response=e}},writeReview(){this.$store.dispatch("lPop/openWindow","writeReview")},setFormName(n){this.formName=n},setFormCity(n){this.formCity=n},setFormOrderNumber(n){this.formOrderNumber=n},setFormRating(n){this.formRating=n},setFormDignity(n){this.formDignity=n},setFormDisadvantage(n){this.formDisadvantage=n},setFormMessage(n){this.formMessage=n},setFormFiles(n){this.formFiles=n}}},sn=n=>(Ze("data-v-eee687d3"),n=n(),Je(),n),_3={class:"reviews"},v3={class:"rating-block"},y3={class:"stars-block"},x3=sn(()=>d("div",{class:"rating-name"},"Рейтинг",-1)),w3={key:0,class:"rating-flex"},b3={class:"stars"},M3={class:"rating-value"},S3={key:1,class:"reviews-stat"},C3={key:2,class:"rating-flex"},T3={class:"stars"},E3=sn(()=>d("rect",{x:"0",y:"0",width:"90",height:"20"},null,-1)),A3=sn(()=>d("rect",{x:"228",y:"0",width:"80",height:"20"},null,-1)),k3=sn(()=>d("rect",{x:"0",y:"64",width:"150",height:"20"},null,-1)),L3=sn(()=>d("rect",{x:"0",y:"94",width:"190",height:"20"},null,-1)),R3=sn(()=>d("rect",{x:"0",y:"144",width:"130",height:"20"},null,-1)),I3=sn(()=>d("rect",{x:"0",y:"174",width:"40",height:"20"},null,-1)),P3=sn(()=>d("rect",{x:"0",y:"224",width:"145",height:"20"},null,-1)),D3=sn(()=>d("rect",{x:"0",y:"254",width:"450",height:"20"},null,-1)),N3=sn(()=>d("rect",{x:"0",y:"310",width:"120",height:"20"},null,-1)),O3=sn(()=>d("rect",{x:"130",y:"301",width:"80",height:"36"},null,-1)),F3=sn(()=>d("rect",{x:"220",y:"301",width:"80",height:"36"},null,-1));function B3(n,e,t,i,s,r){const o=Br,a=An,c=tt,l=ma,u=Lt;return m(),x("div",_3,[I(o,{productId:t.productId,productName:r.product.name},null,8,["productId","productName"]),d("div",v3,[d("div",y3,[x3,r.product.reviews?(m(),x("div",w3,[d("div",b3,[(m(),x(U,null,te(5,h=>I(a,{height:"14",width:"14",color:h<=r.product.reviews.rating?"#FFC633":"#AAAAAA",class:"star",key:h},null,8,["color"])),64))]),d("div",M3,B(r.product.reviews.count),1)])):M("",!0),r.product.reviews?(m(),x("div",S3,[d("span",null,B(r.recomends)+"%",1),Q(" покупателей рекомендуют этот товар")])):M("",!0),r.product.reviews?M("",!0):(m(),x("div",C3,[d("div",T3,[(m(),x(U,null,te(5,h=>I(a,{height:"14",width:"14",color:"#FFC633",class:"star",key:h})),64))])]))]),I(c,{onClick:r.writeReview,class:"w-full",theme:"peach",align:"center"},{default:O(()=>[Q("Оставить отзыв")]),_:1},8,["onClick"])]),r.isLoaded?(m(!0),x(U,{key:0},te(r.reviews,h=>(m(),x(U,{key:h.ID},[r.reviews.length>0&&h.authorName!=="Сборка мебели"?(m(),N(l,{key:0,review:h,"show-images":"",onClickOnImageInReview:r.clickOnImageInReview},null,8,["review","onClickOnImageInReview"])):M("",!0)],64))),128)):(m(),N(u,{key:1,class:"skeleton-reviews",width:"330",height:"338"},{default:O(()=>[E3,A3,k3,L3,R3,I3,P3,D3,N3,O3,F3]),_:1}))])}const $3=Ae(g3,[["render",B3],["__scopeId","data-v-eee687d3"]]),z3={props:["productId"],methods:{clickOnImageInReview(n){this.$emit("clickOnImageInReview",n)}}};function H3(n,e,t,i,s,r){const o=m3,a=$3;return n.$device.isDesktop?(m(),N(o,{key:0,productId:t.productId,onClickOnImageInReview:r.clickOnImageInReview},null,8,["productId","onClickOnImageInReview"])):(m(),N(a,{key:1,productId:t.productId,onClickOnImageInReview:r.clickOnImageInReview},null,8,["productId","onClickOnImageInReview"]))}const hu=Ae(z3,[["render",H3]]),U3={data(){return{modal:!1,region:!0,show:!0,data:[]}},async fetch(){this.$nuxt.context},computed:{...hi("product",{product:"getData"}),mobile(){return!this.$device.isDesktop},isKitchens(){return this.product?this.product.sections.find(({ID:n})=>n==3166):!1},free(){return!(this.region&&[53369,79547].indexOf(this.region.ID)!==-1)},content(){let n=!1,e="при заказе кухонного гарнитура",t=new Intl.NumberFormat("ru-RU").format(this.data.min_price);return this.data.min_price!==null&&(n=!0,e="при заказе кухонного гарнитура на сумму от "+t+" рублей"),{title:this.data.name,description:this.data.description,subtitle:e,price:t,hint:n}}},async beforeMount(){await this.$store.dispatch("measurer/getItems");let n=this.$store.getters["measurer/getItems"];this.data=n[0]},methods:{openModal(){this.modal=!0,this.$gtm.push({event:"measuring_kitchen_form_opened"})}}},V3={key:0},G3=d("br",null,null,-1);function W3(n,e,t,i,s,r){const o=tt,a=rh;return s.show&&r.isKitchens?(m(),x("div",{key:0,class:Ee(["measurer",{mobile:r.mobile}])},[r.isKitchens?(m(),x("div",{key:0,class:"wrapper",onClick:e[0]||(e[0]=(...c)=>r.openModal&&r.openModal(...c))},[d("h3",null,[Q(" Сделаем по"),r.mobile?(m(),x("br",V3)):M("",!0),Q(" размерам"),G3,Q(" вашей кухни ")]),r.mobile?M("",!0):(m(),N(o,{key:0,theme:"yellow"},{default:O(()=>[Q("Заказать бесплатный замер")]),_:1}))])):M("",!0),r.mobile?(m(),N(o,{key:1,onClick:r.openModal,theme:"yellow"},{default:O(()=>[Q("Заказать бесплатный замер")]),_:1},8,["onClick"])):M("",!0),I(a,{active:s.modal,content:r.content,onClose:e[1]||(e[1]=c=>s.modal=!1)},null,8,["active","content"])],2)):M("",!0)}const fu=Ae(U3,[["render",W3]]),q3={name:"InputRange",data(){return{rangeValue:10,minValue:10,maxValue:250,divisor:10}},mounted(){this.getValue()},methods:{setRangeValue(n){const e=n.target.value,t=this.rangeValue;this.rangeValue=parseFloat(e).toFixed(1)*this.divisor,isNaN(this.rangeValue)&&(this.rangeValue=t),e>this.maxValue/this.divisor&&(this.rangeValue=this.maxValue),e<this.minValue&&(this.rangeValue=this.minValue),this.getValue()},onlyNumber(n){const e=n.keyCode?n.keyCode:n.which;(e<48||e>57)&&e!==46&&n.preventDefault()},getValue(){this.$emit("getValue",this.rangeValue/this.divisor)}}},j3={class:"input-range"},X3={class:"range"},Y3=["min","max"],Z3={class:"number-input"},J3=["value"];function Q3(n,e,t,i,s,r){return m(),x("div",j3,[d("div",X3,[$e(d("input",{class:"range-inner",min:s.minValue,max:s.maxValue,type:"range","onUpdate:modelValue":e[0]||(e[0]=o=>s.rangeValue=o),onInput:e[1]||(e[1]=o=>r.getValue())},null,40,Y3),[[ji,s.rangeValue]]),d("div",{class:"filler",style:en(`width:${(s.rangeValue-s.minValue)/(s.maxValue-s.minValue)*100}%`)},null,4)]),d("div",Z3,[d("input",{type:"text",value:s.rangeValue/s.divisor,onChange:e[2]||(e[2]=o=>r.setRangeValue(o)),onKeypress:e[3]||(e[3]=(...o)=>r.onlyNumber&&r.onlyNumber(...o)),onKeyup:e[4]||(e[4]=Yo(o=>r.setRangeValue(o),["enter"]))},null,40,J3)])])}const pu=Ae(q3,[["render",Q3],["__scopeId","data-v-20dce7e0"]]),K3={name:"RunningMeterTrait",props:{priceNew:{type:Number,default:0},priceOld:{type:Number,default:0}},computed:{finalPriceNew(){return this.priceNew*this.currentMeter},finalPriceOld(){return this.priceOld*this.currentMeter},priceSize(){return this.finalPriceNew>1e6||this.finalPriceOld>1e6?"medium":"big"}},components:{InputRange:pu,Price:ht},data(){return{currentMeter:0}},methods:{setMeter(n){this.currentMeter=n,this.$emit("getValue",n)}}},Za=n=>(Ze("data-v-9c6a03b1"),n=n(),Je(),n),eb={class:"trait"},tb=Za(()=>d("div",{class:"trait__name"}," Цена за погонный метр: ",-1)),nb={class:"meter-price"},ib=Za(()=>d("span",{class:"ruble"},"₽",-1)),sb={class:"trait"},rb=Za(()=>d("div",{class:"trait__name"}," Количество погонных метров: ",-1)),ob={class:"price"};function ab(n,e,t,i,s,r){const o=pu,a=ht;return m(),x("div",null,[d("div",eb,[tb,d("div",nb,[Q(B(t.priceNew)+" ",1),ib])]),d("div",sb,[rb,I(o,{onGetValue:r.setMeter},null,8,["onGetValue"])]),d("div",ob,[I(a,{bigSmall:r.priceSize,priceNew:r.finalPriceNew,priceOld:r.finalPriceOld!==r.finalPriceNew?r.finalPriceOld:!1},null,8,["bigSmall","priceNew","priceOld"])])])}const lb=Ae(K3,[["render",ab],["__scopeId","data-v-9c6a03b1"]]),mu={computed:{traits(){var r,o,a,c;let n=this.offers;if(Object.keys(n).length===0)return[];let e=this;if((o=(r=e.$route)==null?void 0:r.query)!=null&&o.offer_id){let l=parseInt(e.$route.query.offer_id),u=!1;Object.keys(n).forEach(h=>{h==l&&(u=!0)}),u?this.curOfferId=l:this.curOfferId=parseInt(e.$store.state.product.product.currentOffer)}else this.curOfferId=parseInt(e.$store.state.product.product.currentOffer);if((a=n[this.curOfferId])!=null&&a.properties||Object.keys(n).forEach(l=>{var u;(u=n[l])!=null&&u.properties&&!this.curOfferId&&(this.curOfferId=l)}),!this.curOfferId)return[];let t=[n[this.curOfferId]];Object.keys(n).forEach(l=>{this.curOfferId!=l&&t.push(n[l])}),Object.keys(n).length>0&&Object.keys(this.filterTraits).length==0&&Object.keys(n).length>0&&this.curOfferId!=0&&Object.values((c=n[this.curOfferId])==null?void 0:c.properties).forEach(l=>{this.filterTraits[l.code]=l.value});let i=[],s=[];return Object.keys(n).length>0&&t.forEach(l=>{var u;l!=null&&l.properties&&((u=Object.values(l==null?void 0:l.properties))==null||u.forEach(h=>{let f=!1;i.forEach(p=>{p.code==h.code&&(f=!0)}),f||i.push({name:h.name,code:h.code,type:h.type,properties:[]})}))}),Object.keys(n).length>0&&i.forEach((l,u)=>{if(t.forEach(h=>{h!=null&&h.properties&&Object.values(h==null?void 0:h.properties).forEach(f=>{if(f.code==l.code&&(s.length==0||s.includes(h.id))){let p=!1;i[u].properties.forEach(g=>{g.val==f.value&&(p=!0)}),p||(f.type=="texture"?i[u].properties.push({id:h.id,name:f.attrName,val:f.value,textureUrl:f==null?void 0:f.textureUrl}):i[u].properties.push({id:h.id,textureUrl:f==null?void 0:f.textureUrl,val:f.value}))}})}),s.length==0)t.forEach(h=>{h!=null&&h.properties&&Object.values(h==null?void 0:h.properties).forEach(f=>{f.code==l.code&&f.value==this.filterTraits[l.code]&&s.push(h.id)})});else{let h=[];s.forEach(f=>{var p;Object.values((p=n[f])==null?void 0:p.properties).forEach(g=>{g.code==l.code&&g.value==this.filterTraits[l.code]&&h.push(f)})}),s=h}}),i=i.map(l=>(l.properties=l.properties.sort(function(u,h){return u.val<h.val?-1:u.val>h.val?1:0}),l)),i}}},cb={mixins:[Yn,mu],components:{Skeleton:Lt,Preloader:ga,IconUpdate:Qc,Select:Os,IconArrowDown:$t},data(){return{filterTraits:{},curOfferId:0,isMounted:!1,countProps:12,baseCountProps:12,texturesNeedUpdate:!1}},computed:{currency(){return this.$store.getters.getRegionData.currency.code},rate(){return parseFloat(this.$store.getters.getRegionData.currency.exchangeRate)},offers(){let n=this.$store.state.product.offers;return Object.keys(n).forEach(e=>{n[e].visible=!1}),n},isLoading(){return Object.keys(this.offers).length==0},isKz(){var n;return(n=this.$store.getters.getRegionData)==null?void 0:n.kz}},methods:{getUrl(n){return(this._.provides[at]||this.$route).fullPath+"?offer_id="+n},isElementVisible(n){if(!n)return!1;let e=n.getBoundingClientRect(),i=(window.innerHeight||document.documentElement.clientHeight)-e.bottom;return i<0&&i||e.top<0&&-e.top},setImgTop(n,e){let t=this.$refs[`el-${n}-${e}`][0];t.style.top="-53px";let i=this.isElementVisible(t);t.style.top=i-53+"px"},changeFilter(n,e){var r,o,a,c;let i=this.offers[e],s={};if(Object.values(i==null?void 0:i.properties).forEach(l=>{s[l.code]=l.value}),this.curOfferId=i.id,this.filterTraits=s,Number((o=(r=this._.provides[at]||this.$route)==null?void 0:r.query)==null?void 0:o.offer_id)!==Number(e))if((a=this._.provides[at]||this.$route)!=null&&a.hash&&((c=this._.provides[at]||this.$route)==null?void 0:c.hash)!=""){let l=i.sampleProdboard?"#project-sample-"+i.sampleProdboard:"#";this.$router.replace({query:{offer_id:e},hash:l})}else this.$router.replace({query:{offer_id:e}});this.$emit("change",e);{let l=this.$store.getters["product/getData"],u=[];l.sections.forEach(w=>{u.push(w.NAME)});let h=[];for(let w in l.sections)h[w]=l.sections[w].name;let f={},p={};for(let w in h)if(w<=4)if(w==0)f.item_category=h[w];else{let y="item_category"+(Number(w)+1);f[y]=h[w]}let g=l.price.new;f.id=l.id,f.item_id=l.currentOffer,f.item_name=l.name,f.price=g,f.item_brand=l.vendor.NAME,f.item_variant=l.offerXml,f.item_list_name=u[u.length-1],f.item_list_id=l.sections[l.sections.length-1].id,f.quantity=1,p.name=l.name,p.id=l.currentOffer,p.price=g,p.brand=l.vendor.NAME,p.category=l.sections[l.sections.length-1].id,p.variant=l.offerXml,p.position=1,this.$gtm.push({ecommerce:null});let _={viewProduct:{productGroup:{ids:{website:l.sections[l.sections.length-1].id}},product:{ids:{website:l.offerXml}},price:g}};this.isKz?this.$gtm.push({event:"view_item",ecommerce:{click:{actionField:{list:u[u.length-1]},products:[p]}},google_tag_params:{ecomm_prodid:l.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:g},offerId:l.currentOffer,mindboxData:_}):this.$gtm.push({event:"view_item",ecommerce:{currency:this.currency,items:[f],value:g},google_tag_params:{ecomm_prodid:l.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:g},offerId:l.currentOffer,mindboxData:_}),this.$gtm.push({mindboxData:null}),this.$gtm.push({mindboxData:_})}},getOptions(n){let e=[];return Object.values(n).forEach(t=>{e.push({value:t.id,name:t.val})}),e},cutTraitsCount(n,e=0){return n.filter((t,i)=>e?i<e:!0)},async updateTextures(){var t;this.texturesNeedUpdate=!1;let n=this.$store.state.product.product.id;(t=(await this.$store.dispatch("product/updateTextures",{id:n})).generated)!=null&&t.length&&window.location.reload()},isFirstTextureTrait(n){return this.traits.findIndex(({type:t})=>t==="texture")===n},textureFailure(n){n.target.src.indexOf("textures/md5")!==-1&&(this.texturesNeedUpdate=!0),this.getDummyUrl(n,!0)}},created(){},mounted(){this.isMounted=!0}},db=n=>(Ze("data-v-e18da854"),n=n(),Je(),n),ub={class:"traits"},hb={class:"trait"},fb={class:"trait__name"},pb={class:"texture-label"},mb=["title"],gb={class:"trait__props"},_b=["data-id","onClick","onMouseover"],vb=["title"],yb=["src"],xb={key:0,width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wb=db(()=>d("path",{d:"M13.6897 0.352653L5.63246 7.98443L2.31026 4.83768C1.77566 4.3313 0.935561 4.3313 0.400955 4.83768C-0.133652 5.34405 -0.133652 6.13978 0.400955 6.64615L4.6778 10.6971C5.21241 11.2035 6.05251 11.2035 6.58711 10.6971L15.599 2.16113C16.1337 1.65476 16.1337 0.859027 15.599 0.352653C15.0644 -0.117551 14.2243 -0.117551 13.6897 0.352653Z",fill:"white"},null,-1)),bb=[wb],Mb=["src"],Sb=["innerHTML"],Cb={key:0,class:"trait__props"},Tb={key:1,class:"trait__name"},Eb={class:"texture-label"},Ab={class:"texture-name"};function kb(n,e,t,i,s,r){const o=Qc,a=cn,c=$t,l=Os;return m(),x("div",ub,[n.traits!=[]?(m(!0),x(U,{key:0},te(n.traits,(u,h)=>(m(),x("div",hb,[u.type=="texture"?(m(),x(U,{key:0},[s.texturesNeedUpdate&&r.isFirstTextureTrait(h)?(m(),x("div",{key:0,class:"traits__texture-update",onClick:e[0]||(e[0]=f=>r.updateTextures())},[I(o,{width:"25",height:"25"})])):M("",!0),d("div",fb,[d("span",pb,B(u.name),1),(m(!0),x(U,null,te(u.properties,f=>(m(),x(U,null,[s.filterTraits[u.code]==f.val?(m(),x("span",{key:0,class:"texture-name",title:f.name},B(f.name),9,mb)):M("",!0)],64))),256))]),d("div",gb,[!n.$device.isCrawler||!n.$device.isGoogleBot?(m(!0),x(U,{key:0},te(r.cutTraitsCount(u.properties,s.countProps),(f,p)=>(m(),x("div",{class:Ee(["trait__prop texture",{texture_selected:s.filterTraits[u.code]==f.val,desktop:n.$device.isDesktop}]),"data-id":f.id,onClick:g=>r.changeFilter(u.code,f.id),onMouseover:g=>r.setImgTop(p,h)},[d("div",{class:"trait__image",title:f.name},[d("img",{src:f.textureUrl.small,onError:e[1]||(e[1]=g=>n.getDummyUrl(g,!0))},null,40,yb),s.filterTraits[u.code]==f.val?(m(),x("svg",xb,bb)):M("",!0)],8,vb),d("div",{class:"trait__big-image",ref_for:!0,ref:`el-${p}-${h}`,style:en(`left:${-330-p%6*43}px`)},[d("img",{src:f.textureUrl.big,alt:"",onError:e[2]||(e[2]=g=>n.getDummyUrl(g,!0))},null,40,Mb),d("div",{class:"desc",innerHTML:f.name},null,8,Sb)],4)],42,_b))),256)):(m(!0),x(U,{key:1},te(r.cutTraitsCount(u.properties,s.countProps),(f,p)=>(m(),N(a,{to:r.getUrl(f.id)},{default:O(()=>[Q(B(f.name),1)]),_:2},1032,["to"]))),256))]),u.properties.length>s.baseCountProps&&s.countProps!==999?(m(),x("div",{key:1,class:"expander",onClick:e[3]||(e[3]=f=>s.countProps=999)},[Q("Показать все цвета "),I(c,{width:"10",height:"6",iconColor:"#5073A8"})])):M("",!0),u.properties.length>s.baseCountProps&&s.countProps===999?(m(),x("div",{key:2,class:"expander down",onClick:e[4]||(e[4]=f=>s.countProps=s.baseCountProps)},[Q(" Свернуть "),I(c,{width:"10",height:"6",iconColor:"#5073A8"})])):M("",!0)],64)):M("",!0),u.type=="select"?(m(),x(U,{key:1},[u.properties.length>1?(m(),x("div",Cb,[!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(l,{key:0,name:u.name,options:r.getOptions(u.properties),class:"w-full",curOffer:s.curOfferId,onCallback:f=>r.changeFilter(u.code,f.value)},null,8,["name","options","curOffer","onCallback"])):(m(!0),x(U,{key:1},te(u.properties,(f,p)=>(m(),N(a,{to:r.getUrl(f.id)},{default:O(()=>[Q(B(f.val),1)]),_:2},1032,["to"]))),256))])):u.properties.length==1?(m(),x("div",Tb,[d("span",Eb,B(u.name),1),Q(),d("span",Ab,B(u.properties[0].val),1)])):M("",!0)],64)):M("",!0)]))),256)):M("",!0)])}const Lb=Ae(cb,[["render",kb],["__scopeId","data-v-e18da854"]]),Rb={components:{IconBase:Ki}},Ib=d("circle",{opacity:"0.88",cx:"14",cy:"14",r:"14",fill:"white"},null,-1),Pb=d("path",{d:"M19.1229 10.2865L12.5764 16.4873L9.87709 13.9306C9.44272 13.5192 8.76014 13.5192 8.32578 13.9306C7.89141 14.342 7.89141 14.9886 8.32578 15.4L11.8007 18.6914C12.2351 19.1029 12.9177 19.1029 13.352 18.6914L20.6742 11.7559C21.1086 11.3445 21.1086 10.698 20.6742 10.2865C20.2399 9.90449 19.5573 9.90449 19.1229 10.2865Z",fill:"#313131"},null,-1);function Db(n,e,t,i,s,r){const o=Ki;return m(),N(o,{style:{"pointer-events":"none"},viewBoxWidth:"28",viewBoxHeight:"28",iconColor:"#ffffff"},{default:O(()=>[Ib,Pb]),_:1})}const Nb=Ae(Rb,[["render",Db]]),Ob={components:{Skeleton:Lt,Preloader:ga,IconCheck:Nb,Select:Os,IconArrowDown:$t},mixins:[mu],data(){return{filterTraits:{},curOfferId:0,isMounted:!1,countProps:16,baseCountProps:16,texturesNeedUpdate:!1}},computed:{currency(){return this.$store.getters.getRegionData.currency.code},rate(){return parseFloat(this.$store.getters.getRegionData.currency.exchangeRate)},offers(){let n=this.$store.state.product.offers;return Object.keys(n).forEach(e=>{n[e].visible=!1}),n},isLoading(){return Object.keys(this.offers).length==0},isKz(){var n;return(n=this.$store.getters.getRegionData)==null?void 0:n.kz}},methods:{getUrl(n){return(this._.provides[at]||this.$route).fullPath+"?offer_id="+n},cutTraitsCount(n,e=0){return n.filter((t,i)=>e?i<e:!0)},changeFilter(n,e){var r,o,a,c;let i=this.offers[e],s={};Object.values(i==null?void 0:i.properties).forEach(l=>{s[l.code]=l.value}),this.curOfferId=i.id,this.filterTraits=s,((o=(r=this._.provides[at]||this.$route)==null?void 0:r.query)==null?void 0:o.offer_id)!=e&&((a=this._.provides[at]||this.$route)!=null&&a.hash&&((c=this._.provides[at]||this.$route)==null?void 0:c.hash)!=""?this.$router.replace({query:{offer_id:e},hash:(this._.provides[at]||this.$route).hash}):this.$router.replace({query:{offer_id:e}}));{let l=this.$store.getters["product/getData"],u=[];l.sections.forEach(w=>{u.push(w.NAME)});let h=[];for(let w in l.sections)h[w]=l.sections[w].name;let f={},p={};for(let w in h)if(w<=4)if(w==0)f.item_category=h[w];else{let y="item_category"+(Number(w)+1);f[y]=h[w]}let g=l.price.new;f.id=l.id,f.item_id=l.currentOffer,f.item_name=l.name,f.price=g,f.item_brand=l.vendor.NAME,f.item_variant=l.offerXml,f.item_list_name=u[u.length-1],f.item_list_id=l.sections[l.sections.length-1].id,f.quantity=1,p.name=l.name,p.id=l.currentOffer,p.price=g,p.brand=l.vendor.NAME,p.category=l.sections[l.sections.length-1].id,p.variant=l.offerXml,p.position=1,this.$gtm.push({ecommerce:null});let _={viewProduct:{productGroup:{ids:{website:l.sections[l.sections.length-1].id}},product:{ids:{website:l.offerXml}},price:g}};this.isKz?this.$gtm.push({event:"view_item",ecommerce:{click:{actionField:{list:u[u.length-1]},products:[p]}},google_tag_params:{ecomm_prodid:l.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:g},offerId:l.currentOffer,mindboxData:_}):this.$gtm.push({event:"view_item",ecommerce:{currency:this.currency,items:[f],value:g},google_tag_params:{ecomm_prodid:l.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:g},offerId:l.currentOffer,mindboxData:_})}this.$emit("change",e)},getOptions(n){let e=[];return Object.values(n).forEach(t=>{e.push({value:t.id,name:t.val})}),e}},created(){},mounted(){this.isMounted=!0}},gu=n=>(Ze("data-v-264df5ee"),n=n(),Je(),n),Fb={key:0,class:"trait"},Bb={class:"trait__name"},$b=["title"],zb={class:"trait__props"},Hb=["data-id","onClick"],Ub={key:0},Vb=["title"],Gb=["src","alt"],Wb={key:0,width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qb=gu(()=>d("path",{d:"M13.6897 0.352653L5.63246 7.98443L2.31026 4.83768C1.77566 4.3313 0.935561 4.3313 0.400955 4.83768C-0.133652 5.34405 -0.133652 6.13978 0.400955 6.64615L4.6778 10.6971C5.21241 11.2035 6.05251 11.2035 6.58711 10.6971L15.599 2.16113C16.1337 1.65476 16.1337 0.859027 15.599 0.352653C15.0644 -0.117551 14.2243 -0.117551 13.6897 0.352653Z",fill:"white"},null,-1)),jb=[qb],Xb={class:"trait__big-image"},Yb=["src","alt"],Zb={class:"trait__big-name"},Jb=gu(()=>d("div",{class:"trait__big-close"},[d("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M14.7589 0.240546C14.4381 -0.0801819 13.9181 -0.0801819 13.5974 0.240546L7.49972 6.33825L1.40258 0.241117C1.08185 -0.079617 0.561843 -0.079617 0.241109 0.241117C-0.0796253 0.561845 -0.0796253 1.08185 0.241109 1.40258L6.33825 7.49972L0.240551 13.5974C-0.0801835 13.9181 -0.0801835 14.4382 0.240551 14.7589C0.561285 15.0796 1.08129 15.0796 1.40203 14.7589L7.49972 8.66119L13.598 14.7595C13.9187 15.0802 14.4387 15.0802 14.7594 14.7595C15.0802 14.4387 15.0802 13.9187 14.7594 13.598L8.66117 7.49972L14.7589 1.40202C15.0796 1.08129 15.0796 0.56128 14.7589 0.240546Z",fill:"white"})])],-1)),Qb={key:0,class:"trait__props"},Kb={key:1,class:"trait__name"},eM={class:"texture-name"};function tM(n,e,t,i,s,r){const o=cn,a=$t,c=Os;return m(),x("div",{class:Ee(["traits",{mobile:!n.$device.isDesktop}])},[(m(!0),x(U,null,te(n.traits,(l,u)=>(m(),x(U,{key:u},[n.traits!=[]?(m(),x("div",Fb,[l.type=="texture"?(m(),x(U,{key:0},[d("div",Bb,[Q(B(l.name)+": ",1),(m(!0),x(U,null,te(l.properties,h=>(m(),x(U,null,[s.filterTraits[l.code]==h.val?(m(),x("span",{key:0,class:"texture-name",title:h.name},B(h.name),9,$b)):M("",!0)],64))),256))]),d("div",zb,[(m(!0),x(U,null,te(r.cutTraitsCount(l.properties,s.countProps),h=>(m(),x("div",{class:Ee(["trait__prop texture",{texture_selected:s.filterTraits[l.code]==h.val,desktop:n.$device.isDesktop,mobile:!n.$device.isDesktop}]),"data-id":h.id,onClick:f=>r.changeFilter(l.code,h.id)},[!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),x("div",Ub,[d("div",{class:"trait__image",title:h.name},[d("img",{src:h.textureUrl.small,alt:h.name},null,8,Gb),s.filterTraits[l.code]==h.val?(m(),x("svg",Wb,jb)):M("",!0)],8,Vb),d("div",Xb,[d("img",{src:h.textureUrl.big,alt:h.name},null,8,Yb),d("div",Zb,B(h.name),1),Jb])])):(m(),N(o,{key:1,to:r.getUrl(h.id)},{default:O(()=>[Q(B(h.name),1)]),_:2},1032,["to"]))],10,Hb))),256))]),l.properties.length>s.baseCountProps&&s.countProps!==999?(m(),x("div",{key:0,class:"expander",onClick:e[0]||(e[0]=h=>s.countProps=999)},[Q("Показать все цвета "),I(a,{width:"10",height:"6",iconColor:"#5073A8"})])):M("",!0),l.properties.length>s.baseCountProps&&s.countProps===999?(m(),x("div",{key:1,class:"expander down",onClick:e[1]||(e[1]=h=>s.countProps=s.baseCountProps)},[Q(" Свернуть "),I(a,{width:"10",height:"6",iconColor:"#5073A8"})])):M("",!0)],64)):M("",!0),l.type=="select"?(m(),x(U,{key:1},[l.properties.length>1?(m(),x("div",Qb,[!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(c,{key:0,name:l.name,options:r.getOptions(l.properties),class:"w-full",curOffer:s.curOfferId,onCallback:h=>r.changeFilter(l.code,h.value)},null,8,["name","options","curOffer","onCallback"])):(m(!0),x(U,{key:1},te(l.properties,(h,f)=>(m(),N(o,{to:r.getUrl(h.id)},{default:O(()=>[Q(B(h.val),1)]),_:2},1032,["to"]))),256))])):l.properties.length==1?(m(),x("div",Kb,[Q(B(l.name)+" ",1),d("span",eM,B(l.properties[0].val),1)])):M("",!0)],64)):M("",!0)])):M("",!0)],64))),128))],2)}const nM=Ae(Ob,[["render",tM],["__scopeId","data-v-264df5ee"]]),iM={methods:{onChange(n){this.$emit("change",n)}}};function sM(n,e,t,i,s,r){const o=Lb,a=nM;return n.$device.isDesktop?(m(),N(o,{key:0,onChange:r.onChange},null,8,["onChange"])):(m(),N(a,{key:1,onChange:r.onChange},null,8,["onChange"]))}const _u=Ae(iM,[["render",sM]]),rM={name:"AboutReceipt",data:()=>({email:"",name:"",phone:"",agree:!0,error:"",phoneError:"",emailError:"",display:!1,formLoading:!1,success:!1}),computed:{isPhone(){return/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/.test(this.phone)},productGuid(){return this.$store.getters["product/getData"].xmlId}},methods:{toggleShow(){this.display=!this.display},async sendForm(){if(!this.agree){this.error="Вы должны согласиться на обработку персональных данных";return}if(this.phone==="+7 (___) ___-__-__"||this.phone.replace(/\D/g,"").length!==11){this.phoneError="Введите корректный номер телефона";return}let n={phone:this.phone,email:this.email,name:this.name,type:"receipt",guid:this.productGuid,url:window.location.href};this.formLoading=!0,this.$store.dispatch("favorites/save",n),this.formLoading=!1,this.success=!0}}},oM=n=>(Ze("data-v-f09afaed"),n=n(),Je(),n),aM={class:"about-receipt"},lM={class:"about-receipt__dropdown"},cM={class:"form"},dM={class:"field"},uM={key:0,class:"error"},hM={class:"field"},fM={key:0,class:"error"},pM={class:"field"},mM={class:"field"},gM={class:"agreement"},_M=oM(()=>d("div",{class:"agreement__text"},[Q("Согласен на обработку персональных данных в соответствии с "),d("a",{href:"/privacy-policy/"},"условиями")],-1)),vM={key:0,class:"error"},yM={key:0,class:"success"};function xM(n,e,t,i,s,r){const o=mn,a=tt;return m(),x("div",aM,[d("div",{class:"about-receipt__btn",onClick:e[0]||(e[0]=(...c)=>r.toggleShow&&r.toggleShow(...c))}," Узнать о поступлении "),$e(d("div",lM,[d("div",cM,[d("div",dM,[I(o,{onFocusout:e[1]||(e[1]=c=>n.phone=c.target.value),title:"Номер телефона *",name:"phone",type:"text",modelValue:n.phone,"onUpdate:modelValue":e[2]||(e[2]=c=>n.phone=c),validator:"phone"},null,8,["modelValue"]),n.phoneError&&!r.isPhone?(m(),x("div",uM,B(n.phoneError),1)):M("",!0)]),d("div",hM,[I(o,{onFocusout:e[3]||(e[3]=c=>n.email=c.target.value),title:"E-mail",name:"email",validator:"email",type:"text",modelValue:n.email,"onUpdate:modelValue":e[4]||(e[4]=c=>n.email=c)},null,8,["modelValue"]),n.emailError?(m(),x("div",fM,B(n.emailError),1)):M("",!0)]),d("div",pM,[I(o,{onFocusout:e[5]||(e[5]=c=>n.name=c.target.value),title:"Имя",name:"name",modelValue:n.name,"onUpdate:modelValue":e[6]||(e[6]=c=>n.name=c)},null,8,["modelValue"])]),d("div",mM,[d("span",gM,[$e(d("input",{type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=c=>n.agree=c)},null,512),[[eh,n.agree]]),_M]),!n.agree&&n.error?(m(),x("div",vM,B(n.error),1)):M("",!0)]),I(a,{theme:"yellow",onClick:r.sendForm,disabled:n.formLoading},{default:O(()=>[Q("Отправить")]),_:1},8,["onClick","disabled"]),n.success?(m(),x("div",yM," Форма была успешно отправлена! Мы уточним информацию о поступлении и свяжемся с вами. ")):M("",!0)])],512),[[Ye,n.display]])])}const vu=Ae(rM,[["render",xM],["__scopeId","data-v-f09afaed"]]);function Oc(n,e){return{Челябинск:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"16:00",7:"14:00"},Уфа:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"13:00",7:!1},Москва:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"13:00",7:!1},Екатеринбург:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"16:00",7:"14:00"},Тюмень:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"13:00",7:!1},Новосибирск:{1:"18:00",2:"18:00",3:"18:00",4:"18:00",5:"18:00",6:"13:00",7:!1}}}const wM={name:"DetailProductSummary",props:{warehouseData:{type:Object,required:!0,default:()=>({}),validator:n=>Object.keys(n).length>0}},data:()=>({assemblyIcon:`<svg width="18" height="18" viewBox="0 0 51 51" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M49.6992 41.5572L26.9297 13.4942C27.2576 12.9356 27.1847 12.2678 26.8083 11.7942L24.9503 9.49911C28.3505 6.96118 30.6821 6.2933 35.7946 6.11115C37.2883 6.06258 37.7862 4.08323 36.499 3.33035C28.7148 -1.24765 21.4164 -1.10193 15.4053 3.74322L9.04195 8.85552C8.39834 9.37768 8.30119 10.3249 8.82337 10.9563C9.3334 11.5877 9.2484 12.5106 8.59264 13.0449C7.94902 13.5671 7.0018 13.4578 6.49177 12.8264C5.96959 12.1828 5.03452 12.0856 4.3909 12.5956L1.6707 14.7814C-0.260159 16.3358 -0.563753 19.153 1.00279 21.0716L4.76735 25.7103C6.32175 27.629 9.15125 27.9204 11.07 26.3782L13.7902 24.1924C14.4338 23.6703 14.5309 22.7352 14.0087 22.0916C13.4866 21.448 13.5959 20.5252 14.2273 20.003C14.871 19.4808 15.8182 19.5901 16.3404 20.2216C16.7532 20.7195 17.4211 20.8895 17.9919 20.6952L40.7007 48.8432C42.7166 51.3447 46.3597 51.7211 48.8492 49.7053C51.3386 47.7017 51.7272 44.0466 49.6992 41.5572ZM20.3721 18.898L24.6588 15.4493L27.9133 19.4566L23.6145 22.9174L20.3721 18.898ZM10.7056 20.6952C10.6328 21.363 10.7178 22.0309 10.9364 22.6502L9.18768 24.0588C8.54406 24.581 7.59685 24.4717 7.07467 23.8403L3.3101 19.2016C2.78792 18.558 2.89722 17.6351 3.52869 17.1129L5.28954 15.7043C6.85608 16.6636 8.9448 16.6029 10.4628 15.3764C12.005 14.1257 12.4908 12.1099 11.8836 10.3977L17.2633 6.07472C21.0643 3.01463 25.3996 2.23746 30.1842 3.73108C27.1847 4.39895 24.8774 5.68614 21.89 8.0905C21.2464 8.61266 21.1493 9.54768 21.6715 10.1913L23.5416 12.4985L17.5304 17.3436C14.7009 15.6314 11.0578 17.4286 10.7056 20.6952ZM46.9669 47.3981C45.7647 48.3696 44.0038 48.1874 43.0202 46.9731L25.4846 25.2367L29.7956 21.7759L47.3798 43.4516C48.3634 44.6538 48.1691 46.4145 46.9669 47.3981Z" fill="#543328"/>
</svg>
`,pickupIcon:`<svg width="19" height="22" viewBox="0 0 19 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.6152 15.5992L15.616 15.5984C16.886 14.406 17.7587 12.8601 18.1175 11.1659C18.4761 9.47248 18.3042 7.7116 17.6249 6.11709C16.9863 4.5099 15.8689 3.13218 14.4209 2.16536C12.9726 1.19837 11.2615 0.68775 9.51357 0.700415C7.7611 0.682384 6.04413 1.1905 4.59056 2.15784C3.13725 3.125 2.01576 4.50565 1.37552 6.11707C0.696178 7.71159 0.524293 9.47247 0.882919 11.1659C1.24175 12.8603 2.11511 14.4068 3.38523 15.5992L9.51357 21.4139L15.6152 15.5992ZM16.2613 10.7893C15.9769 12.1082 15.2958 13.3125 14.3064 14.2446L9.51311 18.8142L4.72115 14.2459L4.71985 14.2446C3.73038 13.3125 3.04935 12.1082 2.76497 10.7893C2.48061 9.4704 2.60599 8.09756 3.12486 6.84981L3.12677 6.84498C3.62708 5.58056 4.50486 4.49498 5.64476 3.73224C6.78472 2.96947 8.13293 2.56566 9.51115 2.57471L9.51508 2.57468C10.8933 2.56566 12.2415 2.96947 13.3815 3.73224C14.5214 4.49498 15.3991 5.58057 15.8994 6.845L15.9014 6.84979C16.4203 8.09754 16.5456 9.4704 16.2613 10.7893Z" fill="#926952"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 9.5C13 11.433 11.433 13 9.5 13C7.567 13 6 11.433 6 9.5C6 7.567 7.567 6 9.5 6C11.433 6 13 7.567 13 9.5ZM9.5 11C10.3284 11 11 10.3284 11 9.5C11 8.67157 10.3284 8 9.5 8C8.67157 8 8 8.67157 8 9.5C8 10.3284 8.67157 11 9.5 11Z" fill="#926952"/>
</svg>

`,deliveryIcon:`<svg width="22" height="16" viewBox="0 0 22 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6724 7.11521L19.4127 3.84243C19.0579 3.32869 18.4845 3.02176 17.8783 3.02176H14.5165V1.8105C14.5165 0.812259 13.7402 0 12.7862 0H1.72997C0.775937 0 0 0.812259 0 1.8105V11.4352C0 12.4331 0.775937 13.2453 1.72997 13.2453H2.49368C2.49194 13.2848 2.4881 13.3239 2.4881 13.3637C2.4881 14.8176 3.61813 16 5.00727 16C6.39641 16 7.52644 14.8176 7.52644 13.3637C7.52644 11.9102 6.39641 10.7278 5.00727 10.7278C4.35321 10.7278 3.75816 10.9923 3.30978 11.4217L1.74603 11.4352L1.72997 1.82694L12.7705 1.8105V9.75478C12.7705 10.2594 13.1612 10.6682 13.6435 10.6682C14.1257 10.6682 14.5165 10.2594 14.5165 9.75478V4.84871H17.8783C17.9255 4.84871 17.9698 4.87246 17.9974 4.91228L20.254 8.1752L20.27 11.4184H18.6867C18.2387 10.9909 17.6454 10.7278 16.9927 10.7278C15.6036 10.7278 14.4736 11.9102 14.4736 13.3637C14.4736 14.8176 15.6036 16 16.9927 16C18.3822 16 19.5123 14.8176 19.5123 13.3637C19.5123 13.3239 19.5081 13.2848 19.5067 13.2453H20.27C21.2237 13.2453 22 12.4331 22 11.4352V8.1752C22 7.79301 21.8869 7.42652 21.6724 7.11521ZM5.00727 12.5551C5.43365 12.5551 5.78041 12.9179 5.78041 13.3641C5.78041 13.8106 5.43365 14.1734 5.00727 14.1734C4.58089 14.1734 4.23413 13.8106 4.23413 13.3641C4.23413 12.9179 4.58089 12.5551 5.00727 12.5551ZM16.9927 14.1734C16.5663 14.1734 16.2196 13.8106 16.2196 13.3641C16.2196 12.9179 16.5663 12.5551 16.9927 12.5551C17.4195 12.5551 17.7662 12.9179 17.7662 13.3641C17.7662 13.8102 17.4195 14.1734 16.9927 14.1734Z" fill="#926952"/>
<path d="M12.8208 11.4188H9.17924C8.69698 11.4188 8.30622 11.8276 8.30622 12.3322C8.30622 12.8368 8.69698 13.2457 9.17924 13.2457H12.8208C13.303 13.2457 13.6938 12.8368 13.6938 12.3322C13.6938 11.8276 13.303 11.4188 12.8208 11.4188Z" fill="#926952"/>
</svg>

`,walletIcon:`<svg width="18" height="18" viewBox="0 0 32 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.4787 14.339H21.7565C21.24 14.339 20.8389 14.7834 20.8389 15.3017C20.8389 15.82 21.24 16.2644 21.7565 16.2644H23.4787C23.9952 16.2644 24.3963 15.82 24.3963 15.3017C24.3963 14.7834 23.9952 14.339 23.4787 14.339Z" fill="#543328"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.4 3.36443C31.3924 1.52021 29.9949 0.0081934 28.2301 0L6.53541 2.17557e-06C4.82983 0.00795315 3.45563 1.43234 3.3763 3.20339H3.17083C1.41346 3.20339 0.00758477 4.70811 0 6.54576V24.0356C0.00757909 25.8718 1.4057 27.3918 3.17083 27.4L24.8646 27.4C26.5702 27.392 27.9444 25.9677 28.0237 24.1966H28.2292C29.9865 24.1966 31.3924 22.6919 31.4 20.8542L31.4 3.36443ZM26.0164 19.8412C26.0732 19.8378 26.1298 19.8331 26.1853 19.8276L26.1921 24.0351C26.192 24.8366 25.5878 25.4676 24.8627 25.4746H3.17182C2.44697 25.4676 1.84197 24.8367 1.83519 24.0339V6.54659C1.84196 5.7525 2.44569 5.12881 3.17083 5.12881H24.8637C25.5833 5.12881 26.1921 5.74644 26.1921 6.54576V10.7421C26.1303 10.7502 26.0699 10.7542 26.0118 10.7542H21.8713C19.4963 10.7542 17.5882 12.8004 17.5882 15.2941C17.5882 17.788 19.497 19.8335 21.8713 19.8415L26.0046 19.8419L26.0164 19.8412ZM27.8273 19.0544C27.8273 19.0544 27.8273 19.0544 27.8273 19.0544V19.0544ZM28.8106 18.3761L29.5648 17.3417V20.8535C29.558 21.6476 28.9543 22.2712 28.2292 22.2712H28.0273V19.1552C28.3196 18.9336 28.5843 18.6677 28.8106 18.3761ZM29.5647 14.1691L27.3569 17.2131C27.0347 17.6582 26.534 17.9165 26.0105 17.9237H21.872C20.529 17.9165 19.4234 16.7584 19.4234 15.3017C19.4234 13.845 20.5289 12.687 21.8718 12.6797H26.0046C26.5303 12.6797 27.0493 12.5582 27.523 12.3149C28.0264 12.0633 28.4666 11.6833 28.807 11.217L29.5586 10.1862L29.5647 14.1691ZM29.5648 3.36593V7.01443L28.0273 9.12069V6.54576C28.0273 4.70734 26.6209 3.20339 24.8637 3.20339H5.21619C5.29103 2.48022 5.86161 1.93197 6.53728 1.92542H28.2282C28.953 1.93245 29.558 2.5632 29.5648 3.36593ZM27.8273 9.73409V6.54596C27.8273 4.80697 26.4997 3.40358 24.8636 3.40358H5.00782V3.36545C5.00782 3.2198 5.02567 3.07855 5.05919 2.94406C5.03827 3.02806 5.02346 3.1147 5.01529 3.20339C5.01038 3.25664 5.00782 3.31084 5.00782 3.36545V3.40358H24.8636C26.4997 3.40358 27.8273 4.80697 27.8273 6.54596V9.73409Z" fill="#543328"/>
</svg>
`,lampIcon:`<svg width="18" height="18" viewBox="0 0 30 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.7779 5.62526C9.81444 5.66019 5.67125 9.81638 5.67188 14.7982C5.67225 17.5599 6.8995 20.1479 9.039 21.8986C9.47237 22.2532 9.74087 22.7489 9.79537 23.2815C9.76856 23.4413 9.78694 23.2571 9.78137 27.25C9.78137 27.7678 10.2011 28.1875 10.7189 28.1875H11.0626V28.2188C11.0626 30.3038 12.7589 32 14.8439 32C16.9289 32 18.6251 30.3038 18.6251 28.2188V28.1875H18.9689C19.4866 28.1875 19.9064 27.7678 19.9064 27.25C19.9002 23.2729 19.921 23.4318 19.8898 23.2647C19.9352 22.746 20.1831 22.2734 20.5866 21.949C22.766 20.1971 24.0159 17.5903 24.0159 14.7969C24.0158 9.6927 19.8628 5.58757 14.7779 5.62526ZM18.0314 24.375V26.3125H11.6564V24.375H18.0314ZM16.7501 28.2188C16.7501 29.2699 15.895 30.125 14.8439 30.125C13.7927 30.125 12.9376 29.2699 12.9376 28.2188V28.1875H16.7501V28.2188ZM19.4118 20.4876C18.7665 21.0064 18.3214 21.7121 18.1233 22.5H11.5528C11.3442 21.7064 10.8864 20.9876 10.2264 20.4474C8.52381 19.0543 7.54719 16.9951 7.54687 14.7979C7.54637 10.8698 10.8638 7.52782 14.7911 7.50019C14.8089 7.50007 14.8264 7.50001 14.8441 7.50001C18.8753 7.50001 22.1409 10.7618 22.1409 14.7969C22.1408 17.0193 21.1461 19.0934 19.4118 20.4876Z" fill="#543328"/>
<path d="M14.8438 3.8125C15.3615 3.8125 15.7812 3.39275 15.7812 2.875V0.9375C15.7812 0.41975 15.3615 0 14.8438 0C14.326 0 13.9062 0.41975 13.9062 0.9375V2.875C13.9062 3.39275 14.326 3.8125 14.8438 3.8125Z" fill="#543328"/>
<path d="M5.71881 7.04267C6.08487 7.4088 6.6785 7.40886 7.04463 7.04267C7.41075 6.67655 7.41075 6.08298 7.04463 5.71686L5.67462 4.34686C5.30856 3.98073 4.71494 3.98073 4.34881 4.34686C3.98269 4.71298 3.98269 5.30655 4.34881 5.67267L5.71881 7.04267Z" fill="#543328"/>
<path d="M3.8125 14.8438C3.8125 14.326 3.39275 13.9062 2.875 13.9062H0.9375C0.41975 13.9062 0 14.326 0 14.8438C0 15.3615 0.41975 15.7812 0.9375 15.7812H2.875C3.39275 15.7812 3.8125 15.3615 3.8125 14.8438Z" fill="#543328"/>
<path d="M28.75 13.9062H26.8125C26.2947 13.9062 25.875 14.326 25.875 14.8438C25.875 15.3615 26.2947 15.7812 26.8125 15.7812H28.75C29.2678 15.7812 29.6875 15.3615 29.6875 14.8438C29.6875 14.326 29.2678 13.9062 28.75 13.9062Z" fill="#543328"/>
<path d="M23.9676 7.04267L25.3376 5.67267C25.7037 5.30655 25.7037 4.71298 25.3376 4.34686C24.9715 3.98073 24.3779 3.98073 24.0118 4.34686L22.6418 5.71686C22.2757 6.08298 22.2757 6.67655 22.6418 7.04267C23.0078 7.4088 23.6015 7.40886 23.9676 7.04267Z" fill="#543328"/>
</svg>
`,clockIcon:`<svg width="18" height="18" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.5 0C3.81321 0 0 3.81301 0 8.5C0 13.187 3.81321 17 8.5 17C13.187 17 17 13.187 17 8.5C17 3.81301 13.1868 0 8.5 0ZM8.5 15.7591C4.49736 15.7591 1.24087 12.5026 1.24087 8.5C1.24087 4.49736 4.49736 1.24087 8.5 1.24087C12.5026 1.24087 15.7591 4.49733 15.7591 8.4998C15.7591 12.5026 12.5026 15.7591 8.5 15.7591Z" fill="#543328"/>
<path d="M11.3953 8.49996H8.70676V4.77733C8.70676 4.43464 8.42902 4.15689 8.08633 4.15689C7.74364 4.15689 7.46589 4.43464 7.46589 4.77733V9.12039C7.46589 9.46308 7.74364 9.74083 8.08633 9.74083H11.3953C11.738 9.74083 12.0158 9.46308 12.0158 9.12039C12.0158 8.77771 11.738 8.49996 11.3953 8.49996Z" fill="#543328"/>
</svg>`,inStockIcon:`<svg width="16" height="15" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M13.6897 0.352653L5.63246 7.98443L2.31026 4.83768C1.77566 4.3313 0.935561 4.3313 0.400955 4.83768C-0.133652 5.34405 -0.133652 6.13978 0.400955 6.64615L4.6778 10.6971C5.21241 11.2035 6.05251 11.2035 6.58711 10.6971L15.599 2.16113C16.1337 1.65476 16.1337 0.859027 15.599 0.352653C15.0644 -0.117551 14.2243 -0.117551 13.6897 0.352653Z" fill="#543328"/>
                            </svg>`}),methods:{inStockCount(n){let e=!1,t=!1;return n==null||n.remains.forEach(i=>{(!t||i.daysTo<t)&&i.quantity&&(t=i.daysTo,e=i)}),e||n==null||n.remains.forEach(i=>{(!t||i.daysTo<t)&&(t=i.daysTo,e=i)}),{deliveryText:e.daysTo===1?e.daysText:"Доставим",pickupText:e.daysTo===1?"Можно забрать сегодня":"Самовывоз",deliveryPrice:this.deliveryPrice(e)}},deliveryPrice(n){return n.fastDelivery&&this.region.YANDEX_API_KEY_DELIVERY!==null&&this.region.YANDEX_DELIVERY_FIX_PRICE>0?this.region.YANDEX_DELIVERY_FIX_PRICE:this.region.DELIVERY_PRICE.ADDRESS}},computed:{...hi({warehouses:"warehouse/getWarehouses",product:"product/getData",offers:"product/getOffers",region:"getRegionData"}),izNotKzNotEmployee(){return!((this.$store.state.regionData.kz||typeof document<"u"&&document.location.origin.includes("1hmm.kz"))&&!this.$store.getters.getShowHiddenBlocksStatus)},currentWarehouseData(){if(this.warehouses.length){let n=!1,e=this.warehouses.filter(i=>i.XML_ID===this.offers[this.product.currentOffer].xmlId)[0].SHIPPING_TIME.deliveryTime,t=[];for(const[i,s]of Object.entries(e))s.guid=i,t.push(s);t.sort((i,s)=>i.daysFrom===s.daysFrom?0:i.daysFrom>s.daysFrom?1:-1);for(let i of t)if(i.quantityOnWarehouse>0){n=i;break}return n||(n=t[0]),n}return!1},assemblyPrice(){if(this.region.MINIMUM_PRICE_ASSEMBLY&&this.region.PERCENTAGE_ASSEMBLY&&this.ownDelivery){const n=parseInt(this.product.price.new*this.region.PERCENTAGE_ASSEMBLY/100);return`Сборка после доставки - ${n>this.region.MINIMUM_PRICE_ASSEMBLY?n:this.region.MINIMUM_PRICE_ASSEMBLY} руб.`}return!1},inStock(){if(this.currentWarehouseData.quantityOnWarehouse>0){const n=this.currentWarehouseData.quantityOnWarehouse;return n>3?"Есть в наличии":`В наличии ${n} шт`}return!1},deliveryPickup(){const n=this.currentWarehouseData;if(n.daysFrom===1&&n.daysTo===1||n.daysTo===0)return{delivery:n.daysText,pickup:`Самовывоз ${this.pickupToday?"сегодня":"завтра"}`};{let e=["день","дня","дней"];return{delivery:`Доставим от ${n.daysFrom}-${n.daysTo} ${ci(n.daysTo,e)}`,pickup:`Самовывоз, ${n.daysFrom}-${n.daysTo} ${ci(n.daysTo,e)}`}}},deliveries(){return this.region.DELIVERY_NAMES},ownDelivery(){return this.region.OWN_DELIVERY==="Y"},pickupToday(){if(Oc()[this.currentWarehouseData.warehouseName]){const n=Oc().Челябинск[oo().weekday()];return oo().isBefore(oo(n,"h:mm"))}return!1}}},to=n=>(Ze("data-v-bd9af471"),n=n(),Je(),n),bM=to(()=>d("div",{class:"summary-title"},"Как получить?",-1)),MM={class:"field"},SM=["innerHTML"],CM={class:"description"},TM={class:"inner"},EM=to(()=>d("div",{class:"dots"},null,-1)),AM=to(()=>d("div",null,B("Бесплатно"),-1)),kM={key:0,class:"field"},LM=["innerHTML"],RM={class:"description"},IM={class:"inner"},PM=to(()=>d("div",{class:"dots"},null,-1)),DM={key:0},NM={key:1};function OM(n,e,t,i,s,r){return m(),x("div",{class:Ee(["summary",`${this.$device.isMobile?"mobile":"desktop"}`])},[bM,d("div",MM,[d("div",{innerHTML:n.pickupIcon,class:"icon"},null,8,SM),d("div",CM,[d("div",TM,[d("div",null,B(t.warehouseData.remainsReady.pickupText),1),EM,AM])])]),r.deliveryPrice?(m(),x("div",kM,[d("div",{innerHTML:n.deliveryIcon,class:"icon"},null,8,LM),d("div",RM,[d("div",IM,[d("div",null,B(r.inStockCount(t.warehouseData).deliveryText),1),PM,r.inStockCount(t.warehouseData).deliveryPrice!==null&&r.inStockCount(t.warehouseData).deliveryPrice!==0?(m(),x("div",DM,B(`от ${r.inStockCount(t.warehouseData).deliveryPrice} руб.`),1)):(m(),x("div",NM,"Бесплатно"))])])])):M("",!0)],2)}const yu=Ae(wM,[["render",OM],["__scopeId","data-v-bd9af471"]]),FM={props:{data:{default:!1},isHit:{type:Boolean,default:!1},isSale:{type:Boolean,default:!1}},methods:{linkPrepare(n){return n=n??"#",n=n.replace("http://hypermarketmebel.ru",""),n=n.replace("https://hypermarketmebel.ru",""),n}}},BM={key:0,class:"wrapper_banner"},$M={key:0},zM=["srcset","alt"],HM=["src","alt"],UM=["src","alt"],VM={key:1,class:"block"},GM={key:0},WM=["srcset","alt"],qM=["src","alt"],jM=["src","alt"];function XM(n,e,t,i,s,r){const o=cn;return t.data&&!(t.data.not_hit&&t.isHit)&&!(t.data.not_sale&&t.isSale)&&t.data.images?(m(),x("div",BM,[t.data.link?(m(),N(o,{key:0,to:r.linkPrepare(t.data.link)},{default:O(()=>[t.data.images.mini.webp?(m(),x("picture",$M,[d("source",{srcset:t.data.images.mini.webp,type:"image/webp",alt:t.data.name},null,8,zM),d("img",{class:"object-contain",src:t.data.images.mini.jpeg,alt:t.data.name},null,8,HM)])):(m(),x("img",{key:1,class:"object-contain",src:t.data.images.mini.src,alt:t.data.name},null,8,UM))]),_:1},8,["to"])):(m(),x("div",VM,[t.data.images.mini.webp?(m(),x("picture",GM,[d("source",{srcset:t.data.images.mini.webp,type:"image/webp",alt:t.data.name},null,8,WM),d("img",{class:"object-contain",src:t.data.images.mini.jpeg,alt:t.data.name},null,8,qM)])):(m(),x("img",{key:1,class:"object-contain",src:t.data.images.mini.src,alt:t.data.name},null,8,jM))]))])):M("",!0)}const YM=Ae(FM,[["render",XM],["__scopeId","data-v-28ca58df"]]),ZM={props:{data:{default:!1},isHit:{type:Boolean,default:!1},isSale:{type:Boolean,default:!1}},methods:{linkPrepare(n){return n=n??"#",n=n.replace("http://hypermarketmebel.ru",""),n=n.replace("https://hypermarketmebel.ru",""),n}}},JM={key:0,class:"wrapper_banner"},QM={key:0},KM=["srcset","alt"],eS=["src","alt"],tS=["src","alt"],nS={key:1,class:"block"},iS={key:0},sS=["srcset","alt"],rS=["src","alt"],oS=["src","alt"];function aS(n,e,t,i,s,r){const o=cn;return t.data&&!(t.data.not_hit&&t.isHit)&&!(t.data.not_sale&&t.isSale)&&t.data.images?(m(),x("div",JM,[t.data.link?(m(),N(o,{key:0,to:r.linkPrepare(t.data.link)},{default:O(()=>[t.data.images.mini.webp?(m(),x("picture",QM,[d("source",{srcset:t.data.images.mini.webp,type:"image/webp",alt:t.data.name},null,8,KM),d("img",{class:"object-contain",src:t.data.images.mini.jpeg,alt:t.data.name},null,8,eS)])):(m(),x("img",{key:1,class:"object-contain",src:t.data.images.mini.src,alt:t.data.name},null,8,tS))]),_:1},8,["to"])):(m(),x("div",nS,[t.data.images.mini.webp?(m(),x("picture",iS,[d("source",{srcset:t.data.images.mini.webp,type:"image/webp",alt:t.data.name},null,8,sS),d("img",{class:"object-contain",src:t.data.images.mini.jpeg,alt:t.data.name},null,8,rS)])):(m(),x("img",{key:1,class:"object-contain",src:t.data.images.mini.src,alt:t.data.name},null,8,oS))]))])):M("",!0)}const lS=Ae(ZM,[["render",aS],["__scopeId","data-v-d5135feb"]]),cS={props:{isHit:{type:Boolean,default:!1},isSale:{type:Boolean,default:!1},productId:0},data:function(){return{MiniBanner:[]}},async fetch(){await this.$store.dispatch("sliders/getCard",{productId:this.productId}),this.MiniBanner=this.$store.getters["sliders/getCard"]}},dS={class:"DetailBanner"};function uS(n,e,t,i,s,r){const o=YM,a=lS;return m(),x("div",dS,[n.$device.isDesktop?(m(),N(o,{key:0,data:n.MiniBanner,isHit:t.isHit,isSale:t.isSale},null,8,["data","isHit","isSale"])):(m(),N(a,{key:1,data:n.MiniBanner,isHit:t.isHit,isSale:t.isSale},null,8,["data","isHit","isSale"]))])}const xu=Ae(cS,[["render",uS]]),hS={components:{Checkbox:kn,Counter:$r,Delimiter:va,IconDots:Kc,Fav:Tn,Shield:Tt,Shields:En,IconSaleBig:Kr,Button:tt,IconThrone:Fc,IconBox:da,Price:ht},props:["product"],data:function(){return{miniatureHover:0,colorHover:0}},watch:{},computed:{image(){return this.product.DETAIL_PICTURE.SRC||this.product.PARENT_PRODUCT.DETAIL_PICTURE.SRC||require("~/assets/images/personal/product-placeholder.jpg")}},methods:{quantityText(n){return parseInt(n)<3?`${n} шт`:"много"},changeImageByMiniature(n,e){this.image="http://vue.dev.1hmm.ru"+n,this.miniatureHover=e},changeImageByColors(n,e){this.image=n,this.colorHover=e},getName(n){return n.substring(0,60)},onCountChange(n){var e;this.$emit("countChange",((e=n==null?void 0:n.target)==null?void 0:e._value)||n)},onCheckboxChange(n){n?(this.$refs.counter.setValue(1),this.$emit("countChange",1)):(this.$refs.counter.setValue(0),this.$emit("countChange",0))},prepareProp(n){return n.includes("см")?parseFloat(n)+" см":n.includes("кг")?parseFloat(n)+" кг":n.indexOf("#")!==-1?n.replace(/#/g,", "):n}},mounted(){}},wu=n=>(Ze("data-v-70adc3f8"),n=n(),Je(),n),fS={class:"card"},pS={class:"card__block"},mS={class:"card__inner"},gS=["src"],_S={class:"card__checkbox"},vS={class:"card__container"},yS={class:"card__art"},xS={class:"flex items-center"},wS={class:"props"},bS={class:"prop"},MS={class:"prop-name"},SS={class:"prop-value"},CS={key:0},TS={class:"prop"},ES={class:"prop-name"},AS={class:"prop-value"},kS={class:"card__footer"},LS={class:"card__btns"},RS={key:0,class:"card__avail"},IS=wu(()=>d("span",{class:"avail_text"},"В наличии",-1)),PS={class:"avail_quantity"},DS=wu(()=>d("hr",null,null,-1));function NS(n,e,t,i,s,r){const o=cn,a=kn,c=ht,l=$r;return m(),x("div",fS,[d("div",pS,[d("div",mS,[I(o,{to:t.product.PARENT_PRODUCT.DETAIL_PAGE_URL+"?offer_id="+t.product.ID,class:"card__image"},{default:O(()=>[d("img",{src:r.image,alt:"",loading:"lazy"},null,8,gS)]),_:1},8,["to"]),d("div",_S,[I(a,{checked:t.product.CNT>0,size:"large",onChange:r.onCheckboxChange},null,8,["checked","onChange"])]),d("div",vS,[d("div",yS,"Код: "+B(t.product.ARTICLE),1),I(o,{to:t.product.PARENT_PRODUCT.DETAIL_PAGE_URL+"?offer_id="+t.product.ID,class:"card__name"},{default:O(()=>[d("div",null,B(r.getName(t.product.NAME)),1)]),_:1},8,["to"]),d("div",xS,[I(c,{bigSmall:"medium",priceNew:t.product.PRICE.NEW,priceOld:t.product.PRICE.OLD!==t.product.PRICE.NEW?t.product.PRICE.OLD:!1,isHit:!1},null,8,["priceNew","priceOld"])]),d("div",wS,[(m(!0),x(U,null,te(t.product.PROPERTIES,u=>(m(),x("div",bS,[d("div",MS,B(u.NAME),1),d("div",SS,[(m(!0),x(U,null,te(u.VALUE,(h,f)=>(m(),x("span",null,[f>0?(m(),x("span",CS,"/")):M("",!0),Q(B(h),1)]))),256))])]))),256)),t.product.PARENT_PRODUCT.PROPERTIES?(m(!0),x(U,{key:0},te(t.product.PARENT_PRODUCT.PROPERTIES,u=>(m(),x("div",TS,[d("div",ES,B(u.NAME),1),d("div",AS,B(r.prepareProp(u.VALUE)),1)]))),256)):M("",!0)]),d("div",kS,[d("div",LS,[I(l,{defaultValue:t.product.CNT,onChange:r.onCountChange,ref:"counter"},null,8,["defaultValue","onChange"])]),t.product.quantityOnStores>0?(m(),x("div",RS,[IS,d("span",PS,B(r.quantityText(t.product.quantityOnStores)),1)])):M("",!0)])])])]),DS])}const OS=Ae(hS,[["render",NS],["__scopeId","data-v-70adc3f8"]]),FS={props:["theme"],data(){return{isOpen:!1}},computed:{themeClass(){return this.theme??"default"}},methods:{onClick:function(){this.isOpen?this.isOpen=!this.isOpen:setTimeout(()=>{this.isOpen=!this.isOpen},10)},close:function(){this.isOpen&&(this.isOpen=!1)}}},BS=n=>(Ze("data-v-b64190da"),n=n(),Je(),n),$S=BS(()=>d("div",{class:"btn-more__items"},[d("div",{class:"btn-more__item"},"Добавить в избранное"),d("div",{class:"btn-more__item"},"Похожие товары")],-1)),zS=[$S];function HS(n,e,t,i,s,r){const o=Bc,a=ha("click-out");return m(),x("div",{class:Ee(["btn-more",{"btn-more_opened":s.isOpen}])},[d("div",{class:Ee(["btn-more__btn inline-block rounded inline-flex items-center justify-center bg-gray-100 text-xs font-medium",r.themeClass]),onClick:e[0]||(e[0]=(...c)=>r.onClick&&r.onClick(...c))},[I(o,{width:"14",height:"3"})],2),$e((m(),x("div",{class:Ee(["btn-more__content",r.themeClass])},zS,2)),[[a,r.close]])],2)}const bu=Ae(FS,[["render",HS],["__scopeId","data-v-b64190da"]]),US={components:{Price:ht,Checkbox:kn,More:bu,IconChecked:$c,IconBasket:zc,Counter:$r,Delimiter:va,Fav:Tn,Shield:Tt,Shields:En,Button:tt},props:["product","view"],data:function(){return{miniatureHover:0,colorHover:0,isLiked:!1,swiperOption:{slidesPerView:"1",centeredSlides:!1,pagination:{el:".swiper-pagination-"+this.product.ID,clickable:!0}},swiperOption2:{slidesPerView:5,centerInsufficientSlides:!0,spaceBetween:8,slideToClickedSlide:!0,slidesOffsetAfter:0,longSwipes:!1}}},watch:{},computed:{image(){return this.product.DETAIL_PICTURE.SRC||this.product.PARENT_PRODUCT.DETAIL_PICTURE.SRC||require("~/assets/images/personal/product-placeholder.jpg")}},methods:{getPropertiesString(n){let e="",t=!0;return Object.keys(n).forEach(i=>{t?(t=!1,e+=n[i].VALUE[0]):e+="<span>•</span>"+n[i].VALUE[0]}),e},prepareProp(n){return n.includes("см")?parseFloat(n)+" см":n.includes("кг")?parseFloat(n)+" кг":n.indexOf("#")!==-1?n.replace(/#/g,", "):n},changeImageByMiniature(n,e){this.image="http://vue.dev.1hmm.ru"+n,this.miniatureHover=e},changeImageByColors(n,e){this.image=n,this.colorHover=e},getName(n){return n.substring(0,60)},onCountChange(n){var e;this.$emit("countChange",((e=n==null?void 0:n.target)==null?void 0:e._value)||n)},onSlideChange(){let n=this.$refs.swiperTop.$swiper.activeIndex;this.$refs.thumbs.forEach(e=>{e.classList.remove("active")}),this.$refs.thumbs[n].classList.add("active")},onCheckboxChange(n){n?(this.$refs.counter.setValue(1),this.$emit("countChange",1)):(this.$refs.counter.setValue(0),this.$emit("countChange",0))}},mounted(){}},VS=n=>(Ze("data-v-a88dcb07"),n=n(),Je(),n),GS={class:"card__inner"},WS={class:"slide"},qS=["src"],jS={class:"miniatures"},XS={class:"thumbs",ref:"swiperThumbs"},YS={class:"thumbs__inner"},ZS=["onClick"],JS=["src"],QS={class:"prop"},KS={class:"prop-name"},eC={class:"prop-value"},tC={key:0},nC={class:"prop"},iC={class:"prop-name"},sC={class:"prop-value"},rC={class:"card__footer"},oC={class:"btns flex mt-4"},aC={class:"card__avail"},lC={key:0,class:"avail_text"},cC={key:1,class:"avail_text"},dC={key:2,class:"avail_text avail_text_hidden"},uC=VS(()=>d("div",{class:"hr"},null,-1));function hC(n,e,t,i,s,r){const o=Tn,a=cn,c=ht,l=$r,u=zc,h=$c;return m(),x("div",{class:Ee(["card complect",{"w-50 card_two":t.view=="two","w-full card_one":t.view=="one"}])},[d("div",GS,[I(a,{to:t.product.PARENT_PRODUCT.DETAIL_PAGE_URL+"?offer_id="+t.product.ID,navigation:!0,class:Ee(["image",{image_big:t.view=="one"}])},{default:O(()=>[d("div",WS,[d("img",{src:r.image,alt:"",loading:"lazy"},null,8,qS),M("",!0)])]),_:1},8,["to","class"]),$e(d("div",jS,[d("div",XS,[d("div",YS,[(m(),x(U,null,te(7,(f,p)=>d("div",{class:Ee(["thumb",{active:p==0}]),onClick:g=>n.onMiniatureClick(f),key:p,ref_for:!0,ref:"thumbs"},[d("img",{src:r.image,alt:""},null,8,JS)],10,ZS)),64))])],512)],512),[[Ye,t.view=="one"]]),d("div",{class:Ee(["card__info",{"flex items-center justify-between":t.view=="one"}])},[I(a,{to:t.product.PARENT_PRODUCT.DETAIL_PAGE_URL+"?offer_id="+t.product.ID,class:"card__name"},{default:O(()=>[d("div",null,B(r.getName(t.product.NAME)),1)]),_:1},8,["to"]),(m(!0),x(U,null,te(t.product.PROPERTIES,f=>(m(),x("div",QS,[d("div",KS,B(f.NAME)+":",1),d("div",eC,[(m(!0),x(U,null,te(f.VALUE,(p,g)=>(m(),x("span",null,[g>0?(m(),x("span",tC,"/")):M("",!0),Q(B(p),1)]))),256))])]))),256)),t.product.PARENT_PRODUCT.PROPERTIES?(m(!0),x(U,{key:0},te(t.product.PARENT_PRODUCT.PROPERTIES,f=>(m(),x("div",nC,[d("div",iC,B(f.NAME)+":",1),d("div",sC,B(r.prepareProp(f.VALUE)),1)]))),256)):M("",!0)],2),d("div",rC,[I(c,{"price-new":t.product.PRICE.NEW,"price-old":t.product.PRICE.OLD,"big-small":"small"},null,8,["price-new","price-old"]),d("div",oC,[I(l,{defaultValue:t.product.CNT,onChange:r.onCountChange,ref:"counter",zeroIncludes:!0},null,8,["defaultValue","onChange"]),d("div",{class:Ee(["mini-btn",{active:t.product.CNT}]),onClick:e[0]||(e[0]=f=>t.product.CNT?"":t.product.CNT++)},[t.product.CNT?(m(),N(h,{key:1,width:"14",height:"11"})):(m(),N(u,{key:0,width:"20",height:"18"}))],2)]),d("div",aC,[t.product.quantityOnStores>=3?(m(),x("span",lC,"много в наличии")):t.product.quantityOnStores>0?(m(),x("span",cC,B(t.product.quantityOnStores)+" шт. в наличии",1)):t.product.quantityOnStores==0?(m(),x("span",dC,"нет в наличии")):M("",!0)])]),uC])],2)}const fC=Ae(US,[["render",hC],["__scopeId","data-v-a88dcb07"]]),pC={props:["product","view"],methods:{onCountChange:function(n){this.$emit("countChange",n)}}};function mC(n,e,t,i,s,r){const o=OS,a=fC;return n.$device.isDesktop?(m(),N(o,{key:0,product:t.product,onCountChange:r.onCountChange},null,8,["product","onCountChange"])):(m(),N(a,{key:1,product:t.product,view:t.view,onCountChange:r.onCountChange},null,8,["product","view","onCountChange"]))}const Ja=Ae(pC,[["render",mC]]),Mu={name:"ComplectFilterModal",components:{Accordions:ya,AccordionLight:xa,Input:mn,Button:tt,Checkbox:kn},props:{products:{type:Array}},data:()=>({reactiveInputs:[]}),beforeMount(){this.resetFilters()},methods:{clickHandler(n,e){e.target.className!=="vue-slider-dot"&&setTimeout(()=>{let t=this.$refs["slider_"+n][0].getValue();this.setProp(n,"currentMin",t[0]),this.setProp(n,"currentMax",t[1])},0)},isHighlighted(n){return typeof n.min<"u"?n.min!==n.currentMin||n.max!==n.currentMax:typeof n.values<"u"?!!n.currentValues.length:!1},applyFilters(){this.$store.commit("complectFilters/applyFilters"),this.$store.dispatch("drawer/closeDrawer","complectFilter"),this.$store.dispatch("lPop/closeWindow","complect-filter")},setCheckbox(n,e,t,i){if(this.reactiveInputs[n].values[e].checked=i,i)this.productProps[n].currentValues.push(t);else{const s=this.productProps[n].currentValues.indexOf(t);s!==-1&&this.productProps[n].currentValues.splice(s,1)}this.$store.dispatch("complectFilters/applyPreFilterCount")},resetFilters(){this.$store.commit("complectFilters/processProducts",this.products),this.reactiveInputs=[],this.productProps.forEach(n=>{typeof n.values<"u"&&(n.values=n.values.map(e=>({value:e,checked:!1}))),this.reactiveInputs.push({...n})}),this.$store.dispatch("complectFilters/applyPreFilterCount")},onlyNumber(n){const e=n.keyCode?n.keyCode:n.which;(e<48||e>57)&&n.preventDefault()},setProp(n,e,t){e==="currentMin"&&(this.reactiveInputs[n].min>t&&(t=this.reactiveInputs[n].min),this.reactiveInputs[n].currentMax<t&&(t=this.reactiveInputs[n].currentMax)),e==="currentMax"&&(this.reactiveInputs[n].max<t&&(t=this.reactiveInputs[n].max),this.reactiveInputs[n].currentMin>t&&(t=this.reactiveInputs[n].currentMin)),this.reactiveInputs[n][e]=t,this.$store.commit("complectFilters/setProp",{id:n,prop:e,val:t})},sliderChange(n,e){this.setProp(n,"currentMin",e[0]),this.setProp(n,"currentMax",e[1]),this.reactiveInputs[n].currentMax=e[1],this.reactiveInputs[n].currentMin=e[0]}},computed:{productProps(){return this.$store.getters["complectFilters/getProductProps"]},preFilterCount(){return this.$store.getters["complectFilters/getPreFilterCount"]}}},gC={mixins:[Mu]},no=n=>(Ze("data-v-9519b0a1"),n=n(),Je(),n),_C={class:"properties"},vC={key:0},yC={class:"flex"},xC={class:"input"},wC=["onUpdate:modelValue","onChange"],bC=no(()=>d("span",{class:"input__icon"},"см",-1)),MC=no(()=>d("div",{class:"delimiter"},null,-1)),SC={class:"input"},CC=["onUpdate:modelValue","onChange"],TC=no(()=>d("span",{class:"input__icon"},"см",-1)),EC=["onClick"],AC={key:1},kC={class:"filter-btns"},LC=no(()=>d("div",{class:"separator"},null,-1));function RC(n,e,t,i,s,r){const o=Es("VueSlider"),a=kn,c=Es("OverlayScrollbarsComponent"),l=xa,u=ya,h=tt,f=oh;return m(),N(f,{name:"complectFilter"},{default:O(()=>[I(c,{defer:"",class:"scroller px-8 py-6"},{default:O(()=>[d("div",_C,[I(u,null,{default:O(()=>[(m(!0),x(U,null,te(n.productProps,(p,g)=>(m(),N(l,{highlighted:n.isHighlighted(p),name:p.label,key:g},{default:O(()=>[typeof p.min<"u"&&typeof p.max<"u"?(m(),x("div",vC,[d("div",yC,[d("div",xC,[$e(d("input",{onKeypress:e[0]||(e[0]=(..._)=>n.onlyNumber&&n.onlyNumber(..._)),"onUpdate:modelValue":_=>n.reactiveInputs[g].currentMin=_,onChange:_=>{n.setProp(g,"currentMin",_.target.value),n.$store.dispatch("complectFilters/applyPreFilterCount")},validator:"number"},null,40,wC),[[ji,n.reactiveInputs[g].currentMin]]),bC]),MC,d("div",SC,[$e(d("input",{onKeypress:e[1]||(e[1]=(..._)=>n.onlyNumber&&n.onlyNumber(..._)),"onUpdate:modelValue":_=>n.reactiveInputs[g].currentMax=_,onChange:_=>{n.setProp(g,"currentMax",_.target.value),n.$store.dispatch("complectFilters/applyPreFilterCount")},validator:"number"},null,40,CC),[[ji,n.reactiveInputs[g].currentMax]]),TC])]),d("div",{class:"form-slider",onClick:_=>n.clickHandler(g,_)},[I(o,{tooltip:"none",dotSize:16,onDragging:_=>n.sliderChange(g,_),onDragEnd:e[2]||(e[2]=_=>n.$store.dispatch("complectFilters/applyPreFilterCount")),modelValue:[p.currentMin,p.currentMax],min:p.min,max:p.max,ref_for:!0,ref:"slider_"+g},null,8,["onDragging","modelValue","min","max"])],8,EC)])):M("",!0),typeof p.values<"u"?(m(),x("div",AC,[I(c,{defer:"",class:"checkboxes"},{default:O(()=>[(m(!0),x(U,null,te(n.reactiveInputs[g].values,(_,w)=>(m(),N(a,{label:_.value,onChange:v=>n.setCheckbox(g,w,_.value,v),checked:n.reactiveInputs[g].values[w].checked,key:w},null,8,["label","onChange","checked"]))),128))]),_:2},1024)])):M("",!0)]),_:2},1032,["highlighted","name"]))),128))]),_:1})])]),_:1}),d("div",kC,[I(h,{theme:"white",class:"flex-shrink-0",onClick:n.resetFilters},{default:O(()=>[Q("Сбросить фильтр")]),_:1},8,["onClick"]),LC,I(h,{theme:"yellow",class:"w-full",count:n.preFilterCount,loading:!1,onClick:n.applyFilters},{default:O(()=>[Q("Показать товары")]),_:1},8,["count","onClick"])])]),_:1})}const IC=Ae(gC,[["render",RC],["__scopeId","data-v-9519b0a1"]]),PC={mixins:[Mu]},io=n=>(Ze("data-v-16840c4e"),n=n(),Je(),n),DC={class:"properties"},NC={key:0},OC={class:"flex"},FC={class:"input"},BC=["onUpdate:modelValue","onChange"],$C=io(()=>d("span",{class:"input__icon"},"см",-1)),zC=io(()=>d("div",{class:"delimiter"},null,-1)),HC={class:"input"},UC=["onUpdate:modelValue","onChange"],VC=io(()=>d("span",{class:"input__icon"},"см",-1)),GC=["onClick"],WC={key:1},qC={class:"filter-btns"},jC=io(()=>d("div",{class:"separator"},null,-1));function XC(n,e,t,i,s,r){const o=Es("VueSlider"),a=kn,c=Es("OverlayScrollbarsComponent"),l=xa,u=ya,h=tt,f=Wt;return m(),N(f,{"pop-name":"Фильтр",popId:"complect-filter"},{default:O(()=>[d("div",DC,[I(u,null,{default:O(()=>[(m(!0),x(U,null,te(n.productProps,(p,g)=>(m(),N(l,{highlighted:n.isHighlighted(p),name:p.label,key:g},{default:O(()=>[typeof p.min<"u"&&typeof p.max<"u"?(m(),x("div",NC,[d("div",OC,[d("div",FC,[$e(d("input",{onKeypress:e[0]||(e[0]=(..._)=>n.onlyNumber&&n.onlyNumber(..._)),"onUpdate:modelValue":_=>n.reactiveInputs[g].currentMin=_,onChange:_=>{n.setProp(g,"currentMin",_.target.value),n.$store.dispatch("complectFilters/applyPreFilterCount")},validator:"number"},null,40,BC),[[ji,n.reactiveInputs[g].currentMin]]),$C]),zC,d("div",HC,[$e(d("input",{onKeypress:e[1]||(e[1]=(..._)=>n.onlyNumber&&n.onlyNumber(..._)),"onUpdate:modelValue":_=>n.reactiveInputs[g].currentMax=_,onChange:_=>{n.setProp(g,"currentMax",_.target.value),n.$store.dispatch("complectFilters/applyPreFilterCount")},validator:"number"},null,40,UC),[[ji,n.reactiveInputs[g].currentMax]]),VC])]),d("div",{class:"form-slider",onClick:_=>n.clickHandler(g,_)},[I(o,{tooltip:"none",dotSize:"16",onDragging:_=>n.sliderChange(g,_),onDragEnd:e[2]||(e[2]=_=>n.$store.dispatch("complectFilters/applyPreFilterCount")),modelValue:[p.currentMin,p.currentMax],min:p.min,max:p.max},null,8,["onDragging","modelValue","min","max"])],8,GC)])):M("",!0),typeof p.values<"u"?(m(),x("div",WC,[I(c,{defer:"",class:"checkboxes"},{default:O(()=>[(m(!0),x(U,null,te(n.reactiveInputs[g].values,(_,w)=>(m(),N(a,{label:_.value,onChange:v=>n.setCheckbox(g,w,_.value,v),checked:n.reactiveInputs[g].values[w].checked,key:w},null,8,["label","onChange","checked"]))),128))]),_:2},1024)])):M("",!0)]),_:2},1032,["highlighted","name"]))),128))]),_:1})]),d("div",qC,[I(h,{theme:"white",class:"flex-shrink-0",onClick:n.resetFilters},{default:O(()=>[Q("Сбросить фильтр")]),_:1},8,["onClick"]),jC,I(h,{theme:"yellow",class:"w-full",count:n.preFilterCount,loading:!1,onClick:n.applyFilters},{default:O(()=>[Q("Показать товары")]),_:1},8,["count","onClick"])])]),_:1})}const YC=Ae(PC,[["render",XC],["__scopeId","data-v-16840c4e"]]),ZC={name:"ComplectFilterModal",props:{products:{type:Array,required:!0}}};function JC(n,e,t,i,s,r){const o=IC,a=YC;return m(),x("div",null,[n.$device.isDesktop?(m(),N(o,{key:0,products:t.products},null,8,["products"])):(m(),N(a,{key:1,products:t.products},null,8,["products"]))])}const Qa=Ae(ZC,[["render",JC]]),Su={name:"ComplectsBlockDesktop",components:{Skeleton:Lt,Checkbox:kn,Button:tt,Price:ht,ComplectCard:Ja,ComplectFilterModal:Qa,IconArrowDown:$t},props:{products:{type:Array,required:!0}},data:()=>({tags:[{type:!1,label:"Все модули"},{type:"top",label:"Верхние шкафы"},{type:"center",label:"Центральные модули"},{type:"bottom",label:"Нижние шкафы"},{type:"other",label:"Дополнительно"},{type:"chosen",label:"Только выбранные"}],currentTag:!1,collapseData:{top:!1,bottom:!1,center:!1,other:!1},inStockOnly:!1,addToBasketStarted:!1,filtersIsLoading:!1}),computed:{inStockQuantity(){return this.products.filter(n=>!!n.quantityOnStores).length},filteredTags(){let n=!0;return this.products.forEach(e=>{e.type||(n=!1)}),n?this.tags.filter(e=>e.type!=="other"):this.tags},kitchenStatus(){return this.$store.getters["product/getKitchenStatus"]},totalCount(){let n=0;return this.$store.getters["product/getComplects"].forEach(e=>{n+=e.CNT}),n},isAllSelected(){return this.products.filter(e=>e.CNT>0).length===this.products.length},isAllUnSelected(){return this.products.filter(e=>e.CNT>0).length<=0},totalPriceNew(){var t;let n=0,e=this.$store.getters["product/getComplects"];return e.length>0?e.forEach(i=>{i.PRICE&&(n+=i.PRICE.NEW*i.CNT)}):n=((t=this.price)==null?void 0:t.new)??0,n},totalPriceOld(){var t;let n=0,e=this.$store.getters["product/getComplects"];return e.length>0?e.forEach(i=>{i.PRICE&&(n+=i.PRICE.OLD*i.CNT)}):n=((t=this.price)==null?void 0:t.old)??0,n},filteredProducts(){return this.products.filter(n=>this.currentTag&&!["chosen","other"].includes(this.currentTag)&&this.currentTag!==n.type||this.currentTag==="chosen"&&!n.CNT||this.currentTag==="other"&&n.type||this.inStockOnly&&!n.quantityOnStores?!1:this.$store.getters["complectFilters/getFilterData"](n))},topTypeProducts(){return this.filteredProducts.filter(n=>n.type==="top")},centerTypeProducts(){return this.filteredProducts.filter(n=>n.type==="center")},bottomTypeProducts(){return this.filteredProducts.filter(n=>n.type==="bottom")},otherTypeProducts(){return this.filteredProducts.filter(n=>!n.type)},productProps(){return this.$store.getters["complectFilters/getProductProps"]}},beforeMount(){this.$store.commit("complectFilters/processProducts",this.products)},methods:{onSelectAll(){this.products.forEach((n,e)=>{n.CNT===0&&this.onCountChange(e,1)})},isInViewport(n,e=0,t=!1){const i=n.getBoundingClientRect();return t?i.bottom+e>0:i.top>=0&&i.left>=0&&i.bottom+e<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)},onUnSelectAll(){this.products.forEach((n,e)=>{n.CNT>0&&this.onCountChange(e,0)})},onCountChange(n,e){this.$store.dispatch("product/changeCountComplect",{key:n,count:e})}},mounted(){window.addEventListener("scroll",n=>{document.getElementsByClassName("kitchen-settings")[0]&&(this.isInViewport(document.getElementById("kitchen-settings"),0,!0)?(document.getElementsByClassName("kitchen-settings")[0].classList.remove("pinned"),document.getElementById("expander").style.height="0"):(document.getElementsByClassName("kitchen-settings")[0].classList.add("pinned"),document.getElementById("expander").style.height=`${this.$device.isDesktop?140:103}px`))})}},QC={mixins:[Su],props:{add:Boolean},mounted(){window.addEventListener("scroll",n=>{document.getElementsByClassName("complects-buy")[0]&&(this.isInViewport(document.getElementById("complects-buy-bottom"),88)?document.getElementsByClassName("complects-buy")[0].classList.remove("fixed-buy"):document.getElementsByClassName("complects-buy")[0].classList.add("fixed-buy"))})}},Ve=n=>(Ze("data-v-59410b9d"),n=n(),Je(),n),KC={class:"title-complects"},e4=Ve(()=>d("div",{class:"title-complects__text"},"Собрать комплект",-1)),t4={class:"title-complects__checkbox"},n4={class:"title-complects__checkbox"},i4={key:0,class:"title-complects__checkbox"},s4=Ve(()=>d("div",{id:"kitchen-settings"},null,-1)),r4=Ve(()=>d("div",{id:"expander"},null,-1)),o4={key:0,class:"kitchen-settings"},a4={class:"kitchen-settings__inner"},l4={class:"kitchen-tags"},c4=["onClick"],d4={key:0,width:"12",height:"9",viewBox:"0 0 12 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u4=Ve(()=>d("path",{d:"M10.2673 0.286531L4.22434 6.48735L1.7327 3.93061C1.33174 3.51918 0.701671 3.51918 0.300716 3.93061C-0.100239 4.34204 -0.100239 4.98857 0.300716 5.4L3.50835 8.69143C3.90931 9.10286 4.53938 9.10286 4.94033 8.69143L11.6993 1.75592C12.1002 1.34449 12.1002 0.697959 11.6993 0.286531C11.2983 -0.0955102 10.6683 -0.0955102 10.2673 0.286531Z",fill:"black"},null,-1)),h4=[u4],f4={class:"kitchen-filter"},p4={class:"title-complects__checkbox"},m4={class:"title-complects__checkbox"},g4={class:"title-complects__checkbox"},_4={key:1,class:"loading"},v4=Ve(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),y4=Ve(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),x4=Ve(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),w4=Ve(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),b4=Ve(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),M4=Ve(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),S4=Ve(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),C4=Ve(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),T4=Ve(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),E4=Ve(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),A4=Ve(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),k4=Ve(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),L4=Ve(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),R4=Ve(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),I4=Ve(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),P4=Ve(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),D4=Ve(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),N4=Ve(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),O4=Ve(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),F4=Ve(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),B4=Ve(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),$4=Ve(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),z4=Ve(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),H4=Ve(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),U4=Ve(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),V4=Ve(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),G4=Ve(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),W4=Ve(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),q4=Ve(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),j4=Ve(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),X4=Ve(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),Y4=Ve(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),Z4=Ve(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),J4=Ve(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),Q4=Ve(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),K4=Ve(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),eT={key:2,style:{"margin-top":"35px"}},tT={key:0,class:"dropdown-complects"},nT={class:"cards"},iT={key:1,class:"dropdown-complects"},sT={class:"cards"},rT={key:2,class:"dropdown-complects"},oT={class:"cards"},aT={key:3,class:"dropdown-complects"},lT={class:"cards"},cT={key:4,class:"no-products"},dT={key:3,style:{"margin-top":"35px"}},uT={class:"cards"},hT=Ve(()=>d("div",{id:"complects-buy-bottom"},null,-1)),fT={class:"complects-buy fixed-buy"},pT={key:0,class:"complects-buy__inner"},mT={class:"count-text"},gT={class:"flex items-center"},_T={key:1,class:"complects-buy__none"};function vT(n,e,t,i,s,r){const o=kn,a=tt,c=Lt,l=$t,u=Ja,h=ht,f=Qa;return m(),x("div",null,[d("div",KC,[e4,n.products.length&&!n.kitchenStatus?(m(),x(U,{key:0},[d("div",t4,[I(o,{label:"Выбрать все",checked:n.isAllSelected,onChange:n.onSelectAll},null,8,["checked","onChange"])]),d("div",n4,[I(o,{label:"Сбросить",checked:n.isAllUnSelected,onChange:n.onUnSelectAll},null,8,["checked","onChange"])]),n.inStockQuantity?(m(),x("div",i4,[I(o,{label:"В наличии",checked:n.inStockOnly,onChange:e[0]||(e[0]=p=>n.inStockOnly=p)},null,8,["checked"])])):M("",!0)],64)):M("",!0)]),s4,r4,n.products.length&&n.kitchenStatus?(m(),x("div",o4,[d("div",a4,[d("div",l4,[(m(!0),x(U,null,te(n.filteredTags,(p,g)=>(m(),x("div",{class:Ee(["tag",{chosen:n.currentTag===p.type}]),key:g,onClick:_=>n.currentTag=p.type},[Q(B(p.label)+" ",1),p.type==="chosen"?(m(),x("svg",d4,h4)):M("",!0)],10,c4))),128))]),d("div",f4,[n.productProps?(m(),N(a,{key:0,theme:"yellow",onClick:e[1]||(e[1]=p=>n.$store.dispatch("drawer/openDrawer","complectFilter")),icon:"settings"},{default:O(()=>[Q("Подобрать по параметрам")]),_:1})):M("",!0),d("div",p4,[I(o,{label:"Выбрать все",checked:n.isAllSelected,onChange:n.onSelectAll},null,8,["checked","onChange"])]),d("div",m4,[I(o,{label:"Сбросить",checked:n.isAllUnSelected,onChange:n.onUnSelectAll},null,8,["checked","onChange"])]),d("div",g4,[I(o,{label:"В наличии",checked:n.inStockOnly,onChange:e[2]||(e[2]=p=>n.inStockOnly=p)},null,8,["checked"])])])])])):M("",!0),n.products.length===0?(m(),x("div",_4,[I(c,{width:"190",height:"398"},{default:O(()=>[v4,y4,x4,w4,b4,M4,S4,C4,T4]),_:1}),I(c,{width:"190",height:"398"},{default:O(()=>[E4,A4,k4,L4,R4,I4,P4,D4,N4]),_:1}),I(c,{width:"190",height:"398"},{default:O(()=>[O4,F4,B4,$4,z4,H4,U4,V4,G4]),_:1}),I(c,{width:"190",height:"398"},{default:O(()=>[W4,q4,j4,X4,Y4,Z4,J4,Q4,K4]),_:1})])):M("",!0),n.products.length>0&&n.kitchenStatus?(m(),x("div",eT,[n.topTypeProducts.length?(m(),x("div",tT,[d("div",{class:"subtitle",onClick:e[3]||(e[3]=p=>n.collapseData.top=!n.collapseData.top)},[d("span",{class:Ee(["dropdown-button",n.collapseData.top?"collapsed":"expanded"])},[I(l,{height:"14",width:"14",iconColor:"#000000"})],2),Q(" Верхние шкафы ")]),$e(d("div",nT,[(m(!0),x(U,null,te(n.topTypeProducts,(p,g)=>(m(),N(u,{product:p,onCountChange:_=>n.onCountChange(p.key,_),key:`${p.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.top]])])):M("",!0),n.centerTypeProducts.length?(m(),x("div",iT,[d("div",{class:"subtitle",onClick:e[4]||(e[4]=p=>n.collapseData.center=!n.collapseData.center)},[d("span",{class:Ee(["dropdown-button",n.collapseData.center?"collapsed":"expanded"])},[I(l,{height:"14",width:"14",iconColor:"#000000"})],2),Q(" Центральные модули ")]),$e(d("div",sT,[(m(!0),x(U,null,te(n.centerTypeProducts,(p,g)=>(m(),N(u,{product:p,onCountChange:_=>n.onCountChange(p.key,_),key:`${p.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.center]])])):M("",!0),n.bottomTypeProducts.length?(m(),x("div",rT,[d("div",{class:"subtitle",onClick:e[5]||(e[5]=p=>n.collapseData.bottom=!n.collapseData.bottom)},[d("span",{class:Ee(["dropdown-button",n.collapseData.bottom?"collapsed":"expanded"])},[I(l,{height:"14",width:"14",iconColor:"#000000"})],2),Q(" Нижние шкафы ")]),$e(d("div",oT,[(m(!0),x(U,null,te(n.bottomTypeProducts,(p,g)=>(m(),N(u,{product:p,onCountChange:_=>n.onCountChange(p.key,_),key:`${p.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.bottom]])])):M("",!0),n.otherTypeProducts.length?(m(),x("div",aT,[d("div",{class:"subtitle",onClick:e[6]||(e[6]=p=>n.collapseData.other=!n.collapseData.other)},[d("span",{class:Ee(["dropdown-button",n.collapseData.other?"collapsed":"expanded"])},[I(l,{height:"14",width:"14",iconColor:"#000000"})],2),Q(" Дополнительно ")]),$e(d("div",lT,[(m(!0),x(U,null,te(n.otherTypeProducts,(p,g)=>(m(),N(u,{product:p,onCountChange:_=>n.onCountChange(p.key,_),key:`${p.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.other]])])):M("",!0),n.filteredProducts.length?M("",!0):(m(),x("div",cT," По выбранным параметрам не найдено ни одного товара "))])):M("",!0),n.products.length>0&&!n.kitchenStatus?(m(),x("div",dT,[d("div",uT,[(m(!0),x(U,null,te(n.filteredProducts,(p,g)=>(m(),N(u,{product:p,onCountChange:_=>n.onCountChange(p.key,_),key:`${p.key}`},null,8,["product","onCountChange"]))),128))])])):M("",!0),hT,$e(d("div",fT,[n.totalCount?(m(),x("div",pT,[d("div",null,[d("div",mT,[Q("Всего выбрано "),d("span",null,B(n.totalCount.toLocaleString()),1),Q(" "+B(n.$declOfNum(n.totalCount,["модуль","модуля","модулей"]))+" на сумму:",1)])]),d("div",gT,[I(h,{bigSmall:"big",priceNew:n.totalPriceNew,priceOld:n.totalPriceOld!==n.totalPriceNew?n.totalPriceOld:!1,isHit:!1},null,8,["priceNew","priceOld"]),I(a,{loading:t.add,theme:"yellow-big",onClick:e[7]||(e[7]=p=>n.$emit("addToBasket")),icon:"basket"},{default:O(()=>[Q("Добавить в корзину")]),_:1},8,["loading"])])])):(m(),x("div",_T,"Не выбрано ни одного модуля"))],512),[[Ye,n.products.length>0]]),n.products.length&&n.productProps?(m(),N(f,{key:4,products:n.products},null,8,["products"])):M("",!0)])}const yT=Ae(QC,[["render",vT],["__scopeId","data-v-59410b9d"]]),xT={mixins:[Su],props:{add:Boolean},components:{Select:Os,IconSettings:Hc},computed:{filterProductProps(){return this.$store.getters["complectFilters/getProductProps"]}},methods:{scrollToComplects(){let n=document.querySelector(".title-complects");n&&(n.click(),n.scrollIntoView({behavior:"smooth",block:"start"}))},getSelectOptions(n){return n.map(e=>({value:e.type,name:e.label}))},setSelect(n){this.currentTag=n}}},pt=n=>(Ze("data-v-de847131"),n=n(),Je(),n),wT={class:"title-complects"},bT=pt(()=>d("div",{class:"title-complects__text"},"Собрать комплект",-1)),MT={class:"kitchen-tags"},ST={class:"tags"},CT=["onClick"],TT={key:0,class:"checkboxes"},ET={class:"checkbox",style:{"justify-content":"space-around"}},AT=pt(()=>d("div",null,"Выбрать все",-1)),kT={key:0,class:"checkbox"},LT=pt(()=>d("div",null,"В наличии",-1)),RT=pt(()=>d("div",{id:"kitchen-settings"},null,-1)),IT=pt(()=>d("div",{id:"expander"},null,-1)),PT={key:0,class:"kitchen-settings"},DT={class:"kitchen-settings__inner"},NT={class:"kitchen-filter"},OT={class:"checkboxes"},FT={class:"checkbox"},BT={class:"checkbox"},$T={key:1,class:"loading"},zT=pt(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),HT=pt(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),UT=pt(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),VT=pt(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),GT=pt(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),WT=pt(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),qT=pt(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),jT=pt(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),XT=pt(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),YT=pt(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"95",height:"18"},null,-1)),ZT=pt(()=>d("rect",{x:"176",y:"0",rx:"3",ry:"3",width:"14",height:"18"},null,-1)),JT=pt(()=>d("rect",{x:"0",y:"26",rx:"3",ry:"3",width:"190",height:"129"},null,-1)),QT=pt(()=>d("rect",{x:"0",y:"180",rx:"3",ry:"3",width:"190",height:"18"},null,-1)),KT=pt(()=>d("rect",{x:"0",y:"208",rx:"3",ry:"3",width:"190",height:"25"},null,-1)),e5=pt(()=>d("rect",{x:"0",y:"277",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),t5=pt(()=>d("rect",{x:"0",y:"299",rx:"3",ry:"3",width:"36",height:"16"},null,-1)),n5=pt(()=>d("rect",{x:"0",y:"328",rx:"3",ry:"3",width:"100",height:"36"},null,-1)),i5=pt(()=>d("rect",{x:"0",y:"377",rx:"3",ry:"3",width:"130",height:"20"},null,-1)),s5={key:2,class:"complects"},r5={key:0,class:"dropdown-complects"},o5={class:"subtitle"},a5={class:"cards"},l5={key:1,class:"dropdown-complects"},c5={class:"subtitle"},d5={class:"cards"},u5={key:2,class:"dropdown-complects"},h5={class:"subtitle"},f5={class:"cards"},p5={key:3,class:"dropdown-complects"},m5={class:"subtitle"},g5={class:"cards"},_5={key:4,class:"no-products"},v5={key:3,class:"complects"},y5={class:"cards"},x5={class:"cards"},w5={key:4,class:"complects-buy loading",style:{width:"100%"}},b5=pt(()=>d("rect",{x:"105",y:"2",rx:"0",ry:"0",width:"150",height:"17"},null,-1)),M5=pt(()=>d("rect",{x:"105",y:"28",rx:"0",ry:"0",width:"150",height:"17"},null,-1)),S5={class:"complect-btn"},C5={key:5,class:"complects-buy"},T5={class:"count-text"},E5={class:"complect-btn"},A5={key:1,class:"complects-buy__none"};function k5(n,e,t,i,s,r){const o=kn,a=Hc,c=Lt,l=$t,u=Ja,h=tt,f=ht,p=Qa,g=ha("preloader");return m(),x("div",null,[d("div",wT,[bT,d("div",MT,[d("div",ST,[(m(!0),x(U,null,te(n.tags,(_,w)=>(m(),x("div",{class:Ee(["tag",{active:n.currentTag===_.type}]),key:w,onClick:v=>r.setSelect(_.type)},B(_.label),11,CT))),128))])]),n.products.length&&!n.kitchenStatus?(m(),x("div",TT,[d("div",ET,[I(o,{checked:n.isAllSelected,onChange:n.onSelectAll},null,8,["checked","onChange"]),AT]),n.inStockQuantity?(m(),x("div",kT,[I(o,{checked:n.inStockOnly,onChange:e[0]||(e[0]=_=>n.inStockOnly=_)},null,8,["checked"]),LT])):M("",!0)])):M("",!0)]),RT,IT,n.products.length&&n.kitchenStatus?$e((m(),x("div",PT,[d("div",DT,[d("div",NT,[d("div",OT,[n.productProps?(m(),x("div",{key:0,class:Ee(["filter-btn",{active:n.$store.state.complectFilters.filterData.length}]),onClick:e[1]||(e[1]=_=>n.$store.dispatch("lPop/openWindow","complect-filter"))},[I(a,{width:"21",height:"13"})],2)):M("",!0),d("div",FT,[I(o,{checked:n.isAllSelected,onChange:n.onSelectAll,label:"Выбрать все"},null,8,["checked","onChange"])]),d("div",BT,[I(o,{checked:n.inStockOnly,onChange:e[2]||(e[2]=_=>n.inStockOnly=_),label:"В наличии"},null,8,["checked"])]),d("div",{class:"checkbox",onClick:e[3]||(e[3]=(..._)=>n.onUnSelectAll&&n.onUnSelectAll(..._))}," Сбросить ")])])])])),[[g,n.filtersIsLoading]]):M("",!0),n.products.length===0?(m(),x("div",$T,[I(c,{width:"190",height:"398"},{default:O(()=>[zT,HT,UT,VT,GT,WT,qT,jT,XT]),_:1}),I(c,{width:"190",height:"398"},{default:O(()=>[YT,ZT,JT,QT,KT,e5,t5,n5,i5]),_:1})])):M("",!0),n.products.length>0&&n.kitchenStatus?(m(),x("div",s5,[n.topTypeProducts.length?(m(),x("div",r5,[d("div",o5,[Q("Верхние шкафы "),d("span",{class:Ee(["dropdown-button",n.collapseData.top?"collapsed":"expanded"]),onClick:e[4]||(e[4]=_=>n.collapseData.top=!n.collapseData.top)},[I(l,{height:"8",width:"8",iconColor:"#5073A8"})],2)]),$e(d("div",a5,[(m(!0),x(U,null,te(n.topTypeProducts,(_,w)=>(m(),N(u,{view:"two",product:_,onCountChange:v=>n.onCountChange(_.key,v),key:`${_.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.top]])])):M("",!0),n.centerTypeProducts.length?(m(),x("div",l5,[d("div",c5,[Q("Центральные модули "),d("span",{class:Ee(["dropdown-button",n.collapseData.center?"collapsed":"expanded"]),onClick:e[5]||(e[5]=_=>n.collapseData.center=!n.collapseData.center)},[I(l,{height:"8",width:"8",iconColor:"#5073A8"})],2)]),$e(d("div",d5,[(m(!0),x(U,null,te(n.centerTypeProducts,(_,w)=>(m(),N(u,{view:"two",product:_,onCountChange:v=>n.onCountChange(_.key,v),key:`${_.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.center]])])):M("",!0),n.bottomTypeProducts.length?(m(),x("div",u5,[d("div",h5,[Q("Нижние шкафы "),d("span",{class:Ee(["dropdown-button",n.collapseData.bottom?"collapsed":"expanded"]),onClick:e[6]||(e[6]=_=>n.collapseData.bottom=!n.collapseData.bottom)},[I(l,{height:"8",width:"8",iconColor:"#5073A8"})],2)]),$e(d("div",f5,[(m(!0),x(U,null,te(n.bottomTypeProducts,(_,w)=>(m(),N(u,{view:"two",product:_,onCountChange:v=>n.onCountChange(_.key,v),key:`${_.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.bottom]])])):M("",!0),n.otherTypeProducts.length?(m(),x("div",p5,[d("div",m5,[Q("Дополнительно "),d("span",{class:Ee(["dropdown-button",n.collapseData.other?"collapsed":"expanded"]),onClick:e[7]||(e[7]=_=>n.collapseData.other=!n.collapseData.other)},[I(l,{height:"8",width:"8",iconColor:"#5073A8"})],2)]),$e(d("div",g5,[(m(!0),x(U,null,te(n.otherTypeProducts,(_,w)=>(m(),N(u,{view:"two",product:_,onCountChange:v=>n.onCountChange(_.key,v),key:`${_.key}`},null,8,["product","onCountChange"]))),128))],512),[[Ye,!n.collapseData.other]])])):M("",!0),n.filteredProducts.length?M("",!0):(m(),x("div",_5," По выбранным параметрам не найдено ни одного товара "))])):M("",!0),n.products.length>0&&!n.kitchenStatus?(m(),x("div",v5,[d("div",y5,[d("div",x5,[(m(!0),x(U,null,te(n.filteredProducts,(_,w)=>(m(),N(u,{view:"two",product:_,onCountChange:v=>n.onCountChange(_.key,v),key:`${_.key}`},null,8,["product","onCountChange"]))),128))])])])):M("",!0),n.products.length===0?(m(),x("div",w5,[I(c,{width:"280",height:"45",style:{width:"100%"}},{default:O(()=>[b5,M5]),_:1}),d("div",S5,[I(h,{theme:"yellow",disabled:""},{default:O(()=>[Q("Оформить")]),_:1})])])):M("",!0),n.products.length>0?(m(),x("div",C5,[n.totalCount?(m(),x(U,{key:0},[d("div",{class:"complects-buy__total",onClick:e[8]||(e[8]=(..._)=>r.scrollToComplects&&r.scrollToComplects(..._))},[d("div",T5,[d("span",null,B(n.totalCount.toLocaleString())+" "+B(n.$declOfNum(n.totalCount,["модуль","модуля","модулей"])),1),Q(" на сумму")]),I(f,{"price-new":n.totalPriceNew,"price-old":n.totalPriceOld,"big-small":"small"},null,8,["price-new","price-old"])]),d("div",E5,[I(h,{loading:t.add,theme:"yellow",onClick:e[9]||(e[9]=_=>n.$emit("addToBasket"))},{default:O(()=>[Q("Оформить")]),_:1},8,["loading"])])],64)):(m(),x("div",A5,"Не выбрано ни одного модуля"))])):M("",!0),n.products.length&&n.productProps?(m(),N(p,{key:6,products:n.products},null,8,["products"])):M("",!0)])}const L5=Ae(xT,[["render",k5],["__scopeId","data-v-de847131"]]),R5={name:"ComplectsBlock",props:{products:{type:Array,required:!0},addToBasket:Boolean}};function I5(n,e,t,i,s,r){const o=yT,a=L5;return m(),x("div",null,[n.$device.isDesktop?(m(),N(o,{key:0,add:t.addToBasket,products:t.products,onAddToBasket:e[0]||(e[0]=c=>n.$emit("addComplectToBasket"))},null,8,["add","products"])):(m(),N(a,{key:1,products:t.products,add:t.addToBasket,onAddToBasket:e[1]||(e[1]=c=>n.$emit("addComplectToBasket"))},null,8,["products","add"]))])}const Cu=Ae(R5,[["render",I5]]),P5={components:{Price:ht,Button:tt,IconArrowDown:$t,Shields:En,Shield:Tt},props:["complects"],methods:{},data:function(){return{swiperOption:{loop:!0,slidesPerView:4,spaceBetween:30,navigation:{nextEl:".complect-next-main",prevEl:".complect-prev-main"},pagination:{el:".complect-pagination",clickable:!0},autoplay:{delay:9e3,disableOnInteraction:!1}},swiperOptionOne:{loop:!1,slidesPerView:1,spaceBetween:30,navigation:!1,pagination:!1,autoplay:!1}}}},so=n=>(Ze("data-v-1942a7aa"),n=n(),Je(),n),D5={key:0,class:"complects"},N5={key:0},O5={class:"complectBlock"},F5={class:"row"},B5=["href"],$5=["alt","src"],z5={class:"code"},H5=so(()=>d("span",null,"Код: ",-1)),U5={class:"vendor"},V5=so(()=>d("span",null,"Производитель: ",-1)),G5={class:"row",style:{width:"100%"}},W5=["href"],q5=so(()=>d("div",{class:"props"},"Характеристики",-1)),j5={class:"properties",style:{width:"100%"}},X5={class:"property"},Y5={class:"property__name"},Z5=so(()=>d("span",null,null,-1)),J5={class:"property__value"},Q5={class:"complectPrice"},K5=["href"],e8={class:"complectBlock"},t8={class:"img"},n8=["href"],i8=["alt","src"],s8={class:"price-block"},r8=["href"],o8=["href"],a8={key:2,class:"swiper-ctrls"},l8={class:"complect-prev-main"},c8={class:"complect-next-main"};function d8(n,e,t,i,s,r){const o=ht,a=Tt,c=En,l=fi,u=pi,h=$t;return t.complects.length>0?(m(),x("div",D5,[d("h3",null,[Q("Этот товар входит в комплект"),t.complects.length>1?(m(),x("span",N5,"ы")):M("",!0)]),t.complects.length===1?(m(),x("div",Cn({key:0},n.swiperOptionOne,{class:"complectWrap"}),[(m(!0),x(U,null,te(t.complects,(f,p)=>(m(),x("div",{class:"complectsSlider",key:p},[d("div",O5,[d("div",F5,[d("a",{href:`${f.url}?offer_id=${f.offerId}`,class:"img"},[d("img",{alt:f.name,src:f.img},null,8,$5)],8,B5),d("div",z5,[H5,Q(B(f.properties.model),1)]),d("div",U5,[V5,Q(B(f.vendor.name),1)])]),d("div",G5,[d("a",{href:`${f.url}?offer_id=${f.offerId}`,class:"name"},B(f.name),9,W5),q5,d("div",j5,[(m(!0),x(U,null,te(f.features,(g,_)=>(m(),x("div",X5,[d("div",Y5,B(g.name),1),Z5,d("div",J5,B(g.value),1)]))),256))])])]),d("div",Q5,[I(o,{bigSmall:"big",priceNew:f.price.new,priceOld:f.price.old!==f.price.new?f.price.old:!1,isHit:f.properties.hit},null,8,["priceNew","priceOld","isHit"]),d("a",{href:`${f.url}?offer_id=${f.offerId}`,class:"yellow"},"Подробнее",8,K5)])]))),128))],16)):(m(),N(u,Cn({key:1},n.swiperOption,{class:"complectWrap mini"}),{default:O(()=>[(m(!0),x(U,null,te(t.complects,(f,p)=>(m(),N(l,{class:"complectsSlider",key:p},{default:O(()=>[d("div",e8,[d("div",t8,[d("a",{href:`${f.url}?offer_id=${f.offerId}`},[d("img",{alt:f.name,src:f.img},null,8,i8)],8,n8),f.icons?(m(),N(c,{key:0},{default:O(()=>[(m(!0),x(U,null,te(f.icons.filter(g=>g.position==="top"),(g,_)=>(m(),N(a,{key:_,bgColor:g.backgroundColor,color:g.textColor,icon:g.icon,gradient:g.lineaGradient},{default:O(()=>[Q(B(g.text),1)]),_:2},1032,["bgColor","color","icon","gradient"]))),128))]),_:2},1024)):M("",!0)]),d("div",null,[d("div",s8,[I(o,{bigSmall:"medium",priceNew:f.price.new,priceOld:f.price.old!==f.price.new?f.price.old:!1,isHit:f.properties.hit},null,8,["priceNew","priceOld","isHit"])]),d("div",null,[d("a",{href:`${f.url}?offer_id=${f.offerId}`,class:"name"},B(f.name),9,r8)])]),d("div",null,[d("a",{href:`${f.url}?offer_id=${f.offerId}`,class:"yellow"},"Подробнее",8,o8)])])]),_:2},1024))),128))]),_:1},16)),t.complects.length>1?(m(),x("div",a8,[d("div",l8,[I(h,{height:"17",width:"17"})]),d("div",c8,[I(h,{height:"17",width:"17"})])])):M("",!0)])):M("",!0)}const u8=Ae(P5,[["render",d8],["__scopeId","data-v-1942a7aa"]]),h8={components:{Price:ht,Button:tt,Shields:En,Shield:Tt},props:["complects"],methods:{goTodetailProduct(n){console.log(n)}},data:function(){return{swiperOption:{loop:!0,slidesPerView:"2",centeredSlides:!1,navigation:!1,lazy:!0,autoHeight:!1,autoplay:{delay:9e3,disableOnInteraction:!1}}}}},f8=n=>(Ze("data-v-53d36cf0"),n=n(),Je(),n),p8={key:0,class:"complects"},m8={class:"complectsTitle"},g8={key:0},_8={key:0,class:"complectWrap"},v8={class:"complectBlock"},y8=["href"],x8=["alt","src"],w8={key:0,class:"shields-bottom"},b8={class:"complectPrice"},M8=["href"],S8={class:"properties"},C8={class:"property"},T8={class:"property__name"},E8=f8(()=>d("span",null,null,-1)),A8={class:"property__value"},k8={class:"price-block"},L8=["href"],R8={class:"complectBlock"},I8=["href"],P8=["alt","src"],D8={key:0,class:"shields-bottom"},N8={class:"complectPrice"},O8={key:1,style:{height:"28px"}},F8=["href"],B8=["href"];function $8(n,e,t,i,s,r){const o=Tt,a=ht,c=fi,l=pi;return t.complects.length>0?(m(),x("div",p8,[d("div",m8,[Q("Этот товар входит в комплект"),t.complects.length>1?(m(),x("span",g8,"ы")):M("",!0)]),t.complects.length===1?(m(),x("div",_8,[(m(!0),x(U,null,te(t.complects,(u,h)=>(m(),x("div",{class:"complectsSlider",key:h,style:{display:"flex","flex-direction":"row","margin-bottom":"20px"}},[d("div",v8,[d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"img"},[d("img",{alt:u.name,src:u.img},null,8,x8),u.icons?(m(),x("div",w8,[(m(!0),x(U,null,te(u.icons.filter(f=>f.position==="top"),(f,p)=>(m(),N(o,{key:p,bgColor:f.backgroundColor,color:f.textColor,icon:f.icon,gradient:f.lineaGradient},{default:O(()=>[Q(B(f.text),1)]),_:2},1032,["bgColor","color","icon","gradient"]))),128))])):M("",!0)],8,y8)]),d("div",b8,[d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"name"},B(u.name),9,M8),d("div",S8,[(m(!0),x(U,null,te(u.features,(f,p)=>(m(),x("div",C8,[d("div",T8,B(f.name),1),E8,d("div",A8,B(f.value),1)]))),256))]),d("div",k8,[I(a,{bigSmall:"small",priceNew:u.price.new,priceOld:u.price.old!==u.price.new?u.price.old:!1,isHit:u.properties.hit},null,8,["priceNew","priceOld","isHit"]),d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"yellow"},"Подробнее",8,L8)])])]))),128))])):(m(),N(l,{key:1,options:n.swiperOption,class:"complectWrap"},{default:O(()=>[(m(!0),x(U,null,te(t.complects,(u,h)=>(m(),N(c,{class:"complectsSlider",key:h},{default:O(()=>[d("div",R8,[d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"img"},[d("img",{alt:u.name,src:u.img},null,8,P8),u.icons?(m(),x("div",D8,[(m(!0),x(U,null,te(u.icons.filter(f=>f.text==="В наличии"),(f,p)=>(m(),N(o,{key:p,bgColor:f.backgroundColor,color:f.textColor,icon:f.icon,gradient:f.lineaGradient},{default:O(()=>[Q(B(f.text),1)]),_:2},1032,["bgColor","color","icon","gradient"]))),128))])):M("",!0)],8,I8)]),d("div",N8,[u.price.new?(m(),N(a,{key:0,bigSmall:"small",priceNew:u.price.new,priceOld:u.price.old!==u.price.new?u.price.old:!1,isHit:u.properties.hit},null,8,["priceNew","priceOld","isHit"])):(m(),x("div",O8)),d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"name"},B(u.name),9,F8),d("a",{href:`${u.url}?offer_id=${u.offerId}`,class:"yellow"},"Подробнее",8,B8)])]),_:2},1024))),128))]),_:1},8,["options"]))])):M("",!0)}const z8=Ae(h8,[["render",$8],["__scopeId","data-v-53d36cf0"]]),H8={props:["product","region"],data:function(){return{complects:[]}},methods:{async runRequest(){await this.$store.dispatch("sliders/getComplect",{productId:this.product,sr:this.region}),this.complects=this.$store.getters["sliders/getComplect"]}},async fetch(){this.$device.isCrawler&&await this.runRequest()},async mounted(){this.$device.isCrawler||await this.runRequest()}},U8={class:"inComplects"};function V8(n,e,t,i,s,r){const o=u8,a=z8;return m(),x("div",U8,[n.$device.isDesktop?(m(),N(o,{key:0,complects:n.complects},null,8,["complects"])):(m(),N(a,{key:1,complects:n.complects},null,8,["complects"]))])}const Tu=Ae(H8,[["render",V8]]);Number.prototype.toDivide=function(){let n=String(Math.trunc(this));if(n.length<=3)return n;let e=0,t="";for(let i=n.length-1;i>=0;i--)e==3&&(t=" "+t,e=0),t=n.charAt(i)+t,e++;return t};const G8={mixins:[Yn],components:{More:bu,Delimiter:va,IconDots:Kc,Fav:Tn,Shield:Tt,Shields:En,IconSaleBig:Kr,Button:tt,IconThrone:Fc,IconBox:da,Price:ht,IconConstructor:Uc,Icon3dvr:es},props:["product","theme"],data:function(){const n=this.product,e=n==null?void 0:n.offerIdCurrent;let t=0;return n.offers.forEach((i,s)=>{i.id===e&&(t=s)}),{image:this.imageProcess(n.images.detail.medium),basketWait:!1,colorHover:0,currentImage:0,miniatureHover:0,currentKey:t}},computed:{sale(){var n,e,t;return((t=(e=(n=this.product)==null?void 0:n.PROPERTIES)==null?void 0:e.SALE)==null?void 0:t.VALUE)??!1},currency(){return this.$store.getters.getRegionData.currency.sign},installmentText(){return this.product.offerCurrent.price.new?`<span>${parseInt(parseInt(this.product.offerCurrent.price.new)/(this.product.hit?10:12)).toDivide()} <span class="rouble">`+this.currency+`</span></span> ${this.product.hit?"в кредит":"в рассрочку"}`:""},bonusesReward(){var n;return((n=this.product.offerCurrent)==null?void 0:n.bonusesReward)>0?this.product.offerCurrent.bonusesReward:0},forAdditional(){return[this.imageProcess(this.product.images.detail.medium),...this.product.images.additional.map(n=>this.imageProcess(n.medium))]},showManufacturer(){return this.$store.getters.getRegionData.HIDDEN_MANUFACTURER==="N"},isKz(){var n;return(n=this.$store.getters.getRegionData)==null?void 0:n.kz}},methods:{isColorName(n){return n??""},imageProcess(n){var e,t;return(e=n==null?void 0:n.webp)!=null&&e.length?n.webp:(t=n==null?void 0:n.jpeg)!=null&&t.length?n.jpeg:(n==null?void 0:n.src)??""},changeImageByColors(n,e,t){this.image=n,this.colorHover=e,this.product.offerIdCurrent=t},addToBasket(){if(!this.basketWait){this.basketWait=!0;let n={};n[this.product.offerIdCurrent]=1,this.$store.dispatch("basket/addProduct",{offers:n,productId:this.product.id}).then(()=>{let t=this.product.offers.filter(i=>i.id==this.product.offerIdCurrent)[0]??0;this.$gtm.push({ecommerce:null}),this.isKz?this.$gtm.push({event:"add_to_cart",ecommerce:{currencyCode:this.currency,add:{products:[{name:this.product.name,id:this.product.offerIdCurrent,price:this.newPrice,brand:this.product.vendor.name,variant:this.product.guid,quantity:1}]}},price:this.newPrice,productGuid:this.product.guid,offerGuid:t,offerId:this.product.offerIdCurrent}):this.$gtm.push({event:"add_to_cart",ecommerce:{currency:this.currency,items:[{item_name:this.product.name,item_id:this.product.offerIdCurrent,price:this.newPrice,item_brand:this.product.vendor.name,item_variant:this.product.guid,item_list_name:this.product.name,quantity:1}],value:this.newPrice},price:this.newPrice,productGuid:this.product.guid,offerGuid:t,offerId:this.product.offerIdCurrent}),this.$gtm.push({event:"webit_click_addToCart"}),this.basketWait=!1,this.$store.dispatch("basket/setLastProduct",{name:this.product.NAME,image:this.image}),this.$store.dispatch("lPop/openWindow","addedBasket")})}},changeImageByDefault(n){n!==""&&(n.indexOf("http")===-1&&n.indexOf("//cdn")===-1?this.image="https://hypermarketmebel.ru"+n:this.image=n,this.miniatureHover=this.currentImage)},changeImageByMiniature(n,e){typeof n<"u"&&(n.indexOf("http")===-1&&n.indexOf("//cdn")===-1?this.image="https://hypermarketmebel.ru"+n:this.image=n,this.miniatureHover=e)},loadedImage(n,e){n.isIntersecting&&(this.imageShow=!0,e())},getName(n){return n.substring(0,60)},reviewWord(n){return ci(n,["отзыв","отзыва","отзывов"])}},mounted(){}},Eu=n=>(Ze("data-v-24306d0a"),n=n(),Je(),n),W8=["data-product-name"],q8={class:"card__block"},j8={class:"top-shields"},X8={class:"top-shields__inner"},Y8={class:"oneShild"},Z8={class:"icon-block"},J8={key:0,class:"card-icon"},Q8=Eu(()=>d("div",{class:"card-icon__description icon-3dvr"},"3D примерка",-1)),K8={key:1,class:"card-icon"},eE=Eu(()=>d("div",{class:"card-icon__description icon-constructor"},"3D конструктор",-1)),tE={key:0,class:"card__image"},nE=["alt","src"],iE={class:"change-image_hover"},sE=["id","onMouseover"],rE=["alt","src"],oE={class:"card__container"},aE={class:"swiper-pagination"},lE=["onMouseover"],cE={class:"price flex items-center"},dE=["innerHTML"],uE={key:0,class:"price-bonus"},hE={key:0,class:"rating mt-2.5 flex items-center"},fE={key:0,class:"rating-value flex items-center"},pE={class:"ml-2.5 text-xs font-medium text-green-400 leading-none"},mE={class:"reviews-count ml-2.5 text-xs text-gray-300"},gE={class:"card__colors"},_E={key:0,class:"card__colors-list"},vE=["onClick","title"],yE=["src"],xE=["to"],wE={key:0,class:"card__color-btn"},bE={key:1,class:"card__color-btn"},ME={class:"card__btns"},SE={key:0},CE={class:"stock"},TE=["innerHTML"],EE=["innerHTML"];function AE(n,e,t,i,s,r){const o=Tt,a=En,c=Tn,l=es,u=Uc,h=cn,f=ht,p=tt;return t.product?(m(),x("div",{key:0,class:Ee(["card",{card_light:t.theme==="light"}]),"data-product-name":t.product.id},[d("div",q8,[(m(),N(Ar(n.$device.isCrawler?"div":"NuxtLink"),Cn(n.$device.isCrawler?{}:{to:t.product.url+"?offer_id="+t.product.offerIdCurrent},{class:"card__inner"}),{default:O(()=>[d("div",j8,[d("div",X8,[d("div",Y8,[t.product.icons.length?(m(),N(a,{key:0,class:Ee({shields_light:t.theme==="light"})},{default:O(()=>[(m(!0),x(U,null,te(t.product.icons.filter(g=>g.position==="top"),(g,_)=>(m(),N(o,{key:_,bgColor:g.backgroundColor,color:g.textColor,icon:g.icon,"font-weight":g.text==="Хит"?700:!1,gradient:g.lineaGradient},{default:O(()=>[Q(B(g.text),1)]),_:2},1032,["bgColor","color","icon","font-weight","gradient"]))),128))]),_:1},8,["class"])):M("",!0)]),d("div",Z8,[I(c,{class:Ee({fav_light:t.theme=="light"}),name:t.product.name,price:t.product.offerCurrent.price.new,productId:t.product.id,offerId:t.product.offerIdCurrent,added:n.isFavorite,product:t.product},null,8,["class","name","price","productId","offerId","added","product"]),n.isAR?(m(),x("div",J8,[Q8,I(l)])):M("",!0),n.isConstructor?(m(),x("div",K8,[eE,I(u)])):M("",!0)])])]),n.$device.isCrawler?(m(),N(h,{key:1,to:t.product.url+"?offer_id="+t.product.offerIdCurrent},{default:O(()=>[$e(d("img",{alt:t.product.name,src:n.image,loading:"lazy",onError:e[3]||(e[3]=g=>n.getDummyUrl(g,!1))},null,40,rE),[[Ye,n.visible||n.$device.isCrawler]])]),_:1},8,["to"])):(m(),x("div",tE,[d("div",{onOnChange:e[1]||(e[1]=(...g)=>n.onChange&&n.onChange(...g)),class:"card__image"},[$e(d("img",{alt:t.product.name,src:n.image,loading:"lazy",onError:e[0]||(e[0]=g=>n.getDummyUrl(g,!1))},null,40,nE),[[Ye,n.visible||n.$device.isCrawler]])],32),d("div",iE,[(m(!0),x(U,null,te(n.productImages,(g,_)=>(m(),x("div",{class:"hover",id:_,onMouseover:w=>r.changeImageByMiniature(g,_),onMouseleave:e[2]||(e[2]=w=>r.changeImageByDefault(n.productImages[n.currentImage])),style:en(`width: ${100/n.productImages.length}%`)},null,44,sE))),256))])])),d("div",oE,[d("div",aE,[(m(!0),x(U,null,te(n.productImages,(g,_)=>(m(),x("div",{class:Ee(["bullet",{active:_===n.miniatureHover}]),onMouseover:w=>{n.currentImage=_,r.changeImageByDefault(n.productImages[n.currentImage])},key:_},null,42,lE))),128))]),d("div",cE,[I(f,{priceNew:t.product.offerCurrent.price.new,bigSmall:"catalog",priceOld:t.product.offerCurrent.price.new!==t.product.offerCurrent.price.old?t.product.offerCurrent.price.old:!1,isHit:t.product.hit},null,8,["priceNew","priceOld","isHit"])]),d("div",{class:"price-installment",innerHTML:r.installmentText},null,8,dE),r.bonusesReward>0?(m(),x("div",uE,"+"+B(r.bonusesReward)+" бонусов за покупку",1)):M("",!0),(m(),N(Ar(n.$device.isCrawler?"NuxtLink":"div"),Cn({class:"card__name"},n.$device.isCrawler?{to:t.product.url+"?offer_id="+t.product.offerIdCurrent}:{}),{default:O(()=>[Q(B(r.getName(t.product.name)),1)]),_:1},16)),d("div",null,[t.product.rating&&t.product.rating.count>0?(m(),x("div",hE,[t.product.rating.score>0?(m(),x("div",fE,[d("span",pE,B(t.product.rating.score.toFixed(1)),1)])):M("",!0),d("div",mE,B(t.product.rating.count)+" "+B(r.reviewWord(t.product.rating.count)),1)])):M("",!0),d("div",gE,[t.product.offers&&t.product.offers.length>0?(m(),x("div",_E,[n.offer.images.texture&&n.i<5?(m(!0),x(U,{key:0},te(t.product.offers,(g,_)=>(m(),x("div",{onClick:Vi(w=>r.changeImageByColors(r.imageProcess(g.images.detail.medium),_,g.id),["prevent"]),class:Ee(["card__color",{card__color_hover:n.colorHover==_}]),title:r.isColorName(g.name),key:_},[g.images.texture?(m(),x("img",{key:0,src:r.imageProcess(g.images.texture.medium),loading:"lazy",onError:e[4]||(e[4]=w=>n.getDummyUrl(w))},null,40,yE)):M("",!0)],10,vE))),128)):M("",!0),t.product.offers.filter(g=>g.images.texture).length>=5?(m(),x("div",{key:1,to:t.product.url},[t.product.offers.filter(g=>g.images.texture).length-5===1?(m(),x("div",wE," + "+B(t.product.offers.filter(g=>g.images.texture).length-5)+" цвет ",1)):M("",!0),t.product.offers.filter(g=>g.images.texture).length-5>1?(m(),x("div",bE," + "+B(t.product.offers.filter(g=>g.images.texture).length-5)+" цветов ",1)):M("",!0)],8,xE)):M("",!0)])):M("",!0)])])])]),_:1},16))]),d("div",ME,[t.product.complectProduct?(m(),N(h,{key:1,to:t.product.urlRaw,class:"add-basket-btn"},{default:O(()=>[I(p,{theme:"yellow",size:"medium"},{default:O(()=>[Q("Подробнее")]),_:1})]),_:1},8,["to"])):(m(),x("div",SE,[I(p,{onClick:r.addToBasket,size:"medium",theme:"yellow-big",align:"center",loading:n.basketWait,class:"add-basket-btn"},{default:O(()=>[Q("В корзину")]),_:1},8,["onClick","loading"])])),d("div",CE,B(n.stockText),1)]),d("div",{class:"card__additional",style:en({bottom:n.stockText?"-27px":"-9px"})},[d("div",{innerHTML:n.pickupText},null,8,TE),d("div",{innerHTML:n.deliveryText},null,8,EE)],4)],10,W8)):M("",!0)}const la=Ae(G8,[["render",AE],["__scopeId","data-v-24306d0a"]]),kE={mixins:[ju,Yn],props:["product","id","view","theme"],data:function(){var c,l;let n=this.product,e=n==null?void 0:n.offerIdCurrent,t=[];for(const[u,h]of Object.entries(n==null?void 0:n.offers))h.id===e&&(t=n==null?void 0:n.offers[u]);let i=0;n.offers.forEach((u,h)=>{u.id===e&&(i=h)});let s=(c=t==null?void 0:t.price)==null?void 0:c.new,r=!1;typeof s=="string"?r=parseInt(s.replace(/\s/,"")):typeof s=="number"&&(r=s);let o=(l=t==null?void 0:t.price)==null?void 0:l.old,a=!1;return typeof o=="string"?a=parseInt(o.replace(/\s/,"")):typeof o=="number"&&(a=o),r>5e3&&this.$store.getters.getRegionData.sugarGift&&(n.sugarGift=!0),{image:this.imageProcess(n.images.detail.medium),miniatureHover:0,currentOfferData:t,currentKey:i,colorHover:0,imageShow:!1,basketWait:!1,newPrice:r,oldPrice:a,isHit:n==null?void 0:n.hit,quickBasketLoading:!1,swiperOption:{slidesPerView:"1",centeredSlides:!1,pagination:{el:".swiper-pagination-"+this.product.id,clickable:!0}},swiperOption2:{slidesPerView:5,centerInsufficientSlides:!0,spaceBetween:8,slideToClickedSlide:!0,slidesOffsetAfter:0,longSwipes:!1}}},computed:{sale(){var n,e,t;return((t=(e=(n=this.product)==null?void 0:n.PROPERTIES)==null?void 0:e.SALE)==null?void 0:t.VALUE)??!1},currency(){return this.$store.getters.getRegionData.currency.sign},installmentText(){return this.product.offerCurrent.price.new?`<span>${parseInt(parseInt(this.product.offerCurrent.price.new)/(this.product.hit?10:12)).toDivide()} <span class="rouble">`+this.currency+`</span></span> ${this.product.hit?"в кредит":"в рассрочку"}`:""},bonusesReward(){var n;return((n=this.product.offerCurrent)==null?void 0:n.bonusesReward)>0?this.product.offerCurrent.bonusesReward:0},changeImageByDefault(n){n!==""&&(n.indexOf("http")===-1&&n.indexOf("//cdn")===-1?this.image="https://hypermarketmebel.ru"+n:this.image=n,this.miniatureHover=this.currentImage)},forAdditional(){return[this.imageProcess(this.product.images.detail.medium),...this.product.images.additional.map(n=>this.imageProcess(n.medium))]},showManufacturer(){return this.$store.getters.getRegionData.HIDDEN_MANUFACTURER==="N"}},methods:{addToBasket(){if(!this.basketWait){this.basketWait=!0;let n={};n[this.product.offerIdCurrent]=1,this.$store.dispatch("basket/addProduct",{offers:n,productId:this.product.id}).then(()=>{let t=this.product.offers.filter(i=>i.id==this.product.offerIdCurrent)[0]??0;this.$gtm.push({event:"add_to_cart",ecommerce:{currency:this.currency,items:[{item_name:this.product.name,item_id:this.product.offerIdCurrent,price:this.newPrice,item_brand:this.product.vendor.name,item_variant:this.product.guid,item_list_name:this.product.name,quantity:1}],value:this.newPrice},price:this.newPrice,productGuid:this.product.guid,offerGuid:t,offerId:this.product.offerIdCurrent}),this.$gtm.push({event:"webit_click_addToCart"}),this.basketWait=!1,this.$store.dispatch("basket/setLastProduct",{name:this.product.name,image:this.image}),this.$store.dispatch("lPop/openWindow","addedBasket")})}},imageProcess(n){var e,t;return(e=n==null?void 0:n.webp)!=null&&e.length?n.webp:(t=n==null?void 0:n.jpeg)!=null&&t.length?n.jpeg:(n==null?void 0:n.src)??""},stockText(){var n,e;return(e=(n=this.product)==null?void 0:n.additional)!=null&&e.quantity?"В наличии":""},loadedImage(n,e){n.isIntersecting&&(this.imageShow=!0,e())},changeImageByMiniature(n,e){this.image="https://hypermarketmebel.ru"+n,this.miniatureHover=e},changeImageByColors(n,e){this.image=n,this.colorHover=e},onMiniatureClick(n){this.$refs.thumbs.forEach(e=>{e.classList.remove("active")}),this.$refs.thumbs[n-1].classList.add("active"),this.$refs.swiperTop.$swiper.slideTo(n-1)},onSlideChange(){let n=this.$refs.swiperTop.$swiper.activeIndex;this.$refs.thumbs.length&&this.$refs.thumbs.forEach(e=>{e.classList.remove("active")}),this.$refs.thumbs[n].classList.add("active")},reviewWord(n){return ci(n,["отзыв","отзыва","отзывов"])}},mounted(){this.$nextTick(()=>{})}},LE=["data-product-name"],RE={class:"top"},IE={key:0,class:"shield_block"},PE={class:"icon-block"},DE={key:0,class:"image"},NE=["alt","src"],OE=["alt","src"],FE={class:"price"},BE=["innerHTML"],$E={key:2,class:"price-bonus"},zE={class:"colors-block"},HE={key:0,class:"colors mt-4 flex"},UE=["data-src"],VE={key:1},GE={class:"more"},WE={class:"btns justify-start mt-4",style:{left:"0"}},qE={class:"additional"},jE=["innerHTML"],XE=["innerHTML"],YE=["innerHTML"];function ZE(n,e,t,i,s,r){const o=Tt,a=Tn,c=Es("observer"),l=fi,u=pi,h=cn,f=ht,p=Bc,g=tt;return m(),x("div",{"data-product-name":t.product.id,class:Ee(["card card_two",{"px-5px":t.theme!="light",light:t.theme=="light"}])},[(m(),N(Ar(n.$device.isCrawler?"div":"NuxtLink"),Cn(n.$device.isCrawler?{}:{to:t.product.url+"?offer_id="+t.product.offerIdCurrent},{class:"card__inner offer"}),{default:O(()=>[d("div",RE,[t.product.icons?(m(),x("div",IE,[(m(!0),x(U,null,te(t.product.icons.filter(_=>_.position==="top"),(_,w)=>(m(),N(o,{key:w,bgColor:_.backgroundColor,color:_.textColor,icon:_.icon,"font-weight":_.text==="Хит"?700:!1,gradient:_.lineaGradient},{default:O(()=>[Q(B(_.text),1)]),_:2},1032,["bgColor","color","icon","font-weight","gradient"]))),128))])):M("",!0)]),d("div",PE,[I(a,{productId:t.product.id,offerId:t.product.offerIdCurrent,added:n.isFavorite,name:t.product.name,price:t.product.offerCurrent.price.new,product:t.product},null,8,["productId","offerId","added","name","price","product"])]),n.$device.isCrawler?(m(),N(h,{key:1,to:t.product.url+"?offer_id="+t.product.offerIdCurrent,class:"image"},{default:O(()=>[d("img",{alt:t.product.name,width:"100%",src:n.productImages[0],loading:"lazy",onError:e[1]||(e[1]=_=>n.getDummyUrl(_,!1))},null,40,OE)]),_:1},8,["to"])):(m(),x("div",DE,[n.productImages.length?(m(),N(u,{key:0,class:"main-banner",options:n.swiperOption,onSlideChange:r.onSlideChange,ref:"swiperTop"},{default:O(()=>[(m(!0),x(U,null,te(n.productImages,(_,w)=>(m(),N(l,{key:w},{default:O(()=>[I(c,{onOnChange:n.onChange,class:"slide"},{default:O(()=>[d("img",{alt:t.product.name,width:"100%",src:_,loading:"lazy",onError:e[0]||(e[0]=v=>n.getDummyUrl(v,!1))},null,40,NE)]),_:2},1032,["onOnChange"])]),_:2},1024))),128))]),_:1},8,["options","onSlideChange"])):M("",!0)])),d("div",{class:Ee(["swiper-pagination","swiper-pagination-"+t.product.id])},null,2),d("div",FE,[I(f,{bigSmall:"small",priceNew:t.product.offerCurrent.price.new,priceOld:t.product.offerCurrent.price.new!==t.product.offerCurrent.price.old?t.product.offerCurrent.price.old:!1,isHit:t.product.hit},null,8,["priceNew","priceOld","isHit"])]),d("div",{class:"price-installment",innerHTML:r.installmentText},null,8,BE),r.bonusesReward>0?(m(),x("div",$E,"+"+B(r.bonusesReward)+" бонусов за покупку",1)):M("",!0),(m(),N(Ar(n.$device.isCrawler?"NuxtLink":"div"),Cn(n.$device.isCrawler?{to:t.product.url+"?offer_id="+t.product.offerIdCurrent}:{},{class:"name h-12 text-sm text-black font-normal leading-4"}),{default:O(()=>[Q(B(t.product.name),1)]),_:1},16)),d("div",zE,[t.product.offers&&t.product.offers.length>0?(m(),x("div",HE,[n.offer.images.texture&&n.i<5?(m(!0),x(U,{key:0},te(t.product.offers,(_,w)=>(m(),x("div",{key:w,class:"color"},[_.images.texture?(m(),x("img",{key:0,"data-src":r.imageProcess(_.images.texture.medium),loading:"lazy",onError:e[2]||(e[2]=v=>n.getDummyUrl(v,!0))},null,40,UE)):M("",!0)]))),128)):M("",!0),t.product.offers.filter(_=>_.images.texture).length>=5?(m(),x("div",VE,[d("div",GE,[I(p,{width:"10",height:"2"})])])):M("",!0)])):M("",!0)])]),_:1},16)),d("div",WE,[t.product.complectProduct?(m(),N(h,{key:1,to:t.product.urlRaw},{default:O(()=>[I(g,{theme:"yellow",size:"small"},{default:O(()=>[Q("Подробнее")]),_:1})]),_:1},8,["to"])):(m(),N(g,{key:0,onClick:r.addToBasket,theme:"yellow",size:"small",loading:n.basketWait,class:"addBtn"},{default:O(()=>[Q("В корзину")]),_:1},8,["onClick","loading"])),d("div",qE,[d("div",{class:"stock",innerHTML:r.stockText},null,8,jE),d("div",{innerHTML:n.pickupText},null,8,XE),d("div",{innerHTML:n.deliveryText},null,8,YE)])])],10,LE)}const ca=Ae(kE,[["render",ZE],["__scopeId","data-v-3f627eda"]]),JE={components:{OfferCardDesktop:la,OfferCardMobile:ca},comments:{OfferCardDesktop:la,OfferCardMobile:ca},props:["product","theme","view"]};function QE(n,e,t,i,s,r){const o=la,a=ca;return n.$device.isDesktop?(m(),N(o,{key:0,product:t.product,theme:t.theme,view:t.view},null,8,["product","theme","view"])):(m(),N(a,{key:1,product:t.product,view:t.view,theme:t.theme},null,8,["product","view","theme"]))}const Au=Ae(JE,[["render",QE]]),KE={components:{IconArrowDown:$t,OfferCard:Au,Price:ht,Shields:En,Shield:Tt},props:["cardComplects"],methods:{cutCount(n,e=0){return n.filter((t,i)=>e?i<e:!0)},removeBase:n=>{let e=new URL(n);return e.pathname+e.search}},data:function(){return{count:12,baseCount:12,swiperOption:{slidesPerView:"auto",spaceBetween:30,navigation:{nextEl:".module-next",prevEl:".module-prev"},pagination:{el:".module-ctrls",clickable:!0}}}}},Ka=n=>(Ze("data-v-21fdbb08"),n=n(),Je(),n),e6={key:0,class:"cardsWrap"},t6=Ka(()=>d("h3",null,"Другие товары из этих комплектов",-1)),n6={class:"cards"},i6={class:"img"},s6=["alt","src"],r6=["alt","src"],o6={class:"shields-top"},a6={class:"price_block"},l6={class:"name"},c6={class:"code"},d6={class:"props"},u6={key:0},h6={key:1},f6=Ka(()=>d("span",{class:"dot"},"•",-1)),p6={class:"card_footer"},m6=Ka(()=>d("p",{class:"yellow"}," В корзину ",-1)),g6={key:0,class:"more"};function _6(n,e,t,i,s,r){const o=Tt,a=cn,c=ht;return t.cardComplects.length>0?(m(),x("div",e6,[t6,d("div",n6,[(m(!0),x(U,null,te(r.cutCount(t.cardComplects,n.count),(l,u)=>(m(),x("div",{class:"card",key:u},[d("div",null,[I(a,{to:r.removeBase(l.url)},{default:O(()=>[d("div",i6,[n.$device.isCrawler?(m(),x("img",{key:1,alt:l.name,src:l.img},null,8,r6)):(m(),x("img",{key:0,alt:l.name,src:l.img,loading:"lazy"},null,8,s6)),(m(!0),x(U,null,te(l.icons,h=>(m(),x("div",o6,[h.code=="hit"?(m(),N(o,{key:0,bgColor:h.backgroundColor,color:h.textColor,icon:h.icon,"font-weight":h.text==="Хит"?700:!1,gradient:h.lineaGradient},{default:O(()=>[Q(B(h.text),1)]),_:2},1032,["bgColor","color","icon","font-weight","gradient"])):M("",!0)]))),256))])]),_:2},1032,["to"]),d("div",a6,[I(c,{bigSmall:"medium",priceNew:l.price.new,priceOld:l.price.old!==l.price.new?l.price.old:!1,isHit:l.properties.hit},null,8,["priceNew","priceOld","isHit"])]),I(a,{to:r.removeBase(l.url)},{default:O(()=>[d("p",l6,B(l.name),1)]),_:2},1032,["to"]),d("div",c6,"Код: "+B(l.properties.model),1),d("div",d6,[(m(!0),x(U,null,te(l.features,(h,f,p)=>(m(),x("span",{class:"prop",key:f},[f==l.features.length-1?(m(),x("span",u6,B(h.value),1)):(m(),x("span",h6,[Q(B(h.value),1),f6]))]))),128))]),d("div",p6,[I(a,{to:r.removeBase(l.url)},{default:O(()=>[m6]),_:2},1032,["to"])])])]))),128))]),t.cardComplects.length>n.baseCount?(m(),x("div",g6,[t.cardComplects.length>n.baseCount&&n.count!==999?(m(),x("div",{key:0,class:"expander",onClick:e[0]||(e[0]=l=>n.count=999)}," Посмотреть все "+B(t.cardComplects.length)+" товаров ",1)):M("",!0),t.cardComplects.length>n.baseCount&&n.count===999?(m(),x("div",{key:1,class:"expander down",onClick:e[1]||(e[1]=l=>n.count=n.baseCount)}," Свернуть ")):M("",!0)])):M("",!0)])):M("",!0)}const v6=Ae(KE,[["render",_6],["__scopeId","data-v-21fdbb08"]]),y6={components:{IconArrowDown:$t,OfferCard:Au,Price:ht,Shields:En,Shield:Tt},props:["cardComplects"],methods:{cutCount(n,e=0){return n.filter((t,i)=>e?i<e:!0)},removeBase:n=>{let e=new URL(n);return e.pathname+e.search}},data:function(){return{count:12,baseCount:12,swiperOption:{slidesPerView:"auto",spaceBetween:30,navigation:{nextEl:".module-next",prevEl:".module-prev"},pagination:{el:".module-ctrls",clickable:!0}}}}},el=n=>(Ze("data-v-cd9e440e"),n=n(),Je(),n),x6={key:0,class:"cardsWrap"},w6=el(()=>d("h3",null,"Другие товары из этих комплектов",-1)),b6={class:"cards"},M6={class:"img"},S6=["alt","src"],C6={class:"shields-top"},T6={class:"price_block"},E6={class:"name"},A6={class:"code"},k6={class:"props"},L6={key:0},R6={key:1},I6=el(()=>d("span",{class:"dot"},"•",-1)),P6={class:"card_footer"},D6=el(()=>d("p",{class:"yellow"}," В корзину ",-1)),N6={key:0,class:"more"};function O6(n,e,t,i,s,r){const o=Tt,a=cn,c=ht;return t.cardComplects.length>0?(m(),x("div",x6,[w6,d("div",b6,[(m(!0),x(U,null,te(r.cutCount(t.cardComplects,n.count),(l,u)=>(m(),x("div",{class:"card",key:u},[d("div",null,[I(a,{to:r.removeBase(l.url)},{default:O(()=>[d("div",M6,[d("img",{alt:l.name,src:l.img,loading:"lazy"},null,8,S6),(m(!0),x(U,null,te(l.icons,h=>(m(),x("div",C6,[h.code=="hit"?(m(),N(o,{key:0,bgColor:h.backgroundColor,color:h.textColor,icon:h.icon,"font-weight":h.text==="Хит"?700:!1,gradient:h.lineaGradient},{default:O(()=>[Q(B(h.text),1)]),_:2},1032,["bgColor","color","icon","font-weight","gradient"])):M("",!0)]))),256))])]),_:2},1032,["to"]),d("div",T6,[I(c,{bigSmall:"small",priceNew:l.price.new,priceOld:l.price.old!==l.price.new?l.price.old:!1,isHit:l.properties.hit},null,8,["priceNew","priceOld","isHit"])]),I(a,{to:r.removeBase(l.url)},{default:O(()=>[d("p",E6,B(l.name),1)]),_:2},1032,["to"]),d("div",A6,"Код: "+B(l.properties.model),1),d("div",k6,[(m(!0),x(U,null,te(l.features,(h,f,p)=>(m(),x("div",{class:"prop",key:f},[f==l.features.length-1?(m(),x("span",L6,B(h.value),1)):(m(),x("span",R6,[Q(B(h.value),1),I6]))]))),128))]),d("div",P6,[I(a,{to:r.removeBase(l.url)},{default:O(()=>[D6]),_:2},1032,["to"])])])]))),128))]),t.cardComplects.length>n.baseCount?(m(),x("div",N6,[t.cardComplects.length>n.baseCount&&n.count!==999?(m(),x("div",{key:0,class:"expander",onClick:e[0]||(e[0]=l=>n.count=999)}," Посмотреть все товары ")):M("",!0),t.cardComplects.length>n.baseCount&&n.count===999?(m(),x("div",{key:1,class:"expander down",onClick:e[1]||(e[1]=l=>n.count=n.baseCount)}," Свернуть ")):M("",!0)])):M("",!0)])):M("",!0)}const F6=Ae(y6,[["render",O6],["__scopeId","data-v-cd9e440e"]]),B6={props:["offer","region"],watch:{offer:function(n,e){this.$store.dispatch("sliders/getCardComplect",{offerId:this.offer,sr:this.region}),this.cardComplects=this.$store.getters["sliders/getCardComplect"]}},methods:{async runRequest(){await this.$store.dispatch("sliders/getCardComplect",{offerId:this.offer,sr:this.region}),this.cardComplects=this.$store.getters["sliders/getCardComplect"]}},data:function(){return{cardComplects:[]}},async fetch(){this.$device.isCrawler&&await this.runRequest()},async mounted(){this.$device.isCrawler||await this.runRequest()}},$6={class:"inComplectsCards"};function z6(n,e,t,i,s,r){const o=v6,a=F6;return m(),x("div",$6,[n.$device.isDesktop?(m(),N(o,{key:0,cardComplects:n.cardComplects},null,8,["cardComplects"])):(m(),N(a,{key:1,cardComplects:n.cardComplects},null,8,["cardComplects"]))])}const ku=Ae(B6,[["render",z6]]),H6={name:"CreditTerm"},U6=n=>(Ze("data-v-2a28befc"),n=n(),Je(),n),V6=U6(()=>d("div",{class:"credit-content"},[Q(" Первый Гипермаркет Мебели предоставляет возможность купить мебель в кредит. У нас действуют различные кредитные программы от нескольких банков, с помощью которых приобрести любую мебель в кротчайшие сроки без бумажной волокиты и потери времени весьма просто."),d("br"),Q(" Как оформить мебель в кредит?"),d("br"),Q(" Оформить кредит можно следующим способом."),d("br"),d("br"),Q(" Вам необходимо:"),d("br"),d("ol",null,[d("li",null,"Оформить заказ, выбрав понравившийся Вам товар;"),d("li",null,"Выбрать способ оплаты «оформить в кредит»;"),d("li",null,"Подтвердить;"),d("li",null,"Заполнить появившуюся анкету;"),d("li",null,"Дождаться звонка кредитного специалиста, который оперативно свяжется с Вами для уточнения указанных персональных данных, на основе которых будет быстро принято решение о программе кредитования и выдаче Вам кредита. "),d("li",null,"Подписать кредитный договор можно в магазине или в отделении банка.")]),d("br"),Q(" Каков первоначальный взнос?"),d("br"),Q(" Первоначальный взнос зависит от условий предоставления кредита."),d("br"),d("br"),Q(" Как подписать кредитный договор и получить товар?"),d("br"),Q(" После заполнения заявки, с Вами свяжется кредитный специалист для уточнения указанных персональных данных, на основе которых будет быстро принято решение о программе кредитования и выдаче Вам кредита, а так же для уточнения времени подписания договора."),d("br"),Q(" - Вы приезжайте в магазин или отделение банка (в зависимости от наличия магазина в Вашем городе)"),d("br"),Q(" - После подписания Вам на руки выдаются: график платежей, кредитный договор (заявление)."),d("br"),Q(" - Остается только дождаться доставку товара в обговоренный со специалистом срок, начать пользоваться покупкой и погашать ежемесячный платеж по кредиту без комиссий."),d("br"),d("br"),Q(" Требования к заемщику:"),d("br"),d("ol",null,[d("li",null,"заемщик является гражданином Российской Федерации;"),d("li",null,"имеется постоянная регистрация по месту жительства на территории Российской Федерации;"),d("li",null,"возраст заемщика: от 18 лет.")])],-1));function G6(n,e,t,i,s,r){const o=Ns;return m(),N(o,null,{default:O(()=>[V6]),_:1})}const W6=Ae(H6,[["render",G6],["__scopeId","data-v-2a28befc"]]),q6={name:"HowTo3d",computed:{isShow(){return this.$store.getters["lPop/getActiveWindow"]=="howTo3d"}}},j6=n=>(Ze("data-v-63e1ed2d"),n=n(),Je(),n),X6={class:"video"},Y6=j6(()=>d("div",{class:"title"}," 3D конструктор ",-1)),Z6={key:0,width:"790",height:"445",src:"https://www.youtube.com/embed/xhSFtA5ClrM",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""};function J6(n,e,t,i,s,r){return m(),x("div",X6,[Y6,r.isShow?(m(),x("iframe",Z6)):M("",!0)])}const Lu=Ae(q6,[["render",J6],["__scopeId","data-v-63e1ed2d"]]),Q6={name:"HowToAR",props:["qr"]},Ru=n=>(Ze("data-v-93b02708"),n=n(),Je(),n),K6={class:"qr"},eA=["src"],tA=Ru(()=>d("div",null," Наведите камеру телефона на QR-код, и мебель появится в комнате. ",-1)),nA=Ru(()=>d("div",{class:"hint"}," *Для смартфонов и планшетов с поддержкой дополненной реальности. ",-1));function iA(n,e,t,i,s,r){return m(),x("div",null,[d("div",K6,[d("img",{src:t.qr,alt:""},null,8,eA)]),tA,nA])}const sA=Ae(Q6,[["render",iA],["__scopeId","data-v-93b02708"]]),rA={name:"DokaConstructor",props:["coef"],data(){return{dokaOrder:{project_id:""},isWaiting:!1}},mounted(){let n=document.createElement("script");n.src="https://dokashkaf.ru/calc_frame/script.js",n.id="dokacalc",n.dataset.target="doka-calc",document.getElementById("dokaConstructor").appendChild(n),n.onload=e=>{window.addEventListener("message",this.listenMessage,!1)}},methods:{listenMessage(n){if(n.data.action==="order"&&this.makeOrder(n),n.data.getCoeff&&n.data.getCoeff==1){const e={coeff:this.coef.D_COEF,coeff_custom:this.coef.D_COEF_CUSTOM};window.frames.doca_calc.postMessage(e,"*")}},makeOrder(n){this.$store.dispatch("lPop/closeWindow","doka"),this.isWaitingStatus(!0);const e=n.data.data.item;this.dokaOrder={project_id:n.data.data.project.id,name:e.name+" - конструктор Дока шкаф",price:e.price,pictures:{big:e.picture.big},params:e.params,product:this.product.id,offer:this.product.currentOffer,offer_id:this.product.currentOffer,project_url:window.location.pathname+window.location.search+n.data.data.project.id,region_id:this.region.ID,doka_constructor:1},this.$store.dispatch("basket/addDokaProduct",this.dokaOrder).then(t=>{this.$store.dispatch("basket/setLastProduct",{name:this.product.name,image:{desktop:e.picture.big,mobile:e.picture.big}}),this.$store.dispatch("lPop/openWindow","addedBasket"),this.isWaitingStatus(!1)})},isWaitingStatus(n){this.isWaiting=n,this.$emit("isWaiting",n)}},computed:{...hi({product:"product/getData",region:"getRegionData"})}},Iu=n=>(Ze("data-v-cf7d5a6f"),n=n(),Je(),n),oA=Iu(()=>d("div",{id:"dokaConstructor"},null,-1)),aA=Iu(()=>d("div",{id:"doka-calc",style:{display:"block",width:"100%","min-height":"90vh",height:"90vh",position:"relative","border-bottom":"10px"}},null,-1)),lA=[oA,aA];function cA(n,e,t,i,s,r){return m(),x("div",{class:Ee(`doka-outer-${n.$device.isMobile?"mobile":"desktop"}`)},lA,2)}const Pu=Ae(rA,[["render",cA],["__scopeId","data-v-cf7d5a6f"]]),dA={name:"RunningMeterModal",props:["meters","offer","product"],components:{Input:mn,Button:tt},data(){return{form:{name:"",phone:"",email:""},isWaiting:!1,orderMessage:""}},computed:{...hi({region:"getRegionData",user:"authentication/getUserData"})},methods:{orderProcess(){this.isWaiting=!0,this.$store.dispatch("basket/addRunningMeterProduct",{offers:{[this.offer]:this.meters},product_card_id:this.product}).then(n=>{console.log(n),n?this.$store.dispatch("basket/makeOrderRM",{sessid:this.user.sessid??"",region_user_id:this.region.MAIN_USER,PERSON_TYPE:1,PERSON_TYPE_OLD:1,ORDER_PROP_1:this.form.name??this.user.fullName??"",ORDER_PROP_2:this.form.email,ORDER_PROP_3:this.form.phone,ORDER_PROP_30:"N",ORDER_PROP_20:this.user.sessid??"",ORDER_PROP_13:this.region.ID,ORDER_PROP_15:this.region.NAME,ORDER_PROP_32:";0;5490;",ADDITIONAL:";0;5490;",ORDER_PROP_45:"roistat_visit",ORDER_PROP_47:"",ORDER_DESCTRIPTION:"",is_ajax_post:"Y",confirmorder:"Y",profile_change:"N",save:"Y",ajax:1,running_meter:!0,action:"make_order"}).then(e=>{var t,i;e.status==="success"&&((t=e==null?void 0:e.orders)!=null&&t[0])?this.orderMessage=`Заказ №${(i=e==null?void 0:e.orders)==null?void 0:i[0]} успешно оформлен.`:this.orderMessage="Возникла ошибка при формировании заказа. Попробуйте еще раз позднее"}).finally(()=>{this.isWaiting=!1}):this.isWaiting=!1})}}},uA={class:"form"},hA={class:"input-outer"},fA={class:"input-outer"},pA={class:"input-outer"},mA={class:"button-outer"},gA=["innerHTML"];function _A(n,e,t,i,s,r){const o=mn,a=tt;return m(),x("div",null,[d("div",uA,[d("div",hA,[I(o,{name:"ФИО",title:"ФИО",modelValue:s.form.name,"onUpdate:modelValue":e[0]||(e[0]=c=>s.form.name=c)},null,8,["modelValue"])]),d("div",fA,[I(o,{validator:"phone",name:"Номер телефона",title:"Номер телефона",modelValue:s.form.phone,"onUpdate:modelValue":e[1]||(e[1]=c=>s.form.phone=c)},null,8,["modelValue"])]),d("div",pA,[I(o,{validator:"email",name:"E-mail (не обязательно)",title:"E-mail (не обязательно)",modelValue:s.form.email,"onUpdate:modelValue":e[2]||(e[2]=c=>s.form.email=c)},null,8,["modelValue"])]),d("div",mA,[s.orderMessage?M("",!0):(m(),N(a,{key:0,loading:s.isWaiting,class:"button",theme:"yellow",onClick:r.orderProcess},{default:O(()=>[Q("Заказать проект")]),_:1},8,["loading","onClick"])),s.orderMessage?(m(),x("div",{key:1,innerHTML:s.orderMessage},null,8,gA)):M("",!0)])])])}const vA=Ae(dA,[["render",_A],["__scopeId","data-v-93a0f3e0"]]),yA={mixins:[Yn],components:{IconStar:An,IconClose:Vc,IconArrowDown:$t},data(){return{swiperOption:{spaceBetween:0,slidesPerView:"1",navigation:{nextEl:".swiper-next",prevEl:".swiper-prev"}},selected:0,showProps:!1,object3dInitialized:!1,isForceLoading:!1,swiperRef:null}},computed:{product(){return this.$store.getters["product/getData"]},offers(){return this.$store.getters["product/getOffers"]},currentOffer(){return Object.values(this.offers).find(n=>parseInt(n.id)===parseInt(this.product.currentOffer))},addPictures(){return this.$store.getters["gallery/getRest"].filter(n=>!n.type)},threeDModels(){var e;let n=[];return(e=this.offers[this.product.currentOffer])!=null&&e.model360?n.unshift({src:this.offers[this.product.currentOffer].model360,type3d:"elarbis"}):this.product.elarbis.model360.length&&n.unshift({src:this.product.elarbis.model360,type3d:"elarbis"}),this.product.model3d&&n.unshift({src:"",model:this.product.model3d,material:this.product.material3d,type3d:"model"}),n},reviewsPictures(){return this.$store.getters["productReviews/getReviews"]},getReviewsCount(){return this.reviewsPictures.reduce((n,e)=>parseInt(n)+parseInt(e.files.length),0)},photos(){let n=this.$store.getters["gallery/getFirst"],e=this.addPictures,t=this.reviewsPictures,i=this.threeDModels,s=[];return s.push({src:n,type:0}),e.forEach(r=>{s.push({src:r,type:1})}),t.forEach(r=>{r.files.forEach(o=>{s.push({type:2,src:o,...r})})}),i.forEach(r=>{s.push({type:3,...r})}),s}},methods:{onClick(n){this.isForceLoading=!0,this.swiperRef.slideTo(n),!this.object3dInitialized&&this.$refs.model3d&&(setTimeout(e=>{this.$refs.model3d[0].init()},1e3),this.object3dInitialized=!0),this.isForceLoading=!1},onClickFromGallery(n){const e=Object.keys(this.photos).find(t=>Object.values(this.photos[t].src).some(i=>i===n||i===(n==null?void 0:n.original)));typeof e<"u"&&this.onClick(e)},onClose(){this.$emit("close")},getImage(n){return(n==null?void 0:n.desktop)??n},slideNext(){this.swiperRef.slideNext()},slidePrev(){this.swiperRef.slidePrev()},onSlideChange(n){this.selected=n.activeIndex;let e=n.el.getElementsByClassName("current-image")[this.selected],t=e.getElementsByClassName("original")[0],i=e.getElementsByClassName("zoomed")[0];t&&(t.addEventListener("mousemove",s=>{e.getBoundingClientRect(),s.clientX,s.clientY;let r=s.srcElement.height,o=s.srcElement.width,a=t.naturalWidth<o?o:t.naturalWidth,c=t.naturalHeight<r?r:t.naturalHeight,l=Math.floor((a-o)*s.offsetX/o),u=Math.floor((c-r)*s.offsetY/r);i.style.opacity="1",t.style.opacity="0",i.style.top=`${-u}px`,i.style.left=`${-l}px`,i.style.setProperty("width",`${a}px`,"important"),i.style.setProperty("height",`${c}px`,"important")}),t.addEventListener("mouseout",s=>{i.style.opacity="0",t.style.opacity="1"}))}},mounted(){this.showProps=!0,this.$refs.wrapper.focus()}},Ws=n=>(Ze("data-v-ab1dc053"),n=n(),Je(),n),xA={class:"d-i-slider__inner"},wA={class:"d-i-slider__col",style:{"overflow-y":"auto"}},bA={class:"product-name"},MA={key:0,class:"properties"},SA={class:"property-value"},CA={class:"images__container images__container_first"},TA={key:1},EA={class:"section"},AA=Ws(()=>d("div",{class:"section__name"},"Дополнительные фотографии",-1)),kA={class:"section__count"},LA={class:"images__container"},RA={key:2},IA={class:"section"},PA=Ws(()=>d("div",{class:"section__name"},"3D модели",-1)),DA={class:"section__count"},NA={class:"images__container"},OA=["onClick"],FA={key:3},BA={class:"section"},$A=Ws(()=>d("div",{class:"section__name"},"Фотографии покупателей",-1)),zA={class:"section__count"},HA={class:"images__container"},UA={class:"d-i-slider__col"},VA={class:"slider"},GA={key:0,class:"current-image",style:"width: fit-content; text-align: center;"},WA={key:1,class:"review-desc"},qA={class:"inner"},jA={class:"review-item"},XA={class:"review-title"},YA={key:0,class:"review_city"},ZA={key:0,class:"review-item"},JA={class:"stars-block"},QA={class:"stars"},KA={key:1,class:"review-item"},ek=Ws(()=>d("div",{class:"review-title"},"Достоинства",-1)),tk={class:"review-text"},nk={class:"review-item"},ik={key:0,class:"review-title"},sk={class:"review-text"},rk={class:"review-item"},ok={key:0,class:"review-title"},ak={class:"review-text"},lk={key:2,class:"current-image three"},ck=["src"],dk={class:"swiper-ctrls"},uk=Ws(()=>d("span",null,"закрыть",-1)),hk={class:"close"};function fk(n,e,t,i,s,r){const o=Fs,a=An,c=Gs,l=Ns,u=fi,h=pi,f=$t,p=Vc;return m(),x("div",{class:"d-i-slider",tabindex:"0",onKeydown:[e[8]||(e[8]=Yo((...g)=>r.slidePrev&&r.slidePrev(...g),["left"])),e[9]||(e[9]=Yo((...g)=>r.slideNext&&r.slideNext(...g),["right"]))],ref:"wrapper"},[d("div",xA,[d("div",wA,[d("div",bA,B(r.product.name),1),s.showProps&&r.currentOffer?(m(),x("div",MA,[(m(!0),x(U,null,te(r.currentOffer.properties,(g,_)=>(m(),x("div",{class:"property",key:_},[d("span",SA,B(g.name)+": "+B(g.attrName?g.attrName:g.value),1)]))),128))])):M("",!0),d("div",CA,[(m(!0),x(U,null,te(r.photos,(g,_)=>(m(),x(U,null,[g.type==0?(m(),N(o,{alt:"",key:_,src:g.src.small,class:Ee({active:_==s.selected}),onClick:w=>r.onClick(_),onError:e[0]||(e[0]=w=>n.getDummyUrl(w,!1))},null,8,["src","class","onClick"])):M("",!0)],64))),256))]),r.addPictures.length>0?(m(),x("div",TA,[d("div",EA,[AA,d("div",kA,B(r.addPictures.length),1)]),d("div",LA,[(m(!0),x(U,null,te(r.photos,(g,_)=>(m(),x(U,null,[g.type==1?(m(),N(o,{alt:"",key:_,src:g.src.small,class:Ee({active:_==s.selected}),onClick:w=>r.onClick(_),onError:e[1]||(e[1]=w=>n.getDummyUrl(w,!1))},null,8,["src","class","onClick"])):M("",!0)],64))),256))])])):M("",!0),r.threeDModels.length?(m(),x("div",RA,[d("div",IA,[PA,d("div",DA,B(r.threeDModels.length),1)]),d("div",NA,[n.photo.type===3?(m(!0),x(U,{key:0},te(r.photos,(g,_)=>(m(),x("img",{src:"http://1hmm.ru/local/templates/public/img/dops/3d-model-icon.png",alt:"",onClick:w=>r.onClick(_),class:Ee({active:_==s.selected})},null,10,OA))),256)):M("",!0)])])):M("",!0),r.reviewsPictures.length>0&&r.getReviewsCount?(m(),x("div",FA,[d("div",BA,[$A,d("div",zA,B(r.getReviewsCount),1)]),d("div",HA,[(m(!0),x(U,null,te(r.photos,(g,_)=>(m(),x(U,null,[g.type==2?(m(),N(o,{alt:"",key:_,src:g.src.miniature,class:Ee({active:_==s.selected}),onClick:w=>r.onClick(_),onError:e[2]||(e[2]=w=>n.getDummyUrl(w,!1))},null,8,["src","class","onClick"])):M("",!0)],64))),256))])])):M("",!0)]),d("div",UA,[d("div",VA,[I(h,{class:"miniatures-slider",options:s.swiperOption,ref:"slider",onSlideChange:r.onSlideChange,onSwiper:e[4]||(e[4]=g=>s.swiperRef=g)},{default:O(()=>[(m(!0),x(U,null,te(r.photos,(g,_)=>(m(),N(u,{class:"slide",key:_},{default:O(()=>[g.type===0||g.type===1||g.type===2?(m(),x("div",GA,[(m(),N(o,{alt:"",key:_,src:r.getImage(g.src.original),onError:e[3]||(e[3]=w=>n.getDummyUrl(w,!1))},null,8,["src"])),d("div",{class:"zoomed",style:en(`background-image: url("${g.src.original}")`)},null,4)])):M("",!0),g.type===2?(m(),x("div",WA,[d("div",qA,[d("div",jA,[d("span",XA,B(g.authorName),1),g.city.length?(m(),x("span",YA,"("+B(g.city.trim())+")",1)):M("",!0)]),g.rating?(m(),x("div",ZA,[d("div",JA,[d("div",QA,[(m(),x(U,null,te(5,w=>I(a,{class:"star",height:"12",width:"12",color:w<=g.rating?"#FFC633":"#AAAAAA",key:w},null,8,["color"])),64))]),d("span",null,B(g.date),1)])])):M("",!0),g.dignity.length>0?(m(),x("div",KA,[ek,d("div",tk,B(g.dignity),1)])):M("",!0),d("div",nk,[g.disadvantage?(m(),x("div",ik,"Недостатки")):M("",!0),d("div",sk,B(g.disadvantage),1)]),d("div",rk,[g.text?(m(),x("div",ok,"Комментарий")):M("",!0),d("div",ak,B(g.text),1)])])])):M("",!0),g.type===3?(m(),x("div",lk,[g.type3d==="elarbis"?(m(),x(U,{key:0},[s.selected==_?(m(),x("iframe",{key:0,src:g.src},null,8,ck)):M("",!0)],64)):g.type3d==="model"?(m(),N(l,{key:1},{default:O(()=>[g.model?(m(),N(c,{key:0,ref_for:!0,ref:"model3d",model:g.model,material:g.material},null,8,["model","material"])):M("",!0)]),_:2},1024)):M("",!0)])):M("",!0)]),_:2},1024))),128))]),_:1},8,["options","onSlideChange"]),d("div",dk,[d("div",{class:"swiper-prev",onClick:e[5]||(e[5]=g=>s.swiperRef.slidePrev())},[I(f,{height:"17",width:"17"})]),d("div",{class:"swiper-next",onClick:e[6]||(e[6]=g=>s.swiperRef.slideNext())},[I(f,{height:"17",width:"17"})])])]),d("div",{class:"close__inner",onClick:e[7]||(e[7]=(...g)=>r.onClose&&r.onClose(...g))},[uk,d("div",hk,[I(p,{width:"15",height:"15"})])])])])],544)}const pk=Ae(yA,[["render",fk],["__scopeId","data-v-ab1dc053"]]),Du={components:{},data(){return{offers:[],additional:!1,showWarehouses:!1,addToBasketStarted:!1,rekBlocks:[],rekMindbox:[],maxVisibleUserImages:!1,limitImagesProceed:!1,showFeatures:!1,deliveryInfo:{},onSelectNameTriggered:!1}},computed:{isLoaded(){return this.$store.getters["product/getLoadedStatus"]},warehouseDataShow(){return this.warehouseData.find(n=>n.id===this.product.currentOffer)},showHiddenBlocks(){return this.$store.getters.getShowHiddenBlocksStatus},showForStaff(){return this.$store.getters.getShowForStaffStatus},miniatures(){return this.$store.getters["gallery/getImages"]},metaData:sd,dokaData(){var n,e,t,i,s,r,o,a,c,l,u,h,f,p;return{status:!!((e=(n=this.product)==null?void 0:n.dokaData)!=null&&e.coef),coef:(s=(i=(t=this.product)==null?void 0:t.dokaData)==null?void 0:i.coef)!=null&&s.D_COEF?(o=(r=this.product)==null?void 0:r.dokaData)==null?void 0:o.coef:!1,settings:((c=(a=this.product)==null?void 0:a.dokaData)==null?void 0:c.setting)??!1,price:((h=(u=(l=this.product)==null?void 0:l.dokaData)==null?void 0:u.setting)==null?void 0:h.price)??!1,isMainDoka:((p=(f=this.product)==null?void 0:f.dokaData)==null?void 0:p.isMainDoka)??!1}},currencyCode(){return this.$store.getters.getRegionData.currency.code},currency(){return this.$store.getters.getRegionData.currency.sign},rate(){return parseFloat(this.$store.getters.getRegionData.currency.exchangeRate)},isAvailLoaded(){return this.$store.getters["warehouse/isLoaded"]},showManufacturer(){return this.$store.getters.getRegionData.HIDDEN_MANUFACTURER==="N"},showFindCheaper(){return this.$store.getters.getRegionData.HIDDEN!=="Y"&&this.$store.getters.getRegionData.OWN_DELIVERY==="Y"},regionId(){return this.$store.getters.getRegionData.ID},instructions(){return this.$store.getters["instructions/getInstructions"]},popName(){var n,e;return this.additional?((e=(n=this.additional)==null?void 0:n.manufacturer)==null?void 0:e.name)??"":""},popUrl(){var n,e;return((e=(n=this.additional)==null?void 0:n.manufacturer)==null?void 0:e.url)??""},isComplect(){return this.product.isComplect},getComplects(){return this.$store.getters["product/getComplects"]},geisBf(){return this.$store.getters.getRegionData.BlackFriday},cyberMonday(){return this.$store.getters.getRegionData.cyberMonday},newYearSale(){return this.$store.getters.getRegionData.newYearSale},installment(){let n=!1,e=!1;return this.product.arProperties.MARKER_PRODUCTS&&(e=!0),!e&&this.$store.getters.getRegionData.PayOptions.PayDolyameAvailable&&this.product.price.new>1500&&(n=!0),n},totalPriceOld(){var t;let n=0,e=this.$store.getters["product/getComplects"];return e.length>0?e.forEach(i=>{n+=i.PRICE.OLD*i.CNT}):n=((t=this.price)==null?void 0:t.old)??0,n},totalPriceNew(){var t;let n=0,e=this.$store.getters["product/getComplects"];return e.length>0?e.forEach(i=>{n+=i.PRICE.NEW*i.CNT}):n=((t=this.price)==null?void 0:t.new)??0,n},totalBonusesReward(){let n=this.$store.getters["product/getOffers"][this.product.currentOffer];return(n==null?void 0:n.bonusesReward)>0?n.bonusesReward:0},totalBonusesRewardComplects(){let n=0,e=this.$store.getters["product/getComplects"];return e.length>0&&e.forEach(t=>{n+=t.bonusesReward*t.CNT}),n},reviews(){return this.$store.getters["productReviews/getReviews"]},countReviews(){let n=this.$store.getters["productReviews/getReviews"],e=0;return n.forEach(t=>{t.authorName.toLowerCase()!="сборка мебели"&&e++}),e},averageRating(){let n=this.reviews,e=0,t=0;return n.forEach(i=>{Number(i.rating)>0&&(t+=Number(i.rating),e++)}),e?(t/e).toFixed(1):0},bonusesText(){return this.isComplect?this.totalBonusesRewardComplects:this.totalBonusesReward},hasPartner(){return this.$store.getters.getRegionData.HAS_PARTNER==="Y"},franchise(){return this.$store.getters.getRegionData.FRANCHISE==="Y"},ownShop(){return this.$store.getters.getRegionData.OWN_SHOP==="Y"},regionTk(){return this.$store.getters.getRegionData.regionType==="ТК"},isKz(){var n;return(n=this.$store.getters.getRegionData)==null?void 0:n.kz},isOffice(){return this.$store.getters.getRegionData.isOffice},productName(){return this.product.seoName?this.product.seoName:this.product.name},currentOffersIcons(){var n,e,t,i;return(e=(n=this.product)==null?void 0:n.offers[this.product.currentOffer])!=null&&e.icons?(i=(t=this.product)==null?void 0:t.offers[this.product.currentOffer])==null?void 0:i.icons:[]}},methods:{processImages(n,e){let t=[];return n.length&&n.forEach((i,s)=>{var o,a,c,l,u,h,f;let r="";!((o=i==null?void 0:i.large)!=null&&o.webp)&&!((a=i==null?void 0:i.large)!=null&&a.jpeg)?r=(c=i==null?void 0:i.large)==null?void 0:c.src:r=i.large.webp?i.large.webp:(l=i==null?void 0:i.large)==null?void 0:l.jpeg,t.push({original:(u=i==null?void 0:i.medium)==null?void 0:u.src,src:r,small:(h=i==null?void 0:i.small)!=null&&h.webp?i.small.webp:(f=i==null?void 0:i.small)==null?void 0:f.jpeg,alt:this.product.name,selected:e})}),t},extractVideoIDs(n){return n.map(e=>{if(!e.includes("youtube")&&!e.includes("youtu.be"))return e;let t;return e=e.split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/),e[2]!==void 0?t=e[2].split(/[^0-9a-z_\-]/i)[0]:t=e,t})},removeYouTubeIframes(n){const e=/<iframe[^>]*src="[^"]*(youtu\.be|youtube\.com)[^>]*>[^<]*<\/iframe>/g;return n.replace(e,"")},async delivery(){Object.keys(this.deliveryInfo).length===0&&(await this.$store.dispatch("sliders/getDelivery"),this.deliveryInfo=await this.$store.getters["sliders/getDelivery"])},setMiniatures(){var a,c,l,u,h,f;const{images:n,name:e}=this.product;let t=((a=n==null?void 0:n.additional)==null?void 0:a.length)&&(n==null?void 0:n.additional)||[],i=n==null?void 0:n.detail,s=(l=(c=this.product.offers[this.product.currentOffer])==null?void 0:c.images)==null?void 0:l.detail,r=((h=(u=this.product.offers[this.product.currentOffer])==null?void 0:u.images)==null?void 0:h.additional)||[],o=s||i;this.selectedObject={src:(f=o==null?void 0:o.medium)==null?void 0:f.src},o!=null&&this.$store.commit("gallery/setFirstDetail",...this.processImages([o],!0)),this.$store.commit("gallery/setRest",this.processImages([...r,i,...t]))},offerImagesArrayProcess(){var e,t,i;const n=((i=(t=(e=this.product)==null?void 0:e.offers)==null?void 0:t[this.product.currentOffer])==null?void 0:i.pictures)||[];n!==void 0&&n.length&&(this.selectedObject={src:this.$device.isDesktop?n[0].original:n[0].medium}),this.$store.commit("gallery/addImages",n.map((s,r)=>({src:this.$device.isDesktop?s.original:s.medium,original:s.original,small:s.small,large:s.large,alt:this.product.name,selected:r===0})))},setDokaWaiting(n){this.addToBasketStarted=n},showDokaConstructor(){this.$store.dispatch("lPop/openWindow","doka")},prepareProp(n){if(!n||n.includes("-0.1")||n==="-"||n==="- ")return"";if(n.includes("мм")||n.includes("см"))return n.split(" ")[0].includes("-0.1")||n.split(" ")[0]==="-"||n.split(" ")[0]==="- "?"":n;if(n.includes("кг")){let e=parseFloat(n);return isNaN(e)?n.split(" ")[0].includes("-0.1")||n.split(" ")[0]==="-"||n.split(" ")[0]==="- "?"":n.split(" ")[1]=="кг"?n.split(" ")[0]:n:e+" кг"}return n.indexOf("#")!==-1?n.replace(/#/g,", "):n},openCheaper(n){this.$store.commit("product/nameSelectedProceed",n),this.$store.dispatch("lPop/openWindow","cheaper")},getInstructions(){(async()=>await this.$store.dispatch("instructions/getInstructions",{id:this.product.id}))()},addToBasket(){let n=[],e={},t={},i=0,s=0,r=0;this.addToBasketStarted||(this.isComplect?(this.getComplects.forEach((o,a)=>{o.CNT>0&&(n.push({offerId:o.ID,offerIdParent:this.product.currentOffer,quantity:o.CNT}),e[a]={name:o.NAME,cnt:o.CNT,props:o.PROPERTIES},e[a].total+=o.PRICE.NEW*o.CNT),o.PRICE&&(i+=o.PRICE.NEW*o.CNT,s+=o.PRICE.OLD*o.CNT,r+=o.CNT,t={new:i,old:s,count:r})}),this.product.kit={moduls:e,price:t}):n.push({offerId:this.product.currentOffer,quantity:1}),(async()=>{var a,c,l,u,h;this.addToBasketStarted=!0,await this.$store.dispatch("basket/addProduct",{offersData:n,productId:this.product.id});{let f=this.currencyCode,p=[];this.product.sections.forEach(v=>{p.push(v.NAME)});let g=[];for(let v in this.product.sections)g[v]=this.product.sections[v].name;let _=p.toString().replaceAll(",","/"),w=this.product.price.new;if(this.product.isComplect){this.getComplects.forEach(C=>{C.CNT>0&&(this.product.name+""+C.NAME,C.ID,C.PRICE.NEW,this.product.vendor.NAME,C.CNT)});let v=[],y=[];this.getComplects.forEach((C,S)=>{let T={},P={};for(let b in g)if(b<=4)if(b==0)T.item_category=g[b];else{let oe="item_category"+(Number(b)+1);T[oe]=g[b]}C.CNT>0&&(T.id=Number(C.ID),T.item_id=Number(C.ID),T.item_name=this.product.name+" - "+C.NAME,T.price=C.PRICE.NEW,T.item_brand=this.product.vendor.NAME,T.item_variant=C.XML_ID,T.index=S,T.quantity=C.CNT,T.item_list_name=p[p.length-1],T.item_list_id=this.product.sections[this.product.sections.length-1].id,P.name=this.product.name+" - "+C.NAME,P.id=this.product.currentOffer,P.price=C.PRICE.NEW,P.brand=this.product.vendor.NAME,P.category=this.product.sections[this.product.sections.length-1].id,P.variant=C.XML_ID,P.quantity=C.CNT,y.push(P),v.push(T))}),this.$gtm.push({ecommerce:null}),this.currencyCode==="KZT"?this.$gtm.push({event:"add_to_cart",ecommerce:{currencyCode:this.currencyCode,add:{products:y}}}):this.$gtm.push({event:"add_to_cart",ecommerce:{currency:f,items:v,value:w},price:w,productGuid:this.product.guid,offerGuid:this.product.offerXml,offerId:this.product.currentOffer}),this.$gtm.push({event:"webit_click_addToCart"})}else{let v={};for(let y in g)if(y<=4)if(y==0)v.item_category=g[y];else{let S="item_category"+(Number(y)+1);v[S]=g[y]}v.id=this.product.id,v.item_id=this.product.currentOffer,v.name=this.product.name,v.price=this.product.price.new,v.item_brand=this.product.vendor.NAME,v.item_variant=this.product.offerXml,v.item_list_name=p[p.length-1],v.item_list_id=this.product.sections[this.product.sections.length-1].id,v.index=1,v.quantity=1,this.$gtm.push({ecommerce:null}),this.currencyCode==="KZT"?this.$gtm.push({event:"add_to_cart",ecommerce:{currencyCode:this.currencyCode,add:{products:[{name:this.product.name,id:this.product.currentOffer,price:this.product.price.new,brand:this.product.vendor.NAME,category:this.product.sections[this.product.sections.length-1].id,variant:this.product.offerXml,quantity:1}]}}}):this.$gtm.push({event:"add_to_cart",ecommerce:{currency:f,items:[v],value:w},price:w,productGuid:this.product.guid,offerGuid:this.product.offerXml,offerId:this.product.currentOffer}),this.$gtm.push({event:"webit_click_addToCart"})}}this.addToBasketStarted=!1;const o=((h=(u=(l=(c=(a=this.product)==null?void 0:a.offers)==null?void 0:c[this.product.currentOffer])==null?void 0:l.pictures)==null?void 0:u[0])==null?void 0:h.medium)||this.product.pictures[0];this.$store.dispatch("basket/setLastProduct",{name:this.product.name,image:o,kit:this.product.kit}),this.$store.dispatch("lPop/openWindow","addedBasket")})())},goToModules(){var n;if((n=this.$refs)!=null&&n.modules){let e=this.$refs.modules.offsetTop,t=this.$device.isDesktop?20:80;window.scrollTo({top:e-t,behavior:"smooth"})}},showVendor(){this.popDesc&&this.$store.dispatch("lPop/openWindow","manufacturerPopup")},limitUserPreviewImages(){this.limitImagesProceed||(this.limitImagesProceed=!0,setTimeout(()=>{let n=0,e=document.getElementsByClassName("photos-list")[0].clientWidth;if(e){const t=document.getElementsByClassName("photos-list")[0].getElementsByClassName("photo");Array.from(t).forEach((i,s)=>{n+=i.clientWidth,n>=e&&!this.maxVisibleUserImages&&(this.maxVisibleUserImages=s),n>=e&&this.maxVisibleUserImages&&i.remove(),n+=12})}},300))},showShieldSale(){let n=this.$store.getters["product/getOffers"][this.product.currentOffer],e=document.getElementsByClassName("shield-sale"),t=!1;e&&(t=e[0]),t&&(n.sale?t.style.display="flex":t.style.display="none")},showShieldBestPrice(){let n=this.$store.getters["product/getCategorization"][this.product.id],e=document.getElementsByClassName("shield-bestPrice"),t=!1;e&&(t=e[0]);let i=this.currentOffersIcons.filter(s=>s.code==="bestPrice");t&&n[this.product.currentOffer]===4&&(i?t.style.display="flex":t.style.display="none")},showFindCheaperOnSelect(){},openNewReviewWindow(){this.$route.query.reviews==="show"&&(this.$store.dispatch("lPop/openWindow","writeReview"),this.goToReviews())}},beforeCreate(){this.$store.dispatch("product/clearOffers"),this.$store.dispatch("productReviews/clearProductReviews"),this.$store.dispatch("warehouse/clearWarehouses")},watch:{filesFromReviews(){this.limitUserPreviewImages()},async $route(n,e){n.path===e.path&&n.query.offer_id!==e.query.offer_id&&(this.changeOffer(n.query.offer_id),this.product.isComplect&&await this.$store.dispatch("product/getComplects",n.query.offer_id))}},mounted(){this.$route.query.shared&&setTimeout(()=>{this.openCheaper(!1)},2e3)}},Nu=Or("/images/pdf.svg"),Ou=Or("/images/doc.svg"),Fu="data:image/svg+xml,%3csvg%20width='23'%20height='20'%20viewBox='0%200%2023%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='13'%20cy='10'%20r='9.5'%20fill='white'%20stroke='%23fa5555'/%3e%3ccircle%20cx='10'%20cy='10'%20r='9.5'%20fill='white'%20stroke='%23fa5555'/%3e%3cpath%20d='M16.5254%2012.3297C16.8418%2012.3297%2017%2012.0898%2017%2011.77C17%2011.5301%2016.8418%2011.2902%2016.5254%2011.2902C16.0508%2011.2902%2015.6554%2011.3701%2015.2599%2011.5301C14.9435%2011.69%2014.7062%2011.9299%2014.4689%2012.1698C14.1525%2012.4897%2013.9943%2012.9695%2013.9153%2013.4493C13.5989%2013.2094%2013.2825%2012.9695%2012.887%2012.8095L14.2316%206.57214C14.2316%206.4122%2014.1525%206.1723%2013.9943%206.09234C13.8362%205.9324%2013.5989%206.01237%2013.4407%206.09234L10.2768%208.65127C10.1186%208.8112%209.88136%208.8112%209.72316%208.65127L6.55932%206.09234C6.40113%206.01237%206.16384%205.9324%206.00565%206.09234C5.84746%206.1723%205.76836%206.4122%205.76836%206.57214L7.11299%2012.8095C6.71751%2012.9695%206.40113%2013.2094%206.08475%2013.4493C6.00565%2012.9695%205.84746%2012.4897%205.53107%2012.1698C5.37288%2011.9299%205.0565%2011.69%204.74011%2011.5301C4.34463%2011.3701%203.94915%2011.2902%203.47458%2011.2902C3.15819%2011.2902%203%2011.5301%203%2011.77C3%2012.0898%203.15819%2012.3297%203.47458%2012.3297C4.10734%2012.3297%204.50282%2012.4897%204.81921%2012.8095C5.29379%2013.3693%205.0565%2014.4089%205.0565%2014.4089C5.0565%2014.6488%205.13559%2014.8087%205.29379%2014.9686C5.37288%2014.9686%205.45198%2014.9686%205.53107%2014.9686C5.68927%2014.9686%205.76836%2014.9686%205.92655%2014.8887C6.9548%2013.6892%208.45763%2013.1294%2010.0395%2013.1294C11.5424%2013.1294%2013.0452%2013.6892%2014.0734%2014.8087C14.2316%2014.9686%2014.3898%2015.0486%2014.548%2014.9686C14.7062%2014.9686%2014.8644%2014.8887%2014.9435%2014.6488C14.9435%2014.5688%2014.9435%2014.4888%2014.9435%2014.4089C14.9435%2014.3289%2014.7853%2013.3693%2015.1808%2012.8095C15.4972%2012.4897%2015.8927%2012.3297%2016.5254%2012.3297ZM10.0395%2012.0898C9.32768%2012.0898%208.61582%2012.2498%207.98305%2012.4097L7.0339%207.69167L9.16949%209.45093C9.40678%209.61087%209.72316%209.7708%2010.0395%209.7708C10.2768%209.7708%2010.5932%209.61087%2010.8305%209.45093L12.9661%207.69167L12.0169%2012.4097C11.3842%2012.2498%2010.6723%2012.0898%2010.0395%2012.0898Z'%20fill='%23fa5555'/%3e%3c/svg%3e",mk=Or("/images/icons/coin-blue.svg"),gk={mixins:[Yn,Du],components:{Template:ah,Slider:Fr,IconBox:da,Icon3dvr:es},props:["product"],data:function(){return{store:this.$store.state,swiperOption:{direction:"vertical",spaceBetween:15,slidesPerView:"auto",navigation:{nextEl:".swiper-next-el",prevEl:".swiper-prev-el"}},selectedObject:{},pageLoaded:!1,host:$n,sliderOpened:!1,projectSample:!1,projectLoaded:!1,isScrollEvent:!1,runningMeter:null,recLoad:!1,isForceLoading:!1,recom:[],operationsToShow:["TestRuchnoeSopostavlenie","PoxozhieTovaryzony","SEtimTovaromPokupayut"],view:"",swiperRef:null}},computed:{...hi({warehouseData:"warehouse/getWarehouses"}),pluralize(){return this.product.totalOrders+" "+ci(this.product.totalOrders,["раз","раза","раз"])},breadcrumbs(){let n=[];return n.push({name:"Интернет-магазин мебели",type:"link",url:"/"}),this.product.sections.forEach(e=>{n.push({name:e.NAME,url:e.SECTION_PAGE_URL})}),n.push({name:this.product.name,url:(this._.provides[at]||this.$route).fullPath}),n[n.length-1].url=!1,n},isAdmin(){if(this.store.authentication.userData!=!1){let n=!1;return this.store.authentication.userData.group.indexOf("28")!=-1&&(n=!0),this.store.authentication.userData.group.indexOf("29")!=-1&&(n=!0),this.store.authentication.userData.group.indexOf("26")!=-1&&(n=!0),n}},popImage(){var n,e;return((e=(n=this.additional)==null?void 0:n.manufacturer)==null?void 0:e.image)??""},popDesc(){var n,e,t,i,s,r;return this.additional&&(e=(n=this.additional)==null?void 0:n.manufacturer)!=null&&e.description&&((i=(t=this.additional)==null?void 0:t.manufacturer)==null?void 0:i.description)!=""?(r=(s=this.additional)==null?void 0:s.manufacturer)==null?void 0:r.description:!1},availQuantity(){return this.$store.getters["warehouse/getQuantities"]},questionsQuantity(){return this.$store.getters["questions/getQuestions"].length},filesFromReviews(){let n=this.$store.getters["productReviews/getReviews"],e=[];return n.forEach(t=>{t==null||t.files.forEach(i=>{e.push(i)})}),e.length>0?e:!1},qrAR(){var n,e;return(n=this.offers[this.product.currentOffer])!=null&&n.ar.length?(e=this.offers[this.product.currentOffer])==null?void 0:e.ar:this.product.elarbis.qr}},methods:{openNewWindow(n){window.open(n,"_blank")},categorizationCurrent(n,e){var s,r;let t=this.$store.getters["product/getCategorization"],i=e;if(i||(i=(r=(s=this._.provides[at]||this.$route)==null?void 0:s.query)==null?void 0:r.offer_id),t[n]){for(let[o,a]of Object.entries(t[n]))if(o==i)return a}},categorizationCurrentStyle(n,e){let t=this.categorizationCurrent(n,e);return t&&t>0?"categorization"+t:""},saleCurrentOffer(n){var t,i,s;let e=n;return e||(e=(i=(t=this._.provides[at]||this.$route)==null?void 0:t.query)==null?void 0:i.offer_id),(s=this.offers[e])==null?void 0:s.sale},setRunningMeter(n){this.runningMeter=n},showRunningMeterModal(){this.$store.dispatch("lPop/openWindow","runningMeterModal")},showHowTo3d(){this.$store.dispatch("lPop/openWindow","howTo3d")},showHowToAR(){this.$store.dispatch("lPop/openWindow","howToAR")},reviewsCount(n){return n+" "+ci(n,["отзыв","отзыва","отзывов"])},onSliderOpen(n){this.sliderOpened=!0;let e=id(()=>{var t;(t=this.$refs)!=null&&t.detailImageSlider&&(this.$refs.detailImageSlider.onClickFromGallery(n),clearInterval(e))},100)},onSliderClose(){this.sliderOpened=!1},addToFavorites(){if(this.favorite)this.$store.dispatch("favorites/remove",{offerId:this.product.currentOffer,productId:this.product.id}).then(()=>{});else{{let n=[];this.product.sections.forEach(i=>{n.push(i.NAME)});let e=[];for(let i in this.product.sections)e[i]=this.product.sections[i].name;let t={};for(let i in e)if(i<=4)if(i==0)t.item_category=e[i];else{let r="item_category"+(Number(i)+1);t[r]=e[i]}t.id=this.product.id,t.item_id=this.product.currentOffer,t.price=this.product.price.new,t.item_brand=this.product.vendor.NAME,t.item_variant=this.product.offerXml,t.item_list_name=n[n.length-1],t.item_list_id=this.product.sections[this.product.sections.length-1].id,t.index=1,t.quantity=1,this.$gtm.push({ecommerce:null}),this.$gtm.push({event:"add_to_wishlist",ecommerce:{items:[t]},value:this.product.price.new})}this.$store.dispatch("favorites/add",{offerId:this.product.currentOffer,productId:this.product.id}).then(()=>{})}},selectMiniature(n){this.miniatures.forEach((e,t)=>{let i=e;n==t?(this.selectedObject=i,i.selected=!0,i.type==="elarbis3d"&&(this.offers[this.product.currentOffer].model360?i.url=this.offers[this.product.currentOffer].model360:this.product.elarbis.model360&&(i.url=this.product.elarbis.model360))):i.selected=!1})},async changeOffer(n){this.$store.dispatch("product/changeCurrentOffer",n),this.product.seoName=this.offers[n].seoName!==""?this.offers[n].seoName:"",Object.keys(this.offers).length>0&&(this.price=this.offers[n].price),this.showShieldSale(),this.showShieldBestPrice(),this.miniatures.map(t=>t.selected=!1),this.setMiniatures();let e=await this.$store.getters["gallery/getImagesBefore"].length;e?this.swiperRef.slideTo(e):this.swiperRef.slideTo(0),this.isComplect&&await this.$store.dispatch("product/getComplects",n),await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml,operationsToShow:this.operationsToShow}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"]},async getProductReviews(){await this.$store.dispatch("productReviews/getProductReviews",{id:this.product.id}),this.openNewReviewWindow()},async constructorInit(){var i;const n={name:"constructor",query:{manufacturer:this.product.vendor.CODE,productId:this.product.id,sr:this.regionId,offerId:this.product.currentOffer}},e=((i=this.offers[this.product.currentOffer])==null?void 0:i.sampleProdboard)??!1;e&&(n.hash=`#project-sample-${e}`);const t=this.$router.resolve(n);window.open(t.href,"_blank")},goToReviews(){document.getElementsByClassName("ctabs")[0].scrollIntoView();let n=!1;document.querySelectorAll(".ctab__name").forEach((e,t)=>{e.outerText.includes("Отзывы")&&(n=t)}),n&&this.$refs.ctabs.clickOnName(n)},clickOnImageInReview(n){this.onSliderOpen(n)},onScroll(n){if(n.type==="scroll"){let e=n.target.querySelector(".Recommend");if(e!==null){let{top:t,bottom:i}=e.getBoundingClientRect(),s=n.target.documentElement.clientHeight;t-360<s&&t>0&&(this.recLoad||(this.recLoad=!0,setTimeout(async()=>{await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml,operationsToShow:this.operationsToShow}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"]},50)))}}}},created(){if(this.product){this.price=this.product.price;let n={type:"getProducts",products:[this.product.id],offers:[]};this.$store.dispatch("product/getCategorization",n);const{youtube:e,model3d:t,name:i,material3d:s,elarbis:r}=this.product;let o=[];t&&o.unshift({src:"",alt:"3D",model:t,material:s??!1,type:"model3d",selected:!1}),r!=null&&r.model360.length&&o.unshift({alt:"3д модель",type:"elarbis3d",url:r.model360,selected:!1}),this.setMiniatures(),this.$store.commit("gallery/setImagesBefore",o)}},async setup({product:n}){const{$device:e}=Xu(),t=Gc(),i=ua().currentRoute._value;if(e.isCrawler){await Promise.all([t.dispatch("productReviews/getProductReviews",{id:n.id}),t.dispatch("questions/getQuestions",{productId:n.id}),t.dispatch("product/getOffers",{id:n.id}),t.dispatch("sliders/getRekSliderM",{id:n.id,guid:n.guid,offer:n.currentOffer,avalability:n.avalability,offerGuid:n.offerXml,operationsToShow:["TestRuchnoeSopostavlenie","PoxozhieTovaryzony","SEtimTovaromPokupayut"]}),t.dispatch("warehouse/getWarehouses",{productId:n.id,section:i.params.section}),t.dispatch("instructions/getInstructions",{id:n.id})]);const s=t.getters["sliders/getRekSliderM"],r=t.getters["product/getOffers"];return{rekMindbox:s,offers:r}}},mounted(){this.showHiddenBlocks||document.getElementById("product-name").addEventListener("mouseup",this.showFindCheaperOnSelect);let n=this;(async function(){var i,s,r,o,a;let e;n.offers.length?e=n.offers:(await n.$store.dispatch("product/getOffers",{id:n.product.id}),e=n.$store.getters["product/getOffers"],n.offers=e),n.product.isActive==="Y"&&!n.product.isForbidden&&await n.$store.dispatch("warehouse/getWarehouses",{productId:n.product.id,section:n.$route.params.section});let t=!1;if((s=(i=n.$route)==null?void 0:i.query)!=null&&s.offer_id){let c=parseInt(n.$route.query.offer_id),l=!1,u=!1;Object.keys(e).forEach(h=>{h==c&&(l=!0),h==u&&(l=!0)}),l?t=c:n.product.currentOffer=t=parseInt(Object.keys(e)[0])}else t=parseInt(n.product.currentOffer);if(n.product.isConstructor&&(n.projectSample=(r=n.offers[t])==null?void 0:r.sampleProdboard,n.projectLoaded=!0,n.projectSample)){let c=n.projectSample?"#project-sample-"+n.projectSample:"";(!n.$route.hash||n.$route.hash==""||!((a=(o=n.$route)==null?void 0:o.query)!=null&&a.offer_id))&&await n.$router.replace({query:n.$route.query,hash:c})}n.isComplect&&await n.$store.dispatch("product/getComplects",n.product.currentOffer),n.$device.isCrawler||(await n.getInstructions(),await n.getProductReviews(),await n.$store.dispatch("questions/getQuestions",{productId:n.product.id})),n.$nextTick(function(){var c;(c=n.$refs)!=null&&c.scrollPhotos&&n.$refs.scrollPhotos.$el.addEventListener("wheel",function(l){l.preventDefault(),l.deltaY>0?n.$refs.scrollPhotos.osInstance().scrollStop().scroll({x:"+= "+l.deltaY*2},150,"linear"):n.$refs.scrollPhotos.osInstance().scrollStop().scroll({x:"+= "+l.deltaY*2},150,"linear")})})})(),this.$nextTick(function(){this.pageLoaded=!0}),async function(){let e=!1;setTimeout(async()=>{await n.$store.dispatch("product/getAdditional",{id:n.product.id}),e=n.$store.getters["product/getAdditional"],n.additional=e},0)}(),this.$nextTick(function(){let e=document.getElementById("original"),t=document.getElementsByClassName("zoomed")[0],i=document.getElementById("zoomed");e&&(e.addEventListener("mousemove",s=>{if(!(i!=null&&i.naturalHeight&&(i!=null&&i.naturalWidth)))return;let r=s.srcElement.height,o=s.srcElement.width,a=i.naturalWidth<o?o:i.naturalWidth,c=i.naturalHeight<r?r:i.naturalHeight,l=Math.floor((a-o)*s.offsetX/o),u=Math.floor((c-r)*s.offsetY/r);t.style.opacity="1",e.style.opacity="0",t.style.top=`${-u}px`,t.style.left=`${-l}px`,t.style.setProperty("width",`${a}px`,"important"),t.style.setProperty("height",`${c}px`,"important")}),e.addEventListener("mouseout",s=>{t.style.opacity="0",e.style.opacity="1"}))}),this.$device.isCrawler||setTimeout(async()=>{await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml,operationsToShow:this.operationsToShow}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"]},300)}},Xe=n=>(Ze("data-v-02a6ea2a"),n=n(),Je(),n),_k={key:0,class:"product"},vk={class:"product__cols"},yk={class:"product__col-line"},xk={class:"name"},wk={key:0,class:"categorization"},bk=["innerHTML"],Mk={class:"product-bar"},Sk={key:0,class:"product-code"},Ck={class:"rating-group"},Tk={key:0,class:"stars-block"},Ek={class:"stars"},Ak={key:0,class:"rating-value"},kk={key:1,class:"stars-block"},Lk={class:"stars"},Rk={key:3,class:"count-sells"},Ik={class:"product__cols"},Pk={class:"product__col"},Dk={class:"product__first"},Nk={class:"favorite-button"},Ok={class:"icon"},Fk=Xe(()=>d("span",null,"Примерить в интерьере",-1)),Bk={class:"sliders"},$k={class:"miniatures"},zk=["onMouseover"],Hk=["onMouseover"],Uk=["alt"],Vk={class:"swiper-ctrls"},Gk={key:0,class:"slider three-elarbis"},Wk=["src"],qk={key:1,class:"sliderDesc"},jk=["href"],Xk={class:"sliderDesc"},Yk={key:0,class:"shields"},Zk={key:0,class:"photos"},Jk=Xe(()=>d("div",{class:"photos-title"},"Фото и видео покупателей",-1)),Qk=["onClick"],Kk={style:{height:"inherit"}},eL={key:0,class:"photo-limiter"},tL=["innerHTML"],nL={class:"features"},iL=Xe(()=>d("div",{class:"features__title"}," Характеристики ",-1)),sL={class:"properties"},rL=Xe(()=>d("div",{class:"property__name"},"Производитель",-1)),oL=Xe(()=>d("span",null,null,-1)),aL={class:"property__value"},lL={key:0,class:"icon-i"},cL=Xe(()=>d("img",{src:mi,alt:""},null,-1)),dL=[cL],uL={key:0,class:"property"},hL={class:"property__name"},fL=Xe(()=>d("span",null,null,-1)),pL={class:"property__value"},mL={key:0,class:"youtube_container"},gL=["src","title"],_L=["innerHTML"],vL={class:"show-features hidden"},yL=Xe(()=>d("div",{class:"features__title"}," Наличие на складах ",-1)),xL=Xe(()=>d("div",{class:"instructions-title"},"Инструкция по сборке",-1)),wL={class:"instructions"},bL=["onClick"],ML={class:"instruction__icon"},SL={key:0,src:Nu,alt:""},CL={key:1,src:Ou,alt:""},TL={class:"instruction__name"},EL={class:"instruction__size"},AL={class:"instruction__download"},kL=["href"],LL=Xe(()=>d("span",{class:"instruction__download-icon"},null,-1)),RL=Xe(()=>d("span",null,"Скачать",-1)),IL=[LL,RL],PL={class:"product__col"},DL={key:0,class:"choose"},NL={key:0,class:"price"},OL=Xe(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"150",height:"40"},null,-1)),FL=Xe(()=>d("rect",{y:"0",rx:"3",ry:"3",width:"200",height:"22"},null,-1)),BL={key:0,src:Fu},$L={key:1,src:mk},zL={key:1,class:"choose"},HL={class:"off-sale"},UL=Xe(()=>d("img",{height:"42",width:"42",src:mi,alt:""},null,-1)),VL=Xe(()=>d("div",null,"Товар закончился",-1)),GL={key:2,class:"choose"},WL={class:"off-sale"},qL=Xe(()=>d("img",{height:"42",width:"42",src:mi,alt:""},null,-1)),jL=Xe(()=>d("div",null,"Товар закончился",-1)),XL={key:3,class:"choose additional-choose",style:{"margin-top":"20px"}},YL=Xe(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"258",height:"48"},null,-1)),ZL=Xe(()=>d("rect",{x:"15",y:"72",rx:"3",ry:"3",width:"228",height:"22"},null,-1)),JL={class:"constructor3d__how"},QL=Xe(()=>d("div",{class:"constructor3d__icon"},[d("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("circle",{cx:"12",cy:"12",r:"8",fill:"black"}),d("path",{d:"M12 0C5.37259 0 0 5.37259 0 12C0 18.6274 5.37259 24 12 24C18.6274 24 24 18.6274 24 12C23.993 5.37555 18.6245 0.00708148 12 0ZM17.0537 12.3823C16.9706 12.549 16.8355 12.6841 16.6689 12.7672V12.7714L9.81172 16.2C9.38824 16.4116 8.87345 16.2399 8.66181 15.8164C8.60164 15.696 8.57065 15.5631 8.57141 15.4286V8.57146C8.57121 8.09805 8.95476 7.71415 9.42817 7.71389C9.56131 7.71384 9.69264 7.74478 9.81172 7.8043L16.6689 11.2329C17.0925 11.444 17.2649 11.9587 17.0537 12.3823Z",fill:"#FFDA56"})])],-1)),KL={key:0},e7={key:0,class:"choose product-warehouse-info"},t7={key:1,class:"choose product-warehouse-info"},n7={key:0},i7=Xe(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"24",height:"24"},null,-1)),s7=Xe(()=>d("rect",{x:"36",y:"0",rx:"3",ry:"3",width:"40",height:"10"},null,-1)),r7=Xe(()=>d("rect",{x:"36",y:"15",rx:"3",ry:"3",width:"80",height:"10"},null,-1)),o7={key:1,class:"load"},a7=Xe(()=>d("div",{class:"name"},null,-1)),l7=Xe(()=>d("div",{class:"line"},null,-1)),c7=Xe(()=>d("div",{class:"line"},null,-1)),d7=Xe(()=>d("div",{class:"line"},null,-1)),u7=[l7,c7,d7],h7={ref:"modules"},f7={class:"mt-60"},p7=Xe(()=>d("div",{id:"prodboard-container",class:"wrapper-prodboard"},null,-1)),m7={id:"prodboard-script"},g7={class:"manufacturer-content"},_7=["src","alt"],v7={key:1,class:"add-pop"},y7=Xe(()=>d("rect",{x:"0",y:"0",width:"550",height:"20"},null,-1)),x7=Xe(()=>d("rect",{x:"0",y:"40",width:"450",height:"20"},null,-1)),w7=Xe(()=>d("rect",{x:"0",y:"80",width:"350",height:"20"},null,-1)),b7={key:0,class:"add-pop"},M7=Xe(()=>d("div",{class:"deliverySeparator"},null,-1)),S7={class:"deliveryName"},C7=["innerHTML"],T7=Xe(()=>d("span",null,null,-1)),E7={key:1,class:"add-pop"},A7=Xe(()=>d("rect",{x:"0",y:"0",width:"550",height:"20"},null,-1)),k7=Xe(()=>d("rect",{x:"0",y:"40",width:"450",height:"20"},null,-1)),L7=Xe(()=>d("rect",{x:"0",y:"80",width:"350",height:"20"},null,-1));function R7(n,e,t,i,s,r){var he,be;const o=Yh,a=Yu,c=Zu,l=Ns,u=An,h=jc,f=Tn,p=es,g=Fs,_=fi,w=pi,v=$t,y=Gs,C=Tt,S=fa,T=du,P=uu,b=hu,z=pa,oe=fu,X=ht,D=Lt,ge=lb,G=Jc,V=tt,Y=_u,W=vu,Z=yu,fe=xu,_e=_a,ne=Cu,ie=Tu,xe=ku,ve=Fr,Ce=ed,Ne=Wt,le=W6,Be=td,Ie=nd,Se=Lu,q=sA,ke=Pu,K=vA,ue=pk;return t.product?(m(),x("div",_k,[r.isAdmin?(m(),N(o,{key:0})):M("",!0),I(c,null,{default:O(()=>[(m(!0),x(U,null,te(r.breadcrumbs,($,Me)=>(m(),N(a,{data:$,lastCrumb:r.breadcrumbs[r.breadcrumbs.length-1],position:Me+1,key:Me},null,8,["data","lastCrumb","position"]))),128))]),_:1}),d("div",vk,[d("div",yk,[d("div",xk,[I(l,null,{default:O(()=>[n.showHiddenBlocks?(m(),x("div",wk,[d("span",{class:Ee(r.categorizationCurrentStyle(t.product.id,t.product.currentOffer))},null,2)])):M("",!0)]),_:1}),d("h1",{id:"product-name",innerHTML:n.productName},null,8,bk)]),d("div",Mk,[t.product.artnumber?(m(),x("div",Sk,"Код: "+B(t.product.artNumberShort),1)):M("",!0),d("div",Ck,[t.product.rating?(m(),x("div",Tk,[d("div",Ek,[(m(),x(U,null,te(5,$=>I(u,{class:"star",height:"12",width:"12",color:$<=t.product.rating.score.toFixed()?"#FFC633":"#AAAAAA",key:$},null,8,["color"])),64))]),t.product.rating?(m(),x("div",Ak,B(t.product.rating.score.toFixed(1)),1)):M("",!0)])):(m(),x("div",kk,[d("div",Lk,[(m(),x(U,null,te(5,$=>I(u,{class:"star",height:"12",width:"12",color:"#FFC633",key:$})),64))]),d("div",{class:"rating-value-none",onClick:e[0]||(e[0]=(...$)=>r.goToReviews&&r.goToReviews(...$))},"Оставить отзыв")])),t.product.rating?(m(),x("div",{key:2,onClick:e[1]||(e[1]=(...$)=>r.goToReviews&&r.goToReviews(...$)),class:"rating"},B(r.reviewsCount(t.product.rating.count)),1)):M("",!0),I(h),t.product.totalOrders>0?(m(),x("div",Rk,"Купили более "+B(r.pluralize),1)):M("",!0)])])])]),d("div",Ik,[d("div",Pk,[d("div",Dk,[d("div",Nk,[I(f,{offerId:t.product.currentOffer,added:n.isFavorite,product:t.product,padding:"3"},null,8,["offerId","added","product"])]),t.product.elarbis.ar.length?(m(),x("div",{key:0,class:"ar-button",onClick:e[2]||(e[2]=(...$)=>r.showHowToAR&&r.showHowToAR(...$))},[d("div",Ok,[I(p)]),Fk])):M("",!0),d("div",Bk,[d("div",$k,[n.pageLoaded?(m(),N(w,Cn({key:0,class:"miniatures-slider"},n.swiperOption,{onSwiper:e[4]||(e[4]=$=>n.swiperRef=$),modules:["SwiperNavigation"in n?n.SwiperNavigation:qc(th)]}),{default:O(()=>[(m(!0),x(U,null,te(n.miniatures,($,Me)=>(m(),N(_,{key:Me},{default:O(()=>[$.src?(m(),x("div",{key:0,class:Ee(["miniature",{miniature_selected:$.selected}]),onMouseover:Pe=>r.selectMiniature(Me)},[d("div",null,[$e((m(),N(g,{class:"image_slide",src:$.small,alt:$.alt,key:Me,onError:e[3]||(e[3]=Pe=>n.getDummyUrl(Pe,!1))},null,8,["src","alt"])),[[Ye,n.visible]])])],42,zk)):(m(),x("div",{key:1,class:Ee(["miniature",{miniature_selected:$.selected}]),onMouseover:Pe=>r.selectMiniature(Me)},[d("img",{src:"https://1hmm.ru/local/templates/public/img/dops/3d-model-icon.png",alt:$.alt,loading:"lazy"},null,8,Uk)],42,Hk))]),_:2},1024))),128))]),_:1},16,["modules"])):M("",!0)]),$e(d("div",Vk,[d("div",{class:Ee(["swiper-prev","swiper-prev-el"])},[I(v,{height:"17",width:"17",iconColor:"#525252"})]),d("div",{class:Ee(["swiper-next","swiper-next-el"])},[I(v,{height:"17",width:"17",iconColor:"#525252"})])],512),[[Ye,n.miniatures.length>5]]),n.selectedObject.type==="elarbis3d"?(m(),x("div",Gk,[d("iframe",{src:n.selectedObject.url,draggable:"false"},null,8,Wk)])):n.selectedObject.type==="model3d"?(m(),x("div",qk,[I(l,null,{default:O(()=>[n.selectedObject.model?(m(),N(y,{key:0,"auto-init":"",model:n.selectedObject.model,material:n.selectedObject.material},null,8,["model","material"])):M("",!0)]),_:1})])):(m(),x("div",{key:2,class:"sliderDesc",onClick:e[6]||(e[6]=$=>r.onSliderOpen(n.selectedObject.src))},[d("link",{itemprop:"image",href:n.selectedObject.src},null,8,jk),d("div",Xk,[$e(I(g,{id:"original",src:n.selectedObject.src||require("~/assets/images/dummy/no-image.webp"),alt:t.product.name,"is-force-loading":n.isForceLoading,onError:e[5]||(e[5]=$=>n.getDummyUrl($,!1))},null,8,["src","alt","is-force-loading"]),[[Ye,n.$device.isCrawler||n.visible]])]),d("div",{class:"zoomed",style:en(`backgroundImage: url("${n.selectedObject.src}")`)},null,4),!t.product.isForbidden&&t.product.isActive=="Y"&&t.product.price.new&&n.currentOffersIcons?(m(),x("div",Yk,[(m(!0),x(U,null,te(n.currentOffersIcons.filter($=>$.text!=="3D конструктор"&&$.text!=="Распродажа"),($,Me)=>(m(),N(C,{key:Me,bgColor:$.backgroundColor,color:$.textColor,icon:$.icon,gradient:$.lineaGradient,code:$==null?void 0:$.code},{default:O(()=>[Q(B($.text),1)]),_:2},1032,["bgColor","color","icon","gradient","code"]))),128)),r.saleCurrentOffer(t.product.currentOffer)?(m(!0),x(U,{key:0},te(n.currentOffersIcons.filter($=>$.text!=="3D конструктор"&&$.text==="Распродажа"),($,Me)=>(m(),N(C,{key:Me,bgColor:$.backgroundColor,color:$.textColor,icon:$.icon,gradient:$.lineaGradient,code:$==null?void 0:$.code},{default:O(()=>[Q(B($.text),1)]),_:2},1032,["bgColor","color","icon","gradient","code"]))),128)):M("",!0)])):M("",!0)]))])]),r.filesFromReviews?(m(),x("div",Zk,[Jk,d("div",{class:"photos-list",style:en(n.$device.isCrawler?"overflow: hidden;":"")},[(m(!0),x(U,null,te(r.filesFromReviews,($,Me)=>(m(),x("div",{key:$.miniature,class:"photo",onClick:Pe=>r.onSliderOpen($)},[d("div",Kk,[n.visible||n.$device.isCrawler?(m(),N(g,{key:Me,src:$.miniature||"/images/dummy/no-image.webp",alt:t.product.name},null,8,["src","alt"])):M("",!0)]),n.maxVisibleUserImages-1===Me?(m(),x("div",eL,B(r.filesFromReviews.length)+" фото ",1)):M("",!0)],8,Qk))),128))],4)])):M("",!0),I(z,{ref:"ctabs"},{default:O(()=>[t.product.richContent?(m(),N(S,{key:0,name:"Описание",selected:t.product.richContent!=!1},{default:O(()=>[d("div",{innerHTML:t.product.richContent.TEXT},null,8,tL)]),_:1},8,["selected"])):M("",!0),I(S,{name:"Характеристики",code:"specifications",selected:!t.product.richContent},{default:O(()=>[d("div",nL,[iL,d("div",sL,[t.product.proizvoditel&&n.showManufacturer&&n.showHiddenBlocks?(m(),x("div",{key:0,class:Ee(["property",{highlighted:n.showForStaff}])},[rL,oL,d("div",aL,[d("div",{class:"vendor",onClick:e[7]||(e[7]=(...$)=>n.showVendor&&n.showVendor(...$))},[Q(B(t.product.proizvoditel.VALUE_ENUM)+" ",1),r.popDesc?(m(),x("div",lL,dL)):M("",!0)])])],2)):M("",!0),(m(!0),x(U,null,te(t.product.properties,($,Me)=>(m(),x(U,null,[$.code!=="RICH_CONTENT"&&n.prepareProp($.value)!==""?(m(),x("div",uL,[d("div",hL,B($.name),1),fL,d("div",pL,B(n.prepareProp($.value)),1)])):M("",!0)],64))),256))]),t.product.youtube?(m(),x("div",mL,[(m(!0),x(U,null,te(n.extractVideoIDs(t.product.youtube),$=>(m(),x("iframe",{width:"100%",height:"450",src:`https://www.youtube.com/embed/${$}`,title:t.product.name,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:""},null,8,gL))),256))])):M("",!0),d("div",{class:"description",innerHTML:t.product.youtube.length>0?n.removeYouTubeIframes(t.product.description):t.product.description},null,8,_L)]),d("div",vL,[Q(" Смотреть "),I(v,{height:"6",width:"10",iconColor:"#5073A8"})])]),_:1},8,["selected"]),n.pageLoaded&&t.product.isActive=="Y"&&!n.isComplect&&!t.product.isForbidden?(m(),N(S,{key:1,name:"Наличие",code:"avail",quantity:r.availQuantity},{default:O(()=>[yL,I(T,{productId:t.product.id,offers:n.offers,productIcons:t.product.icons},null,8,["productId","offers","productIcons"])]),_:1},8,["quantity"])):M("",!0),I(S,{name:"Вопросы",code:"questions",quantity:r.questionsQuantity},{default:O(()=>[I(P,{productId:t.product.id},null,8,["productId"])]),_:1},8,["quantity"]),I(S,{name:"Отзывы",code:"reviews",ref:"reviews",quantity:n.countReviews},{default:O(()=>[I(b,{productId:t.product.id,onClickOnImageInReview:r.clickOnImageInReview},null,8,["productId","onClickOnImageInReview"])]),_:1},8,["quantity"]),n.instructions.length>0?(m(),N(S,{key:2,name:"Инструкция по сборке"},{default:O(()=>[xL,d("div",wL,[(m(!0),x(U,null,te(n.instructions,($,Me)=>(m(),x("div",{class:"instruction",key:Me,onClick:Pe=>n.uploadFile($.SRC)},[d("div",ML,[$.FORMAT=="pdf"?(m(),x("img",SL)):M("",!0),$.FORMAT=="doc"?(m(),x("img",CL)):M("",!0)]),d("div",TL,B($.NAME),1),d("div",EL,B($.SIZE),1),d("div",AL,[d("a",{href:$.SRC,target:"_blank"},IL,8,kL)])],8,bL))),128))])]),_:1})):M("",!0)]),_:1},512),I(oe)]),d("div",PL,[d("div",null,[!t.product.isForbidden&&t.product.isActive=="Y"&&t.product.price.new?(m(),x("div",DL,[!t.product.runningMeter&&t.product.isActive!==!1?(m(),x("div",NL,[!n.isComplect&&!n.dokaData.isMainDoka?(m(),N(X,{key:0,bigSmall:"big",priceNew:n.price.new,priceOld:n.price.old!==n.price.new?n.price.old:!1,isHit:t.product.isHit,lineBreak:!0},null,8,["priceNew","priceOld","isHit"])):n.isComplect?(m(),N(X,{key:1,bigSmall:"big",priceNew:n.totalPriceNew,priceOld:n.totalPriceOld!==n.totalPriceNew?n.totalPriceOld:!1,isHit:!1,lineBreak:!0},null,8,["priceNew","priceOld"])):n.dokaData.price?(m(),N(X,{key:2,bigSmall:"big",priceNew:n.dokaData.price,priceOld:!1,isHit:t.product.isHit,lineBreak:!0},null,8,["priceNew","isHit"])):M("",!0)])):M("",!0),t.product.isActive===!1?(m(),N(D,{key:1,width:"258",height:"40",style:{"margin-bottom":"10px"}},{default:O(()=>[OL]),_:1})):M("",!0),t.product.runningMeter?(m(),N(ge,{key:2,priceNew:n.price.new,priceOld:n.price.old,onGetValue:r.setRunningMeter},null,8,["priceNew","priceOld","onGetValue"])):M("",!0),t.product.isActive!==!1?(m(),N(G,{key:3,product:t.product,price:n.isComplect?n.totalPriceNew:n.price.new,isCategorization:r.categorizationCurrent(t.product.id,t.product.currentOffer)},null,8,["product","price","isCategorization"])):M("",!0),t.product.isActive===!1?(m(),N(D,{key:4,width:"258",height:"22",style:{"margin-bottom":"10px"}},{default:O(()=>[FL]),_:1})):M("",!0),n.bonusesText>0?(m(),x("div",{key:5,class:Ee(["bonuses",{red:((he=n.offers[t.product.currentOffer])==null?void 0:he.increasedBonusPercent)>0}])},[((be=n.offers[t.product.currentOffer])==null?void 0:be.increasedBonusPercent)>0?(m(),x("img",BL)):(m(),x("img",$L)),Q(" +"+B(n.bonusesText)+" бонусов за покупку ",1)],2)):M("",!0),!n.isComplect&&!n.dokaData.isMainDoka&&!t.product.runningMeter?(m(),N(V,{key:6,onClick:n.addToBasket,theme:"yellow-big",align:"center",loading:n.addToBasketStarted,class:"add-basket-btn"},{default:O(()=>[Q("Добавить в корзину")]),_:1},8,["onClick","loading"])):M("",!0),t.product.runningMeter?(m(),N(V,{key:7,theme:"yellow-big",onClick:r.showRunningMeterModal,align:"center",loading:n.addToBasketStarted,class:"add-basket-btn"},{default:O(()=>[Q(" Заказать проект ")]),_:1},8,["onClick","loading"])):M("",!0),n.dokaData.isMainDoka&&n.dokaData.coef?(m(),N(V,{key:8,theme:"yellow-big",align:"center",class:"add-basket-btn",loading:n.addToBasketStarted,onClick:n.showDokaConstructor},{default:O(()=>[Q(B(n.dokaData.price?"Изменить собранный шкаф":"Конструктор шкафов"),1)]),_:1},8,["loading","onClick"])):M("",!0),n.isComplect?(m(),N(V,{key:9,onClick:n.goToModules,theme:"yellow-big",align:"center",loading:n.addToBasketStarted,class:"add-basket-btn"},{default:O(()=>[Q("Выбрать модули")]),_:1},8,["onClick","loading"])):M("",!0),Object.keys(n.offers).length?(m(),N(Y,{key:10,class:"traits",onChange:r.changeOffer},null,8,["onChange"])):M("",!0),n.showFindCheaper&&!n.dokaData.isMainDoka&&!t.product.runningMeter?(m(),x("div",{key:11,class:"find-cheaper",onClick:e[8]||(e[8]=$=>n.openCheaper(!1))},"Нашли дешевле? Сделаем скидку!")):M("",!0)])):t.product.isActive=="N"?(m(),x("div",zL,[d("div",HL,[UL,VL,I(W,{class:"w-100 mt-20"})])])):t.product.isForbidden||!t.product.price.new?(m(),x("div",GL,[d("div",WL,[qL,jL,I(W,{class:"w-100 mt-20"})])])):M("",!0),!t.product.isForbidden&&t.product.isActive=="Y"&&(t.product.isConstructor||n.dokaData.coef&&!n.dokaData.isMainDoka)?(m(),x("div",XL,[t.product.isConstructor?(m(),x(U,{key:0},[n.projectLoaded?(m(),x(U,{key:1},[d("div",{class:"constructor3d__button additional-choose__button",onClick:e[9]||(e[9]=(...$)=>r.constructorInit&&r.constructorInit(...$))},"Собрать в конструкторе"),d("div",JL,[QL,d("div",{class:"constructor3d__text",onClick:e[10]||(e[10]=(...$)=>r.showHowTo3d&&r.showHowTo3d(...$))},"Как работает 3D конструктор")])],64)):(m(),N(D,{key:0,style:{"margin-bottom":"15px"},width:"258",height:"96"},{default:O(()=>[YL,ZL]),_:1}))],64)):(m(),x("div",{key:1,class:"constructor3d__button additional-choose__button",onClick:e[11]||(e[11]=(...$)=>n.showDokaConstructor&&n.showDokaConstructor(...$))},B(n.dokaData.price?"Изменить собранный шкаф":"Собрать в конструкторе"),1))])):M("",!0),!t.product.isForbidden||t.product.isActive=="Y"?(m(),x(U,{key:4},[!(n.hasPartner||n.franchise||n.regionTk)&&!n.isComplect?(m(),x("div",KL,[n.isAvailLoaded?(m(),x("div",e7,[I(Z,{"warehouse-data":n.warehouseDataShow},null,8,["warehouse-data"])])):$e((m(),x("div",t7,[n.$device.isSafari?M("",!0):(m(),x("div",n7,[(m(),x(U,null,te(3,($,Me)=>I(D,{key:Me,style:{"margin-bottom":"15px"},width:"175",height:"24"},{default:O(()=>[i7,s7,r7]),_:2},1024)),64))])),n.$device.isSafari?(m(),x("div",o7,[a7,(m(),x(U,null,te(2,($,Me)=>d("div",{key:Me,class:"macLoad"},u7)),64))])):M("",!0)],512)),[[Ye,!t.product.isForbidden]])])):M("",!0)],64)):M("",!0),!t.product.isForbidden||t.product.isActive=="Y"?(m(),N(fe,{key:5,isHit:t.product.isHit,isSale:t.product.isSale,productId:t.product.id},null,8,["isHit","isSale","productId"])):M("",!0),I(_e,{onDelivery:n.delivery},null,8,["onDelivery"])])])]),d("span",h7,null,512),n.isComplect?(m(),N(ne,{key:1,addToBasket:n.addToBasketStarted,products:n.getComplects,onAddComplectToBasket:n.addToBasket},null,8,["addToBasket","products","onAddComplectToBasket"])):M("",!0),t.product.isIncludeComplect?(m(),N(ie,{key:2,product:t.product.id,region:n.regionId},null,8,["product","region"])):M("",!0),t.product.isModule?(m(),N(xe,{key:3,offer:t.product.currentOffer,region:n.regionId},null,8,["offer","region"])):M("",!0),d("div",f7,[(m(!0),x(U,null,te(n.rekMindbox,$=>(m(),N(ve,{slidesPerView:1.6,title:$.NAME,type:"recommendations",quantity:"8",key:$.NAME,recommendations:$,availability:t.product.avalability},null,8,["title","recommendations","availability"]))),128))]),I(Ne,{"padding-less":"true",popId:"cheaper"},{default:O(()=>[I(Ce)]),_:1}),t.product.isConstructor?(m(),N(Ne,{key:4,popId:"prodboard",popName:"",size:"max"},{default:O(()=>[p7,$e(d("div",m7,null,512),[[Ye,!1]])]),_:1})):M("",!0),I(Ne,{popId:"manufacturerPopup",size:"big"},{default:O(()=>[d("div",g7,[d("div",{class:"manufactureName",onClick:e[12]||(e[12]=$=>r.openNewWindow(n.popUrl))},B(n.popName),1),d("div",{onClick:e[13]||(e[13]=$=>r.openNewWindow(n.popUrl))},[d("img",{src:r.popImage,alt:n.popName},null,8,_7)])]),n.additional?(m(),x("div",{key:0,class:Ee(["vandor-desc",{mobile:n.$device.isMobile}])},B(r.popDesc?r.popDesc:"Описание производителя отсутствует"),3)):M("",!0),n.additional?M("",!0):(m(),x("div",v7,[I(D,{class:"skeleton-reviews",width:"550",height:"338"},{default:O(()=>[y7,x7,w7]),_:1})]))]),_:1}),I(Ne,{popId:"deliveryPopup",popName:"Способы доставки",size:"big"},{default:O(()=>[Object.keys(n.deliveryInfo).length>0?(m(),x("div",b7,[M7,(m(!0),x(U,null,te(n.deliveryInfo,($,Me)=>(m(),x("div",{class:"deliveryInfo",key:Me},[d("div",S7,B($.type),1),d("div",{class:"deliveryDescription",innerHTML:$.description},null,8,C7),T7]))),128))])):(m(),x("div",E7,[d("div",null,[I(D,{class:"skeleton-reviews",width:"550",height:"338"},{default:O(()=>[A7,k7,L7]),_:1})])]))]),_:1}),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(Ne,{key:5,popId:"creditTerm",size:"big",popName:"Кредит"},{default:O(()=>[I(le)]),_:1})):M("",!0),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(Ne,{key:6,popId:"findCheaperRules",popName:"Правила участия в программе",size:"middle"},{default:O(()=>[I(Be)]),_:1})):M("",!0),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(Ne,{key:7,popId:"findCheaperTerms",popName:"Условия участия в программе",size:"middle"},{default:O(()=>[I(Ie)]),_:1})):M("",!0),I(Ne,{popId:"howTo3d",size:"middle","padding-less":"true"},{default:O(()=>[I(Se)]),_:1}),t.product.elarbis.qr?(m(),N(Ne,{key:8,popId:"howToAR",size:"small",popName:"Примерить в интерьере"},{default:O(()=>[I(q,{qr:r.qrAR},null,8,["qr"])]),_:1})):M("",!0),n.dokaData.coef?(m(),N(Ne,{key:9,"pop-id":"doka",size:"xl","padding-less":!0},{default:O(()=>[I(ke,{coef:n.dokaData.coef,onIsWaiting:n.setDokaWaiting},null,8,["coef","onIsWaiting"])]),_:1})):M("",!0),t.product.runningMeter?(m(),N(Ne,{key:10,size:"small","pop-id":"runningMeterModal"},{default:O(()=>[I(K,{offer:t.product.currentOffer,meters:n.runningMeter,product:t.product.id},null,8,["offer","meters","product"])]),_:1})):M("",!0),n.sliderOpened?(m(),N(ue,{key:11,ref:"detailImageSlider",onClose:r.onSliderClose},null,8,["onClose"])):M("",!0)])):M("",!0)}const I7=Ae(gk,[["render",R7],["__scopeId","data-v-02a6ea2a"]]),P7={};function D7(n,e){return m(),x("div",null," 1 ")}const N7=Ae(P7,[["render",D7]]),O7={mixins:[Yn],methods:{onClick(n,e){this.$emit("onSlideClicked",{...n,id:e})}},props:["slides","sliderKey","product"],data:function(){return{store:this.$store.state,initialized:!1,swiperOption:{slidesPerView:"1",touchStartForcePreventDefault:!0,pagination:{el:".js-ctrls",clickable:!0},on:{init:n=>{this.$emit("onSliderInit")}}},swiperRef:null}},mounted(){}},F7=n=>(Ze("data-v-79d7ce4b"),n=n(),Je(),n),B7={class:"slider"},$7={key:0,class:"slide"},z7=["src"],H7=["onClick"],U7=F7(()=>d("div",{class:"swiper-pagination js-ctrls",slot:"pagination"},null,-1));function V7(n,e,t,i,s,r){const o=Fs,a=fi,c=pi;return m(),x("div",B7,[I(c,Cn({class:"main-banner"},n.swiperOption,{modules:["SwiperPagination"in n?n.SwiperPagination:qc(nh)],onSwiper:e[1]||(e[1]=l=>n.swiperRef=l)}),{default:O(()=>[(m(!0),x(U,null,te(t.slides,(l,u)=>(m(),x(U,{key:u},[l.src!==""?(m(),N(a,{key:0,class:"swiper-slide"},{default:O(()=>[l.type==="youtube"?(m(),x("div",$7,[d("iframe",{class:"youtube",src:l.src},null,8,z7)])):(m(),x("div",{key:1,class:"slide",onClick:h=>r.onClick(l,u)},[d("div",null,[$e(I(o,{class:"object-contain",alt:t.product.name,src:l.src,loading:"lazy",onError:e[0]||(e[0]=h=>n.getDummyUrl(h,!1))},null,8,["alt","src"]),[[Ye,n.visible]])])],8,H7))]),_:2},1024)):M("",!0)],64))),128)),U7]),_:1},16,["modules"])])}const G7=Ae(O7,[["render",V7],["__scopeId","data-v-79d7ce4b"]]),W7={methods:{onSlideClicked(n){this.$emit("onSlideClicked",n)},onSliderInit(){this.$emit("onSliderInit")}},props:["slides","product"]};function q7(n,e,t,i,s,r){const o=N7,a=G7;return n.$device.isDesktop?(m(),N(o,{key:0,ref:"slider"},null,512)):(m(),N(a,{key:1,slides:t.slides,product:t.product,onOnSlideClicked:r.onSlideClicked,onOnSliderInit:r.onSliderInit,ref:"slider"},null,8,["slides","product","onOnSlideClicked","onOnSliderInit"]))}const j7=Ae(W7,[["render",q7]]),X7=Or("/svg/youtube_icon.svg"),Y7={mixins:[Yn],components:{Object3d:()=>Ju(()=>Promise.resolve().then(()=>ly),void 0,import.meta.url)},props:["slides","sliderId","sliderKey"],data:function(){return{store:this.$store.state,currentSlide:1,ready:!1,swiperOption:{loop:!0,longSwipes:!1,preloadImages:!1,preventInteractionOnTransition:!0,slidesPerView:"1",zoom:{maxRatio:5}},opacity:!1,swiperRef:null}},methods:{onClick(n,e){this.$emit("onSlideClicked",{...n,id:e})},onIndexChange(){if(this.swiperRef){this.currentSlide=this.swiperRef.activeIndex;const n=document.getElementById("gesture-zone");n.classList.add("down"),n.classList.remove("up")}},onInit(){document.querySelectorAll(".swiper-zoom-container").forEach(n=>{this.pinchZoom(n)})},slideTo(n){console.log("slided");let e=id(()=>{this.swiperRef&&(this.swiperRef.slideTo(n,500,!1),clearTimeout(e),this.opacity=!0)},5)},getImage(n){return n.orig??n.src},pinchZoom(n){}},watch:{isCanCreate:{handler(n){n?setTimeout(()=>{this.ready=!0},100):this.opacity=!1},immediate:!0}},computed:{isCanCreate(){return this.$store.getters["lPop/getActiveWindow"]==this.sliderId},currentReview(){var e,t,i,s,r;let n=this.currentSlide-1;return parseInt((i=(t=(e=this.slides)==null?void 0:e[n])==null?void 0:t.reviewData)==null?void 0:i.rating)>0?(r=(s=this.slides)==null?void 0:s[n])==null?void 0:r.reviewData:!1}},updated(){if(!this.gestureInit){this.gestureInit=!0;let n=0,e=0,t=0,i=0;const s=10,r=-50,o=document.getElementById("gesture-zone"),a=document.getElementById("gesture-show"),c=document.getElementById("gesture-trigger");c.addEventListener("touchstart",function(l){n=l.changedTouches[0].screenY},!1),c.addEventListener("touchmove",l=>{t=l.changedTouches[0].screenY,o.classList.remove("down"),o.classList.remove("up"),i=n-t,i>s?o.style.bottom=`${s}px`:o.style.bottom=`${n-t}px`},!1),c.addEventListener("touchend",function(l){e=l.changedTouches[0].screenY,i=n-e,i>r?o.classList.add("up"):o.classList.add("down")},!1),a.addEventListener("click",function(l){o.classList.contains("down")?(o.classList.add("up"),o.classList.remove("down")):(o.classList.add("down"),o.classList.remove("up"))},!1)}}},Bu=n=>(Ze("data-v-9f6c351f"),n=n(),Je(),n),Z7={class:"slide-container"},J7=["src"],Q7={key:1,class:"elarbis-3d"},K7=["src"],eR={key:2,class:"elarbis-3d swiper-no-swiping"},tR={key:3,style:{height:"100%",display:"contents"}},nR={class:"swiper-zoom-container"},iR=["src"],sR={key:4,style:{height:"100%",display:"contents"}},rR={class:"swiper-zoom-container"},oR=["src"],aR={class:"photos transition"},lR={class:"photos-list-scroll"},cR={class:"photos-list"},dR=["onClick"],uR={key:0,class:"icon",src:X7,alt:"YT"},hR={key:1,class:"icon",src:"https://1hmm.ru/local/templates/public/img/dops/3d-model-icon.png",alt:"YT"},fR={class:"review-status"},pR={class:"review-status__inner",id:"gesture-show"},mR=Bu(()=>d("div",{class:"text"}," Читать отзыв ",-1)),gR={class:"stars-block"},_R={class:"stars"},vR={class:"review-content down",id:"gesture-zone"},yR=Bu(()=>d("div",{class:"gesture-trigger",id:"gesture-trigger"},[d("div",{class:"gesture-trigger__inner"})],-1)),xR={class:"review-content__inner"};function wR(n,e,t,i,s,r){const o=Gs,a=fi,c=pi,l=Fs,u=An,h=ma,f=Ns;return m(),x("div",{class:Ee(["slider",{opacity:n.opacity}])},[I(f,null,{default:O(()=>[n.ready?(m(),N(c,Cn({key:0,class:"main-banner"},n.swiperOption,{ref:"slider",onSwiper:e[0]||(e[0]=p=>n.swiperRef=p),onActiveIndexChange:r.onIndexChange,onInit:r.onInit}),{default:O(()=>[(m(!0),x(U,null,te(t.slides,(p,g)=>(m(),N(a,{key:g},{default:O(()=>[d("div",Z7,[p.type==="youtube"?(m(),x("iframe",{key:0,src:p.src},null,8,J7)):p.type==="elarbis3d"?(m(),x("div",Q7,[d("iframe",{src:p.src,draggable:"false"},null,8,K7)])):p.type==="model3d"?(m(),x("div",eR,[p.model3d?(m(),N(o,{key:0,ref_for:!0,ref:"model3d",model:p.model3d,material:p.material,autoInit:"true"},null,8,["model","material"])):M("",!0)])):p.reviewData?(m(),x("div",tR,[d("div",nR,[d("img",{src:p.src.original,alt:""},null,8,iR)])])):(m(),x("div",sR,[d("div",rR,[d("img",{src:p.large,alt:""},null,8,oR)])]))])]),_:2},1024))),128))]),_:1},16,["onActiveIndexChange","onInit"])):M("",!0),d("div",aR,[d("div",lR,[d("div",cR,[(m(!0),x(U,null,te(t.slides,(p,g)=>(m(),x("div",{class:Ee(["photo",{current:g+1===n.currentSlide}]),key:g,onClick:_=>r.slideTo(g+1)},[p.type==="youtube"?(m(),x("img",uR)):p.type==="elarbis3d"||p.type==="model3d"?(m(),x("img",hR)):p.reviewData?(m(),N(l,{key:2,src:p.src.miniature,alt:"",onError:e[1]||(e[1]=_=>n.getDummyUrl(_,!1))},null,8,["src"])):(m(),N(l,{key:3,src:p.small,alt:"",onError:e[2]||(e[2]=_=>n.getDummyUrl(_,!1))},null,8,["src"]))],10,dR))),128))])])]),$e(d("div",fR,[d("div",pR,[mR,d("div",gR,[d("div",_R,[(m(),x(U,null,te(5,p=>I(u,{class:"star",height:"12",width:"12",color:p<=4?"#FFC633":"#AAAAAA",key:p},null,8,["color"])),64))])])])],512),[[Ye,!!r.currentReview]]),d("div",vR,[yR,d("div",xR,[r.currentReview?(m(),N(h,{key:0,"show-images":!1,review:r.currentReview},null,8,["review"])):M("",!0)])])]),_:1})],2)}const bR=Ae(Y7,[["render",wR],["__scopeId","data-v-9f6c351f"]]),MR={components:{IconFav:rd,IconFavHover:od},props:["productId","offerId","added","icon","color","name","price","mini","product","type"],data(){return{active:!1}},watch:{added(n){this.active=n}},async mounted(){await this.added&&(this.active=await this.added)},computed:{isLoading:n=>n.$store.getters["favorites/getLoading"]},methods:{async toggle(){var n,e,t;if(!this.isLoading)if(this.active)this.active=!1,this.$store.dispatch("favorites/remove",{productId:this.productId,offerId:this.offerId});else{this.active=!0,this.$store.dispatch("favorites/add",{productId:this.productId,offerId:this.offerId});{let i={};if(this.arBreadcrumbs={},await this.$store.dispatch("arBreadcrumbs/getItems",{data:Number(this.productId)}),this.arBreadcrumbs=this.$store.getters["arBreadcrumbs/getItems"],Object.keys(this.arBreadcrumbs).length!==0){for(let r in this.arBreadcrumbs)if(r<=4)if(r==0)i.item_category=this.arBreadcrumbs[r].name;else{let a="item_category"+(Number(r)+1);i[a]=this.arBreadcrumbs[r].name}}i.id=this.product.id,i.item_name=this.product.name,i.item_id=this.product.offerIdCurrent;let s="";for(let r in this.product.offers)((n=this.product.offers[r])==null?void 0:n.id)===this.product.offerIdCurrent&&(s=(e=this.product.offers[r])==null?void 0:e.guid);i.item_variant=s,i.item_brand=(t=this.product.vendor)==null?void 0:t.name,i.price=this.price,i.quantity=1,i.index=1,this.$gtm.push({ecommerce:null}),this.$gtm.push({event:"add_to_wishlist",ecommerce:{items:[i]}})}}}}},$u=n=>(Ze("data-v-074c3ec6"),n=n(),Je(),n),SR={key:0},CR=["width","height"],TR=$u(()=>d("path",{d:"M13.1484 0C11.6511 0 10.3385 0.65704 9.35258 1.90013C9.2211 2.06592 9.10389 2.23178 9 2.39241C8.89611 2.23174 8.7789 2.06592 8.64742 1.90013C7.66146 0.65704 6.34887 0 4.85156 0C2.02303 0 0 2.33073 0 5.12748C0 8.32543 2.66333 11.3393 8.63568 14.8999C8.74765 14.9666 8.87382 15 9 15C9.12618 15 9.25235 14.9666 9.36432 14.8999C15.3367 11.3394 18 8.32546 18 5.12751C18 2.33221 15.9786 0 13.1484 0ZM14.736 9.10947C13.4926 10.4748 11.6137 11.9124 9 13.4972C6.38631 11.9124 4.50738 10.4748 3.26401 9.10951C2.01393 7.73682 1.40625 6.43429 1.40625 5.12751C1.40625 3.1138 2.78909 1.3839 4.85156 1.3839C5.90189 1.3839 6.79746 1.83332 7.51342 2.71971C8.0859 3.42857 8.32711 4.16055 8.3288 4.16578C8.42038 4.45484 8.69235 4.65173 9.00004 4.65173C9.30772 4.65173 9.57969 4.45487 9.67127 4.16578C9.67349 4.15879 9.90745 3.44964 10.4611 2.7516C11.181 1.84404 12.0851 1.38386 13.1484 1.38386C15.2131 1.38386 16.5938 3.11543 16.5938 5.12748C16.5938 6.43426 15.9861 7.73678 14.736 9.10947Z",fill:"black"},null,-1)),ER=[TR],AR={width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},kR=$u(()=>d("path",{d:"M24.6094 12C22.9457 12 21.4873 12.7446 20.3918 14.1535C20.2457 14.3414 20.1154 14.5293 20 14.7114C19.8846 14.5293 19.7543 14.3414 19.6082 14.1535C18.5127 12.7446 17.0543 12 15.3906 12C12.2478 12 10 14.6415 10 17.8111C10 21.4355 12.9593 24.8513 19.5952 28.8865C19.7196 28.9622 19.8598 29 20 29C20.1402 29 20.2804 28.9622 20.4048 28.8866C27.0408 24.8513 30 21.4355 30 17.8112C30 14.6432 27.754 12 24.6094 12Z",fill:"#F95353"},null,-1)),LR=[kR];function RR(n,e,t,i,s,r){const o=rd,a=od;return t.type==="basket"?(m(),x("div",SR,[s.active?(m(),x("div",{key:1,class:"favorite-xs",onClick:e[1]||(e[1]=Vi((...c)=>r.toggle&&r.toggle(...c),["prevent"]))},[I(a,{class:"icon",color:"#AAAAAA",width:"17",height:"14"})])):(m(),x("div",{key:0,class:"favorite-xs",onClick:e[0]||(e[0]=Vi((...c)=>r.toggle&&r.toggle(...c),["prevent"]))},[I(o,{class:"icon",color:"#AAAAAA",width:"17",height:"14"})]))])):(m(),x("div",{key:1,class:"slider-icon slider-icons__favorite",onClick:e[2]||(e[2]=Vi((...c)=>r.toggle&&r.toggle(...c),["prevent"]))},[$e((m(),x("svg",{width:t.mini?12:16,height:t.mini?10:14,viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ER,8,CR)),[[Ye,!s.active]]),$e((m(),x("svg",AR,LR,512)),[[Ye,s.active]])]))}const IR=Ae(MR,[["render",RR],["__scopeId","data-v-074c3ec6"]]),PR="data:image/svg+xml,%3csvg%20width='23'%20height='20'%20viewBox='0%200%2023%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='13'%20cy='10'%20r='9.5'%20fill='white'%20stroke='%23408AF9'/%3e%3ccircle%20cx='10'%20cy='10'%20r='9.5'%20fill='white'%20stroke='%23408AF9'/%3e%3cpath%20d='M16.5254%2012.3297C16.8418%2012.3297%2017%2012.0898%2017%2011.77C17%2011.5301%2016.8418%2011.2902%2016.5254%2011.2902C16.0508%2011.2902%2015.6554%2011.3701%2015.2599%2011.5301C14.9435%2011.69%2014.7062%2011.9299%2014.4689%2012.1698C14.1525%2012.4897%2013.9943%2012.9695%2013.9153%2013.4493C13.5989%2013.2094%2013.2825%2012.9695%2012.887%2012.8095L14.2316%206.57214C14.2316%206.4122%2014.1525%206.1723%2013.9943%206.09234C13.8362%205.9324%2013.5989%206.01237%2013.4407%206.09234L10.2768%208.65127C10.1186%208.8112%209.88136%208.8112%209.72316%208.65127L6.55932%206.09234C6.40113%206.01237%206.16384%205.9324%206.00565%206.09234C5.84746%206.1723%205.76836%206.4122%205.76836%206.57214L7.11299%2012.8095C6.71751%2012.9695%206.40113%2013.2094%206.08475%2013.4493C6.00565%2012.9695%205.84746%2012.4897%205.53107%2012.1698C5.37288%2011.9299%205.0565%2011.69%204.74011%2011.5301C4.34463%2011.3701%203.94915%2011.2902%203.47458%2011.2902C3.15819%2011.2902%203%2011.5301%203%2011.77C3%2012.0898%203.15819%2012.3297%203.47458%2012.3297C4.10734%2012.3297%204.50282%2012.4897%204.81921%2012.8095C5.29379%2013.3693%205.0565%2014.4089%205.0565%2014.4089C5.0565%2014.6488%205.13559%2014.8087%205.29379%2014.9686C5.37288%2014.9686%205.45198%2014.9686%205.53107%2014.9686C5.68927%2014.9686%205.76836%2014.9686%205.92655%2014.8887C6.9548%2013.6892%208.45763%2013.1294%2010.0395%2013.1294C11.5424%2013.1294%2013.0452%2013.6892%2014.0734%2014.8087C14.2316%2014.9686%2014.3898%2015.0486%2014.548%2014.9686C14.7062%2014.9686%2014.8644%2014.8887%2014.9435%2014.6488C14.9435%2014.5688%2014.9435%2014.4888%2014.9435%2014.4089C14.9435%2014.3289%2014.7853%2013.3693%2015.1808%2012.8095C15.4972%2012.4897%2015.8927%2012.3297%2016.5254%2012.3297ZM10.0395%2012.0898C9.32768%2012.0898%208.61582%2012.2498%207.98305%2012.4097L7.0339%207.69167L9.16949%209.45093C9.40678%209.61087%209.72316%209.7708%2010.0395%209.7708C10.2768%209.7708%2010.5932%209.61087%2010.8305%209.45093L12.9661%207.69167L12.0169%2012.4097C11.3842%2012.2498%2010.6723%2012.0898%2010.0395%2012.0898Z'%20fill='%23408AF9'/%3e%3c/svg%3e",DR={mixins:[Yn,Du],components:{Slider:Fr,AdditionalServicesInfo:_a,Fav:Tn,FavMobile:IR,IconSaleBig:Kr,CTabs:pa,CTab:fa,Shield:Tt,Preloader:ga,Icon3dvr:es},props:["product"],data(){return{store:this.$store.state,selectedPicture:"",slides:[],miniatures2:[],price:{},initPopupSlider:!1,initReviewSlider:!1,pageReady:!1,scrollEventLock:!1,selectOpened:!1,object3dInitialized:!1,ifDetailSlider:!1,ifTraitsStart:!1,ifProductAdditional:!1,ifAccordions:!1,ifRecommendations:!0,showPriceSkeleton:!1,reviewsAreLoaded:!1,sliderKey:0,recLoad:!1,urlCopied:!1,sliderInit:!1,recom:[],operationsToShow:["TestRuchnoeSopostavlenie","PoxozhieTovaryzony","SEtimTovaromPokupayut"],source:!1}},computed:{...hi({warehouseData:"warehouse/getWarehouses"}),allowedAR(){var n,e,t,i,s,r,o,a;return(n=this.product.elarbis)!=null&&n.usdz&&this.$device.isIos?{device:"ios",src:(e=this.offers[this.product.currentOffer])!=null&&e.usdz.length?(t=this.offers[this.product.currentOffer])==null?void 0:t.usdz:(i=this.product.elarbis)==null?void 0:i.usdz}:(s=this.product.elarbis)!=null&&s.glb&&this.$device.isAndroid?{device:"android",src:(r=this.offers[this.product.currentOffer])!=null&&r.glb.length?(o=this.offers[this.product.currentOffer])==null?void 0:o.glb:(a=this.product.elarbis)==null?void 0:a.glb}:{device:!1}},breadcrumbs(){let n=[];return n.push({name:"Интернет-магазин мебели",type:"link",url:"/"}),this.product.sections.forEach(e=>{n.push({name:e.NAME,url:e.SECTION_PAGE_URL})}),n.push({name:this.product.name,url:(this._.provides[at]||this.$route).fullPath}),n[n.length-1].url=!1,n},phoneNumber(){var e;let n=(e=this.$store.getters.getRegionData)==null?void 0:e.PHONE_HEAD;return n?n.replace(/\D+/g,""):!1},curPage:ih,sliderObjects(){return this.miniatures.map(n=>{if(n.src)return{src:n.src,large:n.original,small:n.small}})},breadcrumb(){return this.product.sections[this.product.sections.length-1]},popDesc(){var n,e,t,i,s,r;return this.additional&&(e=(n=this.additional)==null?void 0:n.manufacturer)!=null&&e.description&&((i=(t=this.additional)==null?void 0:t.manufacturer)==null?void 0:i.description)!=""?(r=(s=this.additional)==null?void 0:s.manufacturer)==null?void 0:r.description:"Описание производителя отсутствует"},totalCount(){let n=0;return this.$store.getters["product/getComplects"].forEach(e=>{n+=e.CNT}),n},availCount(){return this.$store.getters["warehouse/getQuantities"]},askCount(){return this.$store.getters["questions/getQuestions"].length},reviewsCount(){let n=this.$store.getters["productReviews/getReviews"],e=0;return n.forEach(t=>{t.authorName!="Сборка мебели"&&e++}),e},isAllSelected(){return this.getComplects.filter(e=>e.CNT>0).length==this.getComplects.length},isAllUnSelected(){return!(this.getComplects.filter(e=>e.CNT>0).length>0)},filesFromReviews(){let n=this.$store.getters["productReviews/getReviews"],e=[];return n.forEach(t=>{t==null||t.files.forEach(i=>{e.push({src:i,reviewData:t})})}),e.length>0?e:!1},mobilePopupSlides(){var e,t,i,s,r;let n=[].concat(this.sliderObjects);return this.filesFromReviews&&(n=n.concat(this.filesFromReviews)),this.product.model3d&&n.push({type:"model3d",model3d:this.product.model3d,material:this.product.material??""}),(e=this.offers[this.product.currentOffer])!=null&&e.model360?n.push({src:this.offers[this.product.currentOffer].model360,type:"elarbis3d"}):(i=(t=this.product)==null?void 0:t.elarbis)!=null&&i.model360&&n.push({type:"elarbis3d",src:(r=(s=this.product)==null?void 0:s.elarbis)==null?void 0:r.model360}),n},isOpen3dHelp(){return this.$store.getters["lPop/getActiveWindow"]=="3d-info-help"},hostUrl(){return this.$store.state.domain},path(){var n,e,t;return((n=this._.provides[at]||this.$route)==null?void 0:n.path)+"?offer_id="+((t=(e=this._.provides[at]||this.$route)==null?void 0:e.query)==null?void 0:t.offer_id)}},methods:{async onInitialScroll(){const n=this;document.getElementsByClassName("slider-icons")[0]&&(this.isInViewport(document.getElementById("slider-icons"),0)?document.getElementsByClassName("slider-icons")[0].classList.remove("fixed-icons"):document.getElementsByClassName("slider-icons")[0].classList.add("fixed-icons")),(n.ifTraitsStart||n.$route.query.reviews==="show")&&!this.scrollEventLock&&(this.scrollEventLock=!0,setTimeout(()=>{this.ifProductAdditional=!0},20),setTimeout(async()=>{this.ifAccordions=!0,setTimeout(async()=>{n.getProductReviews()},0),setTimeout(async()=>{this.$store.dispatch("questions/getQuestions",{productId:this.product.id})},0),setTimeout(async()=>{this.product.isActive=="Y"&&!this.isComplect&&this.getWarehouses()},0),setTimeout(async()=>{this.getInstructions()},0),setTimeout(async()=>{await n.$store.dispatch("product/getAdditional",{id:n.product.id});let e=!1;e=n.$store.getters["product/getAdditional"],n.additional=e},0)},150))},openNewWindow(n){window.open(n,"_blank")},categorizationCurrent(n,e){var s,r;let t=this.$store.getters["product/getCategorization"],i=e;if(i||(i=(r=(s=this._.provides[at]||this.$route)==null?void 0:s.query)==null?void 0:r.offer_id),t[n]){for(let[o,a]of Object.entries(t[n]))if(o==i)return a}},categorizationCurrentStyle(n,e){let t=this.categorizationCurrent(n,e);return t&&t>0?"categorization"+t:""},saleCurrentOffer(n){var t,i,s;let e=n;return e||(e=(i=(t=this._.provides[at]||this.$route)==null?void 0:t.query)==null?void 0:i.offer_id),(s=this.offers[e])==null?void 0:s.sale},onBackButton(){const{history:n}=ua().options;n.state.back===null?this.$router.push(this.breadcrumbs[0].url):this.$router.back()},isInViewport(n,e=0,t=!1){const i=n.getBoundingClientRect();return t?i.bottom+e>0:i.top>=0&&i.left>=0&&i.bottom+e<=(window.innerHeight||document.documentElement.clientHeight)},CheckShowPriceSkeleton(){this.showPriceSkeleton=!0},reviewWord(n){return ci(n,["отзыв","отзыва","отзывов"])},openSharePopup(){navigator.share({title:`Купить ${this.product.name} в интернет-магазине Первый Гипермаркет Мебели`,text:`Купить ${this.product.name} в интернет-магазине Первый Гипермаркет Мебели`,url:this.curPage})},goToReviews(){let n=!1;document.querySelectorAll(".ctab__name").forEach((e,t)=>{e.outerText.includes("Отзывы")&&(n=t+1)}),n&&this.onInitialScroll().then(e=>{setTimeout(()=>{let t=document.querySelector(`.ctab__name:nth-child(${n})`);t&&(t.click(),t.scrollIntoView({behavior:"smooth",block:"start"}))},this.reviewsAreLoaded?0:500)})},clickOnImageInReview(n){let e=this.findFileFromReviews(n);this.$store.dispatch("lPop/openWindow","mobileSlider"),this.$nextTick(()=>{this.$refs.mobileSlider.slideTo(e)})},findFileFromReviews(n){return this.mobilePopupSlides.findIndex(e=>e.src==n)+1},open3dHelp(){this.$store.dispatch("lPop/openWindow","3d-info-help")},selectToggle(){this.selectOpened=!this.selectOpened},selectClose(){this.selectOpened=!1},onSlideClicked(n){this.getProductReviews(),this.initPopupSlider=!0,this.$store.dispatch("lPop/openWindow","mobileSlider"),this.$nextTick(()=>{this.$refs.mobileSlider.slideTo(n.id+1)})},onReviewSlideClicked(n){this.$store.dispatch("lPop/openWindow","reviewSlider"),this.$nextTick(()=>{this.$refs.reviewSlider.slideTo(n+1)})},onSelectAll(){this.getComplects.forEach((n,e)=>{n.CNT==0&&this.onCountChange(e,1)})},onUnSelectAll(){this.getComplects.forEach((n,e)=>{n.CNT>0&&this.onCountChange(e,0)})},open3DInfo(){this.$store.dispatch("lPop/openWindow","3d-info")},openWarehouses:function(){this.showWarehouses=!this.showWarehouses},async changeOffer(n){var e,t;await this.$store.dispatch("product/changeCurrentOffer",n),this.product.seoName=this.offers[n].seoName!==""?this.offers[n].seoName:"",this.showShieldSale(),this.showShieldBestPrice(),Object.keys(this.offers).length>0&&((e=this.offers[n])!=null&&e.image&&((t=this.sliderObjects[0])==null?void 0:t.type)!=="youtube"&&(this.sliderObjects[0]!==null&&this.sliderObjects[0].src!==""&&(this.sliderObjects[0].src=this.offers[n].image),setTimeout(()=>{this.$refs["detail-slider"].$refs.slider.$data.swiperRef.slideTo(this.$store.getters["gallery/getImagesBefore"].length)}),this.sliderKey++),this.price=this.offers[n].price,this.selectedPicture=this.offers[n].image,this.setMiniatures(),this.isComplect&&this.$store.dispatch("product/getComplects",n),await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml,operationsToShow:this.operationsToShow}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"])},onCountChange(n,e){this.$store.dispatch("product/changeCountComplect",{key:n,count:e})},async getWarehouses(){this.product.isForbidden||await this.$store.dispatch("warehouse/getWarehouses",{productId:this.product.id,section:(this._.provides[at]||this.$route).params.section})},async getProductReviews(){this.reviewsAreLoaded||(await this.$store.dispatch("productReviews/getProductReviews",{id:this.product.id}),this.openNewReviewWindow(),this.reviewsAreLoaded=!0)},afterTraitsMounted(){setTimeout(()=>{this.ifDetailSlider=!0},150)},copy:sh,show3d(){this.$store.dispatch("lPop/openWindow","popup3d"),this.product.model3d.length&&!this.object3dInitialized&&(setTimeout(n=>{this.$refs.model3d.init()},1e3),this.object3dInitialized=!0)},arProcess(){if(this.allowedAR.device==="ios")this.launchIOSQuickLookAR(this.allowedAR.src);else if(this.allowedAR.device==="android"){let n=window.location.origin+window.location.pathname+window.location.search+"%23openModel3d",e="intent://arvr.google.com/scene-viewer/1.0?file="+this.allowedAR.src+"#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url="+n+";end";this.launchIOSQuickLookAR(e)}},launchIOSQuickLookAR(n){const e=document.createElement("a");return e.setAttribute("rel","ar"),e.appendChild(document.createElement("img")),e.setAttribute("href",n),e.click(),""},onScroll(n){if(n.type==="scroll"){let e=n.target.querySelector(".Recommend");if(e!==null){let{top:t,bottom:i}=e.getBoundingClientRect(),s=n.target.documentElement.clientHeight;t-360<s&&t>0&&(this.recLoad||(this.recLoad=!0,setTimeout(async()=>{await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml,operationsToShow:this.operationsToShow}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"]},50)))}}},urlCopy(){this.copy(),this.urlCopied=!0,setTimeout(()=>{this.urlCopied=!1},3e3)}},created(){this.price=this.product.price;let n={type:"getProducts",products:[this.product.id],offers:[]};this.$store.dispatch("product/getCategorization",n),this.setMiniatures()},mounted(){if(window.addEventListener("scroll",this.onScroll),!this.showHiddenBlocks){const e=this;document.getElementById("product-name").addEventListener("touchend",this.showFindCheaperOnSelect),document.getElementById("product-name").addEventListener("contextmenu",function(){setTimeout(e.showFindCheaperOnSelect,1)})}window.onpopstate=function(){this.$nuxt.$loading.start(),setTimeout(()=>this.$nuxt.$loading.finish(),3500)};let n=this;this.CheckShowPriceSkeleton(),setTimeout(async()=>{n.isComplect&&await n.$store.dispatch("product/getComplects",n.product.currentOffer)},0),n.$route.query.reviews==="show"?n.onInitialScroll():window.addEventListener("scroll",e=>{n.onInitialScroll()}),setTimeout(()=>{(async function(){var i,s,r,o,a;let e=!1;await n.$store.dispatch("product/getOffers",{id:n.product.id}),e=n.$store.getters["product/getOffers"],n.offers=e;let t=!1;if((s=(i=n.$route)==null?void 0:i.query)!=null&&s.offer_id){let c=parseInt(n.$route.query.offer_id),l=!1,u=!1;Object.keys(e).forEach(h=>{h==c&&(l=!0),h==u&&(l=!0)}),l?t=c:n.product.currentOffer=t=Object.keys(e)[0]}else t=parseInt(n.product.currentOffer);if(n.product.isConstructor&&(n.projectSample=(r=n.offers[t])==null?void 0:r.sampleProdboard,n.projectSample)){let c="#project-sample-"+n.projectSample;(!n.$route.hash||n.$route.hash==""||!((a=(o=n.$route)==null?void 0:o.query)!=null&&a.offer_id))&&await n.$router.replace({query:n.$route.query,hash:c})}setTimeout(()=>{n.ifTraitsStart=!0},20)})()},100),this.$device.isCrawler||setTimeout(async()=>{await this.$store.dispatch("sliders/getRekSliderM",{id:this.product.id,guid:this.product.guid,offer:this.product.currentOffer,avalability:this.product.avalability,offerGuid:this.product.offerXml}),this.rekMindbox=this.$store.getters["sliders/getRekSliderM"]},0),this.slides.push(this.selectedPicture),window.scrollTo(0,0),this.ifDetailSlider=!0}},Ue=n=>(Ze("data-v-605b9ea2"),n=n(),Je(),n),NR={class:"detail-product"},OR={key:0,class:"сrawler-breadcrumbs"},FR={class:"head-line"},BR={class:"product-code"},$R={class:"stars-block"},zR={class:"stars"},HR={class:"rating-value"},UR={class:"rating"},VR={class:"stars-block"},GR={class:"stars"},WR=Ue(()=>d("div",{class:"rating rating_gray"},"Оставить отзыв",-1)),qR={class:"detail-slider"},jR=Ue(()=>d("div",{id:"slider-icons"},null,-1)),XR=["src"],YR={class:"slider-icons"},ZR=Ue(()=>d("svg",{width:"17",height:"14",viewBox:"0 0 17 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M16.1 6.30017H2.13535L7.48265 1.20697C7.76265 0.940271 7.7735 0.497171 7.5068 0.217171C7.24045 -0.0624793 6.79735 -0.0736794 6.517 0.193021L0.4102 6.01002C0.14595 6.27462 0 6.62602 0 7.00017C0 7.37397 0.14595 7.72572 0.42245 8.00187L6.51735 13.807C6.6528 13.9361 6.8264 14.0002 7 14.0002C7.1848 14.0002 7.3696 13.9274 7.50715 13.7828C7.77385 13.5028 7.763 13.0601 7.483 12.7934L2.1133 7.70017H16.1C16.4864 7.70017 16.8 7.38657 16.8 7.00017C16.8 6.61377 16.4864 6.30017 16.1 6.30017Z",fill:"black"})],-1)),JR=[ZR],QR={class:"d-flex"},KR={class:"icon"},eI={class:"icon"},tI=Ue(()=>d("svg",{width:"13",height:"14",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M15 2.76864C15 3.30966 14.8413 3.83885 14.5435 4.29084C14.2457 4.74283 13.8217 5.09783 13.3241 5.31199C12.8264 5.52615 12.2768 5.59009 11.7432 5.49592C11.2095 5.40175 10.7152 5.15358 10.3212 4.78208L5.44821 7.26119C5.58204 7.74446 5.58204 8.25492 5.44821 8.73819L10.3212 11.2173C10.7935 10.772 11.4073 10.5062 12.0558 10.4665C12.7042 10.4267 13.346 10.6153 13.8694 10.9996C14.3927 11.3838 14.7644 11.9392 14.9196 12.569C15.0748 13.1988 15.0037 13.863 14.7186 14.4458C14.4336 15.0285 13.9527 15.493 13.3598 15.7581C12.7669 16.0232 12.0996 16.0721 11.4743 15.8964C10.849 15.7207 10.3052 15.3314 9.93793 14.7965C9.57062 14.2615 9.40301 13.6149 9.46434 12.9692L4.27594 10.328C3.85695 10.5974 3.37301 10.7491 2.87498 10.7672C2.37695 10.7853 1.88323 10.6692 1.44571 10.4309C1.0082 10.1927 0.643055 9.84121 0.388655 9.41339C0.134256 8.98556 0 8.49722 0 7.99969C0 7.50216 0.134256 7.01382 0.388655 6.58599C0.643055 6.15817 1.0082 5.80667 1.44571 5.56843C1.88323 5.3302 2.37695 5.21403 2.87498 5.23214C3.37301 5.25026 3.85695 5.40198 4.27594 5.67136L9.46434 3.03019C9.429 2.65721 9.46983 2.28096 9.58435 1.92419C9.69888 1.56742 9.88473 1.23756 10.1306 0.954575C10.3766 0.671587 10.6774 0.441353 11.0151 0.277808C11.3527 0.114263 11.72 0.0208074 12.0949 0.00309649C12.4697 -0.0146145 12.8443 0.0437878 13.1958 0.174769C13.5474 0.30575 13.8687 0.506586 14.1403 0.765123C14.4119 1.02366 14.6281 1.33452 14.7759 1.6789C14.9237 2.02327 14.9999 2.394 15 2.76864Z",fill:"black"})],-1)),nI=[tI],iI={class:"slider-icon"},sI={class:"padd-x"},rI={class:"title-name"},oI={key:0,class:"categorization"},aI=["innerHTML"],lI={key:0,src:Fu},cI={key:1,src:PR},dI=Ue(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),uI=Ue(()=>d("rect",{x:"0",y:"20",rx:"3",ry:"3",width:"38",height:"38"},null,-1)),hI=Ue(()=>d("rect",{x:"48",y:"20",rx:"3",ry:"3",width:"38",height:"38"},null,-1)),fI=Ue(()=>d("rect",{x:"96",y:"20",rx:"3",ry:"3",width:"38",height:"38"},null,-1)),pI=Ue(()=>d("rect",{x:"0",y:"78",rx:"3",ry:"3",width:"90",height:"10"},null,-1)),mI=Ue(()=>d("rect",{x:"0",y:"108",rx:"3",ry:"3",width:"38",height:"38"},null,-1)),gI=Ue(()=>d("rect",{x:"48",y:"108",rx:"3",ry:"3",width:"38",height:"38"},null,-1)),_I=Ue(()=>d("rect",{x:"0",y:"166",rx:"3",ry:"3",width:"70",height:"10"},null,-1)),vI=Ue(()=>d("rect",{x:"0",y:"186",rx:"3",ry:"3",width:"237",height:"49"},null,-1)),yI={key:1,class:"macLoad"},xI=Ue(()=>d("div",{class:"line"},null,-1)),wI={class:"cubs"},bI=Ue(()=>d("div",{class:"line"},null,-1)),MI={class:"cubs"},SI=Ue(()=>d("div",{class:"line"},null,-1)),CI=Ue(()=>d("div",{class:"line"},null,-1)),TI={key:1,class:"padd-x"};const EI={key:2,class:"choose off-sale-product"},AI={class:"off-sale"},kI=Ue(()=>d("img",{height:"42",width:"42",src:mi,alt:""},null,-1)),LI=Ue(()=>d("div",null,"Товар закончился",-1)),RI={key:3,class:"choose off-sale-product"},II={class:"off-sale"},PI=Ue(()=>d("img",{height:"42",width:"42",src:mi,alt:""},null,-1)),DI=Ue(()=>d("div",null,"Товар закончился",-1)),NI={key:0},OI={key:0,class:"product-warehouse-info"},FI={key:1,class:"product-warehouse-info"},BI=Ue(()=>d("rect",{x:"0",y:"0",rx:"3",ry:"3",width:"24",height:"24"},null,-1)),$I=Ue(()=>d("rect",{x:"36",y:"0",rx:"3",ry:"3",width:"80",height:"8"},null,-1)),zI=Ue(()=>d("rect",{x:"36",y:"15",rx:"3",ry:"3",width:"120",height:"8"},null,-1)),HI={class:"load"},UI=Ue(()=>d("div",{class:"name"},null,-1)),VI=Ue(()=>d("div",{class:"left"},[d("div",{class:"line"}),d("div",{class:"line"})],-1)),GI=Ue(()=>d("div",{class:"right"},null,-1)),WI=[VI,GI],qI=Ue(()=>d("div",{class:"photos-title"},"Фото и видео покупателей",-1)),jI={class:"photos-list-scroll"},XI={class:"photos-list"},YI=["onClick"],ZI={style:{height:"inherit"}},JI={key:7,class:"additional-block"},QI={class:"choose additional-choose",style:{"margin-top":"20px","margin-bottom":"20px"}},KI=Ue(()=>d("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"287",height:"48"},null,-1)),eP={class:"constructor3d__how"},tP=Ue(()=>d("div",{class:"constructor3d__icon"},[d("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("circle",{cx:"12",cy:"12",r:"8",fill:"black"}),d("path",{d:"M12 0C5.37259 0 0 5.37259 0 12C0 18.6274 5.37259 24 12 24C18.6274 24 24 18.6274 24 12C23.993 5.37555 18.6245 0.00708148 12 0ZM17.0537 12.3823C16.9706 12.549 16.8355 12.6841 16.6689 12.7672V12.7714L9.81172 16.2C9.38824 16.4116 8.87345 16.2399 8.66181 15.8164C8.60164 15.696 8.57065 15.5631 8.57141 15.4286V8.57146C8.57121 8.09805 8.95476 7.71415 9.42817 7.71389C9.56131 7.71384 9.69264 7.74478 9.81172 7.8043L16.6689 11.2329C17.0925 11.444 17.2649 11.9587 17.0537 12.3823Z",fill:"#FFDA56"})])],-1)),nP=["innerHTML"],iP={class:"features"},sP={class:"properties"},rP=Ue(()=>d("div",{class:"property__name"},"Производитель",-1)),oP={class:"property__value"},aP={key:1,class:"vendor"},lP={key:0,class:"property"},cP={class:"property__name"},dP={class:"property__value"},uP={key:0,class:"youtube_container"},hP=["src","title"],fP=["innerHTML"],pP={class:"show-features hidden"},mP={class:"instructions"},gP={class:"instruction__flex"},_P={class:"instruction__icon"},vP={key:0,src:Nu,alt:""},yP={key:1,src:Ou,alt:""},xP=["innerHTML"],wP={class:"instruction__flex"},bP=["innerHTML"],MP={class:"instruction__download"},SP=["href"],CP=Ue(()=>d("span",{class:"instruction__download-icon"},null,-1)),TP=[CP],EP={ref:"modules"},AP={key:10,class:"buy-bottom"},kP={key:11,class:"buy-bottom"},LP={class:"mt-60"},RP=Ue(()=>d("div",{class:"info-block"},[d("p",null,[Q(" Описание носит информационный характер, детали вы можете уточнить у наших менеджеров по многоканальному бесплатному номеру телефона "),d("a",{href:"tel:+73512003372"},"+7 (351) 200-33-72"),Q(" с 09:00 до 23:00 ежедневно. ")])],-1)),IP={class:"mobile-slider"},PP={key:0,class:"vendor-image"},DP=["src"],NP={key:2,class:"add-pop"},OP=Ue(()=>d("rect",{x:"0",y:"0",width:"300",height:"20"},null,-1)),FP=Ue(()=>d("rect",{x:"0",y:"40",width:"250",height:"20"},null,-1)),BP=Ue(()=>d("rect",{x:"0",y:"80",width:"150",height:"20"},null,-1)),$P={class:"info-3d"},zP=Ue(()=>d("div",{class:"title"},"Собрать в 3D конструкторе",-1)),HP=Ue(()=>d("p",null," Для работы в 3D-конструкторе воспользуйтесь ноутбуком или стационарным компьютером ",-1)),UP={class:"info-3d__copied"},VP={key:0,class:"add-pop"},GP={class:"deliveryName"},WP=["innerHTML"],qP=Ue(()=>d("span",null,null,-1)),jP={key:1,class:"add-pop"},XP=Ue(()=>d("rect",{x:"0",y:"0",width:"300",height:"20"},null,-1)),YP=Ue(()=>d("rect",{x:"0",y:"40",width:"250",height:"20"},null,-1)),ZP=Ue(()=>d("rect",{x:"0",y:"80",width:"150",height:"20"},null,-1)),JP={key:0,class:"elarbis-3d"},QP=["src"],KP={key:1,class:"object-3d"};function e9(n,e,t,i,s,r){var Ie,Se;const o=cn,a=An,c=j7,l=es,u=Tn,h=Tt,f=ht,p=Jc,g=Lt,_=_u,w=tt,v=vu,y=yu,C=Fs,S=xu,T=_a,P=fa,b=$t,z=du,oe=uu,X=hu,D=pa,ge=fu,G=Cu,V=Tu,Y=ku,W=Fr,Z=jc,fe=ed,_e=Wt,ne=Lu,ie=td,xe=nd,ve=bR,Ce=Ns,Ne=Gs,le=Pu,Be=ha("preloader");return m(),x("div",NR,[n.$device.isCrawler||n.$device.isGoogleBot?(m(),x("div",OR,[(m(!0),x(U,null,te(r.breadcrumbs,(q,ke)=>(m(),x("div",{key:ke},[q.url?(m(),N(o,{key:0,to:r.hostUrl+q.url},{default:O(()=>[Q(B(q.name),1)]),_:2},1032,["to"])):(m(),N(o,{key:1,to:r.hostUrl+r.path},{default:O(()=>[Q(B(q.name),1)]),_:2},1032,["to"]))]))),128))])):M("",!0),d("div",FR,[d("div",BR,"Код: "+B(t.product.artNumberShort),1),t.product.rating?(m(),x("div",{key:0,class:"rating-group",onClick:e[0]||(e[0]=(...q)=>r.goToReviews&&r.goToReviews(...q))},[d("div",$R,[d("div",zR,[(m(),x(U,null,te(5,q=>I(a,{class:"star",height:"12",width:"12",color:q<=t.product.rating.score.toFixed()?"#FFC633":"#AAAAAA",key:q},null,8,["color"])),64))]),d("div",HR,B(t.product.rating.score.toFixed(1)),1)]),d("div",UR,B(t.product.rating.count)+" "+B(r.reviewWord(t.product.rating.count)),1)])):M("",!0),t.product.rating?M("",!0):(m(),x("div",{key:1,class:"rating-group",onClick:e[1]||(e[1]=(...q)=>r.goToReviews&&r.goToReviews(...q))},[d("div",VR,[d("div",GR,[(m(),x(U,null,te(5,q=>I(a,{class:"star",height:"12",width:"12",color:"#FFC633",key:q})),64))])]),WR]))]),$e((m(),x("div",qR,[jR,s.ifDetailSlider&&!n.$device.isCrawler?(m(),N(c,{ref:"detail-slider",onOnSliderInit:e[2]||(e[2]=q=>s.sliderInit=!0),slides:r.sliderObjects,product:t.product,onOnSlideClicked:r.onSlideClicked,key:s.sliderKey},null,8,["slides","product","onOnSlideClicked"])):n.$device.isCrawler&&n.selectedObject.src?(m(),x("img",{key:1,src:n.selectedObject.src,alt:""},null,8,XR)):M("",!0),d("div",YR,[d("div",null,[d("div",{class:"slider-icon",onClick:e[3]||(e[3]=(...q)=>r.onBackButton&&r.onBackButton(...q))},JR)]),d("div",QR,[r.allowedAR.device?(m(),x("div",{key:0,class:"ar-button yellow",onClick:e[4]||(e[4]=(...q)=>r.arProcess&&r.arProcess(...q))},[d("div",KR,[I(l)])])):t.product.elarbis.model360.length||t.product.model3d.length?(m(),x("div",{key:1,class:"ar-button yellow",onClick:e[5]||(e[5]=(...q)=>r.show3d&&r.show3d(...q))},[d("div",eI,[I(l)])])):M("",!0),d("div",{class:"slider-icon slider-icons__share",onClick:e[6]||(e[6]=(...q)=>r.openSharePopup&&r.openSharePopup(...q))},nI),d("div",iI,[I(u,{offerId:t.product.currentOffer,added:n.isFavorite,product:t.product,padding:"3"},null,8,["offerId","added","product"])])])])])),[[Be,!n.isLoaded]]),d("div",sI,[!t.product.isForbidden&&t.product.isActive=="Y"&&n.currentOffersIcons?(m(),x("div",{key:0,class:Ee(["shields",{sale:t.product.isSale}])},[(m(!0),x(U,null,te(n.currentOffersIcons.filter(q=>q.text!=="3D конструктор"&&q.text!=="Распродажа"),(q,ke)=>(m(),N(h,{key:ke,bgColor:q.backgroundColor,color:q.textColor,icon:q.icon,gradient:q.lineaGradient,code:q.code},{default:O(()=>[Q(B(q.text),1)]),_:2},1032,["bgColor","color","icon","gradient","code"]))),128)),r.saleCurrentOffer(t.product.currentOffer)?(m(!0),x(U,{key:0},te(n.currentOffersIcons.filter(q=>q.text!=="3D конструктор"&&q.text==="Распродажа"),(q,ke)=>(m(),N(h,{key:ke,bgColor:q.backgroundColor,color:q.textColor,icon:q.icon,gradient:q.lineaGradient,code:q.code},{default:O(()=>[Q(B(q.text),1)]),_:2},1032,["bgColor","color","icon","gradient","code"]))),128)):M("",!0)],2)):M("",!0),d("div",rI,[n.showHiddenBlocks?(m(),x("div",oI,[d("span",{class:Ee(r.categorizationCurrentStyle(t.product.id,t.product.currentOffer))},null,2)])):M("",!0),d("h1",{class:"title",id:"product-name",innerHTML:n.productName},null,8,aI)]),!n.isComplect&&!n.dokaData.isMainDoka?(m(),N(f,{key:1,class:"price-margin",priceNew:s.price.new,priceOld:s.price.new!=s.price.old?s.price.old:!1,isHit:t.product.isHit},null,8,["priceNew","priceOld","isHit"])):n.isComplect?(m(),N(f,{key:2,class:"price-margin",priceNew:n.totalPriceNew,priceOld:n.totalPriceOld!==n.totalPriceNew?n.totalPriceOld:!1,isHit:!1},null,8,["priceNew","priceOld"])):n.dokaData.isMainDoka?(m(),N(f,{key:3,priceNew:n.dokaData.price,priceOld:!1,isHit:t.product.isHit},null,8,["priceNew","isHit"])):M("",!0),I(p,{product:t.product,price:n.isComplect?n.totalPriceNew:s.price.new,isCategorization:r.categorizationCurrent(t.product.id,t.product.currentOffer)},null,8,["product","price","isCategorization"]),n.bonusesText>0?(m(),x("div",{key:4,class:Ee(["bonuses",{red:((Ie=n.offers[t.product.currentOffer])==null?void 0:Ie.increasedBonusPercent)>0}])},[((Se=n.offers[t.product.currentOffer])==null?void 0:Se.increasedBonusPercent)>0?(m(),x("img",lI)):(m(),x("img",cI)),Q(" +"+B(n.bonusesText)+" бонусов за покупку ",1)],2)):M("",!0)]),d("div",{class:Ee(t.product.isActive=="Y"?"detail-traits":"detail-traits2")},[!s.ifTraitsStart&&!n.$device.isSafari?(m(),N(g,{key:0,class:"traits-skeleton",width:"237",height:"235"},{default:O(()=>[dI,uI,hI,fI,pI,mI,gI,_I,vI]),_:1})):M("",!0),!s.ifTraitsStart&&n.$device.isSafari?(m(),x("div",yI,[xI,d("div",wI,[(m(),x(U,null,te(3,(q,ke)=>d("div",{class:"cube",key:ke})),64))]),bI,d("div",MI,[(m(),x(U,null,te(2,(q,ke)=>d("div",{class:"cube",key:ke})),64))]),SI,CI])):M("",!0),s.ifTraitsStart?(m(),N(_,{key:2,onChange:r.changeOffer,"onHook:mounted":r.afterTraitsMounted,class:"traits-margin"},null,8,["onChange","onHook:mounted"])):M("",!0)],2),!t.product.isForbidden&&t.product.isActive=="Y"?(m(),x("div",TI,[M("",!0),n.showFindCheaper&&!n.dokaData.isMainDoka?(m(),N(w,{key:1,theme:"blue",class:"find-cheap-btn",align:"center",onClick:e[7]||(e[7]=q=>n.openCheaper(!1))},{default:O(()=>[Q("Нашли дешевле? Сделаем скидку!")]),_:1})):M("",!0),M("",!0),(t.product.isConstructor,M("",!0)),!n.dokaData.isMainDoka&&n.dokaData.coef?(m(),N(w,{key:4,theme:"brown",class:"btn-m-top",align:"center",onClick:n.showDokaConstructor},{default:O(()=>[Q(B(n.dokaData.price?"Изменить собранный шкаф":"Собрать в конструкторе"),1)]),_:1},8,["onClick"])):M("",!0),(t.product.isConstructor,M("",!0))])):t.product.isActive=="N"?(m(),x("div",EI,[d("div",AI,[kI,LI,I(v,{class:"w-100 mt-20"})])])):t.product.isForbidden?(m(),x("div",RI,[d("div",II,[PI,DI,I(v,{class:"w-100 mt-20"})])])):M("",!0),!t.product.isForbidden||t.product.isActive=="Y"?(m(),x(U,{key:4},[!(n.hasPartner||n.franchise||n.regionTk)&&!n.isComplect?(m(),x("div",NI,[n.isAvailLoaded?(m(),x("div",OI,[I(y,{"warehouse-data":n.warehouseDataShow},null,8,["warehouse-data"])])):(m(),x("div",FI,[n.$device.isSafari?M("",!0):(m(),x("div",{key:0,style:{display:"flex","flex-wrap":"wrap"},class:Ee(["summary",{mobile:n.$device.isMobile}])},[(m(),x(U,null,te(3,(q,ke)=>I(g,{key:ke,width:"175",height:"24",style:{"margin-bottom":"15px",width:"50%"}},{default:O(()=>[BI,$I,zI]),_:2},1024)),64))],2)),d("div",{class:Ee(["summary",{mobile:n.$device.isMobile}])},[d("div",HI,[UI,(m(),x(U,null,te(2,(q,ke)=>d("div",{key:ke,class:"warehouseMacload"},WI)),64))])],2)]))])):M("",!0)],64)):M("",!0),r.filesFromReviews?(m(),x("div",{key:5,class:Ee(["photos",{transition:r.filesFromReviews}])},[qI,d("div",jI,[d("div",XI,[(m(!0),x(U,null,te(r.filesFromReviews,(q,ke)=>(m(),x(U,{key:ke},[q.src?(m(),x("div",{key:0,class:"photo",onClick:K=>r.clickOnImageInReview(q.src)},[d("div",ZI,[$e((m(),N(C,{src:q.src.miniature,key:ke,alt:t.product.name},null,8,["src","alt"])),[[Ye,n.visible]])])],8,YI)):M("",!0)],64))),128))])])],2)):M("",!0),!t.product.isForbidden||t.product.isActive=="Y"?(m(),N(S,{key:6,isHit:t.product.isHit,isSale:t.product.isSale,productId:t.product.id},null,8,["isHit","isSale","productId"])):M("",!0),t.product.isConstructor&&t.product.isActive!=="N"||t.product.isConstructor&&!t.product.isForbidden?(m(),x("div",JI,[d("div",QI,[n.getComplects.length?(m(),x("div",{key:0,class:"constructor3d__button additional-choose__button",onClick:e[9]||(e[9]=Vi(q=>n.$store.dispatch("lPop/openWindow","3d-info"),["prevent"]))},"Собрать в 3D конструкторе")):(m(),N(g,{key:1,width:"287",height:"48"},{default:O(()=>[KI]),_:1})),d("div",eP,[tP,d("div",{class:"constructor3d__text",onClick:e[10]||(e[10]=q=>n.$store.dispatch("lPop/openWindow","howTo3d"))},"Как работает 3D конструктор")])])])):M("",!0),I(T,{onDelivery:n.delivery},null,8,["onDelivery"]),s.ifAccordions?(m(),N(D,{key:8,class:"margin-top"},{default:O(()=>[t.product.richContent?(m(),N(P,{key:0,name:"Описание",selected:t.product.richContent!==!1},{default:O(()=>[d("div",{class:"description",innerHTML:t.product.richContent.TEXT},null,8,nP)]),_:1},8,["selected"])):M("",!0),I(P,{name:"Характеристики",selected:!t.product.richContent},{default:O(()=>[d("div",iP,[d("div",sP,[n.showManufacturer&&t.product.proizvoditel&&n.showHiddenBlocks?(m(),x("div",{key:0,class:Ee(["property",{highlighted:n.showForStaff}])},[rP,d("div",oP,[n.additional&&n.additional.manufacturer.description!=""?(m(),x("div",{key:0,class:"vendor url-active",onClick:e[11]||(e[11]=(...q)=>n.showVendor&&n.showVendor(...q))},B(t.product.proizvoditel.VALUE_ENUM),1)):(m(),x("div",aP,B(t.product.proizvoditel.VALUE_ENUM),1))])],2)):M("",!0),(m(!0),x(U,null,te(t.product.properties,(q,ke)=>(m(),x(U,{key:ke},[q.code!=="RICH_CONTENT"&&n.prepareProp(q.value)!==""?(m(),x("div",lP,[d("div",cP,B(q.name),1),d("div",dP,B(n.prepareProp(q.value)),1)])):M("",!0)],64))),128))]),t.product.youtube?(m(),x("div",uP,[(m(!0),x(U,null,te(n.extractVideoIDs(t.product.youtube),q=>(m(),x("iframe",{width:"100%",height:"450",src:`https://www.youtube.com/embed/${q}`,title:t.product.name,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:""},null,8,hP))),256))])):M("",!0),d("div",{class:"description",innerHTML:t.product.youtube.length>0?n.removeYouTubeIframes(t.product.description):t.product.description},null,8,fP)]),d("div",pP,[Q(" Смотреть "),I(b,{height:"6",width:"10",iconColor:"#5073A8"})])]),_:1},8,["selected"]),t.product.isActive=="Y"&&!n.isComplect&&!t.product.isForbidden?(m(),N(P,{key:1,name:"Наличие",count:r.availCount},{default:O(()=>[I(z,{productId:t.product.id,offers:n.offers,productIcons:t.product.icons},null,8,["productId","offers","productIcons"])]),_:1},8,["count"])):M("",!0),I(P,{name:"Вопросы",count:r.askCount},{default:O(()=>[I(oe,{productId:t.product.id},null,8,["productId"])]),_:1},8,["count"]),I(P,{name:"Отзывы",count:r.reviewsCount},{default:O(()=>[I(X,{productId:t.product.id,onClickOnImageInReview:r.clickOnImageInReview},null,8,["productId","onClickOnImageInReview"])]),_:1},8,["count"]),n.instructions.length>0?(m(),N(P,{key:2,name:"Инструкция по сборке"},{default:O(()=>[d("div",mP,[(m(!0),x(U,null,te(n.instructions,(q,ke)=>(m(),x("div",{class:"instruction",key:ke},[d("div",gP,[d("div",_P,[q.FORMAT==="pdf"?(m(),x("img",vP)):M("",!0),q.FORMAT==="doc"?(m(),x("img",yP)):M("",!0)]),d("div",{class:"instruction__name",innerHTML:q.NAME},null,8,xP)]),d("div",wP,[d("div",{class:"instruction__size",innerHTML:q.SIZE},null,8,bP),d("div",MP,[d("a",{href:q.SRC,target:"_blank"},TP,8,SP)])])]))),128))])]),_:1})):M("",!0)]),_:1})):M("",!0),I(ge),d("span",EP,null,512),n.isComplect?(m(),N(G,{key:9,addToBasket:n.addToBasketStarted,products:n.getComplects,onAddComplectToBasket:n.addToBasket},null,8,["addToBasket","products","onAddComplectToBasket"])):M("",!0),!n.isComplect&&!n.dokaData.isMainDoka&&t.product.isActive!=="N"&&!t.product.isForbidden?(m(),x("div",AP,[I(w,{icon:"basket",theme:"yellow",class:"justify-center w-full buy-bottom_mod",align:"center",loading:n.addToBasketStarted,onClick:n.addToBasket},{default:O(()=>[Q("Добавить в корзину")]),_:1},8,["loading","onClick"])])):M("",!0),n.dokaData.isMainDoka&&n.dokaData.coef?(m(),x("div",kP,[I(w,{theme:"yellow",align:"center",class:"justify-center w-full buy-bottom_mod",onClick:n.showDokaConstructor},{default:O(()=>[Q(B(n.dokaData.price?"Изменить собранный шкаф":"Конструктор шкафов"),1)]),_:1},8,["onClick"])])):M("",!0),t.product.isIncludeComplect?(m(),N(V,{key:12,product:t.product.id,region:n.regionId},null,8,["product","region"])):M("",!0),t.product.isModule?(m(),N(Y,{key:13,offer:t.product.currentOffer,region:n.regionId},null,8,["offer","region"])):M("",!0),d("div",LP,[(m(!0),x(U,null,te(n.rekMindbox,q=>(m(),N(W,{slidesPerView:1.6,title:q.NAME,type:"recommendations",height:"auto",quantity:"8",key:q.NAME,recommendations:q,availability:t.product.avalability},null,8,["title","recommendations","availability"]))),128))]),RP,I(Z),s.ifTraitsStart?(m(),N(_e,{key:14,popId:"cheaper",popName:"Есть сомнения?"},{default:O(()=>[I(fe)]),_:1})):M("",!0),I(_e,{popId:"howTo3d",size:"middle","padding-less":"true"},{default:O(()=>[I(ne)]),_:1}),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(_e,{key:15,popId:"findCheaperRules",popName:"Правила участия в программе",size:"middle"},{default:O(()=>[I(ie)]),_:1})):M("",!0),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(_e,{key:16,popId:"findCheaperTerms",popName:"Условия участия в программе",size:"middle"},{default:O(()=>[I(xe)]),_:1})):M("",!0),I(Ce,null,{default:O(()=>[I(_e,{popId:"mobileSlider",popName:"Фотографии товара",withoutShadow:"true"},{default:O(()=>[d("div",IP,[I(ve,{slides:r.mobilePopupSlides,sliderId:"mobileSlider",ref:"mobileSlider"},null,8,["slides"])])]),_:1})]),_:1}),s.ifProductAdditional?(m(),N(_e,{key:17,popId:"manufacturerPopup",popName:n.popName},{default:O(()=>[n.additional&&n.additional.manufacturer.image?(m(),x("div",PP,[d("div",{onClick:e[12]||(e[12]=q=>r.openNewWindow(n.popUrl))},[d("img",{src:n.additional.manufacturer.image},null,8,DP)])])):M("",!0),n.additional?(m(),x("div",{key:1,class:Ee(["vandor-desc",{mobile:n.$device.isMobile}])},B(r.popDesc),3)):M("",!0),n.additional?M("",!0):(m(),x("div",NP,[I(g,{width:"300",height:"338"},{default:O(()=>[OP,FP,BP]),_:1})]))]),_:1},8,["popName"])):M("",!0),s.ifProductAdditional?(m(),N(_e,{key:18,popId:"3d-info",popName:""},{default:O(()=>[d("div",$P,[zP,HP,d("p",null,[d("b",null,[Q("Отправьте ссылку товара на ПК любым удобным вам способом "),d("span",{class:"info-3d__copy",onClick:e[13]||(e[13]=(...q)=>r.urlCopy&&r.urlCopy(...q))},"Копировать")])]),I(w,{theme:"yellow",class:"come-back",radius:"30px",onClick:r.openSharePopup},{default:O(()=>[Q("Поделиться")]),_:1},8,["onClick"]),$e(d("div",UP,"Ссылка скопирована!",512),[[Ye,s.urlCopied]])])]),_:1})):M("",!0),s.ifProductAdditional?(m(),N(_e,{key:19,popId:"deliveryPopup",popName:"Доставка и сборка"},{default:O(()=>[Object.keys(n.deliveryInfo).length>0?(m(),x("div",VP,[(m(!0),x(U,null,te(n.deliveryInfo,(q,ke)=>(m(),x("div",{class:"deliveryInfo",key:ke},[d("div",GP,B(q.type),1),d("div",{class:"deliveryDescription",innerHTML:q.description},null,8,WP),qP]))),128))])):(m(),x("div",jP,[d("div",null,[I(g,{width:"300",height:"338"},{default:O(()=>[XP,YP,ZP]),_:1})])]))]),_:1})):M("",!0),t.product.elarbis.model360.length||t.product.model3d.length?(m(),N(_e,{key:20,"pop-id":"popup3d"},{default:O(()=>[t.product.elarbis.model360.length?(m(),x("div",JP,[d("iframe",{src:t.product.elarbis.model360[0],draggable:"false"},null,8,QP)])):M("",!0),t.product.model3d.length?(m(),x("div",KP,[t.product.model3d?(m(),N(Ne,{key:0,ref:"model3d",model:t.product.model3d,material:t.product.material},null,8,["model","material"])):M("",!0)])):M("",!0)]),_:1})):M("",!0),n.dokaData.coef?(m(),N(_e,{key:21,"pop-id":"doka",size:"max"},{default:O(()=>[I(le,{coef:n.dokaData.coef,onIsWaiting:n.setDokaWaiting},null,8,["coef","onIsWaiting"])]),_:1})):M("",!0)])}const t9=Ae(DR,[["render",e9],["__scopeId","data-v-605b9ea2"]]),n9={props:["product"]};function i9(n,e,t,i,s,r){const o=I7,a=t9;return n.$device.isDesktop?(m(),N(o,{key:0,product:t.product},null,8,["product"])):n.$device.isMobile?(m(),N(a,{key:1,product:t.product},null,8,["product"])):M("",!0)}const s9=Ae(n9,[["render",i9]]),r9={components:{Tags:ad,Tag:ld,IconArrowDown:$t},data(){return{showButton:!1,isActive:!0,showHideButtonText:"Показать всё"}},props:{items:{type:Array},url:"",msg:""},methods:{showHide(){this.isActive=!this.isActive},changeTextButton(){this.isActive?this.showHideButtonText="Скрыть всё":this.showHideButtonText="Показать всё"}},mounted(){setTimeout(()=>{this.$el.querySelector(".tags__inner")&&(this.showButton=this.$el.querySelector(".tags__inner").clientHeight>50)})},computed:{tagsList(){return this.items.filter(n=>n.tagShowInCatalog)}}},o9={key:0};function a9(n,e,t,i,s,r){const o=ld,a=ad;return r.tagsList&&r.tagsList.length?(m(),x("div",{key:0,class:Ee(["tags-margin",{mobile:n.$device.isMobile}])},[t.msg?(m(),x("h3",o9,B(t.msg),1)):M("",!0),I(a,{class:"tags-margin tags-list__all show_all"},{default:O(()=>[(m(!0),x(U,null,te(r.tagsList,c=>(m(),N(o,{to:`${t.url}${c.tagSectionCode}tag-${c.tagCode}/`,key:c.tagID},{default:O(()=>[Q(B(c.tagName),1)]),_:2},1032,["to"]))),128))]),_:1})],2)):M("",!0)}const l9=Ae(r9,[["render",a9],["__scopeId","data-v-ee03ef2c"]]),c9=hh({components:{},jsonld(){var o,a,c,l,u,h,f;let n=this.product.seoName?this.product.seoName.replace(/<.*?>/g,""):this.product.name,e={"@context":"https://schema.org/","@type":"Product",sku:((o=this.product.currentOffer)==null?void 0:o.toString())??"0",name:n},t=(a=this.product.images)==null?void 0:a.detail,s=((l=(c=this.product.offers[this.product.currentOffer])==null?void 0:c.images)==null?void 0:l.detail)||t,r={src:(u=s==null?void 0:s.medium)==null?void 0:u.src};e.image=r.src??"",e.description=this.product.descriptionWithoutTags;try{e.brand={"@type":"Brand",name:((f=(h=this.product)==null?void 0:h.proizvoditel)==null?void 0:f.VALUE_ENUM)??""},(this.ratingCount||this.ratingValue)&&(e.aggregateRating={"@type":"AggregateRating",reviewCount:this.ratingCount,ratingValue:this.ratingValue.toFixed(1)}),e.offers={"@type":"Offer",url:"https://hypermarketmebel.ru"+(this._.provides[at]||this.$route).fullPath,priceCurrency:"RUB",itemCondition:"https://schema.org/NewCondition",seller:{"@type":"Organization",name:"hypermarketmebel"}};let p=this.product.sections.length;e.category=this.product.sections[p-1].NAME,!this.product.isForbidden&&this.product.isActive=="Y"&&this.product.price.new?(e.offers.price=Number(this.product.price.new)+".00",e.offers.priceValidUntil=this.product.priceValidUntil,e.offers.availability="https://schema.org/InStock"):e.offers.availability="https://schema.org/OutOfStock";let g=[];this.product.features&&this.product.features.forEach(w=>{g.push({"@type":"PropertyValue",name:w.name,value:w.value})}),g&&(e.additionalProperty=g);let _=[];return this.reviews&&this.reviews.forEach(w=>{_.push({"@type":"Review",datePublished:w.date_microdata,name:n,reviewBody:"Преимущества\\r\\n"+w.dignity+`\r
Недостатки\r
`+w.disadvantage+`\r
Комментарий\r
`+w.text,author:{"@type":"Person",name:w.authorName},reviewRating:{"@type":"Rating",ratingValue:w.rating}})}),e.review=_,e}catch(p){return console.warn("SCHEMA ORG ERROR"),console.warn(p),e}},data(){return{product:{},isMounted:!1,canonical:!1,reviews:{}}},async validate({route:n,redirect:e,store:t}){let i=t.getters.getRedirect;return i&&e("301",i,{}),!0},computed:{currency(){return this.$store.getters.getRegionData.currency.code},rate(){return parseFloat(this.$store.getters.getRegionData.currency.exchangeRate)},metaData:sd,isClaimShow(){var n,e;return!!((e=(n=this._.provides[at]||this.$route)==null?void 0:n.query)!=null&&e.qr)},payDolyame(){var n;return(n=this.$store.getters.getRegionData.PayOptions)==null?void 0:n.PayDolyameAvailable},isKz(){var n;return(n=this.$store.getters.getRegionData)==null?void 0:n.kz},offers(){return this.$store.getters["product/getOffers"]},price(){var n,e;return(e=(n=this.offers[this.product.currentOffer])==null?void 0:n.price.new)==null?void 0:e.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")},ratingCount(){return this.product.rating.count>0?this.product.rating.count:1},ratingValue(){return this.product.rating.score>0?this.product.rating.score:5}},methods:{async load(){await this.$store.dispatch("product/getData",this._.provides[at]||this.$route)},closeQr(){this.$store.dispatch("lPop/closeWindow")},openNewClaim(){this.$store.getters["authentication/isAuthorized"]?this.$store.dispatch("lPop/openWindow","claim"):this.$store.dispatch("lPop/openWindow","login")}},mounted(){var n;{let e=[];this.product.sections.forEach(a=>{e.push(a.NAME)});let t=[];for(let a in this.product.sections)t[a]=this.product.sections[a].name;let i={},s={};for(let a in t)if(a<=4)if(a==0)i.item_category=t[a];else{let l="item_category"+(Number(a)+1);i[l]=t[a]}let r=this.product.price.new;typeof r>"u"&&(r=0),i.id=this.product.id,i.item_id=this.product.currentOffer,i.item_name=this.product.name,i.price=r,i.item_brand=this.product.vendor.NAME,i.item_variant=this.product.offerXml,i.item_list_name=e[e.length-1],i.item_list_id=this.product.sections[this.product.sections.length-1].id,i.quantity=1,s.name=this.product.name,s.id=this.product.currentOffer,s.price=r,s.brand=this.product.vendor.NAME,s.category=this.product.sections[this.product.sections.length-1].id,s.variant=this.product.offerXml,s.position=1,this.$gtm.push({ecommerce:null});let o={viewProduct:{productGroup:{ids:{website:this.product.sections[this.product.sections.length-1].id}},product:{ids:{website:this.product.offerXml}},price:r}};this.isKz?this.$gtm.push({event:"view_item",ecommerce:{click:{actionField:{list:e[e.length-1]},products:[s]}},google_tag_params:{ecomm_prodid:this.product.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:r},price:r,productGuid:this.product.guid,offerGuid:this.product.offerXml,offerId:this.product.currentOffer,mindboxData:o}):this.$gtm.push({event:"view_item",ecommerce:{currency:this.currency,items:[i],value:r},google_tag_params:{ecomm_prodid:this.product.currentOffer,ecomm_pagetype:"product",ecomm_totalvalue:r},price:r,productGuid:this.product.guid,offerGuid:this.product.offerXml,offerId:this.product.currentOffer,mindboxData:o})}this.isMounted=!0,(n=(this._.provides[at]||this.$route).query)!=null&&n.qr&&this.$store.dispatch("lPop/openWindow","before-claim")},async setup(n){var S,T,P,b,z;let e,t;const i=ua().currentRoute._value,s=Gc();[e,t]=ao(()=>s.dispatch("product/getData",i)),await e,t();let r=s.getters["product/getData"];const o=typeof location<"u"&&location.origin.indexOf("webcache")>-1;if(Array.isArray(r)){if(!o)throw Qu({statusCode:404,fatal:!0,message:"Not found"});return!1}[e,t]=ao(()=>s.dispatch("cardTags/getItems",r.id)),await e,t();let a=s.getters["cardTags/getItems"],c=((T=(S=r.sections)==null?void 0:S[Object.keys(r.sections)[Object.keys(r.sections).length-1]])==null?void 0:T.SECTION_PAGE_URL)??"",l=s.state.domain+i.path+"?offer_id="+r.currentOffer;[e,t]=ao(()=>s.dispatch("productReviews/getProductReviews",{id:r.id})),await e,t();let u=s.getters["productReviews/getReviews"];s.getters["section/getSectionBreadcrumbs"].some(oe=>oe.sectionName==="Мебель для спальни");const{seoParams:{metaKeywords:h},pictures:[f]}=r;let p=r.seoName?r.seoName:r.name;p=p.replace("<span>","").replace("</span>","");const g=s.getters.getRegionData,_=g.PHONE_HEAD||"8 (800) 775-80-16",w=g.kz?"Казахстану":"России",v=g.kz?"тенге":"руб.";let y=(P=r.price.new)==null?void 0:P.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ");typeof y>"u"&&(y=(z=(b=s.getters["product/getOffers"][r.currentOffer])==null?void 0:b.price.new)==null?void 0:z.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "));let C={};return C.title=`${p} - купить с доставкой, цена в Первый Гипермаркет Мебели`,C.description=`Купить ${p} в интернет-магазине Первый Гипермаркет Мебели ⭐ по цене ${y} ${v} ► Быстрая и бережная доставка по ${w} ✅ Гарантия от производителя ✅ Отзывы и фото покупателей ☎ Звоните ${_}`,C.keywords=h,C.image=(f==null?void 0:f.original)??null,ph(C),{product:r,canonical:l,tags:a,rootSection:c,reviews:u}}},"$ZtRjz9lMzQ"),d9=n=>(Ze("data-v-ad3ff8a8"),n=n(),Je(),n),u9={class:"content"},h9={class:"container max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl mx-auto min-height"},f9={class:"claim-container"},p9={class:"qr-container"},m9=d9(()=>d("div",{class:"qr-title"},"Вы отсканировали QR-код товара:",-1)),g9={class:"qr-product-name"},_9={class:"qr-btns"};function v9(n,e,t,i,s,r){const o=s9,a=l9,c=lh,l=ch,u=Wt,h=tt,f=dh,p=uh;return m(),x("main",u9,[d("div",h9,[n.product?(m(),N(o,{key:0,product:n.product},null,8,["product"])):M("",!0),n.tags&&n.tags.list&&n.tags.list.length&&n.rootSection?(m(),N(a,{key:1,msg:"Часто ищут",items:n.tags.list,url:n.rootSection},null,8,["items","url"])):M("",!0)]),n.isMounted||!n.$device.isCrawler?(m(),N(c,{key:0})):M("",!0),I(u,{"pop-id":"claim",paddingLess:!0,size:"responsive"},{default:O(()=>[d("div",f9,[n.isClaimShow?(m(),N(l,{key:0,"in-i-frame":!1})):M("",!0)])]),_:1}),I(u,{"pop-id":"before-claim",paddingLess:!0,size:"responsive"},{default:O(()=>[d("div",p9,[m9,d("div",g9,B(n.product.name),1),d("div",_9,[I(h,{class:"qr-btn",theme:"white",onClick:n.closeQr},{default:O(()=>[Q("Посмотреть информацию о товаре")]),_:1},8,["onClick"]),I(h,{class:"qr-btn",theme:"white",onClick:n.openNewClaim},{default:O(()=>[Q("Написать обращение")]),_:1},8,["onClick"])])])]),_:1}),!n.$device.isCrawler||!n.$device.isGoogleBot?(m(),N(u,{key:1,"pop-id":"installment-payment","padding-less":"true",size:"middle",class:Ee(["installment-payment",{noPayDolyame:!n.payDolyame}]),withoutShadow:!0,noTitle:!0},{default:O(()=>[I(f)]),_:1},8,["class"])):M("",!0),I(p)])}const lD=Ae(c9,[["render",v9],["__scopeId","data-v-ad3ff8a8"]]);export{lD as default};
