@vsleem-realsee-viewer/realsee-plugin 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,17 +1,17 @@
1
- (function(Ae,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],y):(Ae=typeof globalThis<"u"?globalThis:Ae||self,y(Ae.RealseePlugin={},Ae.Vue,Ae.VSLeemShared))})(this,(function(Ae,y,yt){"use strict";const t_="data:image/png;base64,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",e_="data:image/png;base64,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",Fh=["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],el=[{url:"https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"],attribution:"© 天地图 GS(2022)3124号"}},{url:"https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],zh={...yt.APP_SETTING,obsType:"hs"},nl={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:Fh,pathPin:t_,pathRedPin:e_},Hh={viewMode:1,navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,defaultTransition:{speed:900,rotation:!0},moveInertia:!1,moveThresh:0,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},Vh={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},go={style:{position:"absolute",top:"20px",right:"20px"},showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,offsetTop:20,minSize:200,tileLayers:el,rotation:!0},Gh={},_o={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1,rotation:{slider:!0,play:!0,backward:!1,forward:!1}},Wh={appSetting:zh,realseeSetting:nl,playbar:_o,map:go,immediate:!0},n_={maxRetries:3,retryDelay:1e3},{cloneDeep:Zh,deepMergeProps:i_,getDiffProps:s_}=yt.utils;function r_(n,t,e,s,r,a){const l=y.ref(Zh(go)),h=y.computed(()=>({...l.value,radarAngle:d.value})),u=y.computed(()=>{const{minSize:P=0,size:O=P}=y.unref(h)||{},et=O>P?1:.6;return{width:`${O}px`,height:`${O}px`,opacity:et}}),d=y.computed(()=>{const{currentPoint:P}=t.value||{},O=l.value?.radarYaw||0,et=P?.point.yaw||0;return yt.Point.toDegrees(et+O)}),p=y.computed(()=>{const{dataSource:P,coordinateTree:O,mappedCoordinateTree:et,currentSpace:z,currentModel:H,currentRecord:q,currentPoint:j,currentMarker:ct,currentPointMarkers:W}=t.value||{};return{dataSource:P,coordinateTree:O,mappedCoordinateTree:et,currentSpace:z,currentModel:H,currentRecord:q,currentPoint:j,currentPointMarkers:W,currentMarker:ct,state:h.value}});y.watch(()=>Zh(n.value?.map),m,{immediate:!0,deep:!0}),y.watch(()=>d.value,B);function m(P,O){const et=s_(P,O);E(et)}function _(){return h.value}function E(P){P&&i_(l.value,P)}function S(P){y.unref(e)?.collapse(P)}function w(P){E({size:P})}function v(P){E({radarYaw:P})}function g(P){E({radarHFov:P})}function I(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function C(){try{return E({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{E({showMarker:!0})}}function M(){a("ready")}function k(P){a("collapse",P)}function N(P){E({size:P}),a("dragger")}function B(P){a("angle-updated",P)}async function V(P,O){await h.value?.onPointChange?.(P,O),O?.length&&t.value?.selectMarker(O[0]),t.value?.selectPoint(P),a("select-point",P,O)}return{getProps:h,getSize:u,getBindValue:p,mapAction:{getState:_,setState:E,setSize:w,setCollapse:S,setRadarYaw:v,setRadarHFov:g,needUpdate:I,domElement:C},handleReady:M,handleDragger:N,handleCollapse:k,handleAngleUpdated:B,handleSelectPoint:V}}const o_=["width","height","href"],a_=["x"],l_={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},c_=y.defineComponent({name:"MapCadMarker",__name:"MapCadMarker",props:{point:{},markers:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.ref(30),s=y.ref(30),r=y.computed(()=>t.markers?.sort((p,m)=>p.sort-m.sort)),a=y.computed(()=>y.unref(r)?.[0]),l=y.computed(()=>y.unref(r)?.length||0),h=y.computed(()=>{const{x:p=0,y:m=0}=t.point.point||{},{imgScale:_=0}=t;return{x:p*_,y:m*_}}),u=y.computed(()=>{const p=Math.min((t.imgZoom-1)/10*3+1,2),m=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*p*m}),d=y.computed(()=>{const{x:p=0,y:m=0}=y.unref(h),_=p-y.unref(u)*y.unref(e)/2,E=m-y.unref(u)*y.unref(s);return{transform:`translate(${_}px,${E}px) scale(${u.value})`}});return(p,m)=>a.value?(y.openBlock(),y.createElementBlock("g",{key:0,style:y.normalizeStyle(d.value),class:"vsleem-map-marker"},[y.createElementVNode("image",{width:e.value,height:s.value,href:a.value?.markerIcon,class:"map-marker-img"},null,8,o_),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",l_,y.toDisplayString(l.value),1)],8,a_)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),Pn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},h_=Pn(c_,[["__scopeId","data-v-79e5c590"]]),u_=["cx","cy","r","stroke-width","fill"],d_=Pn(y.defineComponent({name:"MapCadPoint",__name:"MapCadPoint",props:{point:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:a=0,y:l=0}=t.point.point||{},{imgScale:h=0}=t;return{x:a*h,y:l*h}}),s=y.computed(()=>1/(t.imgZoom||1)),r=y.computed(()=>{const a=Math.min((t.imgZoom-1)/10*3+1,2),l=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*2*a*l});return(a,l)=>a.point?(y.openBlock(),y.createElementBlock("circle",{key:0,cx:e.value.x,cy:e.value.y,r:r.value,"stroke-width":2*s.value,stroke:"transparent","vector-effect":"non-scaling-stroke",fill:a.point.color||"#5bb36f","fill-opacity":.8,class:"vsleem-map-point"},null,8,u_)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),f_=["d"],p_=y.defineComponent({name:"MapCadRadar",__name:"MapCadRadar",props:{point:{},radarAngle:{},radarHFov:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:l=0,y:h=0}=t.point?.point||{},{imgScale:u=0}=t;return{x:l*u,y:h*u}}),s=y.computed(()=>{const l=Math.min((t.imgZoom-1)/10*3+1,2),h=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*l*h}),r=y.computed(()=>{const{radarAngle:l=0}=t,{x:h=0,y:u=0}=y.unref(e);return{transform:`translate(${h}px,${u}px) rotate(${l}deg) scale(${s.value})`}}),a=y.computed(()=>{if(!t.point)return"";const l=18,h=0,u=0,{radarHFov:d=90}=t,p=d/2,m=-p,_=p,E=m*Math.PI/180,S=_*Math.PI/180,w=h+l*Math.cos(E),v=u+l*Math.sin(E),g=h+l*Math.cos(S),I=u+l*Math.sin(S),C=d>180?1:0;return`M ${h} ${u} L ${w} ${v} A ${l} ${l} 0 ${C} 1 ${g} ${I} Z`});return(l,h)=>l.point?(y.openBlock(),y.createElementBlock("g",{key:0,class:"vsleem-map-radar",style:y.normalizeStyle(r.value)},[h[0]||(h[0]=y.createElementVNode("defs",null,[y.createElementVNode("linearGradient",{id:"gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%"},[y.createElementVNode("stop",{offset:"0%",style:{"stop-color":"#108ee9","stop-opacity":"1"}}),y.createElementVNode("stop",{offset:"100%",style:{"stop-color":"transparent","stop-opacity":"1"}})])],-1)),y.createElementVNode("path",{d:a.value,fill:"url(#gradient)"},null,8,f_)],4)):y.createCommentVNode("",!0)}}),m_=["width","height"],g_=["width","height","href"],__=1.2,v_=1.05,y_=Pn(y.defineComponent({name:"MapCadWrapper",__name:"MapCadWrapper",props:{url:{}},emits:["ready","resize","zoom-updated","screenshot"],setup(n,{expose:t,emit:e}){const s={x:0,y:0,zoom:1},r={x:0,y:0,width:0,height:0,naturalWidth:0,naturalHeight:0,scale:1},a={width:0,height:0},l={min:1,max:50},h=n,u=e,d=y.ref(),p=y.ref(),m=y.ref(),_=y.ref(!1),E=y.ref(!1),S=y.ref({x:0,y:0,zoom:1,pageX:0,pageY:0}),w=y.ref(0),v=y.ref(!1),g=y.ref({...s}),I=y.ref({...r}),C=y.ref(),M=y.ref(),k=y.ref({...a});let N;const B=y.computed(()=>{const{x:T,y:Z,zoom:$}=y.unref(g);return{transform:`translate(${T}px, ${Z}px) scale(${$})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,W),y.onMounted(()=>{W(h.url),St()}),y.onBeforeUnmount(()=>{at()});const V=T=>{T.preventDefault(),T.stopPropagation();const Z=y.unref(p)?.getBoundingClientRect();if(!Z)return;const $=T.clientX-Z.left,ht=T.clientY-Z.top,lt=T.deltaY>0?-1:1;oe($,ht,lt,__)},D=T=>{if(T.button!==0)return;T.preventDefault(),T.stopPropagation(),_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:lt,zoom:Tt}=y.unref(g);S.value={x:ht,y:lt,zoom:Tt,pageX:Z,pageY:$}},P=T=>{if(!_.value)return;T.preventDefault(),T.stopPropagation();const{pageX:Z,pageY:$}=T,{pageX:ht,pageY:lt,x:Tt,y:pt}=S.value;g.value.x=Math.round(Tt+(Z-ht)),g.value.y=Math.round(pt+($-lt))},O=T=>{_.value&&(T.preventDefault(),T.stopPropagation(),_.value=!1)},et=T=>{_.value&&O(T)},z=T=>{T.preventDefault(),T.stopPropagation(),Ot()},H=T=>{const Z=T.touches;Z.length===1?Qt(Z[0]):Z.length===2&&tt(Z[0],Z[1])},q=T=>{T.preventDefault(),T.stopPropagation();const Z=T.touches;_.value&&Z.length===1?ut(Z[0]):E.value&&Z.length===2&&_t(Z[0],Z[1])},j=T=>{T.touches.length===0?Nt():T.touches.length===1&&Zt(T.touches[0])};function ct(){v.value=!1,g.value={...s},I.value={...r},C.value=void 0,M.value=void 0,k.value={...a}}async function W(T){if(!T)return;ct();const Z=new Image;Z.crossOrigin="Anonymous",Z.src=T,Z.onload=()=>{const{naturalWidth:$,naturalHeight:ht}=Z;v.value=!0,I.value.naturalWidth=$,I.value.naturalHeight=ht,M.value=Z,Mt(),u("ready",y.unref(I.value),y.unref(g))},Z.onerror=$=>{console.error("图片加载失败:",$)}}function St(){N=new ResizeObserver(Mt);const T=y.unref(p);T&&N.observe(T)}function at(){N&&N.disconnect()}function Mt(){if(!y.unref(v))return;const{naturalWidth:T,naturalHeight:Z}=y.unref(I),{clientWidth:$=0,clientHeight:ht=0}=y.unref(p)||{},lt=Math.min($/T,ht/Z),Tt=T*lt,pt=Z*lt,bt={...y.unref(g)},re=k.value,de=re.width===0&&re.height===0,U=re.width!==$||re.height!==ht;if(de){const b=($-Tt)/2,J=(ht-pt)/2;I.value={...I.value,width:Tt,height:pt,scale:lt},g.value.x=b,g.value.y=J,g.value.zoom=1}else if(U){const b=bt.x+I.value.width*bt.zoom/2,J=bt.y+I.value.height*bt.zoom/2,rt=b/re.width,gt=J/re.height,ot=rt*$,Ht=gt*ht,At=ot-Tt*bt.zoom/2,Bt=Ht-pt*bt.zoom/2;I.value={...I.value,width:Tt,height:pt,scale:lt},g.value.x=Math.round(At),g.value.y=Math.round(Bt)}k.value={width:$,height:ht},u("resize",y.unref(I))}function Ot(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:T=0,clientHeight:Z=0}=y.unref(p)||{},{width:$,height:ht}=y.unref(I),lt=(T-$)/2,Tt=(Z-ht)/2;g.value.x=lt,g.value.y=Tt,g.value.zoom=1,k.value={width:T,height:Z},u("zoom-updated",y.unref(g))}function oe(T,Z,$,ht){const{x:lt,y:Tt,zoom:pt}=y.unref(g);let bt=pt*($>0?ht:1/ht);bt=Math.max(l.min,Math.min(l.max,bt));const re=(T-lt)/pt,de=(Z-Tt)/pt,U=T-re*bt,b=Z-de*bt;g.value.x=Math.round(U),g.value.y=Math.round(b),g.value.zoom=bt,u("zoom-updated",y.unref(g))}function Qt(T){_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:lt,zoom:Tt}=y.unref(g);S.value={x:ht,y:lt,zoom:Tt,pageX:Z,pageY:$}}function tt(T,Z){E.value=!0,_.value=!1,w.value=jt(T,Z)}function ut(T){const{pageX:Z,pageY:$}=T,{pageX:ht,pageY:lt,x:Tt,y:pt}=S.value;g.value.x=Math.round(Tt+(Z-ht)),g.value.y=Math.round(pt+($-lt))}function _t(T,Z){const $=y.unref(p)?.getBoundingClientRect();if(!$)return;const ht=jt(T,Z);if(w.value>0){const lt=(T.clientX+Z.clientX)/2-$.left,Tt=(T.clientY+Z.clientY)/2-$.top,bt=ht/w.value>1?1:-1;oe(lt,Tt,bt,v_)}w.value=ht}function Nt(){_.value=!1,E.value=!1,w.value=0}function Zt(T){E.value=!1,_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:lt,zoom:Tt}=y.unref(g);S.value={x:ht,y:lt,zoom:Tt,pageX:Z,pageY:$}}function jt(T,Z){const $=T.clientX-Z.clientX,ht=T.clientY-Z.clientY;return Math.sqrt($*$+ht*ht)}async function Re(){if(!M.value){console.warn("图片实例未找到");return}const T=d.value;if(!T){console.error("未找到 SVG 元素");return}try{const Z=document.createElement("canvas"),$=Z.getContext("2d");if(!$)throw new Error("无法获取 Canvas 2D 上下文");Z.width=M.value.width,Z.height=M.value.height,$.drawImage(M.value,0,0),C.value=Z.toDataURL("image/webp",1),await new Promise(pt=>setTimeout(pt,500));const ht=new XMLSerializer().serializeToString(T),lt=new Blob([ht],{type:"image/svg+xml;charset=utf-8"}),Tt=URL.createObjectURL(lt);return await dt(Tt)}catch(Z){console.error("导出 SVG 到 PNG 失败:",Z)}finally{C.value=""}}function dt(T){return new Promise((Z,$)=>{const ht=new Image;ht.src=T,ht.onload=()=>{try{URL.revokeObjectURL(T);const lt=document.createElement("canvas"),Tt=lt.getContext("2d");if(!Tt)throw new Error("无法获取 Canvas 2D 上下文");const pt=y.unref(p),{width:bt,height:re}=pt?.getBoundingClientRect()||{width:800,height:600},{zoom:de=1,x:U=0,y:b=0}=y.unref(g);lt.width=bt,lt.height=re,Tt.setTransform(de,0,0,de,U,b),Tt.drawImage(ht,0,0),Z(lt)}catch(lt){$(lt)}},ht.onerror=()=>{URL.revokeObjectURL(T),$(new Error("SVG 图像加载失败"))}})}return t({domElement:Re}),(T,Z)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:z,onWheel:V,onMousedown:D,onMousemove:P,onMouseup:O,onMouseleave:et,onTouchstart:H,onTouchmove:q,onTouchend:j},[y.createElementVNode("div",{ref_key:"transformWrapperRef",ref:m,style:y.normalizeStyle(B.value)},[(y.openBlock(),y.createElementBlock("svg",{id:"svgElement",ref_key:"svgRef",ref:d,width:I.value?.width,height:I.value?.height,overflow:"hidden",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[v.value?(y.openBlock(),y.createElementBlock("image",{key:0,x:0,y:0,width:I.value?.width,height:I.value?.height,href:C.value||T.url,crossOrigin:"anonymous"},null,8,g_)):y.createCommentVNode("",!0),y.renderSlot(T.$slots,"default",{},void 0,!0)],8,m_))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),E_={class:"vsleem-map-cad"},x_=Pn(y.defineComponent({name:"MapCad",__name:"MapCad",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(1),h=y.ref(1),u=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));function d(v,g){p(v),m(g),r("ready")}function p(v){h.value=v.scale??1}function m(v){l.value=v.zoom??1}async function _(v){r("select-point",v)}function E(v,g){r("select-point",v,g)}function S(){}async function w(){return await a.value?.domElement()}return t({needUpdate:S,domElement:w}),(v,g)=>(y.openBlock(),y.createElementBlock("div",E_,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(y_,{key:0,url:v.store?.currentModel?.modelValue,ref_key:"wrapperElRef",ref:a,onReady:d,onResize:p,onZoomUpdated:m},{default:y.withCtx(()=>[v.map?.showPoint?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:0},y.renderList(v.store.dataSource,([I,C])=>(y.openBlock(),y.createElementBlock("g",{key:I},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(C.trackPoints,([M,k])=>(y.openBlock(),y.createBlock(d_,{key:M,point:k,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,stroke:v.store.currentPoint?.id==k.id?"#108ee9":"transparent",onClick:y.withModifiers(N=>_(k),["stop","prevent"])},null,8,["point","imgZoom","imgScale","wrapScale","stroke","onClick"]))),128))]))),128)):y.createCommentVNode("",!0),v.map?.showRadar?(y.openBlock(),y.createBlock(p_,{key:1,point:v.store.currentPoint,radarAngle:v.map.radarAngle,radarHFov:v.map.radarHFov,imgZoom:l.value,imgScale:h.value,wrapScale:u.value},null,8,["point","radarAngle","radarHFov","imgZoom","imgScale","wrapScale"])):y.createCommentVNode("",!0),v.map?.showMarker?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:2},y.renderList(v.store.groupedMarkers,([I,C])=>(y.openBlock(),y.createBlock(h_,{key:I.id,point:I,markers:C,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(M=>E(I,C),["stop","prevent"])},null,8,["point","markers","imgZoom","imgScale","wrapScale","onClick"]))),128)):y.createCommentVNode("",!0)]),_:1},8,["url"])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-4f491d69"]]),w_="data:image/png;base64,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",S_="data:image/png;base64,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",M_="data:image/png;base64,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",T_={class:"vsleem-map-dragger"},b_=["src"],A_=["src"],C_=Pn(y.defineComponent({name:"MapDragger",__name:"MapDragger",props:{store:{},map:{}},emits:["collapse","dragger"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(!0),l=y.ref();function h(I){y.unref(a)!=I&&u()}function u(){const{minSize:I,maxSize:C}=s.map,M=y.unref(a)?C:I;a.value=!y.unref(a),r("collapse",y.unref(a)),r("dragger",M)}function d(I){const{minSize:C,size:M=C}=s.map;l.value={x:I.pageX,y:I.pageY,size:M}}function p(I){if(y.unref(l)){const{minSize:C,maxSize:M}=s.map,{x:k=0,size:N=0}=y.unref(l)||{};let B=Math.min(Math.max(N-(I.pageX-k),C),M);r("dragger",B)}}function m(){l.value=void 0}function _(I){d(I),document.addEventListener("mousemove",E),document.addEventListener("mouseup",S)}function E(I){p(I)}function S(){m(),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S)}function w(I){d(I.touches[0]),document.addEventListener("touchmove",v),document.addEventListener("touchend",g)}function v(I){p(I.touches[0])}function g(){m(),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",g)}return t({collapse:h}),(I,C)=>(y.openBlock(),y.createElementBlock("div",T_,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:u},[y.createElementVNode("img",{src:a.value?y.unref(M_):y.unref(S_)},null,8,b_)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:_,onTouchstart:w},[y.createElementVNode("img",{src:y.unref(w_)},null,8,A_)],32)]))}}),[["__scopeId","data-v-cbfac809"]]);function P_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mr={exports:{}};/* @preserve
1
+ (function(Ae,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],y):(Ae=typeof globalThis<"u"?globalThis:Ae||self,y(Ae.RealseePlugin={},Ae.Vue,Ae.VSLeemShared))})(this,(function(Ae,y,yt){"use strict";const t_="data:image/png;base64,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",e_="data:image/png;base64,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",Fh=["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],el=[{url:"https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"],attribution:"© 天地图 GS(2022)3124号"}},{url:"https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],zh={...yt.APP_SETTING,obsType:"hs"},nl={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:Fh,pathPin:t_,pathRedPin:e_},Hh={viewMode:1,navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,defaultTransition:{speed:900,rotation:!0},moveInertia:!1,moveThresh:0,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},Vh={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},go={style:{position:"absolute",top:"20px",right:"20px"},showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,offsetTop:20,minSize:200,tileLayers:el,rotation:!0},Gh={},_o={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1,rotation:{slider:!0,play:!0,backward:!1,forward:!1}},Wh={appSetting:zh,realseeSetting:nl,playbar:_o,map:go,immediate:!0},n_={maxRetries:3,retryDelay:1e3},{cloneDeep:Zh,deepMergeProps:i_,getDiffProps:s_}=yt.utils;function r_(n,t,e,s,r,a){const l=y.ref(Zh(go)),h=y.ref(!0),u=y.computed(()=>({...l.value,isCollapse:h.value,radarAngle:p.value})),d=y.computed(()=>{const{minSize:U=0,size:tt=U}=y.unref(u)||{},F=tt>U?1:.6;return{width:`${tt}px`,height:`${tt}px`,opacity:F}}),p=y.computed(()=>{const{currentPoint:U}=t.value||{},tt=l.value?.radarYaw||0,F=U?.point.yaw||0;return yt.Point.toDegrees(F+tt)}),m=y.computed(()=>{const{dataSource:U,coordinateTree:tt,mappedCoordinateTree:F,currentSpace:H,currentModel:q,currentRecord:j,currentPoint:ct,currentMarker:W,currentPointMarkers:Et}=t.value||{};return{dataSource:U,coordinateTree:tt,mappedCoordinateTree:F,currentSpace:H,currentModel:q,currentRecord:j,currentPoint:ct,currentPointMarkers:Et,currentMarker:W,state:u.value}});y.watch(()=>Zh(n.value?.map),_,{immediate:!0,deep:!0}),y.watch(()=>p.value,V);function _(U,tt){const F=s_(U,tt);S(F)}function E(){return u.value}function S(U){U&&i_(l.value,U)}function w(U){y.unref(e)?.collapse(U)}function v(U){S({size:U})}function g(U){S({radarYaw:U})}function I(U){S({radarHFov:U})}function C(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function M(){try{return S({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{S({showMarker:!0})}}function k(){a("ready")}function N(U){h.value=U,a("collapse",U)}function B(U){S({size:U}),a("dragger")}function V(U){a("angle-updated",U)}async function R(U,tt){await u.value?.onPointChange?.(U,tt),tt?.length&&t.value?.selectMarker(tt[0]),t.value?.selectPoint(U),a("select-point",U,tt)}return{getProps:u,getSize:d,getBindValue:m,mapAction:{getState:E,setState:S,setSize:v,setCollapse:w,setRadarYaw:g,setRadarHFov:I,needUpdate:C,domElement:M},handleReady:k,handleDragger:B,handleCollapse:N,handleAngleUpdated:V,handleSelectPoint:R}}const o_=["width","height","href"],a_=["x"],l_={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},c_=y.defineComponent({name:"MapCadMarker",__name:"MapCadMarker",props:{point:{},markers:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.ref(30),s=y.ref(30),r=y.computed(()=>t.markers?.sort((p,m)=>p.sort-m.sort)),a=y.computed(()=>y.unref(r)?.[0]),l=y.computed(()=>y.unref(r)?.length||0),h=y.computed(()=>{const{x:p=0,y:m=0}=t.point.point||{},{imgScale:_=0}=t;return{x:p*_,y:m*_}}),u=y.computed(()=>{const p=Math.min((t.imgZoom-1)/10*3+1,2),m=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*p*m}),d=y.computed(()=>{const{x:p=0,y:m=0}=y.unref(h),_=p-y.unref(u)*y.unref(e)/2,E=m-y.unref(u)*y.unref(s);return{transform:`translate(${_}px,${E}px) scale(${u.value})`}});return(p,m)=>a.value?(y.openBlock(),y.createElementBlock("g",{key:0,style:y.normalizeStyle(d.value),class:"vsleem-map-marker"},[y.createElementVNode("image",{width:e.value,height:s.value,href:a.value?.markerIcon,class:"map-marker-img"},null,8,o_),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",l_,y.toDisplayString(l.value),1)],8,a_)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),Pn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},h_=Pn(c_,[["__scopeId","data-v-79e5c590"]]),u_=["cx","cy","r","stroke-width","fill"],d_=Pn(y.defineComponent({name:"MapCadPoint",__name:"MapCadPoint",props:{point:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:a=0,y:l=0}=t.point.point||{},{imgScale:h=0}=t;return{x:a*h,y:l*h}}),s=y.computed(()=>1/(t.imgZoom||1)),r=y.computed(()=>{const a=Math.min((t.imgZoom-1)/10*3+1,2),l=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*2*a*l});return(a,l)=>a.point?(y.openBlock(),y.createElementBlock("circle",{key:0,cx:e.value.x,cy:e.value.y,r:r.value,"stroke-width":2*s.value,stroke:"transparent","vector-effect":"non-scaling-stroke",fill:a.point.color||"#5bb36f","fill-opacity":.8,class:"vsleem-map-point"},null,8,u_)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),f_=["d"],p_=y.defineComponent({name:"MapCadRadar",__name:"MapCadRadar",props:{point:{},radarAngle:{},radarHFov:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:l=0,y:h=0}=t.point?.point||{},{imgScale:u=0}=t;return{x:l*u,y:h*u}}),s=y.computed(()=>{const l=Math.min((t.imgZoom-1)/10*3+1,2),h=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*l*h}),r=y.computed(()=>{const{radarAngle:l=0}=t,{x:h=0,y:u=0}=y.unref(e);return{transform:`translate(${h}px,${u}px) rotate(${l}deg) scale(${s.value})`}}),a=y.computed(()=>{if(!t.point)return"";const l=18,h=0,u=0,{radarHFov:d=90}=t,p=d/2,m=-p,_=p,E=m*Math.PI/180,S=_*Math.PI/180,w=h+l*Math.cos(E),v=u+l*Math.sin(E),g=h+l*Math.cos(S),I=u+l*Math.sin(S),C=d>180?1:0;return`M ${h} ${u} L ${w} ${v} A ${l} ${l} 0 ${C} 1 ${g} ${I} Z`});return(l,h)=>l.point?(y.openBlock(),y.createElementBlock("g",{key:0,class:"vsleem-map-radar",style:y.normalizeStyle(r.value)},[h[0]||(h[0]=y.createElementVNode("defs",null,[y.createElementVNode("linearGradient",{id:"gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%"},[y.createElementVNode("stop",{offset:"0%",style:{"stop-color":"#108ee9","stop-opacity":"1"}}),y.createElementVNode("stop",{offset:"100%",style:{"stop-color":"transparent","stop-opacity":"1"}})])],-1)),y.createElementVNode("path",{d:a.value,fill:"url(#gradient)"},null,8,f_)],4)):y.createCommentVNode("",!0)}}),m_=["width","height"],g_=["width","height","href"],__=1.2,v_=1.05,y_=Pn(y.defineComponent({name:"MapCadWrapper",__name:"MapCadWrapper",props:{url:{}},emits:["ready","resize","zoom-updated","screenshot"],setup(n,{expose:t,emit:e}){const s={x:0,y:0,zoom:1},r={x:0,y:0,width:0,height:0,naturalWidth:0,naturalHeight:0,scale:1},a={width:0,height:0},l={min:1,max:50},h=n,u=e,d=y.ref(),p=y.ref(),m=y.ref(),_=y.ref(!1),E=y.ref(!1),S=y.ref({x:0,y:0,zoom:1,pageX:0,pageY:0}),w=y.ref(0),v=y.ref(!1),g=y.ref({...s}),I=y.ref({...r}),C=y.ref(),M=y.ref(),k=y.ref({...a});let N;const B=y.computed(()=>{const{x:T,y:Z,zoom:$}=y.unref(g);return{transform:`translate(${T}px, ${Z}px) scale(${$})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,W),y.onMounted(()=>{W(h.url),Et()}),y.onBeforeUnmount(()=>{lt()});const V=T=>{T.preventDefault(),T.stopPropagation();const Z=y.unref(p)?.getBoundingClientRect();if(!Z)return;const $=T.clientX-Z.left,ht=T.clientY-Z.top,rt=T.deltaY>0?-1:1;oe($,ht,rt,__)},R=T=>{if(T.button!==0)return;T.preventDefault(),T.stopPropagation(),_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:rt,zoom:Tt}=y.unref(g);S.value={x:ht,y:rt,zoom:Tt,pageX:Z,pageY:$}},D=T=>{if(!_.value)return;T.preventDefault(),T.stopPropagation();const{pageX:Z,pageY:$}=T,{pageX:ht,pageY:rt,x:Tt,y:pt}=S.value;g.value.x=Math.round(Tt+(Z-ht)),g.value.y=Math.round(pt+($-rt))},U=T=>{_.value&&(T.preventDefault(),T.stopPropagation(),_.value=!1)},tt=T=>{_.value&&U(T)},F=T=>{T.preventDefault(),T.stopPropagation(),Ot()},H=T=>{const Z=T.touches;Z.length===1?Qt(Z[0]):Z.length===2&&et(Z[0],Z[1])},q=T=>{T.preventDefault(),T.stopPropagation();const Z=T.touches;_.value&&Z.length===1?ut(Z[0]):E.value&&Z.length===2&&_t(Z[0],Z[1])},j=T=>{T.touches.length===0?Nt():T.touches.length===1&&Zt(T.touches[0])};function ct(){v.value=!1,g.value={...s},I.value={...r},C.value=void 0,M.value=void 0,k.value={...a}}async function W(T){if(!T)return;ct();const Z=new Image;Z.crossOrigin="Anonymous",Z.src=T,Z.onload=()=>{const{naturalWidth:$,naturalHeight:ht}=Z;v.value=!0,I.value.naturalWidth=$,I.value.naturalHeight=ht,M.value=Z,Mt(),u("ready",y.unref(I.value),y.unref(g))},Z.onerror=$=>{console.error("图片加载失败:",$)}}function Et(){N=new ResizeObserver(Mt);const T=y.unref(p);T&&N.observe(T)}function lt(){N&&N.disconnect()}function Mt(){if(!y.unref(v))return;const{naturalWidth:T,naturalHeight:Z}=y.unref(I),{clientWidth:$=0,clientHeight:ht=0}=y.unref(p)||{},rt=Math.min($/T,ht/Z),Tt=T*rt,pt=Z*rt,At={...y.unref(g)},ne=k.value,de=ne.width===0&&ne.height===0,O=ne.width!==$||ne.height!==ht;if(de){const b=($-Tt)/2,J=(ht-pt)/2;I.value={...I.value,width:Tt,height:pt,scale:rt},g.value.x=b,g.value.y=J,g.value.zoom=1}else if(O){const b=At.x+I.value.width*At.zoom/2,J=At.y+I.value.height*At.zoom/2,ot=b/ne.width,gt=J/ne.height,at=ot*$,Ht=gt*ht,bt=at-Tt*At.zoom/2,Bt=Ht-pt*At.zoom/2;I.value={...I.value,width:Tt,height:pt,scale:rt},g.value.x=Math.round(bt),g.value.y=Math.round(Bt)}k.value={width:$,height:ht},u("resize",y.unref(I))}function Ot(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:T=0,clientHeight:Z=0}=y.unref(p)||{},{width:$,height:ht}=y.unref(I),rt=(T-$)/2,Tt=(Z-ht)/2;g.value.x=rt,g.value.y=Tt,g.value.zoom=1,k.value={width:T,height:Z},u("zoom-updated",y.unref(g))}function oe(T,Z,$,ht){const{x:rt,y:Tt,zoom:pt}=y.unref(g);let At=pt*($>0?ht:1/ht);At=Math.max(l.min,Math.min(l.max,At));const ne=(T-rt)/pt,de=(Z-Tt)/pt,O=T-ne*At,b=Z-de*At;g.value.x=Math.round(O),g.value.y=Math.round(b),g.value.zoom=At,u("zoom-updated",y.unref(g))}function Qt(T){_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:rt,zoom:Tt}=y.unref(g);S.value={x:ht,y:rt,zoom:Tt,pageX:Z,pageY:$}}function et(T,Z){E.value=!0,_.value=!1,w.value=jt(T,Z)}function ut(T){const{pageX:Z,pageY:$}=T,{pageX:ht,pageY:rt,x:Tt,y:pt}=S.value;g.value.x=Math.round(Tt+(Z-ht)),g.value.y=Math.round(pt+($-rt))}function _t(T,Z){const $=y.unref(p)?.getBoundingClientRect();if(!$)return;const ht=jt(T,Z);if(w.value>0){const rt=(T.clientX+Z.clientX)/2-$.left,Tt=(T.clientY+Z.clientY)/2-$.top,At=ht/w.value>1?1:-1;oe(rt,Tt,At,v_)}w.value=ht}function Nt(){_.value=!1,E.value=!1,w.value=0}function Zt(T){E.value=!1,_.value=!0;const{pageX:Z,pageY:$}=T,{x:ht,y:rt,zoom:Tt}=y.unref(g);S.value={x:ht,y:rt,zoom:Tt,pageX:Z,pageY:$}}function jt(T,Z){const $=T.clientX-Z.clientX,ht=T.clientY-Z.clientY;return Math.sqrt($*$+ht*ht)}async function Re(){if(!M.value){console.warn("图片实例未找到");return}const T=d.value;if(!T){console.error("未找到 SVG 元素");return}try{const Z=document.createElement("canvas"),$=Z.getContext("2d");if(!$)throw new Error("无法获取 Canvas 2D 上下文");Z.width=M.value.width,Z.height=M.value.height,$.drawImage(M.value,0,0),C.value=Z.toDataURL("image/webp",1),await new Promise(pt=>setTimeout(pt,500));const ht=new XMLSerializer().serializeToString(T),rt=new Blob([ht],{type:"image/svg+xml;charset=utf-8"}),Tt=URL.createObjectURL(rt);return await ft(Tt)}catch(Z){console.error("导出 SVG 到 PNG 失败:",Z)}finally{C.value=""}}function ft(T){return new Promise((Z,$)=>{const ht=new Image;ht.src=T,ht.onload=()=>{try{URL.revokeObjectURL(T);const rt=document.createElement("canvas"),Tt=rt.getContext("2d");if(!Tt)throw new Error("无法获取 Canvas 2D 上下文");const pt=y.unref(p),{width:At,height:ne}=pt?.getBoundingClientRect()||{width:800,height:600},{zoom:de=1,x:O=0,y:b=0}=y.unref(g);rt.width=At,rt.height=ne,Tt.setTransform(de,0,0,de,O,b),Tt.drawImage(ht,0,0),Z(rt)}catch(rt){$(rt)}},ht.onerror=()=>{URL.revokeObjectURL(T),$(new Error("SVG 图像加载失败"))}})}return t({domElement:Re}),(T,Z)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:F,onWheel:V,onMousedown:R,onMousemove:D,onMouseup:U,onMouseleave:tt,onTouchstart:H,onTouchmove:q,onTouchend:j},[y.createElementVNode("div",{ref_key:"transformWrapperRef",ref:m,style:y.normalizeStyle(B.value)},[(y.openBlock(),y.createElementBlock("svg",{id:"svgElement",ref_key:"svgRef",ref:d,width:I.value?.width,height:I.value?.height,overflow:"hidden",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[v.value?(y.openBlock(),y.createElementBlock("image",{key:0,x:0,y:0,width:I.value?.width,height:I.value?.height,href:C.value||T.url,crossOrigin:"anonymous"},null,8,g_)):y.createCommentVNode("",!0),y.renderSlot(T.$slots,"default",{},void 0,!0)],8,m_))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),E_={class:"vsleem-map-cad"},x_=Pn(y.defineComponent({name:"MapCad",__name:"MapCad",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(1),h=y.ref(1),u=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));function d(v,g){p(v),m(g),r("ready")}function p(v){h.value=v.scale??1}function m(v){l.value=v.zoom??1}async function _(v){r("select-point",v)}function E(v,g){r("select-point",v,g)}function S(){}async function w(){return await a.value?.domElement()}return t({needUpdate:S,domElement:w}),(v,g)=>(y.openBlock(),y.createElementBlock("div",E_,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(y_,{key:0,url:v.store?.currentModel?.modelValue,ref_key:"wrapperElRef",ref:a,onReady:d,onResize:p,onZoomUpdated:m},{default:y.withCtx(()=>[v.map?.showPoint?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:0},y.renderList(v.store.dataSource,([I,C])=>(y.openBlock(),y.createElementBlock("g",{key:I},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(C.trackPoints,([M,k])=>(y.openBlock(),y.createBlock(d_,{key:M,point:k,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,stroke:v.store.currentPoint?.id==k.id?"#108ee9":"transparent",onClick:y.withModifiers(N=>_(k),["stop","prevent"])},null,8,["point","imgZoom","imgScale","wrapScale","stroke","onClick"]))),128))]))),128)):y.createCommentVNode("",!0),v.map?.showRadar?(y.openBlock(),y.createBlock(p_,{key:1,point:v.store.currentPoint,radarAngle:v.map.radarAngle,radarHFov:v.map.radarHFov,imgZoom:l.value,imgScale:h.value,wrapScale:u.value},null,8,["point","radarAngle","radarHFov","imgZoom","imgScale","wrapScale"])):y.createCommentVNode("",!0),v.map?.showMarker?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:2},y.renderList(v.store.groupedMarkers,([I,C])=>(y.openBlock(),y.createBlock(h_,{key:I.id,point:I,markers:C,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(M=>E(I,C),["stop","prevent"])},null,8,["point","markers","imgZoom","imgScale","wrapScale","onClick"]))),128)):y.createCommentVNode("",!0)]),_:1},8,["url"])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-4f491d69"]]),w_="data:image/png;base64,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",S_="data:image/png;base64,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",M_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAC2VJREFUeF7tnYuR1DgQQE0kHJEAkQCRAJEAkQCRcETCTd9atcbjj1qS1a3p56qtYRdpLL3Wc9uSPfNiYoMABHYJvIANBCCwTwBBGB0QOCCAIAwPCCAIYwACZQTIIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCOAIGXcqBWEAIIECTTdLCNgLcg/0zS9m6ZJXmX7Ob/+O01T+inrGbVGIpDiL6+v54anv32ex4JJf6wF+XLr/PuDnosksi1lEYnS33+YUGOnWgIy2NPPy7nym8Xfjt7v6zRNH7Q7bFXeWpDv0zQJqJptLQtZqIamvu7e0V/+XhtbaU1oQT7eCHzSx0RVY52F5PffZKFshjVH/+ydHBREkBYUK95DhJEUzuna3xDl6C8Z3nqT2IgkJpv1KZaXIJgepUwif77Ts+vD83doUwJB2nCsepe3ZJA7fl4OXq8iz2LJ+e2vqqFdXxk59hnKDKNkEssttCAC/o8hfeQ4h28tiellgOnO59i0mOo9D/N9CeTIp2YliUygSAYx26IKghz6IWchifnkiQdBes+WIIdejlSjtyQIcrsG6bFYmAKMHOVyWEgii8hyL5bZ5iGD9DoqIUe7YdYrZqZrIILLgyA95tuRo50cPTOJedw8CHL1WojMhAjodE9W+6ES8x0lbnL92OKGxD2CpmsgXjLI1YJIP5GkrcQ95HAxPj1kEAEhq+nptum2oXx+NyRpQ7aXHAiyiFevxUIkqZOkpxxyd7WcGptuXjJIL0E43Sofbj3lkFaar4G4SGFzvHquhSCJXpLeciDIKka9BUGSfEks5JDWma+BeMogPdZCtoYE1yTHoljJgSCruPSY6t0bCkiyTcZSDmmR+RqIpwxiKQinW/eCWMuBIBsHLe2DU3Lkb7l2QiZ5CsoVcpTEysUMq4tGzLJopnrTrSNSB0nyL7jPSl4lh1xwp/c+a0PK6KYPSqVGjijI8gY2gY4kOUPuvMyVcqSPVMq9C9jFGoinaxBpS86DU1t3dyLJ+eA/K9FDjtSGHEkQZCNiZ2shR7c+I8mZAvv/31OOXEnMH5TyeIp1dGTJeS4ASfSSWMiRI4mLRUJvp1h7i4U5ciToSJIviaUcZ5JoYp7f44KSni7St9ZCSkAhyflA8CDHkSQuFgm9ZZD1wC6Rg0wylhx7krg5cLtpyExKJJGL9W8NPiuXTHIvi6fMsW5dy9ifHyYyS3gTJLPZ2cWQ5BmVZzmyA9q74KMLIjyR5LrbR1ysdl8pTQRBoktyVeZ4eDm8XaRfeSCIKglyVI6qKBkk4uwWclTKES2DRJIEORrIEVWQK0+3vJyXax4dyBlK5t/TkdPIK8pEO8VaMrxidsvDCvDWHQk1YyesHJEzyBWnW25u0W74lRKh5UCQJ01aZBIXnwK4SBPSp3e33+W28dItvBwI8jx0aiTxJscyO5ZKghwzxcjXIOsja4kkXuWokQQ5FiMDQf7WRCOJdzlKJEGO1WETQe7P0HMkGUUOjSTIsXG1hiDbl7BHkowmR44kyLEzlYEg+3M8W5KMKseRJMhxMM+HIMeToMtbNkaXY0sS5DiZBEeQ0lWC8euJ/HyxKYKMP5LpgR0BMogde/Y8AAEEGSBINNGOAILYsWfPAxBAkAGCRBPtCCCIHXv2PAABBBkgSDTRjgCC2LFnzwMQQJABgkQT7QggiB179jwAAQQZIEg00Y4AgtixZ88DEECQAYJEE+0IIIgde/Y8AAEEGSBINNGOAILYsWfPAxBAkAGCRBPtCCCIHXv2PAABBBkgSDTRjgCC2LFnzwMQQJABgkQT7QggiB179jwAAQQZIEg00Y4AgtixZ88DEECQAYJEE+0IIIgde/Y8AAEEGSBINNGOAILYsWfPAxBAkAGCRBPtCCCIHXv2PAABBBkgSDTRjgCC2LFnzwMQQJC8ID3il808Yp/yoqkohSDHsJZfwfZ1mqYPCraei365fbvU+/kbpt7yTVP7oUKQfTZLOVKpR5Dk+zRNbxbdlq9hQ5KdcYAg22C25HgESdZypD4hCYJkn/EcyTGyJHtyIMnB0CCD/A0nR44RJTmTA0nIIKcZRCPHSJLkyoEkG0OEDPIEpUSOESTRyoEkK0kQpE4Oz5KUyoEkC0miC1KTOdYJ2dMUcK0cSDITiCxISznSgHrlYNFN+vXr9Iorv0DoKeCoglwhhwwkEcTD1iqDhM8kEQV5dDnSpINIIn1ttYXMJNEEiSBHEkL6iiSVh4dIgkSSA0kqxUjVowgSUQ4kaSBJBEEiy4EklZI8uiCtpzwFt6fZKk34uSbR0HK6DiJB/HibLv12e2bhR0F/llWQ4x6gZ0laxr5y6DxX95ZBZIErPQoqK9OfC3uKHPvgPEoiD3DJjJu7DO1JkPWgllOZEkmQ4/yo4kmSpRyp5R7uSPi/LZ4E2QKllQQ5zuXwdOG+FXNpnzwCXHuKnU/ioKQnQeRDBOTDBNZbriTIoR8SlplkTw7phXw4hpw9mG+eBJGL8087RM4kQY7yoWQhyZEc0hMZB6XXn+UkNmp6EiR9FM1eB/ckQY76IdFTkjM5pDduHh0YSZA0w7G8cEeOejl6XpPkyCHtkesPuQ4x3zwJkqZ4z6CkTCJrJS2fe0gCerll/YzDFf9/ZSZJ753TbjeLsZ4E+ZNDbi4jAFveyo0cz/CvkkQTLwTZkEEjiMKlrKJuApLV2usLXSGJttUu1kK8ZJDcc1Mt5JzyyLFNyVoSF2shXgTZWwPJGeA1ZZDjmJ6lJAiyiI2FIMiRd2ixksTFWoiXDHK2BpIXyvxSyJHPSkpaSIIgixj1FAQ5dHKk0r0lcbEW4iWD5K6BlIX2uRZy1BHsKQmCLGLVQxDkqJOjdyZxES8vGeTqNRAXsNuMTxfv0iuTmI9P8wbMF4CtbxlZjyIP/XQxshs2oock5ouFHgbO1YuEZ7fKNxwzod7q6rgJTPO1EA+C9FgDQZK27vaQQ1ps/uCUB0GOHpRqGVYkaUOzlxzSWvO1EA+C9F4DKfkgiDZDa/x36SmH0DJ/cMqDIK0/qv9sGJJJzght/39vOaQV5mshHgTpsQayDjmS6CSxkENaaD4970GQq9dA9oYCkuRJYiUHgszxsRIkBYBrkn1RLOVIrTJdC7HOIB4CIJlEphNdfFBZ3kG9SykPsTFfC7EWpMcaSM5oMp8tyWlk5zI9ZxePuma6WIggTxeCZJD7Ieolg5iuhVgL0uMoJQKk6w35t/z8nl/T750PzsPsLn0SibzKz8v5Nf2u+aSS0k4jSCm5xcBPc+ZJhp/z/3FdUQk3o/paltdzHfm7ZKHazXQtxDqD5Nxmko7yHP1rh5pN/dosZHp9aC2IwHu3+NIcCSFHf5uBbLnXvSwkB0X5BM10ZtC9jdaCdO8wO4SAhgCCaGhRNhwBBAkXcjqsIYAgGlqUDUcAQcKFnA5rCCCIhhZlwxFAkHAhp8MaAgiioUXZcAQQJFzI6bCGAIJoaFE2HAEECRdyOqwhgCAaWpQNRwBBwoWcDmsIIIiGFmXDEUCQcCGnwxoCCKKhRdlwBBAkXMjpsIYAgmhoUTYcAQQJF3I6rCGAIBpalA1HAEHChZwOawggiIYWZcMRQJBwIafDGgIIoqFF2XAEECRcyOmwhgCCaGhRNhwBBAkXcjqsIYAgGlqUDUcAQcKFnA5rCCCIhhZlwxFAkHAhp8MaAv8BX/VX5zh9WSYAAAAASUVORK5CYII=",T_={class:"vsleem-map-dragger"},b_=["src"],A_=["src"],C_=Pn(y.defineComponent({name:"MapDragger",__name:"MapDragger",props:{store:{},map:{}},emits:["collapse","dragger"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref();function l(g){s.map.isCollapse!=g&&h()}function h(){const{minSize:g,maxSize:I}=s.map,C=s.map.isCollapse?I:g;r("collapse",!s.map.isCollapse),r("dragger",C)}function u(g){const{minSize:I,size:C=I}=s.map;a.value={x:g.pageX,y:g.pageY,size:C}}function d(g){if(y.unref(a)){const{minSize:I,maxSize:C}=s.map,{x:M=0,size:k=0}=y.unref(a)||{};let N=Math.min(Math.max(k-(g.pageX-M),I),C);r("dragger",N)}}function p(){a.value=void 0}function m(g){u(g),document.addEventListener("mousemove",_),document.addEventListener("mouseup",E)}function _(g){d(g)}function E(){p(),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",E)}function S(g){u(g.touches[0]),document.addEventListener("touchmove",w),document.addEventListener("touchend",v)}function w(g){d(g.touches[0])}function v(){p(),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",v)}return t({collapse:l}),(g,I)=>(y.openBlock(),y.createElementBlock("div",T_,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:h},[y.createElementVNode("img",{src:g.map.isCollapse?y.unref(M_):y.unref(S_)},null,8,b_)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:m,onTouchstart:S},[y.createElementVNode("img",{src:y.unref(w_)},null,8,A_)],32)]))}}),[["__scopeId","data-v-f27394ae"]]);function P_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mr={exports:{}};/* @preserve
2
2
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
3
3
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
- */var R_=mr.exports,Xh;function L_(){return Xh||(Xh=1,(function(n,t){(function(e,s){s(t)})(R_,(function(e){var s="1.9.4";function r(i){var o,c,f,x;for(c=1,f=arguments.length;c<f;c++){x=arguments[c];for(o in x)i[o]=x[o]}return i}var a=Object.create||(function(){function i(){}return function(o){return i.prototype=o,new i}})();function l(i,o){var c=Array.prototype.slice;if(i.bind)return i.bind.apply(i,c.call(arguments,1));var f=c.call(arguments,2);return function(){return i.apply(o,f.length?f.concat(c.call(arguments)):arguments)}}var h=0;function u(i){return"_leaflet_id"in i||(i._leaflet_id=++h),i._leaflet_id}function d(i,o,c){var f,x,A,F;return F=function(){f=!1,x&&(A.apply(c,x),x=!1)},A=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(F,o),f=!0)},A}function p(i,o,c){var f=o[1],x=o[0],A=f-x;return i===f&&c?i:((i-x)%A+A)%A+x}function m(){return!1}function _(i,o){if(o===!1)return i;var c=Math.pow(10,o===void 0?6:o);return Math.round(i*c)/c}function E(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function S(i){return E(i).split(/\s+/)}function w(i,o){Object.prototype.hasOwnProperty.call(i,"options")||(i.options=i.options?a(i.options):{});for(var c in o)i.options[c]=o[c];return i.options}function v(i,o,c){var f=[];for(var x in i)f.push(encodeURIComponent(c?x.toUpperCase():x)+"="+encodeURIComponent(i[x]));return(!o||o.indexOf("?")===-1?"?":"&")+f.join("&")}var g=/\{ *([\w_ -]+) *\}/g;function I(i,o){return i.replace(g,function(c,f){var x=o[f];if(x===void 0)throw new Error("No value provided for variable "+c);return typeof x=="function"&&(x=x(o)),x})}var C=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"};function M(i,o){for(var c=0;c<i.length;c++)if(i[c]===o)return c;return-1}var k="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(i){return window["webkit"+i]||window["moz"+i]||window["ms"+i]}var B=0;function V(i){var o=+new Date,c=Math.max(0,16-(o-B));return B=o+c,window.setTimeout(i,c)}var D=window.requestAnimationFrame||N("RequestAnimationFrame")||V,P=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function O(i,o,c){if(c&&D===V)i.call(o);else return D.call(window,l(i,o))}function et(i){i&&P.call(window,i)}var z={__proto__:null,extend:r,create:a,bind:l,get lastId(){return h},stamp:u,throttle:d,wrapNum:p,falseFn:m,formatNum:_,trim:E,splitWords:S,setOptions:w,getParamString:v,template:I,isArray:C,indexOf:M,emptyImageUrl:k,requestFn:D,cancelFn:P,requestAnimFrame:O,cancelAnimFrame:et};function H(){}H.extend=function(i){var o=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=o.__super__=this.prototype,f=a(c);f.constructor=o,o.prototype=f;for(var x in this)Object.prototype.hasOwnProperty.call(this,x)&&x!=="prototype"&&x!=="__super__"&&(o[x]=this[x]);return i.statics&&r(o,i.statics),i.includes&&(q(i.includes),r.apply(null,[f].concat(i.includes))),r(f,i),delete f.statics,delete f.includes,f.options&&(f.options=c.options?a(c.options):{},r(f.options,i.options)),f._initHooks=[],f.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var A=0,F=f._initHooks.length;A<F;A++)f._initHooks[A].call(this)}},o},H.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},H.mergeOptions=function(i){return r(this.prototype.options,i),this},H.addInitHook=function(i){var o=Array.prototype.slice.call(arguments,1),c=typeof i=="function"?i:function(){this[i].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function q(i){if(!(typeof L>"u"||!L||!L.Mixin)){i=C(i)?i:[i];for(var o=0;o<i.length;o++)i[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var j={on:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o);else{i=S(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c)}return this},off:function(i,o,c){if(!arguments.length)delete this._events;else if(typeof i=="object")for(var f in i)this._off(f,i[f],o);else{i=S(i);for(var x=arguments.length===1,A=0,F=i.length;A<F;A++)x?this._off(i[A]):this._off(i[A],o,c)}return this},_on:function(i,o,c,f){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(i,o,c)===!1){c===this&&(c=void 0);var x={fn:o,ctx:c};f&&(x.once=!0),this._events=this._events||{},this._events[i]=this._events[i]||[],this._events[i].push(x)}},_off:function(i,o,c){var f,x,A;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,A=f.length;x<A;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var F=this._listens(i,o,c);if(F!==!1){var K=f[F];this._firingCount&&(K.fn=m,this._events[i]=f=f.slice()),f.splice(F,1)}}},fire:function(i,o,c){if(!this.listens(i,c))return this;var f=r({},o,{type:i,target:this,sourceTarget:o&&o.sourceTarget||this});if(this._events){var x=this._events[i];if(x){this._firingCount=this._firingCount+1||1;for(var A=0,F=x.length;A<F;A++){var K=x[A],st=K.fn;K.once&&this.off(i,st,K.ctx),st.call(K.ctx||this,f)}this._firingCount--}}return c&&this._propagateEvent(f),this},listens:function(i,o,c,f){typeof i!="string"&&console.warn('"string" type argument expected');var x=o;typeof o!="function"&&(f=!!o,x=void 0,c=void 0);var A=this._events&&this._events[i];if(A&&A.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var F in this._eventParents)if(this._eventParents[F].listens(i,o,c,f))return!0}return!1},_listens:function(i,o,c){if(!this._events)return!1;var f=this._events[i]||[];if(!o)return!!f.length;c===this&&(c=void 0);for(var x=0,A=f.length;x<A;x++)if(f[x].fn===o&&f[x].ctx===c)return x;return!1},once:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o,!0);else{i=S(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c,!0)}return this},addEventParent:function(i){return this._eventParents=this._eventParents||{},this._eventParents[u(i)]=i,this},removeEventParent:function(i){return this._eventParents&&delete this._eventParents[u(i)],this},_propagateEvent:function(i){for(var o in this._eventParents)this._eventParents[o].fire(i.type,r({layer:i.target,propagatedFrom:i.target},i),!0)}};j.addEventListener=j.on,j.removeEventListener=j.clearAllEventListeners=j.off,j.addOneTimeEventListener=j.once,j.fireEvent=j.fire,j.hasEventListeners=j.listens;var ct=H.extend(j);function W(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var St=Math.trunc||function(i){return i>0?Math.floor(i):Math.ceil(i)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(i){return this.clone()._add(at(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(at(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new W(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new W(this.x/i.x,this.y/i.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=St(this.x),this.y=St(this.y),this},distanceTo:function(i){i=at(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=at(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=at(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function at(i,o,c){return i instanceof W?i:C(i)?new W(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new W(i.x,i.y):new W(i,o,c)}function Mt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}Mt.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof W||typeof i[0]=="number"||"x"in i)o=c=at(i);else if(i=Ot(i),o=i.min,c=i.max,!o||!c)return this;return!this.min&&!this.max?(this.min=o.clone(),this.max=c.clone()):(this.min.x=Math.min(o.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(o.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(i){return at((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return at(this.min.x,this.max.y)},getTopRight:function(){return at(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(i){var o,c;return typeof i[0]=="number"||i instanceof W?i=at(i):i=Ot(i),i instanceof Mt?(o=i.min,c=i.max):o=c=i,o.x>=this.min.x&&c.x<=this.max.x&&o.y>=this.min.y&&c.y<=this.max.y},intersects:function(i){i=Ot(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>=o.x&&f.x<=c.x,F=x.y>=o.y&&f.y<=c.y;return A&&F},overlaps:function(i){i=Ot(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>o.x&&f.x<c.x,F=x.y>o.y&&f.y<c.y;return A&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(i){var o=this.min,c=this.max,f=Math.abs(o.x-c.x)*i,x=Math.abs(o.y-c.y)*i;return Ot(at(o.x-f,o.y-x),at(c.x+f,c.y+x))},equals:function(i){return i?(i=Ot(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function Ot(i,o){return!i||i instanceof Mt?i:new Mt(i,o)}function oe(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}oe.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof tt)f=i,x=i;else if(i instanceof oe){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(ut(i)||Qt(i)):this;return!o&&!c?(this._southWest=new tt(f.lat,f.lng),this._northEast=new tt(x.lat,x.lng)):(o.lat=Math.min(f.lat,o.lat),o.lng=Math.min(f.lng,o.lng),c.lat=Math.max(x.lat,c.lat),c.lng=Math.max(x.lng,c.lng)),this},pad:function(i){var o=this._southWest,c=this._northEast,f=Math.abs(o.lat-c.lat)*i,x=Math.abs(o.lng-c.lng)*i;return new oe(new tt(o.lat-f,o.lng-x),new tt(c.lat+f,c.lng+x))},getCenter:function(){return new tt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new tt(this.getNorth(),this.getWest())},getSouthEast:function(){return new tt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(i){typeof i[0]=="number"||i instanceof tt||"lat"in i?i=ut(i):i=Qt(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof oe?(f=i.getSouthWest(),x=i.getNorthEast()):f=x=i,f.lat>=o.lat&&x.lat<=c.lat&&f.lng>=o.lng&&x.lng<=c.lng},intersects:function(i){i=Qt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>=o.lat&&f.lat<=c.lat,F=x.lng>=o.lng&&f.lng<=c.lng;return A&&F},overlaps:function(i){i=Qt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>o.lat&&f.lat<c.lat,F=x.lng>o.lng&&f.lng<c.lng;return A&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Qt(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Qt(i,o){return i instanceof oe?i:new oe(i,o)}function tt(i,o,c){if(isNaN(i)||isNaN(o))throw new Error("Invalid LatLng object: ("+i+", "+o+")");this.lat=+i,this.lng=+o,c!==void 0&&(this.alt=+c)}tt.prototype={equals:function(i,o){if(!i)return!1;i=ut(i);var c=Math.max(Math.abs(this.lat-i.lat),Math.abs(this.lng-i.lng));return c<=(o===void 0?1e-9:o)},toString:function(i){return"LatLng("+_(this.lat,i)+", "+_(this.lng,i)+")"},distanceTo:function(i){return Nt.distance(this,ut(i))},wrap:function(){return Nt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Qt([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new tt(this.lat,this.lng,this.alt)}};function ut(i,o,c){return i instanceof tt?i:C(i)&&typeof i[0]!="object"?i.length===3?new tt(i[0],i[1],i[2]):i.length===2?new tt(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new tt(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new tt(i,o,c)}var _t={latLngToPoint:function(i,o){var c=this.projection.project(i),f=this.scale(o);return this.transformation._transform(c,f)},pointToLatLng:function(i,o){var c=this.scale(o),f=this.transformation.untransform(i,c);return this.projection.unproject(f)},project:function(i){return this.projection.project(i)},unproject:function(i){return this.projection.unproject(i)},scale:function(i){return 256*Math.pow(2,i)},zoom:function(i){return Math.log(i/256)/Math.LN2},getProjectedBounds:function(i){if(this.infinite)return null;var o=this.projection.bounds,c=this.scale(i),f=this.transformation.transform(o.min,c),x=this.transformation.transform(o.max,c);return new Mt(f,x)},infinite:!1,wrapLatLng:function(i){var o=this.wrapLng?p(i.lng,this.wrapLng,!0):i.lng,c=this.wrapLat?p(i.lat,this.wrapLat,!0):i.lat,f=i.alt;return new tt(c,o,f)},wrapLatLngBounds:function(i){var o=i.getCenter(),c=this.wrapLatLng(o),f=o.lat-c.lat,x=o.lng-c.lng;if(f===0&&x===0)return i;var A=i.getSouthWest(),F=i.getNorthEast(),K=new tt(A.lat-f,A.lng-x),st=new tt(F.lat-f,F.lng-x);return new oe(K,st)}},Nt=r({},_t,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,A=Math.sin((o.lat-i.lat)*c/2),F=Math.sin((o.lng-i.lng)*c/2),K=A*A+Math.cos(f)*Math.cos(x)*F*F,st=2*Math.atan2(Math.sqrt(K),Math.sqrt(1-K));return this.R*st}}),Zt=6378137,jt={R:Zt,MAX_LATITUDE:85.0511287798,project:function(i){var o=Math.PI/180,c=this.MAX_LATITUDE,f=Math.max(Math.min(c,i.lat),-c),x=Math.sin(f*o);return new W(this.R*i.lng*o,this.R*Math.log((1+x)/(1-x))/2)},unproject:function(i){var o=180/Math.PI;return new tt((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=Zt*Math.PI;return new Mt([-i,-i],[i,i])})()};function Re(i,o,c,f){if(C(i)){this._a=i[0],this._b=i[1],this._c=i[2],this._d=i[3];return}this._a=i,this._b=o,this._c=c,this._d=f}Re.prototype={transform:function(i,o){return this._transform(i.clone(),o)},_transform:function(i,o){return o=o||1,i.x=o*(this._a*i.x+this._b),i.y=o*(this._c*i.y+this._d),i},untransform:function(i,o){return o=o||1,new W((i.x/o-this._b)/this._a,(i.y/o-this._d)/this._c)}};function dt(i,o,c,f){return new Re(i,o,c,f)}var T=r({},Nt,{code:"EPSG:3857",projection:jt,transformation:(function(){var i=.5/(Math.PI*jt.R);return dt(i,.5,-i,.5)})()}),Z=r({},T,{code:"EPSG:900913"});function $(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ht(i,o){var c="",f,x,A,F,K,st;for(f=0,A=i.length;f<A;f++){for(K=i[f],x=0,F=K.length;x<F;x++)st=K[x],c+=(x?"L":"M")+st.x+" "+st.y;c+=o?Wt.svg?"z":"x":""}return c||"M0 0"}var lt=document.documentElement.style,Tt="ActiveXObject"in window,pt=Tt&&!document.addEventListener,bt="msLaunchUri"in navigator&&!("documentMode"in document),re=An("webkit"),de=An("android"),U=An("android 2")||An("android 3"),b=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),J=de&&An("Google")&&b<537&&!("AudioNode"in window),rt=!!window.opera,gt=!bt&&An("chrome"),ot=An("gecko")&&!re&&!rt&&!Tt,Ht=!gt&&An("safari"),At=An("phantom"),Bt="OTransition"in lt,Vt=navigator.platform.indexOf("Win")===0,xt=Tt&&"transition"in lt,Lt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!U,ne="MozPerspective"in lt,Gt=!window.L_DISABLE_3D&&(xt||Lt||ne)&&!Bt&&!At,Pt=typeof orientation<"u"||An("mobile"),ce=Pt&&re,G=Pt&&Lt,wt=!window.PointerEvent&&window.MSPointerEvent,Ct=!!(window.PointerEvent||wt),Ut="ontouchstart"in window||!!window.TouchEvent,vt=!window.L_NO_TOUCH&&(Ut||Ct),ft=Pt&&rt,zt=Pt&&ot,le=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,De=(function(){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",m,o),window.removeEventListener("testPassiveEventSupport",m,o)}catch{}return i})(),Me=(function(){return!!document.createElement("canvas").getContext})(),bn=!!(document.createElementNS&&$("svg").createSVGRect),On=!!bn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ba=!bn&&(function(){try{var i=document.createElement("div");i.innerHTML='<v:shape adj="1"/>';var o=i.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch{return!1}})(),wi=navigator.platform.indexOf("Mac")===0,io=navigator.platform.indexOf("Linux")===0;function An(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Wt={ie:Tt,ielt9:pt,edge:bt,webkit:re,android:de,android23:U,androidStock:J,opera:rt,chrome:gt,gecko:ot,safari:Ht,phantom:At,opera12:Bt,win:Vt,ie3d:xt,webkit3d:Lt,gecko3d:ne,any3d:Gt,mobile:Pt,mobileWebkit:ce,mobileWebkit3d:G,msPointer:wt,pointer:Ct,touch:vt,touchNative:Ut,mobileOpera:ft,mobileGecko:zt,retina:le,passiveEvents:De,canvas:Me,svg:bn,vml:Ba,inlineSvg:On,mac:wi,linux:io},_s=Wt.msPointer?"MSPointerDown":"pointerdown",so=Wt.msPointer?"MSPointerMove":"pointermove",vs=Wt.msPointer?"MSPointerUp":"pointerup",ro=Wt.msPointer?"MSPointerCancel":"pointercancel",lr={touchstart:_s,touchmove:so,touchend:vs,touchcancel:ro},Fa={touchstart:Y,touchmove:nt,touchend:nt,touchcancel:nt},Ji={},za=!1;function ph(i,o,c){return o==="touchstart"&&it(),Fa[o]?(c=Fa[o].bind(this,c),i.addEventListener(lr[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function mh(i,o,c){if(!lr[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(lr[o],c,!1)}function gh(i){Ji[i.pointerId]=i}function R(i){Ji[i.pointerId]&&(Ji[i.pointerId]=i)}function X(i){delete Ji[i.pointerId]}function it(){za||(document.addEventListener(_s,gh,!0),document.addEventListener(so,R,!0),document.addEventListener(vs,X,!0),document.addEventListener(ro,X,!0),za=!0)}function nt(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Ji)o.touches.push(Ji[c]);o.changedTouches=[o],i(o)}}function Y(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&nn(o),nt(i,o)}function Et(i){var o={},c,f;for(f in i)c=i[f],o[f]=c&&c.bind?c.bind(i):c;return i=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var It=200;function Ft(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(A){if(A.detail!==1){f=A.detail;return}if(!(A.pointerType==="mouse"||A.sourceCapabilities&&!A.sourceCapabilities.firesTouchEvents)){var F=xm(A);if(!(F.some(function(st){return st instanceof HTMLLabelElement&&st.attributes.for})&&!F.some(function(st){return st instanceof HTMLInputElement||st instanceof HTMLSelectElement}))){var K=Date.now();K-c<=It?(f++,f===2&&o(Et(A))):f=1,c=K}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function kt(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var te=en(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=en(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),qt=ee==="webkitTransition"||ee==="OTransition"?ee+"End":"transitionend";function pe(i){return typeof i=="string"?document.getElementById(i):i}function Ee(i,o){var c=i.style[o]||i.currentStyle&&i.currentStyle[o];if((!c||c==="auto")&&document.defaultView){var f=document.defaultView.getComputedStyle(i,null);c=f?f[o]:null}return c==="auto"?null:c}function Jt(i,o,c){var f=document.createElement(i);return f.className=o||"",c&&c.appendChild(f),f}function ie(i){var o=i.parentNode;o&&o.removeChild(i)}function Te(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Xt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Le(i){var o=i.parentNode;o&&o.firstChild!==i&&o.insertBefore(i,o.firstChild)}function _e(i,o){if(i.classList!==void 0)return i.classList.contains(o);var c=si(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function $t(i,o){if(i.classList!==void 0)for(var c=S(o),f=0,x=c.length;f<x;f++)i.classList.add(c[f]);else if(!_e(i,o)){var A=si(i);tn(i,(A?A+" ":"")+o)}}function ke(i,o){i.classList!==void 0?i.classList.remove(o):tn(i,E((" "+si(i)+" ").replace(" "+o+" "," ")))}function tn(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function si(i){return i.correspondingElement&&(i=i.correspondingElement),i.className.baseVal===void 0?i.className:i.className.baseVal}function ve(i,o){"opacity"in i.style?i.style.opacity=o:"filter"in i.style&&_n(i,o)}function _n(i,o){var c=!1,f="DXImageTransform.Microsoft.Alpha";try{c=i.filters.item(f)}catch{if(o===1)return}o=Math.round(o*100),c?(c.Enabled=o!==100,c.Opacity=o):i.style.filter+=" progid:"+f+"(opacity="+o+")"}function en(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Fe(i,o,c){var f=o||new W(0,0);i.style[te]=(Wt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function ye(i,o){i._leaflet_pos=o,Wt.any3d?Fe(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Yn(i){return i._leaflet_pos||new W(0,0)}var Cn,oo,_h;if("onselectstart"in document)Cn=function(){he(window,"selectstart",nn)},oo=function(){Ue(window,"selectstart",nn)};else{var ao=en(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Cn=function(){if(ao){var i=document.documentElement.style;_h=i[ao],i[ao]="none"}},oo=function(){ao&&(document.documentElement.style[ao]=_h,_h=void 0)}}function vh(){he(window,"dragstart",nn)}function yh(){Ue(window,"dragstart",nn)}var Ha,Eh;function xh(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Va(),Ha=i,Eh=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Va))}function Va(){Ha&&(Ha.style.outlineStyle=Eh,Ha=void 0,Eh=void 0,Ue(window,"keydown",Va))}function ym(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function wh(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var lT={__proto__:null,TRANSFORM:te,TRANSITION:ee,TRANSITION_END:qt,get:pe,getStyle:Ee,create:Jt,remove:ie,empty:Te,toFront:Xt,toBack:Le,hasClass:_e,addClass:$t,removeClass:ke,setClass:tn,getClass:si,setOpacity:ve,testProp:en,setTransform:Fe,setPosition:ye,getPosition:Yn,get disableTextSelection(){return Cn},get enableTextSelection(){return oo},disableImageDrag:vh,enableImageDrag:yh,preventOutline:xh,restoreOutline:Va,getSizedParentNode:ym,getScale:wh};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)Mh(i,x,o[x],c);else{o=S(o);for(var A=0,F=o.length;A<F;A++)Mh(i,o[A],c,f)}return this}var ri="_leaflet_events";function Ue(i,o,c,f){if(arguments.length===1)Em(i),delete i[ri];else if(o&&typeof o=="object")for(var x in o)Th(i,x,o[x],c);else if(o=S(o),arguments.length===2)Em(i,function(K){return M(o,K)!==-1});else for(var A=0,F=o.length;A<F;A++)Th(i,o[A],c,f);return this}function Em(i,o){for(var c in i[ri]){var f=c.split(/\d/)[0];(!o||o(f))&&Th(i,f,null,null,c)}}var Sh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Mh(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ri]&&i[ri][x])return this;var A=function(K){return c.call(f||i,K||window.event)},F=A;!Wt.touchNative&&Wt.pointer&&o.indexOf("touch")===0?A=ph(i,o,A):Wt.touch&&o==="dblclick"?A=Ft(i,A):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(Sh[o]||o,A,Wt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(A=function(K){K=K||window.event,Ah(i,K)&&F(K)},i.addEventListener(Sh[o],A,!1)):i.addEventListener(o,F,!1):i.attachEvent("on"+o,A),i[ri]=i[ri]||{},i[ri][x]=A}function Th(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var A=i[ri]&&i[ri][x];if(!A)return this;!Wt.touchNative&&Wt.pointer&&o.indexOf("touch")===0?mh(i,o,A):Wt.touch&&o==="dblclick"?kt(i,A):"removeEventListener"in i?i.removeEventListener(Sh[o]||o,A,!1):i.detachEvent("on"+o,A),i[ri][x]=null}function ys(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function bh(i){return Mh(i,"wheel",ys),this}function lo(i){return he(i,"mousedown touchstart dblclick contextmenu",ys),i._leaflet_disable_click=!0,this}function nn(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function Es(i){return nn(i),ys(i),this}function xm(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function wm(i,o){if(!o)return new W(i.clientX,i.clientY);var c=wh(o),f=c.boundingClientRect;return new W((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var cT=Wt.linux&&Wt.chrome?window.devicePixelRatio:Wt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Sm(i){return Wt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/cT:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function Ah(i,o){var c=o.relatedTarget;if(!c)return!0;try{for(;c&&c!==i;)c=c.parentNode}catch{return!1}return c!==i}var hT={__proto__:null,on:he,off:Ue,stopPropagation:ys,disableScrollPropagation:bh,disableClickPropagation:lo,preventDefault:nn,stop:Es,getPropagationPath:xm,getMousePosition:wm,getWheelDelta:Sm,isExternalTarget:Ah,addListener:he,removeListener:Ue},Mm=ct.extend({run:function(i,o,c,f){this.stop(),this._el=i,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(f||.5,.2),this._startPos=Yn(i),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=O(this._animate,this),this._step()},_step:function(i){var o=+new Date-this._startTime,c=this._duration*1e3;o<c?this._runFrame(this._easeOut(o/c),i):(this._runFrame(1),this._complete())},_runFrame:function(i,o){var c=this._startPos.add(this._offset.multiplyBy(i));o&&c._round(),ye(this._el,c),this.fire("step")},_complete:function(){et(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),xe=ct.extend({options:{crs:T,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(i,o){o=w(this,o),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(i),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),o.maxBounds&&this.setMaxBounds(o.maxBounds),o.zoom!==void 0&&(this._zoom=this._limitZoom(o.zoom)),o.center&&o.zoom!==void 0&&this.setView(ut(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ee&&Wt.any3d&&!Wt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),he(this._proxy,qt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(i,o,c){if(o=o===void 0?this._zoom:this._limitZoom(o),i=this._limitCenter(ut(i),o,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=r({animate:c.animate},c.zoom),c.pan=r({animate:c.animate,duration:c.duration},c.pan));var f=this._zoom!==o?this._tryAnimatedZoom&&this._tryAnimatedZoom(i,o,c.zoom):this._tryAnimatedPan(i,c.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(i,o,c.pan&&c.pan.noMoveStart),this},setZoom:function(i,o){return this._loaded?this.setView(this.getCenter(),i,{zoom:o}):(this._zoom=i,this)},zoomIn:function(i,o){return i=i||(Wt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(Wt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-i,o)},setZoomAround:function(i,o,c){var f=this.getZoomScale(o),x=this.getSize().divideBy(2),A=i instanceof W?i:this.latLngToContainerPoint(i),F=A.subtract(x).multiplyBy(1-1/f),K=this.containerPointToLatLng(x.add(F));return this.setView(K,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Qt(i);var c=at(o.paddingTopLeft||o.padding||[0,0]),f=at(o.paddingBottomRight||o.padding||[0,0]),x=this.getBoundsZoom(i,!1,c.add(f));if(x=typeof o.maxZoom=="number"?Math.min(o.maxZoom,x):x,x===1/0)return{center:i.getCenter(),zoom:x};var A=f.subtract(c).divideBy(2),F=this.project(i.getSouthWest(),x),K=this.project(i.getNorthEast(),x),st=this.unproject(F.add(K).divideBy(2).add(A),x);return{center:st,zoom:x}},fitBounds:function(i,o){if(i=Qt(i),!i.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(i,o);return this.setView(c.center,c.zoom,o)},fitWorld:function(i){return this.fitBounds([[-90,-180],[90,180]],i)},panTo:function(i,o){return this.setView(i,this._zoom,{pan:o})},panBy:function(i,o){if(i=at(i).round(),o=o||{},!i.x&&!i.y)return this.fire("moveend");if(o.animate!==!0&&!this.getSize().contains(i))return this._resetView(this.unproject(this.project(this.getCenter()).add(i)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Mm,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o.noMoveStart||this.fire("movestart"),o.animate!==!1){$t(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(i).round();this._panAnim.run(this._mapPane,c,o.duration||.25,o.easeLinearity)}else this._rawPanBy(i),this.fire("move").fire("moveend");return this},flyTo:function(i,o,c){if(c=c||{},c.animate===!1||!Wt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),A=this.getSize(),F=this._zoom;i=ut(i),o=o===void 0?F:o;var K=Math.max(A.x,A.y),st=K*this.getZoomScale(F,o),mt=x.distanceTo(f)||1,Dt=1.42,se=Dt*Dt;function me(We){var tl=We?-1:1,KT=We?st:K,$T=st*st-K*K+tl*se*se*mt*mt,tb=2*KT*se*mt,Bh=$T/tb,sg=Math.sqrt(Bh*Bh+1)-Bh,eb=sg<1e-9?-18:Math.log(sg);return eb}function dn(We){return(Math.exp(We)-Math.exp(-We))/2}function je(We){return(Math.exp(We)+Math.exp(-We))/2}function Bn(We){return dn(We)/je(We)}var vn=me(0);function pr(We){return K*(je(vn)/je(vn+Dt*We))}function qT(We){return K*(je(vn)*Bn(vn+Dt*We)-dn(vn))/se}function QT(We){return 1-Math.pow(1-We,1.5)}var jT=Date.now(),ng=(me(1)-vn)/Dt,JT=c.duration?1e3*c.duration:1e3*ng*.8;function ig(){var We=(Date.now()-jT)/JT,tl=QT(We)*ng;We<=1?(this._flyToFrame=O(ig,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(qT(tl)/mt)),F),this.getScaleZoom(K/pr(tl),F),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),ig.call(this),this},flyToBounds:function(i,o){var c=this._getBoundsCenterZoom(i,o);return this.flyTo(c.center,c.zoom,o)},setMaxBounds:function(i){return i=Qt(i),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),i.isValid()?(this.options.maxBounds=i,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(i){var o=this.options.minZoom;return this.options.minZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(i):this},setMaxZoom:function(i){var o=this.options.maxZoom;return this.options.maxZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,o){this._enforcingBounds=!0;var c=this.getCenter(),f=this._limitCenter(c,this._zoom,Qt(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=at(o.paddingTopLeft||o.padding||[0,0]),f=at(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),A=this.project(i),F=this.getPixelBounds(),K=Ot([F.min.add(c),F.max.subtract(f)]),st=K.getSize();if(!K.contains(A)){this._enforcingBounds=!0;var mt=A.subtract(K.getCenter()),Dt=K.extend(A).getSize().subtract(st);x.x+=mt.x<0?-Dt.x:Dt.x,x.y+=mt.y<0?-Dt.y:Dt.y,this.panTo(this.unproject(x),o),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=r({animate:!1,pan:!0},i===!0?{animate:!0}:i);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),f=o.divideBy(2).round(),x=c.divideBy(2).round(),A=f.subtract(x);return!A.x&&!A.y?this:(i.animate&&i.pan?this.panBy(A):(i.pan&&this._rawPanBy(A),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=r({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,c,i):navigator.geolocation.getCurrentPosition(o,c,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var o=i.code,c=i.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var o=i.coords.latitude,c=i.coords.longitude,f=new tt(o,c),x=f.toBounds(i.coords.accuracy*2),A=this._locateOptions;if(A.setView){var F=this.getBoundsZoom(x);this.setView(f,A.maxZoom?Math.min(F,A.maxZoom):F)}var K={latlng:f,bounds:x,timestamp:i.timestamp};for(var st in i.coords)typeof i.coords[st]=="number"&&(K[st]=i.coords[st]);this.fire("locationfound",K)}},addHandler:function(i,o){if(!o)return this;var c=this[i]=new o(this);return this._handlers.push(c),this.options[i]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ie(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(et(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)ie(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,o){var c="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),f=Jt("div",c,o||this._mapPane);return i&&(this._panes[i]=f),f},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),o=this.unproject(i.getBottomLeft()),c=this.unproject(i.getTopRight());return new oe(o,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(i,o,c){i=Qt(i),c=at(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),A=this.getMaxZoom(),F=i.getNorthWest(),K=i.getSouthEast(),st=this.getSize().subtract(c),mt=Ot(this.project(K,f),this.project(F,f)).getSize(),Dt=Wt.any3d?this.options.zoomSnap:1,se=st.x/mt.x,me=st.y/mt.y,dn=o?Math.max(se,me):Math.min(se,me);return f=this.getScaleZoom(dn,f),Dt&&(f=Math.round(f/(Dt/100))*(Dt/100),f=o?Math.ceil(f/Dt)*Dt:Math.floor(f/Dt)*Dt),Math.max(x,Math.min(A,f))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,o){var c=this._getTopLeftPoint(i,o);return new Mt(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,o){var c=this.options.crs;return o=o===void 0?this._zoom:o,c.scale(i)/c.scale(o)},getScaleZoom:function(i,o){var c=this.options.crs;o=o===void 0?this._zoom:o;var f=c.zoom(i*c.scale(o));return isNaN(f)?1/0:f},project:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(ut(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(at(i),o)},layerPointToLatLng:function(i){var o=at(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(ut(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(ut(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Qt(i))},distance:function(i,o){return this.options.crs.distance(ut(i),ut(o))},containerPointToLayerPoint:function(i){return at(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return at(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(at(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ut(i)))},mouseEventToContainerPoint:function(i){return wm(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var o=this._container=pe(i);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");he(o,"scroll",this._onScroll,this),this._containerId=u(o)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&Wt.any3d,$t(i,"leaflet-container"+(Wt.touch?" leaflet-touch":"")+(Wt.retina?" leaflet-retina":"")+(Wt.ielt9?" leaflet-oldie":"")+(Wt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=Ee(i,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ye(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||($t(i.markerPane,"leaflet-zoom-hide"),$t(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,o,c){ye(this._mapPane,new W(0,0));var f=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var x=this._zoom!==o;this._moveStart(x,c)._move(i,o)._moveEnd(x),this.fire("viewreset"),f&&this.fire("load")},_moveStart:function(i,o){return i&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(i,o,c,f){o===void 0&&(o=this._zoom);var x=this._zoom!==o;return this._zoom=o,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),f?c&&c.pinch&&this.fire("zoom",c):((x||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return et(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){ye(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[u(this._container)]=this;var o=i?Ue:he;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),Wt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){et(this._resizeRequest),this._resizeRequest=O(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,o){for(var c=[],f,x=o==="mouseout"||o==="mouseover",A=i.target||i.srcElement,F=!1;A;){if(f=this._targets[u(A)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){F=!0;break}if(f&&f.listens(o,!0)&&(x&&!Ah(A,i)||(c.push(f),x))||A===this._container)break;A=A.parentNode}return!c.length&&!F&&!x&&this.listens(o,!0)&&(c=[this]),c},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var o=i.target||i.srcElement;if(!(!this._loaded||o._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(o))){var c=i.type;c==="mousedown"&&xh(o),this._fireDOMEvent(i,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,o,c){if(i.type==="click"){var f=r({},i);f.type="preclick",this._fireDOMEvent(f,f.type,c)}var x=this._findEventTargets(i,o);if(c){for(var A=[],F=0;F<c.length;F++)c[F].listens(o,!0)&&A.push(c[F]);x=A.concat(x)}if(x.length){o==="contextmenu"&&nn(i);var K=x[0],st={originalEvent:i};if(i.type!=="keypress"&&i.type!=="keydown"&&i.type!=="keyup"){var mt=K.getLatLng&&(!K._radius||K._radius<=10);st.containerPoint=mt?this.latLngToContainerPoint(K.getLatLng()):this.mouseEventToContainerPoint(i),st.layerPoint=this.containerPointToLayerPoint(st.containerPoint),st.latlng=mt?K.getLatLng():this.layerPointToLatLng(st.layerPoint)}for(F=0;F<x.length;F++)if(x[F].fire(o,st,!0),st.originalEvent._stopped||x[F].options.bubblingMouseEvents===!1&&M(this._mouseEvents,o)!==-1)return}},_draggableMoved:function(i){return i=i.dragging&&i.dragging.enabled()?i:this,i.dragging&&i.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,o=this._handlers.length;i<o;i++)this._handlers[i].disable()},whenReady:function(i,o){return this._loaded?i.call(o||this,{target:this}):this.on("load",i,o),this},_getMapPanePos:function(){return Yn(this._mapPane)||new W(0,0)},_moved:function(){var i=this._getMapPanePos();return i&&!i.equals([0,0])},_getTopLeftPoint:function(i,o){var c=i&&o!==void 0?this._getNewPixelOrigin(i,o):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(i,o){var c=this.getSize()._divideBy(2);return this.project(i,o)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return this.project(i,o)._subtract(f)},_latLngBoundsToNewLayerBounds:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return Ot([this.project(i.getSouthWest(),o)._subtract(f),this.project(i.getNorthWest(),o)._subtract(f),this.project(i.getSouthEast(),o)._subtract(f),this.project(i.getNorthEast(),o)._subtract(f)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(i){return this.latLngToLayerPoint(i).subtract(this._getCenterLayerPoint())},_limitCenter:function(i,o,c){if(!c)return i;var f=this.project(i,o),x=this.getSize().divideBy(2),A=new Mt(f.subtract(x),f.add(x)),F=this._getBoundsOffset(A,c,o);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?i:this.unproject(f.add(F),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new Mt(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=Ot(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),A=f.max.subtract(i.max),F=this._rebound(x.x,-A.x),K=this._rebound(x.y,-A.y);return new W(F,K)},_rebound:function(i,o){return i+o>0?Math.round(i-o)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(o))},_limitZoom:function(i){var o=this.getMinZoom(),c=this.getMaxZoom(),f=Wt.any3d?this.options.zoomSnap:1;return f&&(i=Math.round(i/f)*f),Math.max(o,Math.min(c,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ke(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,o){var c=this._getCenterOffset(i)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,o),!0)},_createAnimProxy:function(){var i=this._proxy=Jt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(o){var c=te,f=this._proxy.style[c];Fe(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),f===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ie(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),o=this.getZoom();Fe(this._proxy,this.project(i,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,o,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var f=this.getZoomScale(o),x=this._getCenterOffset(i)._divideBy(1-1/f);return c.animate!==!0&&!this.getSize().contains(x)?!1:(O(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(i,o,!0)},this),!0)},_animateZoom:function(i,o,c,f){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=o,$t(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:o,noUpdate:f}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ke(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function uT(i,o){return new xe(i,o)}var qn=H.extend({options:{position:"topright"},initialize:function(i){w(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var o=this._map;return o&&o.removeControl(this),this.options.position=i,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var o=this._container=this.onAdd(i),c=this.getPosition(),f=i._controlCorners[c];return $t(o,"leaflet-control"),c.indexOf("bottom")!==-1?f.insertBefore(o,f.firstChild):f.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ie(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),co=function(i){return new qn(i)};xe.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},o="leaflet-",c=this._controlContainer=Jt("div",o+"control-container",this._container);function f(x,A){var F=o+x+" "+o+A;i[x+A]=Jt("div",F,c)}f("top","left"),f("top","right"),f("bottom","left"),f("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)ie(this._controlCorners[i]);ie(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Tm=qn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,o,c,f){return c<f?-1:f<c?1:0}},initialize:function(i,o,c){w(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var f in i)this._addLayer(i[f],f);for(f in o)this._addLayer(o[f],f,!0)},onAdd:function(i){this._initLayout(),this._update(),this._map=i,i.on("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(i){return qn.prototype.addTo.call(this,i),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(i,o){return this._addLayer(i,o),this._map?this._update():this},addOverlay:function(i,o){return this._addLayer(i,o,!0),this._map?this._update():this},removeLayer:function(i){i.off("add remove",this._onLayerChange,this);var o=this._getLayer(u(i));return o&&this._layers.splice(this._layers.indexOf(o),1),this._map?this._update():this},expand:function(){$t(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var i=this._map.getSize().y-(this._container.offsetTop+50);return i<this._section.clientHeight?($t(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=i+"px"):ke(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ke(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var i="leaflet-control-layers",o=this._container=Jt("div",i),c=this.options.collapsed;o.setAttribute("aria-haspopup",!0),lo(o),bh(o);var f=this._section=Jt("section",i+"-list");c&&(this._map.on("click",this.collapse,this),he(o,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var x=this._layersLink=Jt("a",i+"-toggle",o);x.href="#",x.title="Layers",x.setAttribute("role","button"),he(x,{keydown:function(A){A.keyCode===13&&this._expandSafely()},click:function(A){nn(A),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Jt("div",i+"-base",f),this._separator=Jt("div",i+"-separator",f),this._overlaysList=Jt("div",i+"-overlays",f),o.appendChild(f)},_getLayer:function(i){for(var o=0;o<this._layers.length;o++)if(this._layers[o]&&u(this._layers[o].layer)===i)return this._layers[o]},_addLayer:function(i,o,c){this._map&&i.on("add remove",this._onLayerChange,this),this._layers.push({layer:i,name:o,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(f,x){return this.options.sortFunction(f.layer,x.layer,f.name,x.name)},this)),this.options.autoZIndex&&i.setZIndex&&(this._lastZIndex++,i.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Te(this._baseLayersList),Te(this._overlaysList),this._layerControlInputs=[];var i,o,c,f,x=0;for(c=0;c<this._layers.length;c++)f=this._layers[c],this._addItem(f),o=o||f.overlay,i=i||!f.overlay,x+=f.overlay?0:1;return this.options.hideSingleBase&&(i=i&&x>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=o&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var o=this._getLayer(u(i.target)),c=o.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;c&&this._map.fire(c,o)},_createRadioElement:function(i,o){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+i+'"'+(o?' checked="checked"':"")+"/>",f=document.createElement("div");return f.innerHTML=c,f.firstChild},_addItem:function(i){var o=document.createElement("label"),c=this._map.hasLayer(i.layer),f;i.overlay?(f=document.createElement("input"),f.type="checkbox",f.className="leaflet-control-layers-selector",f.defaultChecked=c):f=this._createRadioElement("leaflet-base-layers_"+u(this),c),this._layerControlInputs.push(f),f.layerId=u(i.layer),he(f,"click",this._onInputClick,this);var x=document.createElement("span");x.innerHTML=" "+i.name;var A=document.createElement("span");o.appendChild(A),A.appendChild(f),A.appendChild(x);var F=i.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var A=i.length-1;A>=0;A--)o=i[A],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(A=0;A<x.length;A++)this._map.hasLayer(x[A])&&this._map.removeLayer(x[A]);for(A=0;A<f.length;A++)this._map.hasLayer(f[A])||this._map.addLayer(f[A]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var i=this._layerControlInputs,o,c,f=this._map.getZoom(),x=i.length-1;x>=0;x--)o=i[x],c=this._getLayer(o.layerId).layer,o.disabled=c.options.minZoom!==void 0&&f<c.options.minZoom||c.options.maxZoom!==void 0&&f>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;this._preventClick=!0,he(i,"click",nn),this.expand();var o=this;setTimeout(function(){Ue(i,"click",nn),o._preventClick=!1})}}),dT=function(i,o,c){return new Tm(i,o,c)},Ch=qn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(i){var o="leaflet-control-zoom",c=Jt("div",o+" leaflet-bar"),f=this.options;return this._zoomInButton=this._createButton(f.zoomInText,f.zoomInTitle,o+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(f.zoomOutText,f.zoomOutTitle,o+"-out",c,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(i){i.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(i){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(i.shiftKey?3:1))},_zoomOut:function(i){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,o,c,f,x){var A=Jt("a",c,f);return A.innerHTML=i,A.href="#",A.title=o,A.setAttribute("role","button"),A.setAttribute("aria-label",o),lo(A),he(A,"click",Es),he(A,"click",x,this),he(A,"click",this._refocusOnMap,this),A},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";ke(this._zoomInButton,o),ke(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&($t(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&($t(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});xe.mergeOptions({zoomControl:!0}),xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ch,this.addControl(this.zoomControl))});var fT=function(i){return new Ch(i)},bm=qn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var o="leaflet-control-scale",c=Jt("div",o),f=this.options;return this._addScales(f,o+"-line",c),i.on(f.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),c},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,o,c){i.metric&&(this._mScale=Jt("div",o,c)),i.imperial&&(this._iScale=Jt("div",o,c))},_update:function(){var i=this._map,o=i.getSize().y/2,c=i.distance(i.containerPointToLatLng([0,o]),i.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(c)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var o=this._getRoundNum(i),c=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,c,o/i)},_updateImperial:function(i){var o=i*3.2808399,c,f,x;o>5280?(c=o/5280,f=this._getRoundNum(c),this._updateScale(this._iScale,f+" mi",f/c)):(x=this._getRoundNum(o),this._updateScale(this._iScale,x+" ft",x/o))},_updateScale:function(i,o,c){i.style.width=Math.round(this.options.maxWidth*c)+"px",i.innerHTML=o},_getRoundNum:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),c=i/o;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,o*c}}),pT=function(i){return new bm(i)},mT='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ph=qn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Wt.inlineSvg?mT+" ":"")+"Leaflet</a>"},initialize:function(i){w(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Jt("div","leaflet-control-attribution"),lo(this._container);for(var o in i._layers)i._layers[o].getAttribution&&this.addAttribution(i._layers[o].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var o in this._attributions)this._attributions[o]&&i.push(o);var c=[];this.options.prefix&&c.push(this.options.prefix),i.length&&c.push(i.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});xe.mergeOptions({attributionControl:!0}),xe.addInitHook(function(){this.options.attributionControl&&new Ph().addTo(this)});var gT=function(i){return new Ph(i)};qn.Layers=Tm,qn.Zoom=Ch,qn.Scale=bm,qn.Attribution=Ph,co.layers=dT,co.zoom=fT,co.scale=pT,co.attribution=gT;var oi=H.extend({initialize:function(i){this._map=i},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});oi.addTo=function(i,o){return i.addHandler(o,this),this};var _T={Events:j},Am=Wt.touch?"touchstart mousedown":"mousedown",Ki=ct.extend({options:{clickTolerance:3},initialize:function(i,o,c,f){w(this,f),this._element=i,this._dragStartTarget=o||i,this._preventOutline=c},enable:function(){this._enabled||(he(this._dragStartTarget,Am,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ki._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,Am,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!_e(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){Ki._dragging===this&&this.finishDrag();return}if(!(Ki._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Ki._dragging=this,this._preventOutline&&xh(this._element),vh(),Cn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=ym(this._element);this._startPoint=new W(o.clientX,o.clientY),this._startPos=Yn(this._element),this._parentScale=wh(c);var f=i.type==="mousedown";he(document,f?"mousemove":"touchmove",this._onMove,this),he(document,f?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var o=i.touches&&i.touches.length===1?i.touches[0]:i,c=new W(o.clientX,o.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,nn(i),this._moved||(this.fire("dragstart"),this._moved=!0,$t(document.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),$t(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=i,this._updatePosition())}},_updatePosition:function(){var i={originalEvent:this._lastEvent};this.fire("predrag",i),ye(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){ke(document.body,"leaflet-dragging"),this._lastTarget&&(ke(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),yh(),oo();var o=this._moved&&this._moving;this._moving=!1,Ki._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function Cm(i,o,c){var f,x=[1,4,2,8],A,F,K,st,mt,Dt,se,me;for(A=0,Dt=i.length;A<Dt;A++)i[A]._code=xs(i[A],o);for(K=0;K<4;K++){for(se=x[K],f=[],A=0,Dt=i.length,F=Dt-1;A<Dt;F=A++)st=i[A],mt=i[F],st._code&se?mt._code&se||(me=Ga(mt,st,se,o,c),me._code=xs(me,o),f.push(me)):(mt._code&se&&(me=Ga(mt,st,se,o,c),me._code=xs(me,o),f.push(me)),f.push(st));i=f}return i}function Pm(i,o){var c,f,x,A,F,K,st,mt,Dt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var se=ut([0,0]),me=Qt(i),dn=me.getNorthWest().distanceTo(me.getSouthWest())*me.getNorthEast().distanceTo(me.getNorthWest());dn<1700&&(se=Rh(i));var je=i.length,Bn=[];for(c=0;c<je;c++){var vn=ut(i[c]);Bn.push(o.project(ut([vn.lat-se.lat,vn.lng-se.lng])))}for(K=st=mt=0,c=0,f=je-1;c<je;f=c++)x=Bn[c],A=Bn[f],F=x.y*A.x-A.y*x.x,st+=(x.x+A.x)*F,mt+=(x.y+A.y)*F,K+=F*3;K===0?Dt=Bn[0]:Dt=[st/K,mt/K];var pr=o.unproject(at(Dt));return ut([pr.lat+se.lat,pr.lng+se.lng])}function Rh(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var A=ut(i[x]);o+=A.lat,c+=A.lng,f++}return ut([o/f,c/f])}var vT={__proto__:null,clipPolygon:Cm,polygonCenter:Pm,centroid:Rh};function Rm(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=xT(i,c),i=ET(i,c),i}function Lm(i,o,c){return Math.sqrt(ho(i,o,c,!0))}function yT(i,o,c){return ho(i,o,c)}function ET(i,o){var c=i.length,f=typeof Uint8Array<"u"?Uint8Array:Array,x=new f(c);x[0]=x[c-1]=1,Lh(i,x,o,0,c-1);var A,F=[];for(A=0;A<c;A++)x[A]&&F.push(i[A]);return F}function Lh(i,o,c,f,x){var A=0,F,K,st;for(K=f+1;K<=x-1;K++)st=ho(i[K],i[f],i[x],!0),st>A&&(F=K,A=st);A>c&&(o[F]=1,Lh(i,o,c,f,F),Lh(i,o,c,F,x))}function xT(i,o){for(var c=[i[0]],f=1,x=0,A=i.length;f<A;f++)wT(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<A-1&&c.push(i[A-1]),c}var Im;function Dm(i,o,c,f,x){var A=f?Im:xs(i,c),F=xs(o,c),K,st,mt;for(Im=F;;){if(!(A|F))return[i,o];if(A&F)return!1;K=A||F,st=Ga(i,o,K,c,x),mt=xs(st,c),K===A?(i=st,A=mt):(o=st,F=mt)}}function Ga(i,o,c,f,x){var A=o.x-i.x,F=o.y-i.y,K=f.min,st=f.max,mt,Dt;return c&8?(mt=i.x+A*(st.y-i.y)/F,Dt=st.y):c&4?(mt=i.x+A*(K.y-i.y)/F,Dt=K.y):c&2?(mt=st.x,Dt=i.y+F*(st.x-i.x)/A):c&1&&(mt=K.x,Dt=i.y+F*(K.x-i.x)/A),new W(mt,Dt,x)}function xs(i,o){var c=0;return i.x<o.min.x?c|=1:i.x>o.max.x&&(c|=2),i.y<o.min.y?c|=4:i.y>o.max.y&&(c|=8),c}function wT(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function ho(i,o,c,f){var x=o.x,A=o.y,F=c.x-x,K=c.y-A,st=F*F+K*K,mt;return st>0&&(mt=((i.x-x)*F+(i.y-A)*K)/st,mt>1?(x=c.x,A=c.y):mt>0&&(x+=F*mt,A+=K*mt)),F=i.x-x,K=i.y-A,f?F*F+K*K:new W(x,A)}function Nn(i){return!C(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function km(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Nn(i)}function Um(i,o){var c,f,x,A,F,K,st,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var Dt=ut([0,0]),se=Qt(i),me=se.getNorthWest().distanceTo(se.getSouthWest())*se.getNorthEast().distanceTo(se.getNorthWest());me<1700&&(Dt=Rh(i));var dn=i.length,je=[];for(c=0;c<dn;c++){var Bn=ut(i[c]);je.push(o.project(ut([Bn.lat-Dt.lat,Bn.lng-Dt.lng])))}for(c=0,f=0;c<dn-1;c++)f+=je[c].distanceTo(je[c+1])/2;if(f===0)mt=je[0];else for(c=0,A=0;c<dn-1;c++)if(F=je[c],K=je[c+1],x=F.distanceTo(K),A+=x,A>f){st=(A-f)/x,mt=[K.x-st*(K.x-F.x),K.y-st*(K.y-F.y)];break}var vn=o.unproject(at(mt));return ut([vn.lat+Dt.lat,vn.lng+Dt.lng])}var ST={__proto__:null,simplify:Rm,pointToSegmentDistance:Lm,closestPointOnSegment:yT,clipSegment:Dm,_getEdgeIntersection:Ga,_getBitCode:xs,_sqClosestPointOnSegment:ho,isFlat:Nn,_flat:km,polylineCenter:Um},Ih={project:function(i){return new W(i.lng,i.lat)},unproject:function(i){return new tt(i.y,i.x)},bounds:new Mt([-180,-90],[180,90])},Dh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Mt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(i){var o=Math.PI/180,c=this.R,f=i.lat*o,x=this.R_MINOR/c,A=Math.sqrt(1-x*x),F=A*Math.sin(f),K=Math.tan(Math.PI/4-f/2)/Math.pow((1-F)/(1+F),A/2);return f=-c*Math.log(Math.max(K,1e-10)),new W(i.lng*o*c,f)},unproject:function(i){for(var o=180/Math.PI,c=this.R,f=this.R_MINOR/c,x=Math.sqrt(1-f*f),A=Math.exp(-i.y/c),F=Math.PI/2-2*Math.atan(A),K=0,st=.1,mt;K<15&&Math.abs(st)>1e-7;K++)mt=x*Math.sin(F),mt=Math.pow((1-mt)/(1+mt),x/2),st=Math.PI/2-2*Math.atan(A*mt)-F,F+=st;return new tt(F*o,i.x*o/c)}},MT={__proto__:null,LonLat:Ih,Mercator:Dh,SphericalMercator:jt},TT=r({},Nt,{code:"EPSG:3395",projection:Dh,transformation:(function(){var i=.5/(Math.PI*Dh.R);return dt(i,.5,-i,.5)})()}),Om=r({},Nt,{code:"EPSG:4326",projection:Ih,transformation:dt(1/180,1,-1/180,.5)}),bT=r({},_t,{projection:Ih,transformation:dt(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,o){var c=o.lng-i.lng,f=o.lat-i.lat;return Math.sqrt(c*c+f*f)},infinite:!0});_t.Earth=Nt,_t.EPSG3395=TT,_t.EPSG3857=T,_t.EPSG900913=Z,_t.EPSG4326=Om,_t.Simple=bT;var Qn=ct.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[u(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[u(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var o=i.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var c=this.getEvents();o.on(c,this),this.once("remove",function(){o.off(c,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});xe.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var o=u(i);return this._layers[o]?this:(this._layers[o]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var o=u(i);return this._layers[o]?(this._loaded&&i.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return u(i)in this._layers},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},_addLayers:function(i){i=i?C(i)?i:[i]:[];for(var o=0,c=i.length;o<c;o++)this.addLayer(i[o])},_addZoomLimit:function(i){(!isNaN(i.options.maxZoom)||!isNaN(i.options.minZoom))&&(this._zoomBoundLayers[u(i)]=i,this._updateZoomLevels())},_removeZoomLimit:function(i){var o=u(i);this._zoomBoundLayers[o]&&(delete this._zoomBoundLayers[o],this._updateZoomLevels())},_updateZoomLevels:function(){var i=1/0,o=-1/0,c=this._getZoomSpan();for(var f in this._zoomBoundLayers){var x=this._zoomBoundLayers[f].options;i=x.minZoom===void 0?i:Math.min(i,x.minZoom),o=x.maxZoom===void 0?o:Math.max(o,x.maxZoom)}this._layersMaxZoom=o===-1/0?void 0:o,this._layersMinZoom=i===1/0?void 0:i,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var cr=Qn.extend({initialize:function(i,o){w(this,o),this._layers={};var c,f;if(i)for(c=0,f=i.length;c<f;c++)this.addLayer(i[c])},addLayer:function(i){var o=this.getLayerId(i);return this._layers[o]=i,this._map&&this._map.addLayer(i),this},removeLayer:function(i){var o=i in this._layers?i:this.getLayerId(i);return this._map&&this._layers[o]&&this._map.removeLayer(this._layers[o]),delete this._layers[o],this},hasLayer:function(i){var o=typeof i=="number"?i:this.getLayerId(i);return o in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(i){var o=Array.prototype.slice.call(arguments,1),c,f;for(c in this._layers)f=this._layers[c],f[i]&&f[i].apply(f,o);return this},onAdd:function(i){this.eachLayer(i.addLayer,i)},onRemove:function(i){this.eachLayer(i.removeLayer,i)},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},getLayer:function(i){return this._layers[i]},getLayers:function(){var i=[];return this.eachLayer(i.push,i),i},setZIndex:function(i){return this.invoke("setZIndex",i)},getLayerId:function(i){return u(i)}}),AT=function(i,o){return new cr(i,o)},Si=cr.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),cr.prototype.addLayer.call(this,i),this.fire("layeradd",{layer:i}))},removeLayer:function(i){return this.hasLayer(i)?(i in this._layers&&(i=this._layers[i]),i.removeEventParent(this),cr.prototype.removeLayer.call(this,i),this.fire("layerremove",{layer:i})):this},setStyle:function(i){return this.invoke("setStyle",i)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var i=new oe;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),CT=function(i,o){return new Si(i,o)},hr=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(i){w(this,i)},createIcon:function(i){return this._createIcon("icon",i)},createShadow:function(i){return this._createIcon("shadow",i)},_createIcon:function(i,o){var c=this._getIconUrl(i);if(!c){if(i==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var f=this._createImg(c,o&&o.tagName==="IMG"?o:null);return this._setIconStyles(f,i),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),f},_setIconStyles:function(i,o){var c=this.options,f=c[o+"Size"];typeof f=="number"&&(f=[f,f]);var x=at(f),A=at(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),A&&(i.style.marginLeft=-A.x+"px",i.style.marginTop=-A.y+"px"),x&&(i.style.width=x.x+"px",i.style.height=x.y+"px")},_createImg:function(i,o){return o=o||document.createElement("img"),o.src=i,o},_getIconUrl:function(i){return Wt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function PT(i){return new hr(i)}var uo=hr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(i){return typeof uo.imagePath!="string"&&(uo.imagePath=this._detectIconPath()),(this.options.imagePath||uo.imagePath)+hr.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var A=f.exec(c);return A&&A[x]};return i=o(i,/^url\((['"])?(.+)\1\)$/,2),i&&o(i,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var i=Jt("div","leaflet-default-icon-path",document.body),o=Ee(i,"background-image")||Ee(i,"backgroundImage");if(document.body.removeChild(i),o=this._stripUrl(o),o)return o;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Nm=oi.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Ki(i,i,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),$t(i,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ke(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(i){var o=this._marker,c=o._map,f=this._marker.options.autoPanSpeed,x=this._marker.options.autoPanPadding,A=Yn(o._icon),F=c.getPixelBounds(),K=c.getPixelOrigin(),st=Ot(F.min._subtract(K).add(x),F.max._subtract(K).subtract(x));if(!st.contains(A)){var mt=at((Math.max(st.max.x,A.x)-st.max.x)/(F.max.x-st.max.x)-(Math.min(st.min.x,A.x)-st.min.x)/(F.min.x-st.min.x),(Math.max(st.max.y,A.y)-st.max.y)/(F.max.y-st.max.y)-(Math.min(st.min.y,A.y)-st.min.y)/(F.min.y-st.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),ye(o._icon,this._draggable._newPos),this._onDrag(i),this._panRequest=O(this._adjustPan.bind(this,i))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(i){this._marker.options.autoPan&&(et(this._panRequest),this._panRequest=O(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Yn(o._icon),x=o._map.layerPointToLatLng(f);c&&ye(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){et(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),Wa=Qn.extend({options:{icon:new uo,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(i,o){w(this,o),this._latlng=ut(i)},onAdd:function(i){this._zoomAnimated=this._zoomAnimated&&i.options.markerZoomAnimation,this._zoomAnimated&&i.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(i){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&i.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(i){var o=this._latlng;return this._latlng=ut(i),this.update(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},setZIndexOffset:function(i){return this.options.zIndexOffset=i,this.update()},getIcon:function(){return this.options.icon},setIcon:function(i){return this.options.icon=i,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var i=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(i)}return this},_initIcon:function(){var i=this.options,o="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=i.icon.createIcon(this._icon),f=!1;c!==this._icon&&(this._icon&&this._removeIcon(),f=!0,i.title&&(c.title=i.title),c.tagName==="IMG"&&(c.alt=i.alt||"")),$t(c,o),i.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,i.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&he(c,"focus",this._panOnFocus,this);var x=i.icon.createShadow(this._shadow),A=!1;x!==this._shadow&&(this._removeShadow(),A=!0),x&&($t(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&A&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ue(this._icon,"focus",this._panOnFocus,this),ie(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ie(this._shadow),this._shadow=null},_setPos:function(i){this._icon&&ye(this._icon,i),this._shadow&&ye(this._shadow,i),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(i){this._icon&&(this._icon.style.zIndex=this._zIndex+i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center).round();this._setPos(o)},_initInteraction:function(){if(this.options.interactive&&($t(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Nm)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Nm(this),i&&this.dragging.enable()}},setOpacity:function(i){return this.options.opacity=i,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var i=this.options.opacity;this._icon&&ve(this._icon,i),this._shadow&&ve(this._shadow,i)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var i=this._map;if(i){var o=this.options.icon.options,c=o.iconSize?at(o.iconSize):at(0,0),f=o.iconAnchor?at(o.iconAnchor):at(0,0);i.panInside(this._latlng,{paddingTopLeft:f,paddingBottomRight:c.subtract(f)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function RT(i,o){return new Wa(i,o)}var $i=Qn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(i){this._renderer=i.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(i){return w(this,i),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&i&&Object.prototype.hasOwnProperty.call(i,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Za=$i.extend({options:{fill:!0,radius:10},initialize:function(i,o){w(this,o),this._latlng=ut(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=ut(i),this.redraw(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(i){return this.options.radius=this._radius=i,this.redraw()},getRadius:function(){return this._radius},setStyle:function(i){var o=i&&i.radius||this._radius;return $i.prototype.setStyle.call(this,i),this.setRadius(o),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var i=this._radius,o=this._radiusY||i,c=this._clickTolerance(),f=[i+c,o+c];this._pxBounds=new Mt(this._point.subtract(f),this._point.add(f))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(i){return i.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function LT(i,o){return new Za(i,o)}var kh=Za.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),w(this,o),this._latlng=ut(i),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(i){return this._mRadius=i,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var i=[this._radius,this._radiusY||this._radius];return new oe(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:$i.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===Nt.distance){var x=Math.PI/180,A=this._mRadius/Nt.R/x,F=c.project([o+A,i]),K=c.project([o-A,i]),st=F.add(K).divideBy(2),mt=c.unproject(st).lat,Dt=Math.acos((Math.cos(A*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(Dt)||Dt===0)&&(Dt=A/Math.cos(Math.PI/180*o)),this._point=st.subtract(c.getPixelOrigin()),this._radius=isNaN(Dt)?0:st.x-c.project([mt,i-Dt]).x,this._radiusY=st.y-F.y}else{var se=f.unproject(f.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(se).x}this._updateBounds()}});function IT(i,o,c){return new kh(i,o,c)}var Mi=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(i,o){w(this,o),this._setLatLngs(i)},getLatLngs:function(){return this._latlngs},setLatLngs:function(i){return this._setLatLngs(i),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(i){for(var o=1/0,c=null,f=ho,x,A,F=0,K=this._parts.length;F<K;F++)for(var st=this._parts[F],mt=1,Dt=st.length;mt<Dt;mt++){x=st[mt-1],A=st[mt];var se=f(i,x,A,!0);se<o&&(o=se,c=f(i,x,A))}return c&&(c.distance=Math.sqrt(o)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Um(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=ut(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new oe,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Nn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Nn(i),f=0,x=i.length;f<x;f++)c?(o[f]=ut(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new Mt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,i),this._bounds.isValid()&&i.isValid()&&(this._rawPxBounds=i,this._updateBounds())},_updateBounds:function(){var i=this._clickTolerance(),o=new W(i,i);this._rawPxBounds&&(this._pxBounds=new Mt([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof tt,x=i.length,A,F;if(f){for(F=[],A=0;A<x;A++)F[A]=this._map.latLngToLayerPoint(i[A]),c.extend(F[A]);o.push(F)}else for(A=0;A<x;A++)this._projectLatlngs(i[A],o,c)},_clipPoints:function(){var i=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}var o=this._parts,c,f,x,A,F,K,st;for(c=0,x=0,A=this._rings.length;c<A;c++)for(st=this._rings[c],f=0,F=st.length;f<F-1;f++)K=Dm(st[f],st[f+1],i,f,!0),K&&(o[x]=o[x]||[],o[x].push(K[0]),(K[1]!==st[f+1]||f===F-2)&&(o[x].push(K[1]),x++))}},_simplifyPoints:function(){for(var i=this._parts,o=this.options.smoothFactor,c=0,f=i.length;c<f;c++)i[c]=Rm(i[c],o)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(i,o){var c,f,x,A,F,K,st=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,A=this._parts.length;c<A;c++)for(K=this._parts[c],f=0,F=K.length,x=F-1;f<F;x=f++)if(!(!o&&f===0)&&Lm(i,K[x],K[f])<=st)return!0;return!1}});function DT(i,o){return new Mi(i,o)}Mi._flat=km;var ur=Mi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Pm(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Mi.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof tt&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Mi.prototype._setLatLngs.call(this,i),Nn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Nn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,o=this.options.weight,c=new W(o,o);if(i=new Mt(i.min.subtract(c),i.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var f=0,x=this._rings.length,A;f<x;f++)A=Cm(this._rings[f],i,!0),A.length&&this._parts.push(A)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,A,F,K,st,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(A=0,st=this._parts.length;A<st;A++)for(c=this._parts[A],F=0,mt=c.length,K=mt-1;F<mt;K=F++)f=c[F],x=c[K],f.y>i.y!=x.y>i.y&&i.x<(x.x-f.x)*(i.y-f.y)/(x.y-f.y)+f.x&&(o=!o);return o||Mi.prototype._containsPoint.call(this,i,!0)}});function kT(i,o){return new ur(i,o)}var Ti=Si.extend({initialize:function(i,o){w(this,o),this._layers={},i&&this.addData(i)},addData:function(i){var o=C(i)?i:i.features,c,f,x;if(o){for(c=0,f=o.length;c<f;c++)x=o[c],(x.geometries||x.geometry||x.features||x.coordinates)&&this.addData(x);return this}var A=this.options;if(A.filter&&!A.filter(i))return this;var F=Xa(i,A);return F?(F.feature=Qa(i),F.defaultOptions=F.options,this.resetStyle(F),A.onEachFeature&&A.onEachFeature(i,F),this.addLayer(F)):this},resetStyle:function(i){return i===void 0?this.eachLayer(this.resetStyle,this):(i.options=r({},i.defaultOptions),this._setLayerStyle(i,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(o){this._setLayerStyle(o,i)},this)},_setLayerStyle:function(i,o){i.setStyle&&(typeof o=="function"&&(o=o(i.feature)),i.setStyle(o))}});function Xa(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],A=o&&o.pointToLayer,F=o&&o.coordsToLatLng||Uh,K,st,mt,Dt;if(!f&&!c)return null;switch(c.type){case"Point":return K=F(f),Bm(A,i,K,o);case"MultiPoint":for(mt=0,Dt=f.length;mt<Dt;mt++)K=F(f[mt]),x.push(Bm(A,i,K,o));return new Si(x);case"LineString":case"MultiLineString":return st=Ya(f,c.type==="LineString"?0:1,F),new Mi(st,o);case"Polygon":case"MultiPolygon":return st=Ya(f,c.type==="Polygon"?1:2,F),new ur(st,o);case"GeometryCollection":for(mt=0,Dt=c.geometries.length;mt<Dt;mt++){var se=Xa({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);se&&x.push(se)}return new Si(x);case"FeatureCollection":for(mt=0,Dt=c.features.length;mt<Dt;mt++){var me=Xa(c.features[mt],o);me&&x.push(me)}return new Si(x);default:throw new Error("Invalid GeoJSON object.")}}function Bm(i,o,c,f){return i?i(o,c):new Wa(c,f&&f.markersInheritOptions&&f)}function Uh(i){return new tt(i[1],i[0],i[2])}function Ya(i,o,c){for(var f=[],x=0,A=i.length,F;x<A;x++)F=o?Ya(i[x],o-1,c):(c||Uh)(i[x]),f.push(F);return f}function Oh(i,o){return i=ut(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function qa(i,o,c,f){for(var x=[],A=0,F=i.length;A<F;A++)x.push(o?qa(i[A],Nn(i[A])?0:o-1,c,f):Oh(i[A],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function dr(i,o){return i.feature?r({},i.feature,{geometry:o}):Qa(o)}function Qa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var Nh={toGeoJSON:function(i){return dr(this,{type:"Point",coordinates:Oh(this.getLatLng(),i)})}};Wa.include(Nh),kh.include(Nh),Za.include(Nh),Mi.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=qa(this._latlngs,o?1:0,!1,i);return dr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),ur.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=o&&!Nn(this._latlngs[0]),f=qa(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),dr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),cr.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),dr(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(i){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(i);var c=o==="GeometryCollection",f=[];return this.eachLayer(function(x){if(x.toGeoJSON){var A=x.toGeoJSON(i);if(c)f.push(A.geometry);else{var F=Qa(A);F.type==="FeatureCollection"?f.push.apply(f,F.features):f.push(F)}}}),c?dr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function Fm(i,o){return new Ti(i,o)}var UT=Fm,ja=Qn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Qt(o),w(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&($t(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ie(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(i){return this.options.opacity=i,this._image&&this._updateOpacity(),this},setStyle:function(i){return i.opacity&&this.setOpacity(i.opacity),this},bringToFront:function(){return this._map&&Xt(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Qt(i),this._map&&this._reset(),this},getEvents:function(){var i={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var i=this._url.tagName==="IMG",o=this._image=i?this._url:Jt("img");if($t(o,"leaflet-image-layer"),this._zoomAnimated&&$t(o,"leaflet-zoom-animated"),this.options.className&&$t(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onload=l(this.fire,this,"load"),o.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),i){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(i){var o=this._map.getZoomScale(i.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;Fe(this._image,c,o)},_reset:function(){var i=this._image,o=new Mt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();ye(i,o.min),i.style.width=c.x+"px",i.style.height=c.y+"px"},_updateOpacity:function(){ve(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var i=this.options.errorOverlayUrl;i&&this._url!==i&&(this._url=i,this._image.src=i)},getCenter:function(){return this._bounds.getCenter()}}),OT=function(i,o,c){return new ja(i,o,c)},zm=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var i=this._url.tagName==="VIDEO",o=this._image=i?this._url:Jt("video");if($t(o,"leaflet-image-layer"),this._zoomAnimated&&$t(o,"leaflet-zoom-animated"),this.options.className&&$t(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onloadeddata=l(this.fire,this,"load"),i){for(var c=o.getElementsByTagName("source"),f=[],x=0;x<c.length;x++)f.push(c[x].src);this._url=c.length>0?f:[o.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var A=0;A<this._url.length;A++){var F=Jt("source");F.src=this._url[A],o.appendChild(F)}}});function NT(i,o,c){return new zm(i,o,c)}var Hm=ja.extend({_initImage:function(){var i=this._image=this._url;$t(i,"leaflet-image-layer"),this._zoomAnimated&&$t(i,"leaflet-zoom-animated"),this.options.className&&$t(i,this.options.className),i.onselectstart=m,i.onmousemove=m}});function BT(i,o,c){return new Hm(i,o,c)}var ai=Qn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof tt||C(i))?(this._latlng=ut(i),w(this,o)):(w(this,i),this._source=o),this.options.content&&(this._content=this.options.content)},openOn:function(i){return i=arguments.length?i:this._source._map,i.hasLayer(this)||i.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(i){return this._map?this.close():(arguments.length?this._source=i:i=this._source,this._prepareOpen(),this.openOn(i._map)),this},onAdd:function(i){this._zoomAnimated=i._zoomAnimated,this._container||this._initLayout(),i._fadeAnimated&&ve(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),i._fadeAnimated&&ve(this._container,1),this.bringToFront(),this.options.interactive&&($t(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(i){i._fadeAnimated?(ve(this._container,0),this._removeTimeout=setTimeout(l(ie,void 0,this._container),200)):ie(this._container),this.options.interactive&&(ke(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=ut(i),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(i){return this._content=i,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var i={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Xt(this._container),this},bringToBack:function(){return this._map&&Le(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof Si){o=null;var c=this._source._layers;for(var f in c)if(c[f]._map){o=c[f];break}if(!o)return!1;this._source=o}if(!i)if(o.getCenter)i=o.getCenter();else if(o.getLatLng)i=o.getLatLng();else if(o.getBounds)i=o.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(i),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var i=this._contentNode,o=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof o=="string")i.innerHTML=o;else{for(;i.hasChildNodes();)i.removeChild(i.firstChild);i.appendChild(o)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),o=at(this.options.offset),c=this._getAnchor();this._zoomAnimated?ye(this._container,i.add(c)):o=o.add(i).add(c);var f=this._containerBottom=-o.y,x=this._containerLeft=-Math.round(this._containerWidth/2)+o.x;this._container.style.bottom=f+"px",this._container.style.left=x+"px"}},_getAnchor:function(){return[0,0]}});xe.include({_initOverlay:function(i,o,c,f){var x=o;return x instanceof i||(x=new i(f).setContent(o)),c&&x.setLatLng(c),x}}),Qn.include({_initOverlay:function(i,o,c,f){var x=c;return x instanceof i?(w(x,f),x._source=this):(x=o&&!f?o:new i(f,this),x.setContent(c)),x}});var Ja=ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(i){return i=arguments.length?i:this._source._map,!i.hasLayer(this)&&i._popup&&i._popup.options.autoClose&&i.removeLayer(i._popup),i._popup=this,ai.prototype.openOn.call(this,i)},onAdd:function(i){ai.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",ys))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",ys))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(i.preclick=this.close),this.options.keepInView&&(i.moveend=this._adjustPan),i},_initLayout:function(){var i="leaflet-popup",o=this._container=Jt("div",i+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Jt("div",i+"-content-wrapper",o);if(this._contentNode=Jt("div",i+"-content",c),lo(o),bh(this._contentNode),he(o,"contextmenu",ys),this._tipContainer=Jt("div",i+"-tip-container",o),this._tip=Jt("div",i+"-tip",this._tipContainer),this.options.closeButton){var f=this._closeButton=Jt("a",i+"-close-button",o);f.setAttribute("role","button"),f.setAttribute("aria-label","Close popup"),f.href="#close",f.innerHTML='<span aria-hidden="true">&#215;</span>',he(f,"click",function(x){nn(x),this.close()},this)}},_updateLayout:function(){var i=this._contentNode,o=i.style;o.width="",o.whiteSpace="nowrap";var c=i.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),o.width=c+1+"px",o.whiteSpace="",o.height="";var f=i.offsetHeight,x=this.options.maxHeight,A="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",$t(i,A)):ke(i,A),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();ye(this._container,o.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,o=parseInt(Ee(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new W(this._containerLeft,-c-this._containerBottom);x._add(Yn(this._container));var A=i.layerPointToContainerPoint(x),F=at(this.options.autoPanPadding),K=at(this.options.autoPanPaddingTopLeft||F),st=at(this.options.autoPanPaddingBottomRight||F),mt=i.getSize(),Dt=0,se=0;A.x+f+st.x>mt.x&&(Dt=A.x+f-mt.x+st.x),A.x-Dt-K.x<0&&(Dt=A.x-K.x),A.y+c+st.y>mt.y&&(se=A.y+c-mt.y+st.y),A.y-se-K.y<0&&(se=A.y-K.y),(Dt||se)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([Dt,se]))}},_getAnchor:function(){return at(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),FT=function(i,o){return new Ja(i,o)};xe.mergeOptions({closePopupOnClick:!0}),xe.include({openPopup:function(i,o,c){return this._initOverlay(Ja,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Qn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Ja,this._popup,i,o),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof Si||(this._popup._source=this),this._popup._prepareOpen(i||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){Es(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof $i)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=o,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var Ka=ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ai.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",o=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Jt("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var o,c,f=this._map,x=this._container,A=f.latLngToContainerPoint(f.getCenter()),F=f.layerPointToContainerPoint(i),K=this.options.direction,st=x.offsetWidth,mt=x.offsetHeight,Dt=at(this.options.offset),se=this._getAnchor();K==="top"?(o=st/2,c=mt):K==="bottom"?(o=st/2,c=0):K==="center"?(o=st/2,c=mt/2):K==="right"?(o=0,c=mt/2):K==="left"?(o=st,c=mt/2):F.x<A.x?(K="right",o=0,c=mt/2):(K="left",o=st+(Dt.x+se.x)*2,c=mt/2),i=i.subtract(at(o,c,!0)).add(Dt).add(se),ke(x,"leaflet-tooltip-right"),ke(x,"leaflet-tooltip-left"),ke(x,"leaflet-tooltip-top"),ke(x,"leaflet-tooltip-bottom"),$t(x,"leaflet-tooltip-"+K),ye(x,i)},_updatePosition:function(){var i=this._map.latLngToLayerPoint(this._latlng);this._setPosition(i)},setOpacity:function(i){this.options.opacity=i,this._container&&ve(this._container,i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center);this._setPosition(o)},_getAnchor:function(){return at(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),zT=function(i,o){return new Ka(i,o)};xe.include({openTooltip:function(i,o,c){return this._initOverlay(Ka,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Qn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ka,this._tooltip,i,o),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(i){if(!(!i&&this._tooltipHandlersAdded)){var o=i?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[o](c),this._tooltipHandlersAdded=!i}},openTooltip:function(i){return this._tooltip&&(this instanceof Si||(this._tooltip._source=this),this._tooltip._prepareOpen(i)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(i){return this._tooltip&&this._tooltip.setContent(i),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&(he(o,"focus",function(){this._tooltip._source=i,this.openTooltip()},this),he(o,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&o.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(i){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var o=this;this._map.once("moveend",function(){o._openOnceFlag=!1,o._openTooltip(i)});return}this._tooltip._source=i.layer||i.target,this.openTooltip(this._tooltip.options.sticky?i.latlng:void 0)}},_moveTooltip:function(i){var o=i.latlng,c,f;this._tooltip.options.sticky&&i.originalEvent&&(c=this._map.mouseEventToContainerPoint(i.originalEvent),f=this._map.containerPointToLayerPoint(c),o=this._map.layerPointToLatLng(f)),this._tooltip.setLatLng(o)}});var Vm=hr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(i){var o=i&&i.tagName==="DIV"?i:document.createElement("div"),c=this.options;if(c.html instanceof Element?(Te(o),o.appendChild(c.html)):o.innerHTML=c.html!==!1?c.html:"",c.bgPos){var f=at(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function HT(i){return new Vm(i)}hr.Default=uo;var fo=Qn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Wt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(i){w(this,i)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(i){i._addZoomLimit(this)},onRemove:function(i){this._removeAllTiles(),ie(this._container),i._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Xt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Le(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(i){return this.options.opacity=i,this._updateOpacity(),this},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var i=this._clampZoom(this._map.getZoom());i!==this._tileZoom&&(this._tileZoom=i,this._updateLevels()),this._update()}return this},getEvents:function(){var i={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),i.move=this._onMove),this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},createTile:function(){return document.createElement("div")},getTileSize:function(){var i=this.options.tileSize;return i instanceof W?i:new W(i,i)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(i){for(var o=this.getPane().children,c=-i(-1/0,1/0),f=0,x=o.length,A;f<x;f++)A=o[f].style.zIndex,o[f]!==this._container&&A&&(c=i(c,+A));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Wt.ielt9){ve(this._container,this.options.opacity);var i=+new Date,o=!1,c=!1;for(var f in this._tiles){var x=this._tiles[f];if(!(!x.current||!x.loaded)){var A=Math.min(1,(i-x.loaded)/200);ve(x.el,A),A<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(et(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Jt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,o=this.options.maxZoom;if(i!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===i?(this._levels[c].el.style.zIndex=o-Math.abs(i-c),this._onUpdateLevel(c)):(ie(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var f=this._levels[i],x=this._map;return f||(f=this._levels[i]={},f.el=Jt("div","leaflet-tile-container leaflet-zoom-animated",this._container),f.el.style.zIndex=o,f.origin=x.project(x.unproject(x.getPixelOrigin()),i).round(),f.zoom=i,this._setZoomTransform(f,x.getCenter(),x.getZoom()),m(f.el.offsetWidth),this._onCreateLevel(f)),this._level=f,f}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var i,o,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(i in this._tiles)o=this._tiles[i],o.retain=o.current;for(i in this._tiles)if(o=this._tiles[i],o.current&&!o.active){var f=o.coords;this._retainParent(f.x,f.y,f.z,f.z-5)||this._retainChildren(f.x,f.y,f.z,f.z+2)}for(i in this._tiles)this._tiles[i].retain||this._removeTile(i)}},_removeTilesAtZoom:function(i){for(var o in this._tiles)this._tiles[o].coords.z===i&&this._removeTile(o)},_removeAllTiles:function(){for(var i in this._tiles)this._removeTile(i)},_invalidateAll:function(){for(var i in this._levels)ie(this._levels[i].el),this._onRemoveLevel(Number(i)),delete this._levels[i];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(i,o,c,f){var x=Math.floor(i/2),A=Math.floor(o/2),F=c-1,K=new W(+x,+A);K.z=+F;var st=this._tileCoordsToKey(K),mt=this._tiles[st];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),F>f?this._retainParent(x,A,F,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var A=2*o;A<2*o+2;A++){var F=new W(x,A);F.z=c+1;var K=this._tileCoordsToKey(F),st=this._tiles[K];if(st&&st.active){st.retain=!0;continue}else st&&st.loaded&&(st.retain=!0);c+1<f&&this._retainChildren(x,A,c+1,f)}},_resetView:function(i){var o=i&&(i.pinch||i.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),o,o)},_animateZoom:function(i){this._setView(i.center,i.zoom,!0,i.noUpdate)},_clampZoom:function(i){var o=this.options;return o.minNativeZoom!==void 0&&i<o.minNativeZoom?o.minNativeZoom:o.maxNativeZoom!==void 0&&o.maxNativeZoom<i?o.maxNativeZoom:i},_setView:function(i,o,c,f){var x=Math.round(o);this.options.maxZoom!==void 0&&x>this.options.maxZoom||this.options.minZoom!==void 0&&x<this.options.minZoom?x=void 0:x=this._clampZoom(x);var A=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||A)&&(this._tileZoom=x,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),x!==void 0&&this._update(i),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(i,o)},_setZoomTransforms:function(i,o){for(var c in this._levels)this._setZoomTransform(this._levels[c],i,o)},_setZoomTransform:function(i,o,c){var f=this._map.getZoomScale(c,i.zoom),x=i.origin.multiplyBy(f).subtract(this._map._getNewPixelOrigin(o,c)).round();Wt.any3d?Fe(i.el,x,f):ye(i.el,x)},_resetGrid:function(){var i=this._map,o=i.options.crs,c=this._tileSize=this.getTileSize(),f=this._tileZoom,x=this._map.getPixelWorldBounds(this._tileZoom);x&&(this._globalTileRange=this._pxBoundsToTileRange(x)),this._wrapX=o.wrapLng&&!this.options.noWrap&&[Math.floor(i.project([0,o.wrapLng[0]],f).x/c.x),Math.ceil(i.project([0,o.wrapLng[1]],f).x/c.y)],this._wrapY=o.wrapLat&&!this.options.noWrap&&[Math.floor(i.project([o.wrapLat[0],0],f).y/c.x),Math.ceil(i.project([o.wrapLat[1],0],f).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(i){var o=this._map,c=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),f=o.getZoomScale(c,this._tileZoom),x=o.project(i,this._tileZoom).floor(),A=o.getSize().divideBy(f*2);return new Mt(x.subtract(A),x.add(A))},_update:function(i){var o=this._map;if(o){var c=this._clampZoom(o.getZoom());if(i===void 0&&(i=o.getCenter()),this._tileZoom!==void 0){var f=this._getTiledPixelBounds(i),x=this._pxBoundsToTileRange(f),A=x.getCenter(),F=[],K=this.options.keepBuffer,st=new Mt(x.getBottomLeft().subtract([K,-K]),x.getTopRight().add([K,-K]));if(!(isFinite(x.min.x)&&isFinite(x.min.y)&&isFinite(x.max.x)&&isFinite(x.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var mt in this._tiles){var Dt=this._tiles[mt].coords;(Dt.z!==this._tileZoom||!st.contains(new W(Dt.x,Dt.y)))&&(this._tiles[mt].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(i,c);return}for(var se=x.min.y;se<=x.max.y;se++)for(var me=x.min.x;me<=x.max.x;me++){var dn=new W(me,se);if(dn.z=this._tileZoom,!!this._isValidTile(dn)){var je=this._tiles[this._tileCoordsToKey(dn)];je?je.current=!0:F.push(dn)}}if(F.sort(function(vn,pr){return vn.distanceTo(A)-pr.distanceTo(A)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Bn=document.createDocumentFragment();for(me=0;me<F.length;me++)this._addTile(F[me],Bn);this._level.el.appendChild(Bn)}}}},_isValidTile:function(i){var o=this._map.options.crs;if(!o.infinite){var c=this._globalTileRange;if(!o.wrapLng&&(i.x<c.min.x||i.x>c.max.x)||!o.wrapLat&&(i.y<c.min.y||i.y>c.max.y))return!1}if(!this.options.bounds)return!0;var f=this._tileCoordsToBounds(i);return Qt(this.options.bounds).overlaps(f)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var o=this._map,c=this.getTileSize(),f=i.scaleBy(c),x=f.add(c),A=o.unproject(f,i.z),F=o.unproject(x,i.z);return[A,F]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new oe(o[0],o[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var o=i.split(":"),c=new W(+o[0],+o[1]);return c.z=+o[2],c},_removeTile:function(i){var o=this._tiles[i];o&&(ie(o.el),delete this._tiles[i],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){$t(i,"leaflet-tile");var o=this.getTileSize();i.style.width=o.x+"px",i.style.height=o.y+"px",i.onselectstart=m,i.onmousemove=m,Wt.ielt9&&this.options.opacity<1&&ve(i,this.options.opacity)},_addTile:function(i,o){var c=this._getTilePos(i),f=this._tileCoordsToKey(i),x=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(x),this.createTile.length<2&&O(l(this._tileReady,this,i,null,x)),ye(x,c),this._tiles[f]={el:x,coords:i,current:!0},o.appendChild(x),this.fire("tileloadstart",{tile:x,coords:i})},_tileReady:function(i,o,c){o&&this.fire("tileerror",{error:o,tile:c,coords:i});var f=this._tileCoordsToKey(i);c=this._tiles[f],c&&(c.loaded=+new Date,this._map._fadeAnimated?(ve(c.el,0),et(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),o||($t(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Wt.ielt9||!this._map._fadeAnimated?O(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var o=new W(this._wrapX?p(i.x,this._wrapX):i.x,this._wrapY?p(i.y,this._wrapY):i.y);return o.z=i.z,o},_pxBoundsToTileRange:function(i){var o=this.getTileSize();return new Mt(i.min.unscaleBy(o).floor(),i.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function VT(i){return new fo(i)}var fr=fo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,o){this._url=i,o=w(this,o),o.detectRetina&&Wt.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,o){return this._url===i&&o===void 0&&(o=!0),this._url=i,o||this.redraw(),this},createTile:function(i,o){var c=document.createElement("img");return he(c,"load",l(this._tileOnLoad,this,o,c)),he(c,"error",l(this._tileOnError,this,o,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(i),c},getTileUrl:function(i){var o={r:Wt.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-i.y;this.options.tms&&(o.y=c),o["-y"]=c}return I(this._url,r(o,this.options))},_tileOnLoad:function(i,o){Wt.ielt9?setTimeout(l(i,this,null,o),0):i(null,o)},_tileOnError:function(i,o,c){var f=this.options.errorTileUrl;f&&o.getAttribute("src")!==f&&(o.src=f),i(c,o)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,o=this.options.maxZoom,c=this.options.zoomReverse,f=this.options.zoomOffset;return c&&(i=o-i),i+f},_getSubdomain:function(i){var o=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var i,o;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(o=this._tiles[i].el,o.onload=m,o.onerror=m,!o.complete)){o.src=k;var c=this._tiles[i].coords;ie(o),delete this._tiles[i],this.fire("tileabort",{tile:o,coords:c})}},_removeTile:function(i){var o=this._tiles[i];if(o)return o.el.setAttribute("src",k),fo.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===k))return fo.prototype._tileReady.call(this,i,o,c)}});function Gm(i,o){return new fr(i,o)}var Wm=fr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,o){this._url=i;var c=r({},this.defaultWmsParams);for(var f in o)f in this.options||(c[f]=o[f]);o=w(this,o);var x=o.detectRetina&&Wt.retina?2:1,A=this.getTileSize();c.width=A.x*x,c.height=A.y*x,this.wmsParams=c},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,fr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=Ot(c.project(o[0]),c.project(o[1])),x=f.min,A=f.max,F=(this._wmsVersion>=1.3&&this._crs===Om?[x.y,x.x,A.y,A.x]:[x.x,x.y,A.x,A.y]).join(","),K=fr.prototype.getTileUrl.call(this,i);return K+v(this.wmsParams,K,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function GT(i,o){return new Wm(i,o)}fr.WMS=Wm,Gm.wms=GT;var bi=Qn.extend({options:{padding:.1},initialize:function(i){w(this,i),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),$t(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,o){var c=this._map.getZoomScale(o,this._zoom),f=this._map.getSize().multiplyBy(.5+this.options.padding),x=this._map.project(this._center,o),A=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));Wt.any3d?Fe(this._container,A,c):ye(this._container,A)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,o=this._map.getSize(),c=this._map.containerPointToLayerPoint(o.multiplyBy(-i)).round();this._bounds=new Mt(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zm=bi.extend({options:{tolerance:0},getEvents:function(){var i=bi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");he(i,"mousemove",this._onMouseMove,this),he(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),he(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){et(this._redrawRequest),delete this._ctx,ie(this._container),Ue(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var o in this._layers)i=this._layers[o],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=Wt.retina?2:1;ye(o,i.min),o.width=f*c.x,o.height=f*c.y,o.style.width=c.x+"px",o.style.height=c.y+"px",Wt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){bi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[u(i)]=i;var o=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var o=i._order,c=o.next,f=o.prev;c?c.prev=f:this._drawLast=f,f?f.next=c:this._drawFirst=c,delete i._order,delete this._layers[u(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var o=i.options.dashArray.split(/[, ]+/),c=[],f,x;for(x=0;x<o.length;x++){if(f=Number(o[x]),isNaN(f))return;c.push(f)}i.options._dashArray=c}else i.options._dashArray=i.options.dashArray},_requestRedraw:function(i){this._map&&(this._extendRedrawBounds(i),this._redrawRequest=this._redrawRequest||O(this._redraw,this))},_extendRedrawBounds:function(i){if(i._pxBounds){var o=(i.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Mt,this._redrawBounds.extend(i._pxBounds.min.subtract([o,o])),this._redrawBounds.extend(i._pxBounds.max.add([o,o]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var i=this._redrawBounds;if(i){var o=i.getSize();this._ctx.clearRect(i.min.x,i.min.y,o.x,o.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var i,o=this._redrawBounds;if(this._ctx.save(),o){var c=o.getSize();this._ctx.beginPath(),this._ctx.rect(o.min.x,o.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var f=this._drawFirst;f;f=f.next)i=f.layer,(!o||i._pxBounds&&i._pxBounds.intersects(o))&&i._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(i,o){if(this._drawing){var c,f,x,A,F=i._parts,K=F.length,st=this._ctx;if(K){for(st.beginPath(),c=0;c<K;c++){for(f=0,x=F[c].length;f<x;f++)A=F[c][f],st[f?"lineTo":"moveTo"](A.x,A.y);o&&st.closePath()}this._fillStroke(st,i)}}},_updateCircle:function(i){if(!(!this._drawing||i._empty())){var o=i._point,c=this._ctx,f=Math.max(Math.round(i._radius),1),x=(Math.max(Math.round(i._radiusY),1)||f)/f;x!==1&&(c.save(),c.scale(1,x)),c.beginPath(),c.arc(o.x,o.y/x,f,0,Math.PI*2,!1),x!==1&&c.restore(),this._fillStroke(c,i)}},_fillStroke:function(i,o){var c=o.options;c.fill&&(i.globalAlpha=c.fillOpacity,i.fillStyle=c.fillColor||c.color,i.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(i.setLineDash&&i.setLineDash(o.options&&o.options._dashArray||[]),i.globalAlpha=c.opacity,i.lineWidth=c.weight,i.strokeStyle=c.color,i.lineCap=c.lineCap,i.lineJoin=c.lineJoin,i.stroke())},_onClick:function(i){for(var o=this._map.mouseEventToLayerPoint(i),c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(!(i.type==="click"||i.type==="preclick")||!this._map._draggableMoved(c))&&(f=c);this._fireEvent(f?[f]:!1,i)},_onMouseMove:function(i){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var o=this._map.mouseEventToLayerPoint(i);this._handleMouseHover(i,o)}},_handleMouseOut:function(i){var o=this._hoveredLayer;o&&(ke(this._container,"leaflet-interactive"),this._fireEvent([o],i,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(i,o){if(!this._mouseHoverThrottled){for(var c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(f=c);f!==this._hoveredLayer&&(this._handleMouseOut(i),f&&($t(this._container,"leaflet-interactive"),this._fireEvent([f],i,"mouseover"),this._hoveredLayer=f)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,i),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(i,o,c){this._map._fireDOMEvent(o,c||o.type,i)},_bringToFront:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(c)c.prev=f;else return;f?f.next=c:c&&(this._drawFirst=c),o.prev=this._drawLast,this._drawLast.next=o,o.next=null,this._drawLast=o,this._requestRedraw(i)}},_bringToBack:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(f)f.next=c;else return;c?c.prev=f:f&&(this._drawLast=f),o.prev=null,o.next=this._drawFirst,this._drawFirst.prev=o,this._drawFirst=o,this._requestRedraw(i)}}});function Xm(i){return Wt.canvas?new Zm(i):null}var po=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(i){return document.createElement("<lvml:"+i+' class="lvml">')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),WT={_initContainer:function(){this._container=Jt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=po("shape");$t(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=po("path"),o.appendChild(i._path),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){var o=i._container;this._container.appendChild(o),i.options.interactive&&i.addInteractiveTarget(o)},_removePath:function(i){var o=i._container;ie(o),i.removeInteractiveTarget(o),delete this._layers[u(i)]},_updateStyle:function(i){var o=i._stroke,c=i._fill,f=i.options,x=i._container;x.stroked=!!f.stroke,x.filled=!!f.fill,f.stroke?(o||(o=i._stroke=po("stroke")),x.appendChild(o),o.weight=f.weight+"px",o.color=f.color,o.opacity=f.opacity,f.dashArray?o.dashStyle=C(f.dashArray)?f.dashArray.join(" "):f.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=f.lineCap.replace("butt","flat"),o.joinstyle=f.lineJoin):o&&(x.removeChild(o),i._stroke=null),f.fill?(c||(c=i._fill=po("fill")),x.appendChild(c),c.color=f.fillColor||f.color,c.opacity=f.fillOpacity):c&&(x.removeChild(c),i._fill=null)},_updateCircle:function(i){var o=i._point.round(),c=Math.round(i._radius),f=Math.round(i._radiusY||c);this._setPath(i,i._empty()?"M0 0":"AL "+o.x+","+o.y+" "+c+","+f+" 0,"+65535*360)},_setPath:function(i,o){i._path.v=o},_bringToFront:function(i){Xt(i._container)},_bringToBack:function(i){Le(i._container)}},$a=Wt.vml?po:$,mo=bi.extend({_initContainer:function(){this._container=$a("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$a("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ie(this._container),Ue(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=i.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,c.setAttribute("width",o.x),c.setAttribute("height",o.y)),ye(c,i.min),c.setAttribute("viewBox",[i.min.x,i.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(i){var o=i._path=$a("path");i.options.className&&$t(o,i.options.className),i.options.interactive&&$t(o,"leaflet-interactive"),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){ie(i._path),i.removeInteractiveTarget(i._path),delete this._layers[u(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var o=i._path,c=i.options;o&&(c.stroke?(o.setAttribute("stroke",c.color),o.setAttribute("stroke-opacity",c.opacity),o.setAttribute("stroke-width",c.weight),o.setAttribute("stroke-linecap",c.lineCap),o.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?o.setAttribute("stroke-dasharray",c.dashArray):o.removeAttribute("stroke-dasharray"),c.dashOffset?o.setAttribute("stroke-dashoffset",c.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),c.fill?(o.setAttribute("fill",c.fillColor||c.color),o.setAttribute("fill-opacity",c.fillOpacity),o.setAttribute("fill-rule",c.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(i,o){this._setPath(i,ht(i._parts,o))},_updateCircle:function(i){var o=i._point,c=Math.max(Math.round(i._radius),1),f=Math.max(Math.round(i._radiusY),1)||c,x="a"+c+","+f+" 0 1,0 ",A=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,A)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){Xt(i._path)},_bringToBack:function(i){Le(i._path)}});Wt.vml&&mo.include(WT);function Ym(i){return Wt.svg||Wt.vml?new mo(i):null}xe.include({getRenderer:function(i){var o=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var o=this._paneRenderers[i];return o===void 0&&(o=this._createRenderer({pane:i}),this._paneRenderers[i]=o),o},_createRenderer:function(i){return this.options.preferCanvas&&Xm(i)||Ym(i)}});var qm=ur.extend({initialize:function(i,o){ur.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Qt(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function ZT(i,o){return new qm(i,o)}mo.create=$a,mo.pointsToPath=ht,Ti.geometryToLayer=Xa,Ti.coordsToLatLng=Uh,Ti.coordsToLatLngs=Ya,Ti.latLngToCoords=Oh,Ti.latLngsToCoords=qa,Ti.getFeature=dr,Ti.asFeature=Qa,xe.mergeOptions({boxZoom:!0});var Qm=oi.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){he(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ue(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ie(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cn(),vh(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Jt("div","leaflet-zoom-box",this._container),$t(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var o=new Mt(this._point,this._startPoint),c=o.getSize();ye(this._box,o.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(ie(this._box),ke(this._container,"leaflet-crosshair")),oo(),yh(),Ue(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var o=new oe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xe.addInitHook("addHandler","boxZoom",Qm),xe.mergeOptions({doubleClickZoom:!0});var jm=oi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var o=this._map,c=o.getZoom(),f=o.options.zoomDelta,x=i.originalEvent.shiftKey?c-f:c+f;o.options.doubleClickZoom==="center"?o.setZoom(x):o.setZoomAround(i.containerPoint,x)}});xe.addInitHook("addHandler","doubleClickZoom",jm),xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jm=oi.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Ki(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}$t(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ke(this._map._container,"leaflet-grab"),ke(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=Qt(this._map.options.maxBounds);this._offsetLimit=Ot(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var o=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(o),this._prunePositions(o)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,o){return i-(i-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;i.x<o.min.x&&(i.x=this._viscousLimit(i.x,o.min.x)),i.y<o.min.y&&(i.y=this._viscousLimit(i.y,o.min.y)),i.x>o.max.x&&(i.x=this._viscousLimit(i.x,o.max.x)),i.y>o.max.y&&(i.y=this._viscousLimit(i.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,o=Math.round(i/2),c=this._initialWorldOffset,f=this._draggable._newPos.x,x=(f-o+c)%i+o-c,A=(f+o+c)%i-o-c,F=Math.abs(x+c)<Math.abs(A+c)?x:A;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(i){var o=this._map,c=o.options,f=!c.inertia||i.noInertia||this._times.length<2;if(o.fire("dragend",i),f)o.fire("moveend");else{this._prunePositions(+new Date);var x=this._lastPos.subtract(this._positions[0]),A=(this._lastTime-this._times[0])/1e3,F=c.easeLinearity,K=x.multiplyBy(F/A),st=K.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,st),Dt=K.multiplyBy(mt/st),se=mt/(c.inertiaDeceleration*F),me=Dt.multiplyBy(-se/2).round();!me.x&&!me.y?o.fire("moveend"):(me=o._limitOffset(me,o.options.maxBounds),O(function(){o.panBy(me,{duration:se,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});xe.addInitHook("addHandler","dragging",Jm),xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Km=oi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(i){this._map=i,this._setPanDelta(i.options.keyboardPanDelta),this._setZoomDelta(i.options.zoomDelta)},addHooks:function(){var i=this._map._container;i.tabIndex<=0&&(i.tabIndex="0"),he(i,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ue(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=document.body,o=document.documentElement,c=i.scrollTop||o.scrollTop,f=i.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(f,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(i){var o=this._panKeys={},c=this.keyCodes,f,x;for(f=0,x=c.left.length;f<x;f++)o[c.left[f]]=[-1*i,0];for(f=0,x=c.right.length;f<x;f++)o[c.right[f]]=[i,0];for(f=0,x=c.down.length;f<x;f++)o[c.down[f]]=[0,i];for(f=0,x=c.up.length;f<x;f++)o[c.up[f]]=[0,-1*i]},_setZoomDelta:function(i){var o=this._zoomKeys={},c=this.keyCodes,f,x;for(f=0,x=c.zoomIn.length;f<x;f++)o[c.zoomIn[f]]=i;for(f=0,x=c.zoomOut.length;f<x;f++)o[c.zoomOut[f]]=-i},_addHooks:function(){he(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ue(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(i){if(!(i.altKey||i.ctrlKey||i.metaKey)){var o=i.keyCode,c=this._map,f;if(o in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(f=this._panKeys[o],i.shiftKey&&(f=at(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(at(f),c.options.maxBounds)),c.options.worldCopyJump){var x=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(f)));c.panTo(x)}else c.panBy(f)}else if(o in this._zoomKeys)c.setZoom(c.getZoom()+(i.shiftKey?3:1)*this._zoomKeys[o]);else if(o===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;Es(i)}}});xe.addInitHook("addHandler","keyboard",Km),xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var $m=oi.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ue(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=Sm(i),c=this._map.options.wheelDebounceTime;this._delta+=o,this._lastMousePos=this._map.mouseEventToContainerPoint(i),this._startTime||(this._startTime=+new Date);var f=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),f),Es(i)},_performZoom:function(){var i=this._map,o=i.getZoom(),c=this._map.options.zoomSnap||0;i._stop();var f=this._delta/(this._map.options.wheelPxPerZoomLevel*4),x=4*Math.log(2/(1+Math.exp(-Math.abs(f))))/Math.LN2,A=c?Math.ceil(x/c)*c:x,F=i._limitZoom(o+(this._delta>0?A:-A))-o;this._delta=0,this._startTime=null,F&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+F):i.setZoomAround(this._lastMousePos,o+F))}});xe.addInitHook("addHandler","scrollWheelZoom",$m);var XT=600;xe.mergeOptions({tapHold:Wt.touchNative&&Wt.safari&&Wt.mobile,tapTolerance:15});var tg=oi.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var o=i.touches[0];this._startPos=this._newPos=new W(o.clientX,o.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(he(document,"touchend",nn),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),XT),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Ue(document,"touchend",nn),Ue(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)},_onMove:function(i){var o=i.touches[0];this._newPos=new W(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,o){var c=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});c._simulated=!0,o.target.dispatchEvent(c)}});xe.addInitHook("addHandler","tapHold",tg),xe.mergeOptions({touchZoom:Wt.touch,bounceAtZoomLimits:!0});var eg=oi.extend({addHooks:function(){$t(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ke(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var o=this._map;if(!(!i.touches||i.touches.length!==2||o._animatingZoom||this._zooming)){var c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(c.add(f)._divideBy(2))),this._startDist=c.distanceTo(f),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),he(document,"touchmove",this._onTouchMove,this),he(document,"touchend touchcancel",this._onTouchEnd,this),nn(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var o=this._map,c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]),x=c.distanceTo(f)/this._startDist;if(this._zoom=o.getScaleZoom(x,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoom<o.getMinZoom()&&x<1||this._zoom>o.getMaxZoom()&&x>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,x===1)return}else{var A=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&A.x===0&&A.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(A),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),et(this._animRequest);var F=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=O(F,this,!0),nn(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,et(this._animRequest),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});xe.addInitHook("addHandler","touchZoom",eg),xe.BoxZoom=Qm,xe.DoubleClickZoom=jm,xe.Drag=Jm,xe.Keyboard=Km,xe.ScrollWheelZoom=$m,xe.TapHold=tg,xe.TouchZoom=eg,e.Bounds=Mt,e.Browser=Wt,e.CRS=_t,e.Canvas=Zm,e.Circle=kh,e.CircleMarker=Za,e.Class=H,e.Control=qn,e.DivIcon=Vm,e.DivOverlay=ai,e.DomEvent=hT,e.DomUtil=lT,e.Draggable=Ki,e.Evented=ct,e.FeatureGroup=Si,e.GeoJSON=Ti,e.GridLayer=fo,e.Handler=oi,e.Icon=hr,e.ImageOverlay=ja,e.LatLng=tt,e.LatLngBounds=oe,e.Layer=Qn,e.LayerGroup=cr,e.LineUtil=ST,e.Map=xe,e.Marker=Wa,e.Mixin=_T,e.Path=$i,e.Point=W,e.PolyUtil=vT,e.Polygon=ur,e.Polyline=Mi,e.Popup=Ja,e.PosAnimation=Mm,e.Projection=MT,e.Rectangle=qm,e.Renderer=bi,e.SVG=mo,e.SVGOverlay=Hm,e.TileLayer=fr,e.Tooltip=Ka,e.Transformation=Re,e.Util=z,e.VideoOverlay=zm,e.bind=l,e.bounds=Ot,e.canvas=Xm,e.circle=IT,e.circleMarker=LT,e.control=co,e.divIcon=HT,e.extend=r,e.featureGroup=CT,e.geoJSON=Fm,e.geoJson=UT,e.gridLayer=VT,e.icon=PT,e.imageOverlay=OT,e.latLng=ut,e.latLngBounds=Qt,e.layerGroup=AT,e.map=uT,e.marker=RT,e.point=at,e.polygon=kT,e.polyline=DT,e.popup=FT,e.rectangle=ZT,e.setOptions=w,e.stamp=u,e.svg=Ym,e.svgOverlay=BT,e.tileLayer=Gm,e.tooltip=zT,e.transformation=dt,e.version=s,e.videoOverlay=NT;var YT=window.L;e.noConflict=function(){return window.L=YT,this},window.L=e}))})(mr,mr.exports)),mr.exports}var I_=L_();const yn=P_(I_);function D_(n,t,e){if(n){const{obsType:s,obsPrefix:r,obsTiles:a}=e||{},{cols:l=8,rows:h=1}=a||{},{width:u=5760,height:d=2880}=t||{};if(s===yt.AppObsType.Hw){const m=ws(n,"x-image-process=image/resize,m_fixed,w_720,h_360,limit_0/marker,u_plus/imageslim");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-image-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/imageslim`;return ws(n,v)}}}else if(s===yt.AppObsType.Ali){const m=ws(n,"x-oss-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-oss-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else if(s===yt.AppObsType.Hs){const m=ws(n,"x-tos-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-tos-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else return s===yt.AppObsType.Aws?n:s===yt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function k_(n,t){if(n){const{obsType:e}=t||{};if(e===yt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await yt.api.getImageInfo(s);return{width:r,height:a}}else if(e===yt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await yt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===yt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await yt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===yt.AppObsType.Aws?{width:5760,height:2880}:e===yt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function ws(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class U_{marker;options;radarElement;map=null;constructor(t){this.options={radius:t.radius??30,color:t.color??"#108ee9",hFov:t.hFov??90,angle:t.angle??0,className:t.className??"leaflet-radar-marker"},this.radarElement=this.createRadarElement(),this.updateRadarStyle(),this.marker=yn.marker(t.latLng,{icon:yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[this.options.radius*2,this.options.radius*2],iconAnchor:[this.options.radius,this.options.radius]}),interactive:!1})}createRadarElement(){const t=document.createElement("div");t.style.pointerEvents="none",t.style.position="relative";const e=document.createElement("div");return e.style.transition="all 0.3s ease",e.style.display="block",t.appendChild(e),t}updateRadarStyle(){const t=this?.radarElement?.querySelector("div");if(!t)return;const{radius:e,color:s,hFov:r,angle:a}=this.options,h=`conic-gradient(
4
+ */var R_=mr.exports,Xh;function L_(){return Xh||(Xh=1,(function(n,t){(function(e,s){s(t)})(R_,(function(e){var s="1.9.4";function r(i){var o,c,f,x;for(c=1,f=arguments.length;c<f;c++){x=arguments[c];for(o in x)i[o]=x[o]}return i}var a=Object.create||(function(){function i(){}return function(o){return i.prototype=o,new i}})();function l(i,o){var c=Array.prototype.slice;if(i.bind)return i.bind.apply(i,c.call(arguments,1));var f=c.call(arguments,2);return function(){return i.apply(o,f.length?f.concat(c.call(arguments)):arguments)}}var h=0;function u(i){return"_leaflet_id"in i||(i._leaflet_id=++h),i._leaflet_id}function d(i,o,c){var f,x,A,z;return z=function(){f=!1,x&&(A.apply(c,x),x=!1)},A=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(z,o),f=!0)},A}function p(i,o,c){var f=o[1],x=o[0],A=f-x;return i===f&&c?i:((i-x)%A+A)%A+x}function m(){return!1}function _(i,o){if(o===!1)return i;var c=Math.pow(10,o===void 0?6:o);return Math.round(i*c)/c}function E(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function S(i){return E(i).split(/\s+/)}function w(i,o){Object.prototype.hasOwnProperty.call(i,"options")||(i.options=i.options?a(i.options):{});for(var c in o)i.options[c]=o[c];return i.options}function v(i,o,c){var f=[];for(var x in i)f.push(encodeURIComponent(c?x.toUpperCase():x)+"="+encodeURIComponent(i[x]));return(!o||o.indexOf("?")===-1?"?":"&")+f.join("&")}var g=/\{ *([\w_ -]+) *\}/g;function I(i,o){return i.replace(g,function(c,f){var x=o[f];if(x===void 0)throw new Error("No value provided for variable "+c);return typeof x=="function"&&(x=x(o)),x})}var C=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"};function M(i,o){for(var c=0;c<i.length;c++)if(i[c]===o)return c;return-1}var k="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(i){return window["webkit"+i]||window["moz"+i]||window["ms"+i]}var B=0;function V(i){var o=+new Date,c=Math.max(0,16-(o-B));return B=o+c,window.setTimeout(i,c)}var R=window.requestAnimationFrame||N("RequestAnimationFrame")||V,D=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function U(i,o,c){if(c&&R===V)i.call(o);else return R.call(window,l(i,o))}function tt(i){i&&D.call(window,i)}var F={__proto__:null,extend:r,create:a,bind:l,get lastId(){return h},stamp:u,throttle:d,wrapNum:p,falseFn:m,formatNum:_,trim:E,splitWords:S,setOptions:w,getParamString:v,template:I,isArray:C,indexOf:M,emptyImageUrl:k,requestFn:R,cancelFn:D,requestAnimFrame:U,cancelAnimFrame:tt};function H(){}H.extend=function(i){var o=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=o.__super__=this.prototype,f=a(c);f.constructor=o,o.prototype=f;for(var x in this)Object.prototype.hasOwnProperty.call(this,x)&&x!=="prototype"&&x!=="__super__"&&(o[x]=this[x]);return i.statics&&r(o,i.statics),i.includes&&(q(i.includes),r.apply(null,[f].concat(i.includes))),r(f,i),delete f.statics,delete f.includes,f.options&&(f.options=c.options?a(c.options):{},r(f.options,i.options)),f._initHooks=[],f.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var A=0,z=f._initHooks.length;A<z;A++)f._initHooks[A].call(this)}},o},H.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},H.mergeOptions=function(i){return r(this.prototype.options,i),this},H.addInitHook=function(i){var o=Array.prototype.slice.call(arguments,1),c=typeof i=="function"?i:function(){this[i].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function q(i){if(!(typeof L>"u"||!L||!L.Mixin)){i=C(i)?i:[i];for(var o=0;o<i.length;o++)i[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var j={on:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o);else{i=S(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c)}return this},off:function(i,o,c){if(!arguments.length)delete this._events;else if(typeof i=="object")for(var f in i)this._off(f,i[f],o);else{i=S(i);for(var x=arguments.length===1,A=0,z=i.length;A<z;A++)x?this._off(i[A]):this._off(i[A],o,c)}return this},_on:function(i,o,c,f){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(i,o,c)===!1){c===this&&(c=void 0);var x={fn:o,ctx:c};f&&(x.once=!0),this._events=this._events||{},this._events[i]=this._events[i]||[],this._events[i].push(x)}},_off:function(i,o,c){var f,x,A;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,A=f.length;x<A;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var z=this._listens(i,o,c);if(z!==!1){var K=f[z];this._firingCount&&(K.fn=m,this._events[i]=f=f.slice()),f.splice(z,1)}}},fire:function(i,o,c){if(!this.listens(i,c))return this;var f=r({},o,{type:i,target:this,sourceTarget:o&&o.sourceTarget||this});if(this._events){var x=this._events[i];if(x){this._firingCount=this._firingCount+1||1;for(var A=0,z=x.length;A<z;A++){var K=x[A],st=K.fn;K.once&&this.off(i,st,K.ctx),st.call(K.ctx||this,f)}this._firingCount--}}return c&&this._propagateEvent(f),this},listens:function(i,o,c,f){typeof i!="string"&&console.warn('"string" type argument expected');var x=o;typeof o!="function"&&(f=!!o,x=void 0,c=void 0);var A=this._events&&this._events[i];if(A&&A.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var z in this._eventParents)if(this._eventParents[z].listens(i,o,c,f))return!0}return!1},_listens:function(i,o,c){if(!this._events)return!1;var f=this._events[i]||[];if(!o)return!!f.length;c===this&&(c=void 0);for(var x=0,A=f.length;x<A;x++)if(f[x].fn===o&&f[x].ctx===c)return x;return!1},once:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o,!0);else{i=S(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c,!0)}return this},addEventParent:function(i){return this._eventParents=this._eventParents||{},this._eventParents[u(i)]=i,this},removeEventParent:function(i){return this._eventParents&&delete this._eventParents[u(i)],this},_propagateEvent:function(i){for(var o in this._eventParents)this._eventParents[o].fire(i.type,r({layer:i.target,propagatedFrom:i.target},i),!0)}};j.addEventListener=j.on,j.removeEventListener=j.clearAllEventListeners=j.off,j.addOneTimeEventListener=j.once,j.fireEvent=j.fire,j.hasEventListeners=j.listens;var ct=H.extend(j);function W(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var Et=Math.trunc||function(i){return i>0?Math.floor(i):Math.ceil(i)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(i){return this.clone()._add(lt(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(lt(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new W(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new W(this.x/i.x,this.y/i.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Et(this.x),this.y=Et(this.y),this},distanceTo:function(i){i=lt(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=lt(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=lt(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function lt(i,o,c){return i instanceof W?i:C(i)?new W(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new W(i.x,i.y):new W(i,o,c)}function Mt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}Mt.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof W||typeof i[0]=="number"||"x"in i)o=c=lt(i);else if(i=Ot(i),o=i.min,c=i.max,!o||!c)return this;return!this.min&&!this.max?(this.min=o.clone(),this.max=c.clone()):(this.min.x=Math.min(o.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(o.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(i){return lt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return lt(this.min.x,this.max.y)},getTopRight:function(){return lt(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(i){var o,c;return typeof i[0]=="number"||i instanceof W?i=lt(i):i=Ot(i),i instanceof Mt?(o=i.min,c=i.max):o=c=i,o.x>=this.min.x&&c.x<=this.max.x&&o.y>=this.min.y&&c.y<=this.max.y},intersects:function(i){i=Ot(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>=o.x&&f.x<=c.x,z=x.y>=o.y&&f.y<=c.y;return A&&z},overlaps:function(i){i=Ot(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>o.x&&f.x<c.x,z=x.y>o.y&&f.y<c.y;return A&&z},isValid:function(){return!!(this.min&&this.max)},pad:function(i){var o=this.min,c=this.max,f=Math.abs(o.x-c.x)*i,x=Math.abs(o.y-c.y)*i;return Ot(lt(o.x-f,o.y-x),lt(c.x+f,c.y+x))},equals:function(i){return i?(i=Ot(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function Ot(i,o){return!i||i instanceof Mt?i:new Mt(i,o)}function oe(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}oe.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof et)f=i,x=i;else if(i instanceof oe){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(ut(i)||Qt(i)):this;return!o&&!c?(this._southWest=new et(f.lat,f.lng),this._northEast=new et(x.lat,x.lng)):(o.lat=Math.min(f.lat,o.lat),o.lng=Math.min(f.lng,o.lng),c.lat=Math.max(x.lat,c.lat),c.lng=Math.max(x.lng,c.lng)),this},pad:function(i){var o=this._southWest,c=this._northEast,f=Math.abs(o.lat-c.lat)*i,x=Math.abs(o.lng-c.lng)*i;return new oe(new et(o.lat-f,o.lng-x),new et(c.lat+f,c.lng+x))},getCenter:function(){return new et((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new et(this.getNorth(),this.getWest())},getSouthEast:function(){return new et(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(i){typeof i[0]=="number"||i instanceof et||"lat"in i?i=ut(i):i=Qt(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof oe?(f=i.getSouthWest(),x=i.getNorthEast()):f=x=i,f.lat>=o.lat&&x.lat<=c.lat&&f.lng>=o.lng&&x.lng<=c.lng},intersects:function(i){i=Qt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>=o.lat&&f.lat<=c.lat,z=x.lng>=o.lng&&f.lng<=c.lng;return A&&z},overlaps:function(i){i=Qt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>o.lat&&f.lat<c.lat,z=x.lng>o.lng&&f.lng<c.lng;return A&&z},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Qt(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Qt(i,o){return i instanceof oe?i:new oe(i,o)}function et(i,o,c){if(isNaN(i)||isNaN(o))throw new Error("Invalid LatLng object: ("+i+", "+o+")");this.lat=+i,this.lng=+o,c!==void 0&&(this.alt=+c)}et.prototype={equals:function(i,o){if(!i)return!1;i=ut(i);var c=Math.max(Math.abs(this.lat-i.lat),Math.abs(this.lng-i.lng));return c<=(o===void 0?1e-9:o)},toString:function(i){return"LatLng("+_(this.lat,i)+", "+_(this.lng,i)+")"},distanceTo:function(i){return Nt.distance(this,ut(i))},wrap:function(){return Nt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Qt([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new et(this.lat,this.lng,this.alt)}};function ut(i,o,c){return i instanceof et?i:C(i)&&typeof i[0]!="object"?i.length===3?new et(i[0],i[1],i[2]):i.length===2?new et(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new et(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new et(i,o,c)}var _t={latLngToPoint:function(i,o){var c=this.projection.project(i),f=this.scale(o);return this.transformation._transform(c,f)},pointToLatLng:function(i,o){var c=this.scale(o),f=this.transformation.untransform(i,c);return this.projection.unproject(f)},project:function(i){return this.projection.project(i)},unproject:function(i){return this.projection.unproject(i)},scale:function(i){return 256*Math.pow(2,i)},zoom:function(i){return Math.log(i/256)/Math.LN2},getProjectedBounds:function(i){if(this.infinite)return null;var o=this.projection.bounds,c=this.scale(i),f=this.transformation.transform(o.min,c),x=this.transformation.transform(o.max,c);return new Mt(f,x)},infinite:!1,wrapLatLng:function(i){var o=this.wrapLng?p(i.lng,this.wrapLng,!0):i.lng,c=this.wrapLat?p(i.lat,this.wrapLat,!0):i.lat,f=i.alt;return new et(c,o,f)},wrapLatLngBounds:function(i){var o=i.getCenter(),c=this.wrapLatLng(o),f=o.lat-c.lat,x=o.lng-c.lng;if(f===0&&x===0)return i;var A=i.getSouthWest(),z=i.getNorthEast(),K=new et(A.lat-f,A.lng-x),st=new et(z.lat-f,z.lng-x);return new oe(K,st)}},Nt=r({},_t,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,A=Math.sin((o.lat-i.lat)*c/2),z=Math.sin((o.lng-i.lng)*c/2),K=A*A+Math.cos(f)*Math.cos(x)*z*z,st=2*Math.atan2(Math.sqrt(K),Math.sqrt(1-K));return this.R*st}}),Zt=6378137,jt={R:Zt,MAX_LATITUDE:85.0511287798,project:function(i){var o=Math.PI/180,c=this.MAX_LATITUDE,f=Math.max(Math.min(c,i.lat),-c),x=Math.sin(f*o);return new W(this.R*i.lng*o,this.R*Math.log((1+x)/(1-x))/2)},unproject:function(i){var o=180/Math.PI;return new et((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=Zt*Math.PI;return new Mt([-i,-i],[i,i])})()};function Re(i,o,c,f){if(C(i)){this._a=i[0],this._b=i[1],this._c=i[2],this._d=i[3];return}this._a=i,this._b=o,this._c=c,this._d=f}Re.prototype={transform:function(i,o){return this._transform(i.clone(),o)},_transform:function(i,o){return o=o||1,i.x=o*(this._a*i.x+this._b),i.y=o*(this._c*i.y+this._d),i},untransform:function(i,o){return o=o||1,new W((i.x/o-this._b)/this._a,(i.y/o-this._d)/this._c)}};function ft(i,o,c,f){return new Re(i,o,c,f)}var T=r({},Nt,{code:"EPSG:3857",projection:jt,transformation:(function(){var i=.5/(Math.PI*jt.R);return ft(i,.5,-i,.5)})()}),Z=r({},T,{code:"EPSG:900913"});function $(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ht(i,o){var c="",f,x,A,z,K,st;for(f=0,A=i.length;f<A;f++){for(K=i[f],x=0,z=K.length;x<z;x++)st=K[x],c+=(x?"L":"M")+st.x+" "+st.y;c+=o?Wt.svg?"z":"x":""}return c||"M0 0"}var rt=document.documentElement.style,Tt="ActiveXObject"in window,pt=Tt&&!document.addEventListener,At="msLaunchUri"in navigator&&!("documentMode"in document),ne=An("webkit"),de=An("android"),O=An("android 2")||An("android 3"),b=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),J=de&&An("Google")&&b<537&&!("AudioNode"in window),ot=!!window.opera,gt=!At&&An("chrome"),at=An("gecko")&&!ne&&!ot&&!Tt,Ht=!gt&&An("safari"),bt=An("phantom"),Bt="OTransition"in rt,Vt=navigator.platform.indexOf("Win")===0,wt=Tt&&"transition"in rt,Lt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!O,ie="MozPerspective"in rt,Gt=!window.L_DISABLE_3D&&(wt||Lt||ie)&&!Bt&&!bt,Pt=typeof orientation<"u"||An("mobile"),ce=Pt&&ne,G=Pt&&Lt,St=!window.PointerEvent&&window.MSPointerEvent,Ct=!!(window.PointerEvent||St),Ut="ontouchstart"in window||!!window.TouchEvent,vt=!window.L_NO_TOUCH&&(Ut||Ct),dt=Pt&&ot,zt=Pt&&at,le=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,De=(function(){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",m,o),window.removeEventListener("testPassiveEventSupport",m,o)}catch{}return i})(),Me=(function(){return!!document.createElement("canvas").getContext})(),bn=!!(document.createElementNS&&$("svg").createSVGRect),On=!!bn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ba=!bn&&(function(){try{var i=document.createElement("div");i.innerHTML='<v:shape adj="1"/>';var o=i.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch{return!1}})(),wi=navigator.platform.indexOf("Mac")===0,io=navigator.platform.indexOf("Linux")===0;function An(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Wt={ie:Tt,ielt9:pt,edge:At,webkit:ne,android:de,android23:O,androidStock:J,opera:ot,chrome:gt,gecko:at,safari:Ht,phantom:bt,opera12:Bt,win:Vt,ie3d:wt,webkit3d:Lt,gecko3d:ie,any3d:Gt,mobile:Pt,mobileWebkit:ce,mobileWebkit3d:G,msPointer:St,pointer:Ct,touch:vt,touchNative:Ut,mobileOpera:dt,mobileGecko:zt,retina:le,passiveEvents:De,canvas:Me,svg:bn,vml:Ba,inlineSvg:On,mac:wi,linux:io},_s=Wt.msPointer?"MSPointerDown":"pointerdown",so=Wt.msPointer?"MSPointerMove":"pointermove",vs=Wt.msPointer?"MSPointerUp":"pointerup",ro=Wt.msPointer?"MSPointerCancel":"pointercancel",lr={touchstart:_s,touchmove:so,touchend:vs,touchcancel:ro},Fa={touchstart:Y,touchmove:nt,touchend:nt,touchcancel:nt},Ji={},za=!1;function ph(i,o,c){return o==="touchstart"&&it(),Fa[o]?(c=Fa[o].bind(this,c),i.addEventListener(lr[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function mh(i,o,c){if(!lr[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(lr[o],c,!1)}function gh(i){Ji[i.pointerId]=i}function P(i){Ji[i.pointerId]&&(Ji[i.pointerId]=i)}function X(i){delete Ji[i.pointerId]}function it(){za||(document.addEventListener(_s,gh,!0),document.addEventListener(so,P,!0),document.addEventListener(vs,X,!0),document.addEventListener(ro,X,!0),za=!0)}function nt(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Ji)o.touches.push(Ji[c]);o.changedTouches=[o],i(o)}}function Y(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&nn(o),nt(i,o)}function xt(i){var o={},c,f;for(f in i)c=i[f],o[f]=c&&c.bind?c.bind(i):c;return i=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var It=200;function Ft(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(A){if(A.detail!==1){f=A.detail;return}if(!(A.pointerType==="mouse"||A.sourceCapabilities&&!A.sourceCapabilities.firesTouchEvents)){var z=xm(A);if(!(z.some(function(st){return st instanceof HTMLLabelElement&&st.attributes.for})&&!z.some(function(st){return st instanceof HTMLInputElement||st instanceof HTMLSelectElement}))){var K=Date.now();K-c<=It?(f++,f===2&&o(xt(A))):f=1,c=K}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function kt(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var te=en(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ee=en(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),qt=ee==="webkitTransition"||ee==="OTransition"?ee+"End":"transitionend";function pe(i){return typeof i=="string"?document.getElementById(i):i}function Ee(i,o){var c=i.style[o]||i.currentStyle&&i.currentStyle[o];if((!c||c==="auto")&&document.defaultView){var f=document.defaultView.getComputedStyle(i,null);c=f?f[o]:null}return c==="auto"?null:c}function Jt(i,o,c){var f=document.createElement(i);return f.className=o||"",c&&c.appendChild(f),f}function se(i){var o=i.parentNode;o&&o.removeChild(i)}function Te(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Xt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Le(i){var o=i.parentNode;o&&o.firstChild!==i&&o.insertBefore(i,o.firstChild)}function _e(i,o){if(i.classList!==void 0)return i.classList.contains(o);var c=si(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function $t(i,o){if(i.classList!==void 0)for(var c=S(o),f=0,x=c.length;f<x;f++)i.classList.add(c[f]);else if(!_e(i,o)){var A=si(i);tn(i,(A?A+" ":"")+o)}}function ke(i,o){i.classList!==void 0?i.classList.remove(o):tn(i,E((" "+si(i)+" ").replace(" "+o+" "," ")))}function tn(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function si(i){return i.correspondingElement&&(i=i.correspondingElement),i.className.baseVal===void 0?i.className:i.className.baseVal}function ve(i,o){"opacity"in i.style?i.style.opacity=o:"filter"in i.style&&_n(i,o)}function _n(i,o){var c=!1,f="DXImageTransform.Microsoft.Alpha";try{c=i.filters.item(f)}catch{if(o===1)return}o=Math.round(o*100),c?(c.Enabled=o!==100,c.Opacity=o):i.style.filter+=" progid:"+f+"(opacity="+o+")"}function en(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Fe(i,o,c){var f=o||new W(0,0);i.style[te]=(Wt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function ye(i,o){i._leaflet_pos=o,Wt.any3d?Fe(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Yn(i){return i._leaflet_pos||new W(0,0)}var Cn,oo,_h;if("onselectstart"in document)Cn=function(){he(window,"selectstart",nn)},oo=function(){Ue(window,"selectstart",nn)};else{var ao=en(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Cn=function(){if(ao){var i=document.documentElement.style;_h=i[ao],i[ao]="none"}},oo=function(){ao&&(document.documentElement.style[ao]=_h,_h=void 0)}}function vh(){he(window,"dragstart",nn)}function yh(){Ue(window,"dragstart",nn)}var Ha,Eh;function xh(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Va(),Ha=i,Eh=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Va))}function Va(){Ha&&(Ha.style.outlineStyle=Eh,Ha=void 0,Eh=void 0,Ue(window,"keydown",Va))}function ym(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function wh(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var lT={__proto__:null,TRANSFORM:te,TRANSITION:ee,TRANSITION_END:qt,get:pe,getStyle:Ee,create:Jt,remove:se,empty:Te,toFront:Xt,toBack:Le,hasClass:_e,addClass:$t,removeClass:ke,setClass:tn,getClass:si,setOpacity:ve,testProp:en,setTransform:Fe,setPosition:ye,getPosition:Yn,get disableTextSelection(){return Cn},get enableTextSelection(){return oo},disableImageDrag:vh,enableImageDrag:yh,preventOutline:xh,restoreOutline:Va,getSizedParentNode:ym,getScale:wh};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)Mh(i,x,o[x],c);else{o=S(o);for(var A=0,z=o.length;A<z;A++)Mh(i,o[A],c,f)}return this}var ri="_leaflet_events";function Ue(i,o,c,f){if(arguments.length===1)Em(i),delete i[ri];else if(o&&typeof o=="object")for(var x in o)Th(i,x,o[x],c);else if(o=S(o),arguments.length===2)Em(i,function(K){return M(o,K)!==-1});else for(var A=0,z=o.length;A<z;A++)Th(i,o[A],c,f);return this}function Em(i,o){for(var c in i[ri]){var f=c.split(/\d/)[0];(!o||o(f))&&Th(i,f,null,null,c)}}var Sh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Mh(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ri]&&i[ri][x])return this;var A=function(K){return c.call(f||i,K||window.event)},z=A;!Wt.touchNative&&Wt.pointer&&o.indexOf("touch")===0?A=ph(i,o,A):Wt.touch&&o==="dblclick"?A=Ft(i,A):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(Sh[o]||o,A,Wt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(A=function(K){K=K||window.event,Ah(i,K)&&z(K)},i.addEventListener(Sh[o],A,!1)):i.addEventListener(o,z,!1):i.attachEvent("on"+o,A),i[ri]=i[ri]||{},i[ri][x]=A}function Th(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var A=i[ri]&&i[ri][x];if(!A)return this;!Wt.touchNative&&Wt.pointer&&o.indexOf("touch")===0?mh(i,o,A):Wt.touch&&o==="dblclick"?kt(i,A):"removeEventListener"in i?i.removeEventListener(Sh[o]||o,A,!1):i.detachEvent("on"+o,A),i[ri][x]=null}function ys(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function bh(i){return Mh(i,"wheel",ys),this}function lo(i){return he(i,"mousedown touchstart dblclick contextmenu",ys),i._leaflet_disable_click=!0,this}function nn(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function Es(i){return nn(i),ys(i),this}function xm(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function wm(i,o){if(!o)return new W(i.clientX,i.clientY);var c=wh(o),f=c.boundingClientRect;return new W((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var cT=Wt.linux&&Wt.chrome?window.devicePixelRatio:Wt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Sm(i){return Wt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/cT:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function Ah(i,o){var c=o.relatedTarget;if(!c)return!0;try{for(;c&&c!==i;)c=c.parentNode}catch{return!1}return c!==i}var hT={__proto__:null,on:he,off:Ue,stopPropagation:ys,disableScrollPropagation:bh,disableClickPropagation:lo,preventDefault:nn,stop:Es,getPropagationPath:xm,getMousePosition:wm,getWheelDelta:Sm,isExternalTarget:Ah,addListener:he,removeListener:Ue},Mm=ct.extend({run:function(i,o,c,f){this.stop(),this._el=i,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(f||.5,.2),this._startPos=Yn(i),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=U(this._animate,this),this._step()},_step:function(i){var o=+new Date-this._startTime,c=this._duration*1e3;o<c?this._runFrame(this._easeOut(o/c),i):(this._runFrame(1),this._complete())},_runFrame:function(i,o){var c=this._startPos.add(this._offset.multiplyBy(i));o&&c._round(),ye(this._el,c),this.fire("step")},_complete:function(){tt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),xe=ct.extend({options:{crs:T,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(i,o){o=w(this,o),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(i),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),o.maxBounds&&this.setMaxBounds(o.maxBounds),o.zoom!==void 0&&(this._zoom=this._limitZoom(o.zoom)),o.center&&o.zoom!==void 0&&this.setView(ut(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ee&&Wt.any3d&&!Wt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),he(this._proxy,qt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(i,o,c){if(o=o===void 0?this._zoom:this._limitZoom(o),i=this._limitCenter(ut(i),o,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=r({animate:c.animate},c.zoom),c.pan=r({animate:c.animate,duration:c.duration},c.pan));var f=this._zoom!==o?this._tryAnimatedZoom&&this._tryAnimatedZoom(i,o,c.zoom):this._tryAnimatedPan(i,c.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(i,o,c.pan&&c.pan.noMoveStart),this},setZoom:function(i,o){return this._loaded?this.setView(this.getCenter(),i,{zoom:o}):(this._zoom=i,this)},zoomIn:function(i,o){return i=i||(Wt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(Wt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-i,o)},setZoomAround:function(i,o,c){var f=this.getZoomScale(o),x=this.getSize().divideBy(2),A=i instanceof W?i:this.latLngToContainerPoint(i),z=A.subtract(x).multiplyBy(1-1/f),K=this.containerPointToLatLng(x.add(z));return this.setView(K,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Qt(i);var c=lt(o.paddingTopLeft||o.padding||[0,0]),f=lt(o.paddingBottomRight||o.padding||[0,0]),x=this.getBoundsZoom(i,!1,c.add(f));if(x=typeof o.maxZoom=="number"?Math.min(o.maxZoom,x):x,x===1/0)return{center:i.getCenter(),zoom:x};var A=f.subtract(c).divideBy(2),z=this.project(i.getSouthWest(),x),K=this.project(i.getNorthEast(),x),st=this.unproject(z.add(K).divideBy(2).add(A),x);return{center:st,zoom:x}},fitBounds:function(i,o){if(i=Qt(i),!i.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(i,o);return this.setView(c.center,c.zoom,o)},fitWorld:function(i){return this.fitBounds([[-90,-180],[90,180]],i)},panTo:function(i,o){return this.setView(i,this._zoom,{pan:o})},panBy:function(i,o){if(i=lt(i).round(),o=o||{},!i.x&&!i.y)return this.fire("moveend");if(o.animate!==!0&&!this.getSize().contains(i))return this._resetView(this.unproject(this.project(this.getCenter()).add(i)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Mm,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o.noMoveStart||this.fire("movestart"),o.animate!==!1){$t(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(i).round();this._panAnim.run(this._mapPane,c,o.duration||.25,o.easeLinearity)}else this._rawPanBy(i),this.fire("move").fire("moveend");return this},flyTo:function(i,o,c){if(c=c||{},c.animate===!1||!Wt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),A=this.getSize(),z=this._zoom;i=ut(i),o=o===void 0?z:o;var K=Math.max(A.x,A.y),st=K*this.getZoomScale(z,o),mt=x.distanceTo(f)||1,Dt=1.42,re=Dt*Dt;function me(We){var tl=We?-1:1,KT=We?st:K,$T=st*st-K*K+tl*re*re*mt*mt,tb=2*KT*re*mt,Bh=$T/tb,sg=Math.sqrt(Bh*Bh+1)-Bh,eb=sg<1e-9?-18:Math.log(sg);return eb}function dn(We){return(Math.exp(We)-Math.exp(-We))/2}function je(We){return(Math.exp(We)+Math.exp(-We))/2}function Bn(We){return dn(We)/je(We)}var vn=me(0);function pr(We){return K*(je(vn)/je(vn+Dt*We))}function qT(We){return K*(je(vn)*Bn(vn+Dt*We)-dn(vn))/re}function QT(We){return 1-Math.pow(1-We,1.5)}var jT=Date.now(),ng=(me(1)-vn)/Dt,JT=c.duration?1e3*c.duration:1e3*ng*.8;function ig(){var We=(Date.now()-jT)/JT,tl=QT(We)*ng;We<=1?(this._flyToFrame=U(ig,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(qT(tl)/mt)),z),this.getScaleZoom(K/pr(tl),z),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),ig.call(this),this},flyToBounds:function(i,o){var c=this._getBoundsCenterZoom(i,o);return this.flyTo(c.center,c.zoom,o)},setMaxBounds:function(i){return i=Qt(i),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),i.isValid()?(this.options.maxBounds=i,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(i){var o=this.options.minZoom;return this.options.minZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(i):this},setMaxZoom:function(i){var o=this.options.maxZoom;return this.options.maxZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,o){this._enforcingBounds=!0;var c=this.getCenter(),f=this._limitCenter(c,this._zoom,Qt(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=lt(o.paddingTopLeft||o.padding||[0,0]),f=lt(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),A=this.project(i),z=this.getPixelBounds(),K=Ot([z.min.add(c),z.max.subtract(f)]),st=K.getSize();if(!K.contains(A)){this._enforcingBounds=!0;var mt=A.subtract(K.getCenter()),Dt=K.extend(A).getSize().subtract(st);x.x+=mt.x<0?-Dt.x:Dt.x,x.y+=mt.y<0?-Dt.y:Dt.y,this.panTo(this.unproject(x),o),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=r({animate:!1,pan:!0},i===!0?{animate:!0}:i);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),f=o.divideBy(2).round(),x=c.divideBy(2).round(),A=f.subtract(x);return!A.x&&!A.y?this:(i.animate&&i.pan?this.panBy(A):(i.pan&&this._rawPanBy(A),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=r({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,c,i):navigator.geolocation.getCurrentPosition(o,c,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var o=i.code,c=i.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var o=i.coords.latitude,c=i.coords.longitude,f=new et(o,c),x=f.toBounds(i.coords.accuracy*2),A=this._locateOptions;if(A.setView){var z=this.getBoundsZoom(x);this.setView(f,A.maxZoom?Math.min(z,A.maxZoom):z)}var K={latlng:f,bounds:x,timestamp:i.timestamp};for(var st in i.coords)typeof i.coords[st]=="number"&&(K[st]=i.coords[st]);this.fire("locationfound",K)}},addHandler:function(i,o){if(!o)return this;var c=this[i]=new o(this);return this._handlers.push(c),this.options[i]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),se(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(tt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)se(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,o){var c="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),f=Jt("div",c,o||this._mapPane);return i&&(this._panes[i]=f),f},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),o=this.unproject(i.getBottomLeft()),c=this.unproject(i.getTopRight());return new oe(o,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(i,o,c){i=Qt(i),c=lt(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),A=this.getMaxZoom(),z=i.getNorthWest(),K=i.getSouthEast(),st=this.getSize().subtract(c),mt=Ot(this.project(K,f),this.project(z,f)).getSize(),Dt=Wt.any3d?this.options.zoomSnap:1,re=st.x/mt.x,me=st.y/mt.y,dn=o?Math.max(re,me):Math.min(re,me);return f=this.getScaleZoom(dn,f),Dt&&(f=Math.round(f/(Dt/100))*(Dt/100),f=o?Math.ceil(f/Dt)*Dt:Math.floor(f/Dt)*Dt),Math.max(x,Math.min(A,f))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,o){var c=this._getTopLeftPoint(i,o);return new Mt(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,o){var c=this.options.crs;return o=o===void 0?this._zoom:o,c.scale(i)/c.scale(o)},getScaleZoom:function(i,o){var c=this.options.crs;o=o===void 0?this._zoom:o;var f=c.zoom(i*c.scale(o));return isNaN(f)?1/0:f},project:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(ut(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(lt(i),o)},layerPointToLatLng:function(i){var o=lt(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(ut(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(ut(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Qt(i))},distance:function(i,o){return this.options.crs.distance(ut(i),ut(o))},containerPointToLayerPoint:function(i){return lt(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return lt(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(lt(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ut(i)))},mouseEventToContainerPoint:function(i){return wm(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var o=this._container=pe(i);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");he(o,"scroll",this._onScroll,this),this._containerId=u(o)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&Wt.any3d,$t(i,"leaflet-container"+(Wt.touch?" leaflet-touch":"")+(Wt.retina?" leaflet-retina":"")+(Wt.ielt9?" leaflet-oldie":"")+(Wt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=Ee(i,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ye(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||($t(i.markerPane,"leaflet-zoom-hide"),$t(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,o,c){ye(this._mapPane,new W(0,0));var f=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var x=this._zoom!==o;this._moveStart(x,c)._move(i,o)._moveEnd(x),this.fire("viewreset"),f&&this.fire("load")},_moveStart:function(i,o){return i&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(i,o,c,f){o===void 0&&(o=this._zoom);var x=this._zoom!==o;return this._zoom=o,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),f?c&&c.pinch&&this.fire("zoom",c):((x||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return tt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){ye(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[u(this._container)]=this;var o=i?Ue:he;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),Wt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){tt(this._resizeRequest),this._resizeRequest=U(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,o){for(var c=[],f,x=o==="mouseout"||o==="mouseover",A=i.target||i.srcElement,z=!1;A;){if(f=this._targets[u(A)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){z=!0;break}if(f&&f.listens(o,!0)&&(x&&!Ah(A,i)||(c.push(f),x))||A===this._container)break;A=A.parentNode}return!c.length&&!z&&!x&&this.listens(o,!0)&&(c=[this]),c},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var o=i.target||i.srcElement;if(!(!this._loaded||o._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(o))){var c=i.type;c==="mousedown"&&xh(o),this._fireDOMEvent(i,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,o,c){if(i.type==="click"){var f=r({},i);f.type="preclick",this._fireDOMEvent(f,f.type,c)}var x=this._findEventTargets(i,o);if(c){for(var A=[],z=0;z<c.length;z++)c[z].listens(o,!0)&&A.push(c[z]);x=A.concat(x)}if(x.length){o==="contextmenu"&&nn(i);var K=x[0],st={originalEvent:i};if(i.type!=="keypress"&&i.type!=="keydown"&&i.type!=="keyup"){var mt=K.getLatLng&&(!K._radius||K._radius<=10);st.containerPoint=mt?this.latLngToContainerPoint(K.getLatLng()):this.mouseEventToContainerPoint(i),st.layerPoint=this.containerPointToLayerPoint(st.containerPoint),st.latlng=mt?K.getLatLng():this.layerPointToLatLng(st.layerPoint)}for(z=0;z<x.length;z++)if(x[z].fire(o,st,!0),st.originalEvent._stopped||x[z].options.bubblingMouseEvents===!1&&M(this._mouseEvents,o)!==-1)return}},_draggableMoved:function(i){return i=i.dragging&&i.dragging.enabled()?i:this,i.dragging&&i.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,o=this._handlers.length;i<o;i++)this._handlers[i].disable()},whenReady:function(i,o){return this._loaded?i.call(o||this,{target:this}):this.on("load",i,o),this},_getMapPanePos:function(){return Yn(this._mapPane)||new W(0,0)},_moved:function(){var i=this._getMapPanePos();return i&&!i.equals([0,0])},_getTopLeftPoint:function(i,o){var c=i&&o!==void 0?this._getNewPixelOrigin(i,o):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(i,o){var c=this.getSize()._divideBy(2);return this.project(i,o)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return this.project(i,o)._subtract(f)},_latLngBoundsToNewLayerBounds:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return Ot([this.project(i.getSouthWest(),o)._subtract(f),this.project(i.getNorthWest(),o)._subtract(f),this.project(i.getSouthEast(),o)._subtract(f),this.project(i.getNorthEast(),o)._subtract(f)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(i){return this.latLngToLayerPoint(i).subtract(this._getCenterLayerPoint())},_limitCenter:function(i,o,c){if(!c)return i;var f=this.project(i,o),x=this.getSize().divideBy(2),A=new Mt(f.subtract(x),f.add(x)),z=this._getBoundsOffset(A,c,o);return Math.abs(z.x)<=1&&Math.abs(z.y)<=1?i:this.unproject(f.add(z),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new Mt(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=Ot(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),A=f.max.subtract(i.max),z=this._rebound(x.x,-A.x),K=this._rebound(x.y,-A.y);return new W(z,K)},_rebound:function(i,o){return i+o>0?Math.round(i-o)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(o))},_limitZoom:function(i){var o=this.getMinZoom(),c=this.getMaxZoom(),f=Wt.any3d?this.options.zoomSnap:1;return f&&(i=Math.round(i/f)*f),Math.max(o,Math.min(c,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ke(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,o){var c=this._getCenterOffset(i)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,o),!0)},_createAnimProxy:function(){var i=this._proxy=Jt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(o){var c=te,f=this._proxy.style[c];Fe(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),f===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){se(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),o=this.getZoom();Fe(this._proxy,this.project(i,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,o,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var f=this.getZoomScale(o),x=this._getCenterOffset(i)._divideBy(1-1/f);return c.animate!==!0&&!this.getSize().contains(x)?!1:(U(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(i,o,!0)},this),!0)},_animateZoom:function(i,o,c,f){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=o,$t(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:o,noUpdate:f}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ke(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function uT(i,o){return new xe(i,o)}var qn=H.extend({options:{position:"topright"},initialize:function(i){w(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var o=this._map;return o&&o.removeControl(this),this.options.position=i,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var o=this._container=this.onAdd(i),c=this.getPosition(),f=i._controlCorners[c];return $t(o,"leaflet-control"),c.indexOf("bottom")!==-1?f.insertBefore(o,f.firstChild):f.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(se(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),co=function(i){return new qn(i)};xe.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},o="leaflet-",c=this._controlContainer=Jt("div",o+"control-container",this._container);function f(x,A){var z=o+x+" "+o+A;i[x+A]=Jt("div",z,c)}f("top","left"),f("top","right"),f("bottom","left"),f("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)se(this._controlCorners[i]);se(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Tm=qn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,o,c,f){return c<f?-1:f<c?1:0}},initialize:function(i,o,c){w(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var f in i)this._addLayer(i[f],f);for(f in o)this._addLayer(o[f],f,!0)},onAdd:function(i){this._initLayout(),this._update(),this._map=i,i.on("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(i){return qn.prototype.addTo.call(this,i),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(i,o){return this._addLayer(i,o),this._map?this._update():this},addOverlay:function(i,o){return this._addLayer(i,o,!0),this._map?this._update():this},removeLayer:function(i){i.off("add remove",this._onLayerChange,this);var o=this._getLayer(u(i));return o&&this._layers.splice(this._layers.indexOf(o),1),this._map?this._update():this},expand:function(){$t(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var i=this._map.getSize().y-(this._container.offsetTop+50);return i<this._section.clientHeight?($t(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=i+"px"):ke(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ke(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var i="leaflet-control-layers",o=this._container=Jt("div",i),c=this.options.collapsed;o.setAttribute("aria-haspopup",!0),lo(o),bh(o);var f=this._section=Jt("section",i+"-list");c&&(this._map.on("click",this.collapse,this),he(o,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var x=this._layersLink=Jt("a",i+"-toggle",o);x.href="#",x.title="Layers",x.setAttribute("role","button"),he(x,{keydown:function(A){A.keyCode===13&&this._expandSafely()},click:function(A){nn(A),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Jt("div",i+"-base",f),this._separator=Jt("div",i+"-separator",f),this._overlaysList=Jt("div",i+"-overlays",f),o.appendChild(f)},_getLayer:function(i){for(var o=0;o<this._layers.length;o++)if(this._layers[o]&&u(this._layers[o].layer)===i)return this._layers[o]},_addLayer:function(i,o,c){this._map&&i.on("add remove",this._onLayerChange,this),this._layers.push({layer:i,name:o,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(f,x){return this.options.sortFunction(f.layer,x.layer,f.name,x.name)},this)),this.options.autoZIndex&&i.setZIndex&&(this._lastZIndex++,i.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Te(this._baseLayersList),Te(this._overlaysList),this._layerControlInputs=[];var i,o,c,f,x=0;for(c=0;c<this._layers.length;c++)f=this._layers[c],this._addItem(f),o=o||f.overlay,i=i||!f.overlay,x+=f.overlay?0:1;return this.options.hideSingleBase&&(i=i&&x>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=o&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var o=this._getLayer(u(i.target)),c=o.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;c&&this._map.fire(c,o)},_createRadioElement:function(i,o){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+i+'"'+(o?' checked="checked"':"")+"/>",f=document.createElement("div");return f.innerHTML=c,f.firstChild},_addItem:function(i){var o=document.createElement("label"),c=this._map.hasLayer(i.layer),f;i.overlay?(f=document.createElement("input"),f.type="checkbox",f.className="leaflet-control-layers-selector",f.defaultChecked=c):f=this._createRadioElement("leaflet-base-layers_"+u(this),c),this._layerControlInputs.push(f),f.layerId=u(i.layer),he(f,"click",this._onInputClick,this);var x=document.createElement("span");x.innerHTML=" "+i.name;var A=document.createElement("span");o.appendChild(A),A.appendChild(f),A.appendChild(x);var z=i.overlay?this._overlaysList:this._baseLayersList;return z.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var A=i.length-1;A>=0;A--)o=i[A],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(A=0;A<x.length;A++)this._map.hasLayer(x[A])&&this._map.removeLayer(x[A]);for(A=0;A<f.length;A++)this._map.hasLayer(f[A])||this._map.addLayer(f[A]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var i=this._layerControlInputs,o,c,f=this._map.getZoom(),x=i.length-1;x>=0;x--)o=i[x],c=this._getLayer(o.layerId).layer,o.disabled=c.options.minZoom!==void 0&&f<c.options.minZoom||c.options.maxZoom!==void 0&&f>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;this._preventClick=!0,he(i,"click",nn),this.expand();var o=this;setTimeout(function(){Ue(i,"click",nn),o._preventClick=!1})}}),dT=function(i,o,c){return new Tm(i,o,c)},Ch=qn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(i){var o="leaflet-control-zoom",c=Jt("div",o+" leaflet-bar"),f=this.options;return this._zoomInButton=this._createButton(f.zoomInText,f.zoomInTitle,o+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(f.zoomOutText,f.zoomOutTitle,o+"-out",c,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(i){i.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(i){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(i.shiftKey?3:1))},_zoomOut:function(i){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,o,c,f,x){var A=Jt("a",c,f);return A.innerHTML=i,A.href="#",A.title=o,A.setAttribute("role","button"),A.setAttribute("aria-label",o),lo(A),he(A,"click",Es),he(A,"click",x,this),he(A,"click",this._refocusOnMap,this),A},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";ke(this._zoomInButton,o),ke(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&($t(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&($t(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});xe.mergeOptions({zoomControl:!0}),xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ch,this.addControl(this.zoomControl))});var fT=function(i){return new Ch(i)},bm=qn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var o="leaflet-control-scale",c=Jt("div",o),f=this.options;return this._addScales(f,o+"-line",c),i.on(f.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),c},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,o,c){i.metric&&(this._mScale=Jt("div",o,c)),i.imperial&&(this._iScale=Jt("div",o,c))},_update:function(){var i=this._map,o=i.getSize().y/2,c=i.distance(i.containerPointToLatLng([0,o]),i.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(c)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var o=this._getRoundNum(i),c=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,c,o/i)},_updateImperial:function(i){var o=i*3.2808399,c,f,x;o>5280?(c=o/5280,f=this._getRoundNum(c),this._updateScale(this._iScale,f+" mi",f/c)):(x=this._getRoundNum(o),this._updateScale(this._iScale,x+" ft",x/o))},_updateScale:function(i,o,c){i.style.width=Math.round(this.options.maxWidth*c)+"px",i.innerHTML=o},_getRoundNum:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),c=i/o;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,o*c}}),pT=function(i){return new bm(i)},mT='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ph=qn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Wt.inlineSvg?mT+" ":"")+"Leaflet</a>"},initialize:function(i){w(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Jt("div","leaflet-control-attribution"),lo(this._container);for(var o in i._layers)i._layers[o].getAttribution&&this.addAttribution(i._layers[o].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var o in this._attributions)this._attributions[o]&&i.push(o);var c=[];this.options.prefix&&c.push(this.options.prefix),i.length&&c.push(i.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});xe.mergeOptions({attributionControl:!0}),xe.addInitHook(function(){this.options.attributionControl&&new Ph().addTo(this)});var gT=function(i){return new Ph(i)};qn.Layers=Tm,qn.Zoom=Ch,qn.Scale=bm,qn.Attribution=Ph,co.layers=dT,co.zoom=fT,co.scale=pT,co.attribution=gT;var oi=H.extend({initialize:function(i){this._map=i},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});oi.addTo=function(i,o){return i.addHandler(o,this),this};var _T={Events:j},Am=Wt.touch?"touchstart mousedown":"mousedown",Ki=ct.extend({options:{clickTolerance:3},initialize:function(i,o,c,f){w(this,f),this._element=i,this._dragStartTarget=o||i,this._preventOutline=c},enable:function(){this._enabled||(he(this._dragStartTarget,Am,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ki._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,Am,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!_e(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){Ki._dragging===this&&this.finishDrag();return}if(!(Ki._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Ki._dragging=this,this._preventOutline&&xh(this._element),vh(),Cn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=ym(this._element);this._startPoint=new W(o.clientX,o.clientY),this._startPos=Yn(this._element),this._parentScale=wh(c);var f=i.type==="mousedown";he(document,f?"mousemove":"touchmove",this._onMove,this),he(document,f?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var o=i.touches&&i.touches.length===1?i.touches[0]:i,c=new W(o.clientX,o.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,nn(i),this._moved||(this.fire("dragstart"),this._moved=!0,$t(document.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),$t(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=i,this._updatePosition())}},_updatePosition:function(){var i={originalEvent:this._lastEvent};this.fire("predrag",i),ye(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){ke(document.body,"leaflet-dragging"),this._lastTarget&&(ke(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),yh(),oo();var o=this._moved&&this._moving;this._moving=!1,Ki._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function Cm(i,o,c){var f,x=[1,4,2,8],A,z,K,st,mt,Dt,re,me;for(A=0,Dt=i.length;A<Dt;A++)i[A]._code=xs(i[A],o);for(K=0;K<4;K++){for(re=x[K],f=[],A=0,Dt=i.length,z=Dt-1;A<Dt;z=A++)st=i[A],mt=i[z],st._code&re?mt._code&re||(me=Ga(mt,st,re,o,c),me._code=xs(me,o),f.push(me)):(mt._code&re&&(me=Ga(mt,st,re,o,c),me._code=xs(me,o),f.push(me)),f.push(st));i=f}return i}function Pm(i,o){var c,f,x,A,z,K,st,mt,Dt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var re=ut([0,0]),me=Qt(i),dn=me.getNorthWest().distanceTo(me.getSouthWest())*me.getNorthEast().distanceTo(me.getNorthWest());dn<1700&&(re=Rh(i));var je=i.length,Bn=[];for(c=0;c<je;c++){var vn=ut(i[c]);Bn.push(o.project(ut([vn.lat-re.lat,vn.lng-re.lng])))}for(K=st=mt=0,c=0,f=je-1;c<je;f=c++)x=Bn[c],A=Bn[f],z=x.y*A.x-A.y*x.x,st+=(x.x+A.x)*z,mt+=(x.y+A.y)*z,K+=z*3;K===0?Dt=Bn[0]:Dt=[st/K,mt/K];var pr=o.unproject(lt(Dt));return ut([pr.lat+re.lat,pr.lng+re.lng])}function Rh(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var A=ut(i[x]);o+=A.lat,c+=A.lng,f++}return ut([o/f,c/f])}var vT={__proto__:null,clipPolygon:Cm,polygonCenter:Pm,centroid:Rh};function Rm(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=xT(i,c),i=ET(i,c),i}function Lm(i,o,c){return Math.sqrt(ho(i,o,c,!0))}function yT(i,o,c){return ho(i,o,c)}function ET(i,o){var c=i.length,f=typeof Uint8Array<"u"?Uint8Array:Array,x=new f(c);x[0]=x[c-1]=1,Lh(i,x,o,0,c-1);var A,z=[];for(A=0;A<c;A++)x[A]&&z.push(i[A]);return z}function Lh(i,o,c,f,x){var A=0,z,K,st;for(K=f+1;K<=x-1;K++)st=ho(i[K],i[f],i[x],!0),st>A&&(z=K,A=st);A>c&&(o[z]=1,Lh(i,o,c,f,z),Lh(i,o,c,z,x))}function xT(i,o){for(var c=[i[0]],f=1,x=0,A=i.length;f<A;f++)wT(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<A-1&&c.push(i[A-1]),c}var Im;function Dm(i,o,c,f,x){var A=f?Im:xs(i,c),z=xs(o,c),K,st,mt;for(Im=z;;){if(!(A|z))return[i,o];if(A&z)return!1;K=A||z,st=Ga(i,o,K,c,x),mt=xs(st,c),K===A?(i=st,A=mt):(o=st,z=mt)}}function Ga(i,o,c,f,x){var A=o.x-i.x,z=o.y-i.y,K=f.min,st=f.max,mt,Dt;return c&8?(mt=i.x+A*(st.y-i.y)/z,Dt=st.y):c&4?(mt=i.x+A*(K.y-i.y)/z,Dt=K.y):c&2?(mt=st.x,Dt=i.y+z*(st.x-i.x)/A):c&1&&(mt=K.x,Dt=i.y+z*(K.x-i.x)/A),new W(mt,Dt,x)}function xs(i,o){var c=0;return i.x<o.min.x?c|=1:i.x>o.max.x&&(c|=2),i.y<o.min.y?c|=4:i.y>o.max.y&&(c|=8),c}function wT(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function ho(i,o,c,f){var x=o.x,A=o.y,z=c.x-x,K=c.y-A,st=z*z+K*K,mt;return st>0&&(mt=((i.x-x)*z+(i.y-A)*K)/st,mt>1?(x=c.x,A=c.y):mt>0&&(x+=z*mt,A+=K*mt)),z=i.x-x,K=i.y-A,f?z*z+K*K:new W(x,A)}function Nn(i){return!C(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function km(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Nn(i)}function Um(i,o){var c,f,x,A,z,K,st,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var Dt=ut([0,0]),re=Qt(i),me=re.getNorthWest().distanceTo(re.getSouthWest())*re.getNorthEast().distanceTo(re.getNorthWest());me<1700&&(Dt=Rh(i));var dn=i.length,je=[];for(c=0;c<dn;c++){var Bn=ut(i[c]);je.push(o.project(ut([Bn.lat-Dt.lat,Bn.lng-Dt.lng])))}for(c=0,f=0;c<dn-1;c++)f+=je[c].distanceTo(je[c+1])/2;if(f===0)mt=je[0];else for(c=0,A=0;c<dn-1;c++)if(z=je[c],K=je[c+1],x=z.distanceTo(K),A+=x,A>f){st=(A-f)/x,mt=[K.x-st*(K.x-z.x),K.y-st*(K.y-z.y)];break}var vn=o.unproject(lt(mt));return ut([vn.lat+Dt.lat,vn.lng+Dt.lng])}var ST={__proto__:null,simplify:Rm,pointToSegmentDistance:Lm,closestPointOnSegment:yT,clipSegment:Dm,_getEdgeIntersection:Ga,_getBitCode:xs,_sqClosestPointOnSegment:ho,isFlat:Nn,_flat:km,polylineCenter:Um},Ih={project:function(i){return new W(i.lng,i.lat)},unproject:function(i){return new et(i.y,i.x)},bounds:new Mt([-180,-90],[180,90])},Dh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Mt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(i){var o=Math.PI/180,c=this.R,f=i.lat*o,x=this.R_MINOR/c,A=Math.sqrt(1-x*x),z=A*Math.sin(f),K=Math.tan(Math.PI/4-f/2)/Math.pow((1-z)/(1+z),A/2);return f=-c*Math.log(Math.max(K,1e-10)),new W(i.lng*o*c,f)},unproject:function(i){for(var o=180/Math.PI,c=this.R,f=this.R_MINOR/c,x=Math.sqrt(1-f*f),A=Math.exp(-i.y/c),z=Math.PI/2-2*Math.atan(A),K=0,st=.1,mt;K<15&&Math.abs(st)>1e-7;K++)mt=x*Math.sin(z),mt=Math.pow((1-mt)/(1+mt),x/2),st=Math.PI/2-2*Math.atan(A*mt)-z,z+=st;return new et(z*o,i.x*o/c)}},MT={__proto__:null,LonLat:Ih,Mercator:Dh,SphericalMercator:jt},TT=r({},Nt,{code:"EPSG:3395",projection:Dh,transformation:(function(){var i=.5/(Math.PI*Dh.R);return ft(i,.5,-i,.5)})()}),Om=r({},Nt,{code:"EPSG:4326",projection:Ih,transformation:ft(1/180,1,-1/180,.5)}),bT=r({},_t,{projection:Ih,transformation:ft(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,o){var c=o.lng-i.lng,f=o.lat-i.lat;return Math.sqrt(c*c+f*f)},infinite:!0});_t.Earth=Nt,_t.EPSG3395=TT,_t.EPSG3857=T,_t.EPSG900913=Z,_t.EPSG4326=Om,_t.Simple=bT;var Qn=ct.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[u(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[u(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var o=i.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var c=this.getEvents();o.on(c,this),this.once("remove",function(){o.off(c,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});xe.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var o=u(i);return this._layers[o]?this:(this._layers[o]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var o=u(i);return this._layers[o]?(this._loaded&&i.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return u(i)in this._layers},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},_addLayers:function(i){i=i?C(i)?i:[i]:[];for(var o=0,c=i.length;o<c;o++)this.addLayer(i[o])},_addZoomLimit:function(i){(!isNaN(i.options.maxZoom)||!isNaN(i.options.minZoom))&&(this._zoomBoundLayers[u(i)]=i,this._updateZoomLevels())},_removeZoomLimit:function(i){var o=u(i);this._zoomBoundLayers[o]&&(delete this._zoomBoundLayers[o],this._updateZoomLevels())},_updateZoomLevels:function(){var i=1/0,o=-1/0,c=this._getZoomSpan();for(var f in this._zoomBoundLayers){var x=this._zoomBoundLayers[f].options;i=x.minZoom===void 0?i:Math.min(i,x.minZoom),o=x.maxZoom===void 0?o:Math.max(o,x.maxZoom)}this._layersMaxZoom=o===-1/0?void 0:o,this._layersMinZoom=i===1/0?void 0:i,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var cr=Qn.extend({initialize:function(i,o){w(this,o),this._layers={};var c,f;if(i)for(c=0,f=i.length;c<f;c++)this.addLayer(i[c])},addLayer:function(i){var o=this.getLayerId(i);return this._layers[o]=i,this._map&&this._map.addLayer(i),this},removeLayer:function(i){var o=i in this._layers?i:this.getLayerId(i);return this._map&&this._layers[o]&&this._map.removeLayer(this._layers[o]),delete this._layers[o],this},hasLayer:function(i){var o=typeof i=="number"?i:this.getLayerId(i);return o in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(i){var o=Array.prototype.slice.call(arguments,1),c,f;for(c in this._layers)f=this._layers[c],f[i]&&f[i].apply(f,o);return this},onAdd:function(i){this.eachLayer(i.addLayer,i)},onRemove:function(i){this.eachLayer(i.removeLayer,i)},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},getLayer:function(i){return this._layers[i]},getLayers:function(){var i=[];return this.eachLayer(i.push,i),i},setZIndex:function(i){return this.invoke("setZIndex",i)},getLayerId:function(i){return u(i)}}),AT=function(i,o){return new cr(i,o)},Si=cr.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),cr.prototype.addLayer.call(this,i),this.fire("layeradd",{layer:i}))},removeLayer:function(i){return this.hasLayer(i)?(i in this._layers&&(i=this._layers[i]),i.removeEventParent(this),cr.prototype.removeLayer.call(this,i),this.fire("layerremove",{layer:i})):this},setStyle:function(i){return this.invoke("setStyle",i)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var i=new oe;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),CT=function(i,o){return new Si(i,o)},hr=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(i){w(this,i)},createIcon:function(i){return this._createIcon("icon",i)},createShadow:function(i){return this._createIcon("shadow",i)},_createIcon:function(i,o){var c=this._getIconUrl(i);if(!c){if(i==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var f=this._createImg(c,o&&o.tagName==="IMG"?o:null);return this._setIconStyles(f,i),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),f},_setIconStyles:function(i,o){var c=this.options,f=c[o+"Size"];typeof f=="number"&&(f=[f,f]);var x=lt(f),A=lt(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),A&&(i.style.marginLeft=-A.x+"px",i.style.marginTop=-A.y+"px"),x&&(i.style.width=x.x+"px",i.style.height=x.y+"px")},_createImg:function(i,o){return o=o||document.createElement("img"),o.src=i,o},_getIconUrl:function(i){return Wt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function PT(i){return new hr(i)}var uo=hr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(i){return typeof uo.imagePath!="string"&&(uo.imagePath=this._detectIconPath()),(this.options.imagePath||uo.imagePath)+hr.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var A=f.exec(c);return A&&A[x]};return i=o(i,/^url\((['"])?(.+)\1\)$/,2),i&&o(i,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var i=Jt("div","leaflet-default-icon-path",document.body),o=Ee(i,"background-image")||Ee(i,"backgroundImage");if(document.body.removeChild(i),o=this._stripUrl(o),o)return o;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Nm=oi.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Ki(i,i,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),$t(i,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ke(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(i){var o=this._marker,c=o._map,f=this._marker.options.autoPanSpeed,x=this._marker.options.autoPanPadding,A=Yn(o._icon),z=c.getPixelBounds(),K=c.getPixelOrigin(),st=Ot(z.min._subtract(K).add(x),z.max._subtract(K).subtract(x));if(!st.contains(A)){var mt=lt((Math.max(st.max.x,A.x)-st.max.x)/(z.max.x-st.max.x)-(Math.min(st.min.x,A.x)-st.min.x)/(z.min.x-st.min.x),(Math.max(st.max.y,A.y)-st.max.y)/(z.max.y-st.max.y)-(Math.min(st.min.y,A.y)-st.min.y)/(z.min.y-st.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),ye(o._icon,this._draggable._newPos),this._onDrag(i),this._panRequest=U(this._adjustPan.bind(this,i))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(i){this._marker.options.autoPan&&(tt(this._panRequest),this._panRequest=U(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Yn(o._icon),x=o._map.layerPointToLatLng(f);c&&ye(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){tt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),Wa=Qn.extend({options:{icon:new uo,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(i,o){w(this,o),this._latlng=ut(i)},onAdd:function(i){this._zoomAnimated=this._zoomAnimated&&i.options.markerZoomAnimation,this._zoomAnimated&&i.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(i){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&i.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(i){var o=this._latlng;return this._latlng=ut(i),this.update(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},setZIndexOffset:function(i){return this.options.zIndexOffset=i,this.update()},getIcon:function(){return this.options.icon},setIcon:function(i){return this.options.icon=i,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var i=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(i)}return this},_initIcon:function(){var i=this.options,o="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=i.icon.createIcon(this._icon),f=!1;c!==this._icon&&(this._icon&&this._removeIcon(),f=!0,i.title&&(c.title=i.title),c.tagName==="IMG"&&(c.alt=i.alt||"")),$t(c,o),i.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,i.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&he(c,"focus",this._panOnFocus,this);var x=i.icon.createShadow(this._shadow),A=!1;x!==this._shadow&&(this._removeShadow(),A=!0),x&&($t(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&A&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ue(this._icon,"focus",this._panOnFocus,this),se(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&se(this._shadow),this._shadow=null},_setPos:function(i){this._icon&&ye(this._icon,i),this._shadow&&ye(this._shadow,i),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(i){this._icon&&(this._icon.style.zIndex=this._zIndex+i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center).round();this._setPos(o)},_initInteraction:function(){if(this.options.interactive&&($t(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Nm)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Nm(this),i&&this.dragging.enable()}},setOpacity:function(i){return this.options.opacity=i,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var i=this.options.opacity;this._icon&&ve(this._icon,i),this._shadow&&ve(this._shadow,i)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var i=this._map;if(i){var o=this.options.icon.options,c=o.iconSize?lt(o.iconSize):lt(0,0),f=o.iconAnchor?lt(o.iconAnchor):lt(0,0);i.panInside(this._latlng,{paddingTopLeft:f,paddingBottomRight:c.subtract(f)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function RT(i,o){return new Wa(i,o)}var $i=Qn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(i){this._renderer=i.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(i){return w(this,i),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&i&&Object.prototype.hasOwnProperty.call(i,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Za=$i.extend({options:{fill:!0,radius:10},initialize:function(i,o){w(this,o),this._latlng=ut(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=ut(i),this.redraw(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(i){return this.options.radius=this._radius=i,this.redraw()},getRadius:function(){return this._radius},setStyle:function(i){var o=i&&i.radius||this._radius;return $i.prototype.setStyle.call(this,i),this.setRadius(o),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var i=this._radius,o=this._radiusY||i,c=this._clickTolerance(),f=[i+c,o+c];this._pxBounds=new Mt(this._point.subtract(f),this._point.add(f))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(i){return i.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function LT(i,o){return new Za(i,o)}var kh=Za.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),w(this,o),this._latlng=ut(i),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(i){return this._mRadius=i,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var i=[this._radius,this._radiusY||this._radius];return new oe(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:$i.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===Nt.distance){var x=Math.PI/180,A=this._mRadius/Nt.R/x,z=c.project([o+A,i]),K=c.project([o-A,i]),st=z.add(K).divideBy(2),mt=c.unproject(st).lat,Dt=Math.acos((Math.cos(A*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(Dt)||Dt===0)&&(Dt=A/Math.cos(Math.PI/180*o)),this._point=st.subtract(c.getPixelOrigin()),this._radius=isNaN(Dt)?0:st.x-c.project([mt,i-Dt]).x,this._radiusY=st.y-z.y}else{var re=f.unproject(f.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(re).x}this._updateBounds()}});function IT(i,o,c){return new kh(i,o,c)}var Mi=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(i,o){w(this,o),this._setLatLngs(i)},getLatLngs:function(){return this._latlngs},setLatLngs:function(i){return this._setLatLngs(i),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(i){for(var o=1/0,c=null,f=ho,x,A,z=0,K=this._parts.length;z<K;z++)for(var st=this._parts[z],mt=1,Dt=st.length;mt<Dt;mt++){x=st[mt-1],A=st[mt];var re=f(i,x,A,!0);re<o&&(o=re,c=f(i,x,A))}return c&&(c.distance=Math.sqrt(o)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Um(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=ut(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new oe,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Nn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Nn(i),f=0,x=i.length;f<x;f++)c?(o[f]=ut(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new Mt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,i),this._bounds.isValid()&&i.isValid()&&(this._rawPxBounds=i,this._updateBounds())},_updateBounds:function(){var i=this._clickTolerance(),o=new W(i,i);this._rawPxBounds&&(this._pxBounds=new Mt([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof et,x=i.length,A,z;if(f){for(z=[],A=0;A<x;A++)z[A]=this._map.latLngToLayerPoint(i[A]),c.extend(z[A]);o.push(z)}else for(A=0;A<x;A++)this._projectLatlngs(i[A],o,c)},_clipPoints:function(){var i=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}var o=this._parts,c,f,x,A,z,K,st;for(c=0,x=0,A=this._rings.length;c<A;c++)for(st=this._rings[c],f=0,z=st.length;f<z-1;f++)K=Dm(st[f],st[f+1],i,f,!0),K&&(o[x]=o[x]||[],o[x].push(K[0]),(K[1]!==st[f+1]||f===z-2)&&(o[x].push(K[1]),x++))}},_simplifyPoints:function(){for(var i=this._parts,o=this.options.smoothFactor,c=0,f=i.length;c<f;c++)i[c]=Rm(i[c],o)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(i,o){var c,f,x,A,z,K,st=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,A=this._parts.length;c<A;c++)for(K=this._parts[c],f=0,z=K.length,x=z-1;f<z;x=f++)if(!(!o&&f===0)&&Lm(i,K[x],K[f])<=st)return!0;return!1}});function DT(i,o){return new Mi(i,o)}Mi._flat=km;var ur=Mi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Pm(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Mi.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof et&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Mi.prototype._setLatLngs.call(this,i),Nn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Nn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,o=this.options.weight,c=new W(o,o);if(i=new Mt(i.min.subtract(c),i.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var f=0,x=this._rings.length,A;f<x;f++)A=Cm(this._rings[f],i,!0),A.length&&this._parts.push(A)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,A,z,K,st,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(A=0,st=this._parts.length;A<st;A++)for(c=this._parts[A],z=0,mt=c.length,K=mt-1;z<mt;K=z++)f=c[z],x=c[K],f.y>i.y!=x.y>i.y&&i.x<(x.x-f.x)*(i.y-f.y)/(x.y-f.y)+f.x&&(o=!o);return o||Mi.prototype._containsPoint.call(this,i,!0)}});function kT(i,o){return new ur(i,o)}var Ti=Si.extend({initialize:function(i,o){w(this,o),this._layers={},i&&this.addData(i)},addData:function(i){var o=C(i)?i:i.features,c,f,x;if(o){for(c=0,f=o.length;c<f;c++)x=o[c],(x.geometries||x.geometry||x.features||x.coordinates)&&this.addData(x);return this}var A=this.options;if(A.filter&&!A.filter(i))return this;var z=Xa(i,A);return z?(z.feature=Qa(i),z.defaultOptions=z.options,this.resetStyle(z),A.onEachFeature&&A.onEachFeature(i,z),this.addLayer(z)):this},resetStyle:function(i){return i===void 0?this.eachLayer(this.resetStyle,this):(i.options=r({},i.defaultOptions),this._setLayerStyle(i,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(o){this._setLayerStyle(o,i)},this)},_setLayerStyle:function(i,o){i.setStyle&&(typeof o=="function"&&(o=o(i.feature)),i.setStyle(o))}});function Xa(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],A=o&&o.pointToLayer,z=o&&o.coordsToLatLng||Uh,K,st,mt,Dt;if(!f&&!c)return null;switch(c.type){case"Point":return K=z(f),Bm(A,i,K,o);case"MultiPoint":for(mt=0,Dt=f.length;mt<Dt;mt++)K=z(f[mt]),x.push(Bm(A,i,K,o));return new Si(x);case"LineString":case"MultiLineString":return st=Ya(f,c.type==="LineString"?0:1,z),new Mi(st,o);case"Polygon":case"MultiPolygon":return st=Ya(f,c.type==="Polygon"?1:2,z),new ur(st,o);case"GeometryCollection":for(mt=0,Dt=c.geometries.length;mt<Dt;mt++){var re=Xa({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);re&&x.push(re)}return new Si(x);case"FeatureCollection":for(mt=0,Dt=c.features.length;mt<Dt;mt++){var me=Xa(c.features[mt],o);me&&x.push(me)}return new Si(x);default:throw new Error("Invalid GeoJSON object.")}}function Bm(i,o,c,f){return i?i(o,c):new Wa(c,f&&f.markersInheritOptions&&f)}function Uh(i){return new et(i[1],i[0],i[2])}function Ya(i,o,c){for(var f=[],x=0,A=i.length,z;x<A;x++)z=o?Ya(i[x],o-1,c):(c||Uh)(i[x]),f.push(z);return f}function Oh(i,o){return i=ut(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function qa(i,o,c,f){for(var x=[],A=0,z=i.length;A<z;A++)x.push(o?qa(i[A],Nn(i[A])?0:o-1,c,f):Oh(i[A],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function dr(i,o){return i.feature?r({},i.feature,{geometry:o}):Qa(o)}function Qa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var Nh={toGeoJSON:function(i){return dr(this,{type:"Point",coordinates:Oh(this.getLatLng(),i)})}};Wa.include(Nh),kh.include(Nh),Za.include(Nh),Mi.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=qa(this._latlngs,o?1:0,!1,i);return dr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),ur.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=o&&!Nn(this._latlngs[0]),f=qa(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),dr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),cr.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),dr(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(i){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(i);var c=o==="GeometryCollection",f=[];return this.eachLayer(function(x){if(x.toGeoJSON){var A=x.toGeoJSON(i);if(c)f.push(A.geometry);else{var z=Qa(A);z.type==="FeatureCollection"?f.push.apply(f,z.features):f.push(z)}}}),c?dr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function Fm(i,o){return new Ti(i,o)}var UT=Fm,ja=Qn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Qt(o),w(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&($t(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){se(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(i){return this.options.opacity=i,this._image&&this._updateOpacity(),this},setStyle:function(i){return i.opacity&&this.setOpacity(i.opacity),this},bringToFront:function(){return this._map&&Xt(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Qt(i),this._map&&this._reset(),this},getEvents:function(){var i={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var i=this._url.tagName==="IMG",o=this._image=i?this._url:Jt("img");if($t(o,"leaflet-image-layer"),this._zoomAnimated&&$t(o,"leaflet-zoom-animated"),this.options.className&&$t(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onload=l(this.fire,this,"load"),o.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),i){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(i){var o=this._map.getZoomScale(i.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;Fe(this._image,c,o)},_reset:function(){var i=this._image,o=new Mt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();ye(i,o.min),i.style.width=c.x+"px",i.style.height=c.y+"px"},_updateOpacity:function(){ve(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var i=this.options.errorOverlayUrl;i&&this._url!==i&&(this._url=i,this._image.src=i)},getCenter:function(){return this._bounds.getCenter()}}),OT=function(i,o,c){return new ja(i,o,c)},zm=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var i=this._url.tagName==="VIDEO",o=this._image=i?this._url:Jt("video");if($t(o,"leaflet-image-layer"),this._zoomAnimated&&$t(o,"leaflet-zoom-animated"),this.options.className&&$t(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onloadeddata=l(this.fire,this,"load"),i){for(var c=o.getElementsByTagName("source"),f=[],x=0;x<c.length;x++)f.push(c[x].src);this._url=c.length>0?f:[o.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var A=0;A<this._url.length;A++){var z=Jt("source");z.src=this._url[A],o.appendChild(z)}}});function NT(i,o,c){return new zm(i,o,c)}var Hm=ja.extend({_initImage:function(){var i=this._image=this._url;$t(i,"leaflet-image-layer"),this._zoomAnimated&&$t(i,"leaflet-zoom-animated"),this.options.className&&$t(i,this.options.className),i.onselectstart=m,i.onmousemove=m}});function BT(i,o,c){return new Hm(i,o,c)}var ai=Qn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof et||C(i))?(this._latlng=ut(i),w(this,o)):(w(this,i),this._source=o),this.options.content&&(this._content=this.options.content)},openOn:function(i){return i=arguments.length?i:this._source._map,i.hasLayer(this)||i.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(i){return this._map?this.close():(arguments.length?this._source=i:i=this._source,this._prepareOpen(),this.openOn(i._map)),this},onAdd:function(i){this._zoomAnimated=i._zoomAnimated,this._container||this._initLayout(),i._fadeAnimated&&ve(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),i._fadeAnimated&&ve(this._container,1),this.bringToFront(),this.options.interactive&&($t(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(i){i._fadeAnimated?(ve(this._container,0),this._removeTimeout=setTimeout(l(se,void 0,this._container),200)):se(this._container),this.options.interactive&&(ke(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=ut(i),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(i){return this._content=i,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var i={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Xt(this._container),this},bringToBack:function(){return this._map&&Le(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof Si){o=null;var c=this._source._layers;for(var f in c)if(c[f]._map){o=c[f];break}if(!o)return!1;this._source=o}if(!i)if(o.getCenter)i=o.getCenter();else if(o.getLatLng)i=o.getLatLng();else if(o.getBounds)i=o.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(i),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var i=this._contentNode,o=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof o=="string")i.innerHTML=o;else{for(;i.hasChildNodes();)i.removeChild(i.firstChild);i.appendChild(o)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),o=lt(this.options.offset),c=this._getAnchor();this._zoomAnimated?ye(this._container,i.add(c)):o=o.add(i).add(c);var f=this._containerBottom=-o.y,x=this._containerLeft=-Math.round(this._containerWidth/2)+o.x;this._container.style.bottom=f+"px",this._container.style.left=x+"px"}},_getAnchor:function(){return[0,0]}});xe.include({_initOverlay:function(i,o,c,f){var x=o;return x instanceof i||(x=new i(f).setContent(o)),c&&x.setLatLng(c),x}}),Qn.include({_initOverlay:function(i,o,c,f){var x=c;return x instanceof i?(w(x,f),x._source=this):(x=o&&!f?o:new i(f,this),x.setContent(c)),x}});var Ja=ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(i){return i=arguments.length?i:this._source._map,!i.hasLayer(this)&&i._popup&&i._popup.options.autoClose&&i.removeLayer(i._popup),i._popup=this,ai.prototype.openOn.call(this,i)},onAdd:function(i){ai.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",ys))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",ys))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(i.preclick=this.close),this.options.keepInView&&(i.moveend=this._adjustPan),i},_initLayout:function(){var i="leaflet-popup",o=this._container=Jt("div",i+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Jt("div",i+"-content-wrapper",o);if(this._contentNode=Jt("div",i+"-content",c),lo(o),bh(this._contentNode),he(o,"contextmenu",ys),this._tipContainer=Jt("div",i+"-tip-container",o),this._tip=Jt("div",i+"-tip",this._tipContainer),this.options.closeButton){var f=this._closeButton=Jt("a",i+"-close-button",o);f.setAttribute("role","button"),f.setAttribute("aria-label","Close popup"),f.href="#close",f.innerHTML='<span aria-hidden="true">&#215;</span>',he(f,"click",function(x){nn(x),this.close()},this)}},_updateLayout:function(){var i=this._contentNode,o=i.style;o.width="",o.whiteSpace="nowrap";var c=i.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),o.width=c+1+"px",o.whiteSpace="",o.height="";var f=i.offsetHeight,x=this.options.maxHeight,A="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",$t(i,A)):ke(i,A),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();ye(this._container,o.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,o=parseInt(Ee(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new W(this._containerLeft,-c-this._containerBottom);x._add(Yn(this._container));var A=i.layerPointToContainerPoint(x),z=lt(this.options.autoPanPadding),K=lt(this.options.autoPanPaddingTopLeft||z),st=lt(this.options.autoPanPaddingBottomRight||z),mt=i.getSize(),Dt=0,re=0;A.x+f+st.x>mt.x&&(Dt=A.x+f-mt.x+st.x),A.x-Dt-K.x<0&&(Dt=A.x-K.x),A.y+c+st.y>mt.y&&(re=A.y+c-mt.y+st.y),A.y-re-K.y<0&&(re=A.y-K.y),(Dt||re)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([Dt,re]))}},_getAnchor:function(){return lt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),FT=function(i,o){return new Ja(i,o)};xe.mergeOptions({closePopupOnClick:!0}),xe.include({openPopup:function(i,o,c){return this._initOverlay(Ja,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Qn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Ja,this._popup,i,o),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof Si||(this._popup._source=this),this._popup._prepareOpen(i||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){Es(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof $i)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=o,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var Ka=ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ai.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",o=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Jt("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var o,c,f=this._map,x=this._container,A=f.latLngToContainerPoint(f.getCenter()),z=f.layerPointToContainerPoint(i),K=this.options.direction,st=x.offsetWidth,mt=x.offsetHeight,Dt=lt(this.options.offset),re=this._getAnchor();K==="top"?(o=st/2,c=mt):K==="bottom"?(o=st/2,c=0):K==="center"?(o=st/2,c=mt/2):K==="right"?(o=0,c=mt/2):K==="left"?(o=st,c=mt/2):z.x<A.x?(K="right",o=0,c=mt/2):(K="left",o=st+(Dt.x+re.x)*2,c=mt/2),i=i.subtract(lt(o,c,!0)).add(Dt).add(re),ke(x,"leaflet-tooltip-right"),ke(x,"leaflet-tooltip-left"),ke(x,"leaflet-tooltip-top"),ke(x,"leaflet-tooltip-bottom"),$t(x,"leaflet-tooltip-"+K),ye(x,i)},_updatePosition:function(){var i=this._map.latLngToLayerPoint(this._latlng);this._setPosition(i)},setOpacity:function(i){this.options.opacity=i,this._container&&ve(this._container,i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center);this._setPosition(o)},_getAnchor:function(){return lt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),zT=function(i,o){return new Ka(i,o)};xe.include({openTooltip:function(i,o,c){return this._initOverlay(Ka,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Qn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ka,this._tooltip,i,o),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(i){if(!(!i&&this._tooltipHandlersAdded)){var o=i?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[o](c),this._tooltipHandlersAdded=!i}},openTooltip:function(i){return this._tooltip&&(this instanceof Si||(this._tooltip._source=this),this._tooltip._prepareOpen(i)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(i){return this._tooltip&&this._tooltip.setContent(i),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&(he(o,"focus",function(){this._tooltip._source=i,this.openTooltip()},this),he(o,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&o.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(i){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var o=this;this._map.once("moveend",function(){o._openOnceFlag=!1,o._openTooltip(i)});return}this._tooltip._source=i.layer||i.target,this.openTooltip(this._tooltip.options.sticky?i.latlng:void 0)}},_moveTooltip:function(i){var o=i.latlng,c,f;this._tooltip.options.sticky&&i.originalEvent&&(c=this._map.mouseEventToContainerPoint(i.originalEvent),f=this._map.containerPointToLayerPoint(c),o=this._map.layerPointToLatLng(f)),this._tooltip.setLatLng(o)}});var Vm=hr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(i){var o=i&&i.tagName==="DIV"?i:document.createElement("div"),c=this.options;if(c.html instanceof Element?(Te(o),o.appendChild(c.html)):o.innerHTML=c.html!==!1?c.html:"",c.bgPos){var f=lt(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function HT(i){return new Vm(i)}hr.Default=uo;var fo=Qn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Wt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(i){w(this,i)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(i){i._addZoomLimit(this)},onRemove:function(i){this._removeAllTiles(),se(this._container),i._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Xt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Le(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(i){return this.options.opacity=i,this._updateOpacity(),this},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var i=this._clampZoom(this._map.getZoom());i!==this._tileZoom&&(this._tileZoom=i,this._updateLevels()),this._update()}return this},getEvents:function(){var i={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),i.move=this._onMove),this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},createTile:function(){return document.createElement("div")},getTileSize:function(){var i=this.options.tileSize;return i instanceof W?i:new W(i,i)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(i){for(var o=this.getPane().children,c=-i(-1/0,1/0),f=0,x=o.length,A;f<x;f++)A=o[f].style.zIndex,o[f]!==this._container&&A&&(c=i(c,+A));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Wt.ielt9){ve(this._container,this.options.opacity);var i=+new Date,o=!1,c=!1;for(var f in this._tiles){var x=this._tiles[f];if(!(!x.current||!x.loaded)){var A=Math.min(1,(i-x.loaded)/200);ve(x.el,A),A<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(tt(this._fadeFrame),this._fadeFrame=U(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Jt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,o=this.options.maxZoom;if(i!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===i?(this._levels[c].el.style.zIndex=o-Math.abs(i-c),this._onUpdateLevel(c)):(se(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var f=this._levels[i],x=this._map;return f||(f=this._levels[i]={},f.el=Jt("div","leaflet-tile-container leaflet-zoom-animated",this._container),f.el.style.zIndex=o,f.origin=x.project(x.unproject(x.getPixelOrigin()),i).round(),f.zoom=i,this._setZoomTransform(f,x.getCenter(),x.getZoom()),m(f.el.offsetWidth),this._onCreateLevel(f)),this._level=f,f}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var i,o,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(i in this._tiles)o=this._tiles[i],o.retain=o.current;for(i in this._tiles)if(o=this._tiles[i],o.current&&!o.active){var f=o.coords;this._retainParent(f.x,f.y,f.z,f.z-5)||this._retainChildren(f.x,f.y,f.z,f.z+2)}for(i in this._tiles)this._tiles[i].retain||this._removeTile(i)}},_removeTilesAtZoom:function(i){for(var o in this._tiles)this._tiles[o].coords.z===i&&this._removeTile(o)},_removeAllTiles:function(){for(var i in this._tiles)this._removeTile(i)},_invalidateAll:function(){for(var i in this._levels)se(this._levels[i].el),this._onRemoveLevel(Number(i)),delete this._levels[i];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(i,o,c,f){var x=Math.floor(i/2),A=Math.floor(o/2),z=c-1,K=new W(+x,+A);K.z=+z;var st=this._tileCoordsToKey(K),mt=this._tiles[st];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),z>f?this._retainParent(x,A,z,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var A=2*o;A<2*o+2;A++){var z=new W(x,A);z.z=c+1;var K=this._tileCoordsToKey(z),st=this._tiles[K];if(st&&st.active){st.retain=!0;continue}else st&&st.loaded&&(st.retain=!0);c+1<f&&this._retainChildren(x,A,c+1,f)}},_resetView:function(i){var o=i&&(i.pinch||i.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),o,o)},_animateZoom:function(i){this._setView(i.center,i.zoom,!0,i.noUpdate)},_clampZoom:function(i){var o=this.options;return o.minNativeZoom!==void 0&&i<o.minNativeZoom?o.minNativeZoom:o.maxNativeZoom!==void 0&&o.maxNativeZoom<i?o.maxNativeZoom:i},_setView:function(i,o,c,f){var x=Math.round(o);this.options.maxZoom!==void 0&&x>this.options.maxZoom||this.options.minZoom!==void 0&&x<this.options.minZoom?x=void 0:x=this._clampZoom(x);var A=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||A)&&(this._tileZoom=x,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),x!==void 0&&this._update(i),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(i,o)},_setZoomTransforms:function(i,o){for(var c in this._levels)this._setZoomTransform(this._levels[c],i,o)},_setZoomTransform:function(i,o,c){var f=this._map.getZoomScale(c,i.zoom),x=i.origin.multiplyBy(f).subtract(this._map._getNewPixelOrigin(o,c)).round();Wt.any3d?Fe(i.el,x,f):ye(i.el,x)},_resetGrid:function(){var i=this._map,o=i.options.crs,c=this._tileSize=this.getTileSize(),f=this._tileZoom,x=this._map.getPixelWorldBounds(this._tileZoom);x&&(this._globalTileRange=this._pxBoundsToTileRange(x)),this._wrapX=o.wrapLng&&!this.options.noWrap&&[Math.floor(i.project([0,o.wrapLng[0]],f).x/c.x),Math.ceil(i.project([0,o.wrapLng[1]],f).x/c.y)],this._wrapY=o.wrapLat&&!this.options.noWrap&&[Math.floor(i.project([o.wrapLat[0],0],f).y/c.x),Math.ceil(i.project([o.wrapLat[1],0],f).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(i){var o=this._map,c=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),f=o.getZoomScale(c,this._tileZoom),x=o.project(i,this._tileZoom).floor(),A=o.getSize().divideBy(f*2);return new Mt(x.subtract(A),x.add(A))},_update:function(i){var o=this._map;if(o){var c=this._clampZoom(o.getZoom());if(i===void 0&&(i=o.getCenter()),this._tileZoom!==void 0){var f=this._getTiledPixelBounds(i),x=this._pxBoundsToTileRange(f),A=x.getCenter(),z=[],K=this.options.keepBuffer,st=new Mt(x.getBottomLeft().subtract([K,-K]),x.getTopRight().add([K,-K]));if(!(isFinite(x.min.x)&&isFinite(x.min.y)&&isFinite(x.max.x)&&isFinite(x.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var mt in this._tiles){var Dt=this._tiles[mt].coords;(Dt.z!==this._tileZoom||!st.contains(new W(Dt.x,Dt.y)))&&(this._tiles[mt].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(i,c);return}for(var re=x.min.y;re<=x.max.y;re++)for(var me=x.min.x;me<=x.max.x;me++){var dn=new W(me,re);if(dn.z=this._tileZoom,!!this._isValidTile(dn)){var je=this._tiles[this._tileCoordsToKey(dn)];je?je.current=!0:z.push(dn)}}if(z.sort(function(vn,pr){return vn.distanceTo(A)-pr.distanceTo(A)}),z.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Bn=document.createDocumentFragment();for(me=0;me<z.length;me++)this._addTile(z[me],Bn);this._level.el.appendChild(Bn)}}}},_isValidTile:function(i){var o=this._map.options.crs;if(!o.infinite){var c=this._globalTileRange;if(!o.wrapLng&&(i.x<c.min.x||i.x>c.max.x)||!o.wrapLat&&(i.y<c.min.y||i.y>c.max.y))return!1}if(!this.options.bounds)return!0;var f=this._tileCoordsToBounds(i);return Qt(this.options.bounds).overlaps(f)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var o=this._map,c=this.getTileSize(),f=i.scaleBy(c),x=f.add(c),A=o.unproject(f,i.z),z=o.unproject(x,i.z);return[A,z]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new oe(o[0],o[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var o=i.split(":"),c=new W(+o[0],+o[1]);return c.z=+o[2],c},_removeTile:function(i){var o=this._tiles[i];o&&(se(o.el),delete this._tiles[i],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){$t(i,"leaflet-tile");var o=this.getTileSize();i.style.width=o.x+"px",i.style.height=o.y+"px",i.onselectstart=m,i.onmousemove=m,Wt.ielt9&&this.options.opacity<1&&ve(i,this.options.opacity)},_addTile:function(i,o){var c=this._getTilePos(i),f=this._tileCoordsToKey(i),x=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(x),this.createTile.length<2&&U(l(this._tileReady,this,i,null,x)),ye(x,c),this._tiles[f]={el:x,coords:i,current:!0},o.appendChild(x),this.fire("tileloadstart",{tile:x,coords:i})},_tileReady:function(i,o,c){o&&this.fire("tileerror",{error:o,tile:c,coords:i});var f=this._tileCoordsToKey(i);c=this._tiles[f],c&&(c.loaded=+new Date,this._map._fadeAnimated?(ve(c.el,0),tt(this._fadeFrame),this._fadeFrame=U(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),o||($t(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Wt.ielt9||!this._map._fadeAnimated?U(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var o=new W(this._wrapX?p(i.x,this._wrapX):i.x,this._wrapY?p(i.y,this._wrapY):i.y);return o.z=i.z,o},_pxBoundsToTileRange:function(i){var o=this.getTileSize();return new Mt(i.min.unscaleBy(o).floor(),i.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function VT(i){return new fo(i)}var fr=fo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,o){this._url=i,o=w(this,o),o.detectRetina&&Wt.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,o){return this._url===i&&o===void 0&&(o=!0),this._url=i,o||this.redraw(),this},createTile:function(i,o){var c=document.createElement("img");return he(c,"load",l(this._tileOnLoad,this,o,c)),he(c,"error",l(this._tileOnError,this,o,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(i),c},getTileUrl:function(i){var o={r:Wt.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-i.y;this.options.tms&&(o.y=c),o["-y"]=c}return I(this._url,r(o,this.options))},_tileOnLoad:function(i,o){Wt.ielt9?setTimeout(l(i,this,null,o),0):i(null,o)},_tileOnError:function(i,o,c){var f=this.options.errorTileUrl;f&&o.getAttribute("src")!==f&&(o.src=f),i(c,o)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,o=this.options.maxZoom,c=this.options.zoomReverse,f=this.options.zoomOffset;return c&&(i=o-i),i+f},_getSubdomain:function(i){var o=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var i,o;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(o=this._tiles[i].el,o.onload=m,o.onerror=m,!o.complete)){o.src=k;var c=this._tiles[i].coords;se(o),delete this._tiles[i],this.fire("tileabort",{tile:o,coords:c})}},_removeTile:function(i){var o=this._tiles[i];if(o)return o.el.setAttribute("src",k),fo.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===k))return fo.prototype._tileReady.call(this,i,o,c)}});function Gm(i,o){return new fr(i,o)}var Wm=fr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,o){this._url=i;var c=r({},this.defaultWmsParams);for(var f in o)f in this.options||(c[f]=o[f]);o=w(this,o);var x=o.detectRetina&&Wt.retina?2:1,A=this.getTileSize();c.width=A.x*x,c.height=A.y*x,this.wmsParams=c},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,fr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=Ot(c.project(o[0]),c.project(o[1])),x=f.min,A=f.max,z=(this._wmsVersion>=1.3&&this._crs===Om?[x.y,x.x,A.y,A.x]:[x.x,x.y,A.x,A.y]).join(","),K=fr.prototype.getTileUrl.call(this,i);return K+v(this.wmsParams,K,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+z},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function GT(i,o){return new Wm(i,o)}fr.WMS=Wm,Gm.wms=GT;var bi=Qn.extend({options:{padding:.1},initialize:function(i){w(this,i),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),$t(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,o){var c=this._map.getZoomScale(o,this._zoom),f=this._map.getSize().multiplyBy(.5+this.options.padding),x=this._map.project(this._center,o),A=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));Wt.any3d?Fe(this._container,A,c):ye(this._container,A)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,o=this._map.getSize(),c=this._map.containerPointToLayerPoint(o.multiplyBy(-i)).round();this._bounds=new Mt(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zm=bi.extend({options:{tolerance:0},getEvents:function(){var i=bi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");he(i,"mousemove",this._onMouseMove,this),he(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),he(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){tt(this._redrawRequest),delete this._ctx,se(this._container),Ue(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var o in this._layers)i=this._layers[o],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=Wt.retina?2:1;ye(o,i.min),o.width=f*c.x,o.height=f*c.y,o.style.width=c.x+"px",o.style.height=c.y+"px",Wt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){bi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[u(i)]=i;var o=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var o=i._order,c=o.next,f=o.prev;c?c.prev=f:this._drawLast=f,f?f.next=c:this._drawFirst=c,delete i._order,delete this._layers[u(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var o=i.options.dashArray.split(/[, ]+/),c=[],f,x;for(x=0;x<o.length;x++){if(f=Number(o[x]),isNaN(f))return;c.push(f)}i.options._dashArray=c}else i.options._dashArray=i.options.dashArray},_requestRedraw:function(i){this._map&&(this._extendRedrawBounds(i),this._redrawRequest=this._redrawRequest||U(this._redraw,this))},_extendRedrawBounds:function(i){if(i._pxBounds){var o=(i.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Mt,this._redrawBounds.extend(i._pxBounds.min.subtract([o,o])),this._redrawBounds.extend(i._pxBounds.max.add([o,o]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var i=this._redrawBounds;if(i){var o=i.getSize();this._ctx.clearRect(i.min.x,i.min.y,o.x,o.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var i,o=this._redrawBounds;if(this._ctx.save(),o){var c=o.getSize();this._ctx.beginPath(),this._ctx.rect(o.min.x,o.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var f=this._drawFirst;f;f=f.next)i=f.layer,(!o||i._pxBounds&&i._pxBounds.intersects(o))&&i._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(i,o){if(this._drawing){var c,f,x,A,z=i._parts,K=z.length,st=this._ctx;if(K){for(st.beginPath(),c=0;c<K;c++){for(f=0,x=z[c].length;f<x;f++)A=z[c][f],st[f?"lineTo":"moveTo"](A.x,A.y);o&&st.closePath()}this._fillStroke(st,i)}}},_updateCircle:function(i){if(!(!this._drawing||i._empty())){var o=i._point,c=this._ctx,f=Math.max(Math.round(i._radius),1),x=(Math.max(Math.round(i._radiusY),1)||f)/f;x!==1&&(c.save(),c.scale(1,x)),c.beginPath(),c.arc(o.x,o.y/x,f,0,Math.PI*2,!1),x!==1&&c.restore(),this._fillStroke(c,i)}},_fillStroke:function(i,o){var c=o.options;c.fill&&(i.globalAlpha=c.fillOpacity,i.fillStyle=c.fillColor||c.color,i.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(i.setLineDash&&i.setLineDash(o.options&&o.options._dashArray||[]),i.globalAlpha=c.opacity,i.lineWidth=c.weight,i.strokeStyle=c.color,i.lineCap=c.lineCap,i.lineJoin=c.lineJoin,i.stroke())},_onClick:function(i){for(var o=this._map.mouseEventToLayerPoint(i),c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(!(i.type==="click"||i.type==="preclick")||!this._map._draggableMoved(c))&&(f=c);this._fireEvent(f?[f]:!1,i)},_onMouseMove:function(i){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var o=this._map.mouseEventToLayerPoint(i);this._handleMouseHover(i,o)}},_handleMouseOut:function(i){var o=this._hoveredLayer;o&&(ke(this._container,"leaflet-interactive"),this._fireEvent([o],i,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(i,o){if(!this._mouseHoverThrottled){for(var c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(f=c);f!==this._hoveredLayer&&(this._handleMouseOut(i),f&&($t(this._container,"leaflet-interactive"),this._fireEvent([f],i,"mouseover"),this._hoveredLayer=f)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,i),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(i,o,c){this._map._fireDOMEvent(o,c||o.type,i)},_bringToFront:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(c)c.prev=f;else return;f?f.next=c:c&&(this._drawFirst=c),o.prev=this._drawLast,this._drawLast.next=o,o.next=null,this._drawLast=o,this._requestRedraw(i)}},_bringToBack:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(f)f.next=c;else return;c?c.prev=f:f&&(this._drawLast=f),o.prev=null,o.next=this._drawFirst,this._drawFirst.prev=o,this._drawFirst=o,this._requestRedraw(i)}}});function Xm(i){return Wt.canvas?new Zm(i):null}var po=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(i){return document.createElement("<lvml:"+i+' class="lvml">')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),WT={_initContainer:function(){this._container=Jt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=po("shape");$t(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=po("path"),o.appendChild(i._path),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){var o=i._container;this._container.appendChild(o),i.options.interactive&&i.addInteractiveTarget(o)},_removePath:function(i){var o=i._container;se(o),i.removeInteractiveTarget(o),delete this._layers[u(i)]},_updateStyle:function(i){var o=i._stroke,c=i._fill,f=i.options,x=i._container;x.stroked=!!f.stroke,x.filled=!!f.fill,f.stroke?(o||(o=i._stroke=po("stroke")),x.appendChild(o),o.weight=f.weight+"px",o.color=f.color,o.opacity=f.opacity,f.dashArray?o.dashStyle=C(f.dashArray)?f.dashArray.join(" "):f.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=f.lineCap.replace("butt","flat"),o.joinstyle=f.lineJoin):o&&(x.removeChild(o),i._stroke=null),f.fill?(c||(c=i._fill=po("fill")),x.appendChild(c),c.color=f.fillColor||f.color,c.opacity=f.fillOpacity):c&&(x.removeChild(c),i._fill=null)},_updateCircle:function(i){var o=i._point.round(),c=Math.round(i._radius),f=Math.round(i._radiusY||c);this._setPath(i,i._empty()?"M0 0":"AL "+o.x+","+o.y+" "+c+","+f+" 0,"+65535*360)},_setPath:function(i,o){i._path.v=o},_bringToFront:function(i){Xt(i._container)},_bringToBack:function(i){Le(i._container)}},$a=Wt.vml?po:$,mo=bi.extend({_initContainer:function(){this._container=$a("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$a("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){se(this._container),Ue(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=i.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,c.setAttribute("width",o.x),c.setAttribute("height",o.y)),ye(c,i.min),c.setAttribute("viewBox",[i.min.x,i.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(i){var o=i._path=$a("path");i.options.className&&$t(o,i.options.className),i.options.interactive&&$t(o,"leaflet-interactive"),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){se(i._path),i.removeInteractiveTarget(i._path),delete this._layers[u(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var o=i._path,c=i.options;o&&(c.stroke?(o.setAttribute("stroke",c.color),o.setAttribute("stroke-opacity",c.opacity),o.setAttribute("stroke-width",c.weight),o.setAttribute("stroke-linecap",c.lineCap),o.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?o.setAttribute("stroke-dasharray",c.dashArray):o.removeAttribute("stroke-dasharray"),c.dashOffset?o.setAttribute("stroke-dashoffset",c.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),c.fill?(o.setAttribute("fill",c.fillColor||c.color),o.setAttribute("fill-opacity",c.fillOpacity),o.setAttribute("fill-rule",c.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(i,o){this._setPath(i,ht(i._parts,o))},_updateCircle:function(i){var o=i._point,c=Math.max(Math.round(i._radius),1),f=Math.max(Math.round(i._radiusY),1)||c,x="a"+c+","+f+" 0 1,0 ",A=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,A)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){Xt(i._path)},_bringToBack:function(i){Le(i._path)}});Wt.vml&&mo.include(WT);function Ym(i){return Wt.svg||Wt.vml?new mo(i):null}xe.include({getRenderer:function(i){var o=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var o=this._paneRenderers[i];return o===void 0&&(o=this._createRenderer({pane:i}),this._paneRenderers[i]=o),o},_createRenderer:function(i){return this.options.preferCanvas&&Xm(i)||Ym(i)}});var qm=ur.extend({initialize:function(i,o){ur.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Qt(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function ZT(i,o){return new qm(i,o)}mo.create=$a,mo.pointsToPath=ht,Ti.geometryToLayer=Xa,Ti.coordsToLatLng=Uh,Ti.coordsToLatLngs=Ya,Ti.latLngToCoords=Oh,Ti.latLngsToCoords=qa,Ti.getFeature=dr,Ti.asFeature=Qa,xe.mergeOptions({boxZoom:!0});var Qm=oi.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){he(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ue(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){se(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cn(),vh(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Jt("div","leaflet-zoom-box",this._container),$t(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var o=new Mt(this._point,this._startPoint),c=o.getSize();ye(this._box,o.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(se(this._box),ke(this._container,"leaflet-crosshair")),oo(),yh(),Ue(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var o=new oe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xe.addInitHook("addHandler","boxZoom",Qm),xe.mergeOptions({doubleClickZoom:!0});var jm=oi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var o=this._map,c=o.getZoom(),f=o.options.zoomDelta,x=i.originalEvent.shiftKey?c-f:c+f;o.options.doubleClickZoom==="center"?o.setZoom(x):o.setZoomAround(i.containerPoint,x)}});xe.addInitHook("addHandler","doubleClickZoom",jm),xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jm=oi.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Ki(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}$t(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ke(this._map._container,"leaflet-grab"),ke(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=Qt(this._map.options.maxBounds);this._offsetLimit=Ot(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var o=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(o),this._prunePositions(o)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,o){return i-(i-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;i.x<o.min.x&&(i.x=this._viscousLimit(i.x,o.min.x)),i.y<o.min.y&&(i.y=this._viscousLimit(i.y,o.min.y)),i.x>o.max.x&&(i.x=this._viscousLimit(i.x,o.max.x)),i.y>o.max.y&&(i.y=this._viscousLimit(i.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,o=Math.round(i/2),c=this._initialWorldOffset,f=this._draggable._newPos.x,x=(f-o+c)%i+o-c,A=(f+o+c)%i-o-c,z=Math.abs(x+c)<Math.abs(A+c)?x:A;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=z},_onDragEnd:function(i){var o=this._map,c=o.options,f=!c.inertia||i.noInertia||this._times.length<2;if(o.fire("dragend",i),f)o.fire("moveend");else{this._prunePositions(+new Date);var x=this._lastPos.subtract(this._positions[0]),A=(this._lastTime-this._times[0])/1e3,z=c.easeLinearity,K=x.multiplyBy(z/A),st=K.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,st),Dt=K.multiplyBy(mt/st),re=mt/(c.inertiaDeceleration*z),me=Dt.multiplyBy(-re/2).round();!me.x&&!me.y?o.fire("moveend"):(me=o._limitOffset(me,o.options.maxBounds),U(function(){o.panBy(me,{duration:re,easeLinearity:z,noMoveStart:!0,animate:!0})}))}}});xe.addInitHook("addHandler","dragging",Jm),xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Km=oi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(i){this._map=i,this._setPanDelta(i.options.keyboardPanDelta),this._setZoomDelta(i.options.zoomDelta)},addHooks:function(){var i=this._map._container;i.tabIndex<=0&&(i.tabIndex="0"),he(i,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ue(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=document.body,o=document.documentElement,c=i.scrollTop||o.scrollTop,f=i.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(f,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(i){var o=this._panKeys={},c=this.keyCodes,f,x;for(f=0,x=c.left.length;f<x;f++)o[c.left[f]]=[-1*i,0];for(f=0,x=c.right.length;f<x;f++)o[c.right[f]]=[i,0];for(f=0,x=c.down.length;f<x;f++)o[c.down[f]]=[0,i];for(f=0,x=c.up.length;f<x;f++)o[c.up[f]]=[0,-1*i]},_setZoomDelta:function(i){var o=this._zoomKeys={},c=this.keyCodes,f,x;for(f=0,x=c.zoomIn.length;f<x;f++)o[c.zoomIn[f]]=i;for(f=0,x=c.zoomOut.length;f<x;f++)o[c.zoomOut[f]]=-i},_addHooks:function(){he(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ue(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(i){if(!(i.altKey||i.ctrlKey||i.metaKey)){var o=i.keyCode,c=this._map,f;if(o in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(f=this._panKeys[o],i.shiftKey&&(f=lt(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(lt(f),c.options.maxBounds)),c.options.worldCopyJump){var x=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(f)));c.panTo(x)}else c.panBy(f)}else if(o in this._zoomKeys)c.setZoom(c.getZoom()+(i.shiftKey?3:1)*this._zoomKeys[o]);else if(o===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;Es(i)}}});xe.addInitHook("addHandler","keyboard",Km),xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var $m=oi.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ue(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=Sm(i),c=this._map.options.wheelDebounceTime;this._delta+=o,this._lastMousePos=this._map.mouseEventToContainerPoint(i),this._startTime||(this._startTime=+new Date);var f=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),f),Es(i)},_performZoom:function(){var i=this._map,o=i.getZoom(),c=this._map.options.zoomSnap||0;i._stop();var f=this._delta/(this._map.options.wheelPxPerZoomLevel*4),x=4*Math.log(2/(1+Math.exp(-Math.abs(f))))/Math.LN2,A=c?Math.ceil(x/c)*c:x,z=i._limitZoom(o+(this._delta>0?A:-A))-o;this._delta=0,this._startTime=null,z&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+z):i.setZoomAround(this._lastMousePos,o+z))}});xe.addInitHook("addHandler","scrollWheelZoom",$m);var XT=600;xe.mergeOptions({tapHold:Wt.touchNative&&Wt.safari&&Wt.mobile,tapTolerance:15});var tg=oi.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var o=i.touches[0];this._startPos=this._newPos=new W(o.clientX,o.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(he(document,"touchend",nn),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),XT),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Ue(document,"touchend",nn),Ue(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)},_onMove:function(i){var o=i.touches[0];this._newPos=new W(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,o){var c=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});c._simulated=!0,o.target.dispatchEvent(c)}});xe.addInitHook("addHandler","tapHold",tg),xe.mergeOptions({touchZoom:Wt.touch,bounceAtZoomLimits:!0});var eg=oi.extend({addHooks:function(){$t(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ke(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var o=this._map;if(!(!i.touches||i.touches.length!==2||o._animatingZoom||this._zooming)){var c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(c.add(f)._divideBy(2))),this._startDist=c.distanceTo(f),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),he(document,"touchmove",this._onTouchMove,this),he(document,"touchend touchcancel",this._onTouchEnd,this),nn(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var o=this._map,c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]),x=c.distanceTo(f)/this._startDist;if(this._zoom=o.getScaleZoom(x,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoom<o.getMinZoom()&&x<1||this._zoom>o.getMaxZoom()&&x>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,x===1)return}else{var A=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&A.x===0&&A.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(A),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),tt(this._animRequest);var z=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=U(z,this,!0),nn(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,tt(this._animRequest),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});xe.addInitHook("addHandler","touchZoom",eg),xe.BoxZoom=Qm,xe.DoubleClickZoom=jm,xe.Drag=Jm,xe.Keyboard=Km,xe.ScrollWheelZoom=$m,xe.TapHold=tg,xe.TouchZoom=eg,e.Bounds=Mt,e.Browser=Wt,e.CRS=_t,e.Canvas=Zm,e.Circle=kh,e.CircleMarker=Za,e.Class=H,e.Control=qn,e.DivIcon=Vm,e.DivOverlay=ai,e.DomEvent=hT,e.DomUtil=lT,e.Draggable=Ki,e.Evented=ct,e.FeatureGroup=Si,e.GeoJSON=Ti,e.GridLayer=fo,e.Handler=oi,e.Icon=hr,e.ImageOverlay=ja,e.LatLng=et,e.LatLngBounds=oe,e.Layer=Qn,e.LayerGroup=cr,e.LineUtil=ST,e.Map=xe,e.Marker=Wa,e.Mixin=_T,e.Path=$i,e.Point=W,e.PolyUtil=vT,e.Polygon=ur,e.Polyline=Mi,e.Popup=Ja,e.PosAnimation=Mm,e.Projection=MT,e.Rectangle=qm,e.Renderer=bi,e.SVG=mo,e.SVGOverlay=Hm,e.TileLayer=fr,e.Tooltip=Ka,e.Transformation=Re,e.Util=F,e.VideoOverlay=zm,e.bind=l,e.bounds=Ot,e.canvas=Xm,e.circle=IT,e.circleMarker=LT,e.control=co,e.divIcon=HT,e.extend=r,e.featureGroup=CT,e.geoJSON=Fm,e.geoJson=UT,e.gridLayer=VT,e.icon=PT,e.imageOverlay=OT,e.latLng=ut,e.latLngBounds=Qt,e.layerGroup=AT,e.map=uT,e.marker=RT,e.point=lt,e.polygon=kT,e.polyline=DT,e.popup=FT,e.rectangle=ZT,e.setOptions=w,e.stamp=u,e.svg=Ym,e.svgOverlay=BT,e.tileLayer=Gm,e.tooltip=zT,e.transformation=ft,e.version=s,e.videoOverlay=NT;var YT=window.L;e.noConflict=function(){return window.L=YT,this},window.L=e}))})(mr,mr.exports)),mr.exports}var I_=L_();const yn=P_(I_);function D_(n,t,e){if(n){const{obsType:s,obsPrefix:r,obsTiles:a}=e||{},{cols:l=8,rows:h=1}=a||{},{width:u=5760,height:d=2880}=t||{};if(s===yt.AppObsType.Hw){const m=ws(n,"x-image-process=image/resize,m_fixed,w_720,h_360,limit_0/marker,u_plus/imageslim");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-image-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/imageslim`;return ws(n,v)}}}else if(s===yt.AppObsType.Ali){const m=ws(n,"x-oss-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-oss-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else if(s===yt.AppObsType.Hs){const m=ws(n,"x-tos-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-tos-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else return s===yt.AppObsType.Aws?n:s===yt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function k_(n,t){if(n){const{obsType:e}=t||{};if(e===yt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await yt.api.getImageInfo(s);return{width:r,height:a}}else if(e===yt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await yt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===yt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await yt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===yt.AppObsType.Aws?{width:5760,height:2880}:e===yt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function ws(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class U_{marker;options;radarElement;map=null;constructor(t){this.options={radius:t.radius??30,color:t.color??"#108ee9",hFov:t.hFov??90,angle:t.angle??0,className:t.className??"leaflet-radar-marker"},this.radarElement=this.createRadarElement(),this.updateRadarStyle(),this.marker=yn.marker(t.latLng,{icon:yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[this.options.radius*2,this.options.radius*2],iconAnchor:[this.options.radius,this.options.radius]}),interactive:!1})}createRadarElement(){const t=document.createElement("div");t.style.pointerEvents="none",t.style.position="relative";const e=document.createElement("div");return e.style.transition="all 0.3s ease",e.style.display="block",t.appendChild(e),t}updateRadarStyle(){const t=this?.radarElement?.querySelector("div");if(!t)return;const{radius:e,color:s,hFov:r,angle:a}=this.options,h=`conic-gradient(
5
5
  from ${this.normalizeAngle(a+90)-r/2}deg,
6
6
  white 0deg,
7
7
  white ${r}deg,
8
8
  transparent ${r}deg,
9
9
  transparent 360deg
10
- )`,u=e*2;Object.assign(t.style,{width:"100%",height:"100%",borderRadius:"50%",backgroundImage:`radial-gradient(circle at 50% 50%, ${s} 0%, transparent 100%)`,maskImage:h,WebkitMaskImage:h}),Object.assign(this.radarElement.style,{width:`${u}px`,height:`${u}px`,background:"transparent",border:"none",pointerEvents:"none"})}normalizeAngle(t){return(t%360+360)%360}updateIconSize=()=>{if(!this.map)return;const t=this.options.radius/this.getMeterPerPixel(),e=t*2,s=yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[e,e],iconAnchor:[t,t]});this.marker.setIcon(s)};getMeterPerPixel(){if(!this.map)return 1;const t=this.map.getCenter(),e=this.map.latLngToContainerPoint(t),s=this.map.latLngToContainerPoint(yn.latLng(t.lat,t.lng+.001)),r=Math.abs(s.x-e.x);return r>0?111.32/r:1}addTo(t){return this.marker.addTo(t),this}remove(){return this.marker.remove(),this}removeFrom(t){return this.marker.removeFrom(t),this}setOptions(t){let e=!1;return t.radius!==void 0&&(this.options.radius=t.radius,e=!0),t.color!==void 0&&(this.options.color=t.color),t.hFov!==void 0&&(this.options.hFov=t.hFov),t.angle!==void 0&&(this.options.angle=t.angle),t.latLng!==void 0&&this.setLatLng(t.latLng),t.className!==void 0&&(this.options.className=t.className,e=!0),this.updateRadarStyle(),e&&this.updateIconSize(),this}setLatLng(t){return this.marker.setLatLng(t),this}setRadius(t){return this.setOptions({radius:t})}setColor(t){return this.setOptions({color:t})}setHFov(t){return this.setOptions({hFov:t})}setAngle(t){return this.setOptions({angle:t})}getLatLng(){return this.marker.getLatLng()}getMarker(){return this.marker}on(t,e,s){return this.marker.on(t,e,s),this}off(t,e,s){return this.marker.off(t,e,s),this}}const O_={class:"vsleem-map-geo"},N_=Pn(y.defineComponent({name:"MapGeo",__name:"MapGeo",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const{debounce:s}=yt.utils,r=n,a=e,l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref([]),p=s(O,10),m=s(et,10),_=y.computed(()=>(r.map.size??0)/(r.map.minSize??1)),E=y.computed(()=>Array.from(r.store?.dataSource?.keys()??[]).join(","));y.watch(()=>E.value,m),y.watch(()=>_.value,p),y.watch(()=>r.map.radarAngle,g),y.watch(()=>r.map.radarHFov,g),y.watch(()=>r.store?.currentPoint?.id,g),y.onMounted(()=>{S(),w(),C(),I(),v()}),y.onUnmounted(()=>{P()});function S(){const{currentPoint:z}=r.store||{},H={...Vh};if(z){const{point:q}=z;H.center=[q.lat,q.lon]}h.value=yn.map(l.value,H),a("ready",h.value)}function w(){const{tileLayers:z=el}=r.map||{};z.length&&h.value&&z?.forEach(H=>yn.tileLayer(H.url,H.options).addTo(h.value))}function v(){const{point:z}=r.store?.currentPoint||{};if(!r.map.showRadar||!h.value||!z)return;const{radarAngle:H,radarHFov:q}=r.map,j=yn.latLng(z.lat,z.lon);u.value?u.value.setOptions({latLng:j,hFov:q,angle:H}):(u.value=new U_({latLng:j,hFov:q,angle:H}),u.value?.addTo(h.value))}function g(){v()}async function I(){const{dataSource:z}=r.store||{},{showPoint:H,showMarker:q}=r.map;for(const j of z?.values()||[])for(const ct of j.trackPoints.values()){const{lon:W,lat:St}=ct.point,at=yn.latLng(St,W);H&&M(ct,at),q&&k(ct,at)}}function C(){d.value.length&&d.value.forEach(z=>{h.value&&z.removeFrom(h.value)}),d.value=[]}function M(z,H){if(h.value){const q=yn.circleMarker(H,{fillColor:z.color,fillOpacity:1,radius:3,opacity:0}).addTo(h.value);d.value.push(q),N(q,z)}}function k(z,H){const q=r.store?.groupedMarkers.get(z);if(q?.length&&h.value){const j=yn.icon({iconUrl:q[0].markerIcon,iconSize:yn.point([30,35]),iconAnchor:yn.point([15,35])}),ct=yn.marker(H,{icon:j}).addTo(h.value);d.value.push(ct),B(ct,z,q)}}function N(z,H){z?.addEventListener("click",q=>{q.originalEvent.preventDefault(),q.originalEvent.stopPropagation(),V(H)})}function B(z,H,q){z?.addEventListener("click",j=>{j.originalEvent.preventDefault(),j.originalEvent.stopPropagation(),D(H,q)})}async function V(z){a("select-point",z)}function D(z,H){a("select-point",z,H)}function P(){h.value&&h.value.remove()}function O(){const{currentPoint:z}=r.store||{};if(z){const{point:H}=z,q=h.value?.getZoom()??17;h.value?.setView([H.lat,H.lon],q)}h.value?.invalidateSize(!0)}async function et(){C(),I(),v()}return t({needUpdate:m}),(z,H)=>(y.openBlock(),y.createElementBlock("div",O_,[y.createElementVNode("div",{ref_key:"mapElRef",ref:l,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-ce267b94"]]),Yh=Pn(y.defineComponent({name:"Map",__name:"Map",emits:["register","ready","collapse","dragger","angle-updated","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref(),p=y.computed(()=>y.unref(y.unref(d))),m=y.computed(()=>y.unref(y.unref(u))),{getProps:_,getSize:E,getBindValue:S,mapAction:w,handleReady:v,handleCollapse:g,handleDragger:I,handleSelectPoint:C}=r_(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,M,{immediate:!0}),y.onMounted(N);function M(B){if(B){const{minSize:V}=_.value;r.value=w,r.value.setSize(V)}}function k(B,V){d.value=B,u.value=V}function N(){s("register",r,k)}return t(w),(B,V)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-map",style:y.normalizeStyle(y.unref(_).style)},[y.renderSlot(B.$slots,"left",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.createElementVNode("div",{class:"vsleem-map-content",style:y.normalizeStyle(y.unref(E))},[y.renderSlot(B.$slots,"extra",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(C_,{key:0,ref_key:"draggerElRef",ref:a,store:m.value,map:y.unref(_),onCollapse:y.unref(g),onDragger:y.unref(I)},null,8,["store","map","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(yt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(N_,{key:1,ref_key:"mapGeoElRef",ref:l,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"])):(y.openBlock(),y.createBlock(x_,{key:2,ref_key:"mapCadElRef",ref:h,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"]))],4),y.renderSlot(B.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.renderSlot(B.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)],4))}}),[["__scopeId","data-v-50f5a4e6"]]),{cloneDeep:qh,deepMergeProps:B_,getDiffProps:F_}=yt.utils;function z_(n,t,e,s,r){const a=y.ref(qh(_o)),l=y.computed(()=>{const{currentRecord:H,currentPoint:q}=y.unref(t)||{},j=H?.trackPoints?.size??0,ct=q?.index??0;return{...a.value,count:j,index:ct}}),h=y.computed(()=>{const{currentRecord:H}=y.unref(t)||{};return Array.from(H?.trackPoints?.values()||[])}),u=y.computed(()=>{const{dataSource:H,coordinateTree:q,mappedCoordinateTree:j,currentSpace:ct,currentModel:W,currentRecord:St,currentPoint:at,currentMarker:Mt,currentPointMarkers:Ot}=t.value||{};return{dataSource:H,coordinateTree:q,mappedCoordinateTree:j,currentSpace:ct,currentModel:W,currentRecord:St,currentPoint:at,currentPointMarkers:Ot,currentMarker:Mt,state:l.value}});y.watch(()=>qh(n.value?.playbar),d,{immediate:!0,deep:!0});function d(H,q){const j=F_(H,q);m(j)}function p(){return l.value}function m(H){H&&B_(a.value,H)}function _(H){return h.value[H]}function E(){r("ready")}function S(H){const q=_(H);q&&(M(q),r("backward",q))}function w(H){const q=_(H);q&&r("pause",q)}function v(H){const q=_(H);q&&(M(q),r("play",q))}function g(H){const q=_(H);q&&(M(q),r("forward",q))}function I(H){r("speed",H)}function C(H){const q=_(H);q&&(M(q),r("slider",q))}function M(H){y.unref(t)?.selectPoint(H),r("select-point",H)}function k(){y.unref(e)?.handleBackward?.()}function N(){y.unref(e)?.handlePlay?.()}function B(){y.unref(e)?.handlePause?.()}function V(){y.unref(e)?.handleForward?.()}function D(){y.unref(e)?.handleSpeed?.()}function P(){y.unref(e)?.handlePlayNext?.()}function O(){y.unref(s)?.handleSlider?.()}function et(H=0){return _(H)?.uxTime?.split(" ")?.[1]||null}return{getProps:l,getBindValue:u,playbarAction:{getState:p,setState:m,backward:k,play:N,pause:B,forward:V,slider:O,speed:D,playNext:P},formatter:et,handleReady:E,handleBackward:S,handlePause:w,handlePlay:v,handleForward:g,handleSlider:C,handleSpeed:I}}const H_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACaVJREFUeF7tnf2V1DYUR61OoBO2E6gEUkmgkmwnoRMFJV5wZpkd61nS+7pzTk7+iGVJ9+laP3vG2bLxgQAE7hIosIEABO4TQBBWBwTeIIAgLA8IIAhrAAIyAuwgMm60SkIAQZIUmmnKCCCIjButkhBAkCSFZpoyAggi40arJAQQJEmhmaaMAILIuNEqCQEESVJopikjgCAybrRKQgBBkhSaacoIIIiMG62SEECQJIVmmjICCCLjRqskBBAkSaGZpowAgsi40SoJAQRJUmimKSOAIDJutEpCAEGSFJppygggiIwbrZIQQJAkhWaaMgIIIuNGqyQEECRJoZmmjACCyLjRKgkBBElSaKYpI4AgMm60SkIAQZIUmmnKCCCIjButkhBAkCSFZpoyAggi40arJAQQJEmhmaaMAILIuNEqCQEESVJopikjgCAybrRKQgBBkhSaacoIIIiMG62SEECQJIVmmjICCCLjRqskBBAkSaGZpowAgsi40SoJAQRJUmimKSOAIDJutEpCAEGSFJppygggiIwbrZIQQBDFQtdaP2/b9vHHP9+3bftWSvmqOJxlXddaP2zb1ub+8vlUSmkMzH0QRKEktdZ327b9uW1bWyjHz1Mp5VlhSMu63C8KX246bHM2KQmCLFsa/3W0Xz3/utPtcynlafGQlnVXa23zvr0ovPT/3uIugiDLlsdDOf4dSSklZE0eyNGm3nYQcxEzZDEWrvnTXd2JFq/aRxPkjTh5O/cvP+b+x2mgiw5EkAWga63tfqPdjD/8RBLkQZxEkIerIcEBJ6LF/yhEEaRTjsaAHSSBDz+n2BEtwglSa227Zds1ez4I0kPL87G7HO2JTXuc2/XxvoP0xMkbMAjStVKcHiyIFmF2kN44iSBOF7l02FflaP163EGkcRJBpCvNYbuzj3EfTc2bIFfiJII8Wg1B/vvFaOE2Yo3YMQ+T5x4kiA+Xn1S9xcHLDjJYjoYEQSIJMih3v0LiQZBRcZKIFcmIw1wmXD1/nt26ICPjJIIEFGSmHNafYk2Ug4gVwZVJ0cL8TfqsOMkOEsGKfQ6Tr55mI9bsHZOnWAEkWSWHtYi1UA4ilkdPFkULkxFrRZwkYnm04lekaq+G3ns1dtrMLDzFWrljErGmLaV5J14cLUztIEpyELHmLeexZ1aIFiYE0YiTRKyxa3f62S68yzBsbBoRS3PHJGINWzpzT6QYLVR3ECNyELHmLm/52Q1ECzVBhK/GymG/3ZIfK84iKz2voavnzymsilgW4iT3INKVu6CdRTnatFcIYiVOIsiChS7pwli0WBaxrMVJBJGs3sltDEaLJYIMfDV2VoW4B5lF9ux5jUaL6YJYjZPsIGdX7uTjjEeLqYI4kYPHvJMduHt6T3KMvknX/lVAZ82JWJ3ALh/u6Oo5/DGvhzhJxLq8xOUn8CjHqB3EoRxELPlS72/pLFoMuwfxFifZQfrX9uUWTq+elyOW1x3zUHDuQS6v/gcn8C6HNGIFkIOINVMO59HiUsTyHCeJWDOt2M8d5OopilgRdkwi1kRJosnRE7GCyUHEGu1JoGjRFbEixUki1mgrfsWq0381dtIQpp32rZ+7R9wxiViDl1LAaHFqBwkuBxHrqieBo8VDQSy/v3K1ruwgAwgmuHrefYpl/f2VAeV9OQVfFEpgZpLj9ilW9DjJTbrEiEObJNHiVcTKEicR5IIgUR/jnkDyfv9/Ar87cWykQ4hYZ6u5X0H/Pnt8sOO+btv2MdiczkwHQc5Qasck3j3OIop4HIKcrWrGe48Dm+/btmWLV3wPclaOfQdpC6T9bY6MC4WI1bNYJh9bJp9ffPqsMav91KTW2u6/sl0ciFi9tuyStBvWNItlFyTjDoogvYLscav9KbT248QUkhx/rJjoW3TuQSRyvLTZv01PIcntr3kTRU12kIuSpIgdv/u5e5KoiSBXBDnsJmHfBWlzvPc+yP7o+3PgqIkgIwSJ/kXiiRemokZNBBklyEGScE+4Hv0BHQd/xkBaZgSRkrvXLmLseCTIIWq2L1LbE74oHwSZUcloT7jOCrLvopHuxxBkhiDRfprSI0iw+zEEmSXIIXa4/4lGryCB7scQZLYgEWKHRJAgvzhAkBWCeI8dUkECRE0EWSWI59hxRRDnkiDISkG8xo6rghzux7w94UKQ1YJ4vKKOEsRh1EQQDUG8STJSEGdRE0G0BPEUO0YL4ihqIoi2IB5ixwxBnEiCIBYEsR47ZgniIGoiiBVBLF9RZwpiPGoiiCVBrEqyQhCjURNBrAliMXasEsRg1EQQi4JYix0rBdklaS+dWXiVF0EsC2IldqwWxFDURBDrgliIHRqCGImaCOJBEO3YoSXIIWpqvcqLIF4E0Ywd2oLsc9f4oSOCeBJEK3ZYEETpfgxBvAlyiB3LXuW1IojC/RiCeBVkZeywJMjiqIkgngVZFTusCbIwaiKId0FWxA6LgiySBEEiCDI7dlgVZMEvDhAkiiAzr6jWBZkYNREkkiCzJPEgyKSoiSDRBJkRO7wIMiFqIkhUQUbGDk+CDJYEQSILMip2eBNkYNREkOiCjLiiehRkUNREkAyCXJXEsyAXoyaCZBHkSuzwLsiFqIkgmQSRxo4IguyS9L7KiyAZBemNHVEEEURNBMkqSE/siCRIZ9REkMyCnI0d0QQ5RM1Hr/IiSHZBTsSO51LKU1ROtda3XuV9KqU8W5t7sTagDOOptb7btq1dUdu/jx+Ti2RkTWqt7f/B9eXmnGYvDAgysvqd59oXS3va066c3yxeQTundOrw/W/bN1E+/LhIfC2lfDrVUOEgBFGATpd+CCCIn1oxUgUCCKIAnS79EEAQP7VipAoEEEQBOl36IYAgfmrFSBUIIIgCdLr0QwBB/NSKkSoQQBAF6HTphwCC+KkVI1UggCAK0OnSDwEE8VMrRqpAAEEUoNOlHwII4qdWjFSBAIIoQKdLPwQQxE+tGKkCAQRRgE6XfgggiJ9aMVIFAgiiAJ0u/RBAED+1YqQKBBBEATpd+iGAIH5qxUgVCCCIAnS69EMAQfzUipEqEEAQBeh06YcAgvipFSNVIIAgCtDp0g8BBPFTK0aqQABBFKDTpR8CCOKnVoxUgQCCKECnSz8EEMRPrRipAgEEUYBOl34IIIifWjFSBQIIogCdLv0QQBA/tWKkCgQQRAE6XfohgCB+asVIFQggiAJ0uvRDAEH81IqRKhBAEAXodOmHAIL4qRUjVSCAIArQ6dIPAQTxUytGqkAAQRSg06UfAgjip1aMVIEAgihAp0s/BBDET60YqQKBfwD4AKH2xW3zZwAAAABJRU5ErkJggg==",V_="data:image/png;base64,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",G_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAABr5JREFUeF7t181tVUEQROG5mZAJZAJkApFAKBAJZHL5XbAA9Ko1ltw9n9c9V+7TVTr2tfwggMA/CVzYIIDAvwkoiHQg8B8CCiIeCCiIDCBQI8AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQUJBDDm3NGgEFqXHz6hACCnLIoa1ZI6AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQOKog932/WWu9rN72uq631bfP6d1936/WWq8Lv9Pntdan67q+Ft62fHJaQT6stX6UpPRzXdcIXvd9f1lrvShBWOvddw7vi2/bPRtx8Eep3/etIGut+77vR5n9Ze7jFJM+wkBBHqH0e2aQQRTkwbsryIOgfowpyE9YDBJkptWoP7F+ncufWI/HlkEeZ8Ugv1gxSJCZVqMMwiBpYBkkIOZ/EAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEBhnky1rrRbD6n6PvvnN4X3zb7tlpBXmz1npZvdJ1XW+rb5/Tu/u+X/3mkJbk83VdH5/TLk/9uxxVkKeG6fvzCCjIvJvaaCMBBdkI06fmEVCQeTe10UYCCrIRpk/NI6Ag825qo40EFGQjTJ+aR0BB5t3URhsJKMhGmD41j4CCzLupjTYSUJCNMH1qHgEFmXdTG20koCAbYfrUPAIKMu+mNtpIQEE2wvSpeQQUZN5NbbSRgIJshOlT8wgoyLyb2mgjAQXZCNOn5hFQkHk3tdFGAgqyEaZPzSOgIPNuaqONBBRkI0yfmkdAQebd1EYbCSjIRpg+NY+Agsy7qY02ElCQjTB9ah4BBZl3UxttJKAgG2H61DwCCjLvpjbaSEBBNsL0qXkEFGTeTW20kYCCbITpU/MIKMi8m9poI4FvKQ+mBQo6RGMAAAAASUVORK5CYII=",W_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACENJREFUeF7tneF5GzcQBYFKYleSuBO5E7sSO5XYndidXHKJ/EWRSN5isYvD4Q3/CtjjzsOYvBVF18IDAhC4S6DCBgIQuE8AQTgdEHhAAEE4HhBAEM4ABHwEeAXxcWOXCAEEEQmaNn0EEMTHjV0iBBBEJGja9BFAEB83dokQQBCRoGnTRwBBfNzYJUIAQUSCpk0fAQTxcWOXCAEEEQmaNn0EEMTHjV0iBBBEJGja9BFAEB83dokQQBCRoGnTRwBBfNzYJUIAQUSCpk0fAQTxcWOXCAEEEQmaNn0EEMTHjV0iBBBEJGja9BFAEB83dokQQBCRoGnTRwBBfNzYJUIAQUSCpk0fAQTxcWOXCAEEEQmaNn0EJAXZtu2plPL7M7LPtdafPnzsWp2AnCDbtn0rpfzxKtivpRREWf20O/qTEmTbti+llP3V49bjeynlI68mjlO08BYZQbZte1dK+XGQ5f5W6wOSLHziG1tTEmR/W7W/vbI8dkn2VxQe4gSUBNnfWu1vsayP/e3Wfm/CQ5gAgjwO/1Ot9bPw+ZBvHUGOj8CnUsqf3Jccg1pxBYLYUmXCZeO03CoEsUfKhMvOapmVCNIWJZK08br8agTxRciEy8ftcrsQxB8ZEy4/u8vsRJC+qJhw9fGbfjeC9EfEhKuf4bQVECQmGm7eYzhOVwVB4iJBkjiW01RCkPgomHDFMz2tIoLkoGfClcN1eFUEyUPOhCuP7bDKCJKLmj/lzeWbXh1B0hEXxsD5jNOugCBpaP9XmAnXGM7hV0GQcKQPC/KnvGN5d18NQboRNhdgDNyM7LwNCHIOe8bA53BvviqCNCML28AYOAxlXiEEyWNrqcyEy0LpxDUIciL850sz4To/g7vPAEHmCec935wyTxi/ngmCzJUJE6658igIMlkgfz8dJlwTZYIgE4Xx4qkw4ZokFwSZJIgbT4MJ1wTZIMgEITx4Cky4Ts4HQU4OwHB5JDFAylqCIFlk4+sy4YpnelgRQQ4RTbWACdfgOBBkMPCAyzHhCoBoLYEgVlJzrWPCNSgPBBkEOuEy3LwnQH1dEkEGQE68BJIkwt1LI0gy4EHlmXAlgUaQJLAnlGXClQAdQRKgnliSCVcwfAQJBjpBOb6sLjAEBAmEOVEpxsBBYSBIEMgJyzDhCggFQQIgTl6CL6vrCAhBOuBdaCtjYGdYCOIEd8FtjIEdoSGIA9qFtzAGbgwPQRqBLbCcCVdDiAjSAGuhpUy4jGEiiBHUosv4srqDYBFk0ZPf0BYTrgewEKThJC28lAnXnXARZOFT39gaE64bwBCk8RQtvpwJ16uAEWTxE+9ojwnXC2gI4jhBAluQ5DlkBBE47R0tyk+4EKTj9IhslZ5wIYjIKe9sU3bChSCdJ0dou+SEC0GETnhAq3KSIEjAqRErIXVPgiBipzuoXZkPOSJI0IkRKyMz/kUQsZMd1K7MF0EgSNCJUSpTa5U5NzKNbtv2VEr5onSQk3r9Wmv9mFR7urIIMl0kUz+hn7XW91M/w+AnhyDBQBcu973W+mHh/m62hiBqifv6lZRjR4UgvgOjtEvqF4Ovg0UQpaPe3qvMOPceGgRpPzQKO/Y/mNp/Gbh/9kr6gSDS8d9sHjleYEEQBHlJQPZmnLdY/KLw6J8C5LhBiFeQo2Oj8XPpSdWjiBFEQ4BHXcpPqhCklMJnsW4eA+Q4+AeSVxDNVxAmVcbcEcQIaqFl3Iw3hIkgDbAWWIocjSEiSCOwCy9nUuUID0Ec0C64hZtxZ2gI4gR3oW3I0REWgnTAm3wrk6qAgBAkAOKEJbgZDwoFQYJATlQGOQLDQJBAmBOUkvrGkRG8EWQE5THXkPm2wzE4/70KgoyknXctJlVJbBEkCeygskyqkkEjSDLgxPL8R5uJcH+VRpABkBMuwaQqAeqtkggyCHTgZZAjEOZRKQQ5IjTXz/nA4eA8EGQw8I7LManqgOfdiiBecuP2Makax/rNlRDkRPiGSyOHAVLmEgTJpNtXm5vxPn4huxEkBGN4EeQIR+oriCA+bpm7mFRl0m2sjSCNwJKXM6lKBtxaHkFaieWtR448tu7KCOJGF7aRSVUYyvhCCBLPtKUiN+MttE5YiyAnQH++JHKcx958ZQQxowpdyKQqFGdeMQTJY3uvMn8aO565+4oI4kbn2sikyoXtvE0IMoY9k6oxnMOvgiDhSN8U5GY8n3HaFRAkDe0/hZEjl296dQTJQ8yXuOWxHVYZQXJQM6nK4Tq8KoLEI2dSFc/0tIoIEoeeSVUcy2kqIUhMFHyJWwzH6aogSH8kTKr6GU5bAUH6okGOPn7T70YQf0R84NDP7jI7EcQXFZMqH7fL7UKQ9siQo53ZZXcgiD06xrh2VsusRBBblNyM2zgttwpBjiNFjmNGy65AkMfRMqla9ujbGkOQ+5y4GbedoaVXIcjteJFj6WNvb05GkB3Jtm0/SinvHuBhUmU/OxIrEeS/mLkZlzjybU1KCfLgVYS//ms7NzKr5QR5luSplPLb89utz7XW/a0VDwi8ISApCOcAAlYCCGIlxTpJAggiGTtNWwkgiJUU6yQJIIhk7DRtJYAgVlKskySAIJKx07SVAIJYSbFOkgCCSMZO01YCCGIlxTpJAggiGTtNWwkgiJUU6yQJIIhk7DRtJYAgVlKskySAIJKx07SVAIJYSbFOkgCCSMZO01YCCGIlxTpJAggiGTtNWwkgiJUU6yQJIIhk7DRtJYAgVlKskySAIJKx07SVAIJYSbFOkgCCSMZO01YCCGIlxTpJAggiGTtNWwkgiJUU6yQJIIhk7DRtJYAgVlKskySAIJKx07SVwF8Zmefn1nhYywAAAABJRU5ErkJggg==",Z_={class:"vsleem-playbar-box"},X_={class:"playbar-box-caption"},Y_={style:{flex:"1"}},q_={class:"playbar-box-btns"},Q_=["src"],j_=["src"],J_=["src"],K_=["src"],$_=["title"],tv=Pn(y.defineComponent({name:"PlaybarBox",__name:"PlaybarBox",props:{state:{},currentPoint:{}},emits:["backward","pause","play","forward","speed"],setup(n,{expose:t,emit:e}){const s=n,r=e;let a;const l=y.ref(!1),h=y.computed(()=>l.value||s.state.index<1),u=y.computed(()=>s.state.index>=s.state.count-1),d=y.computed(()=>l.value||u.value),p=y.computed(()=>Math.round(s.state.baseSpeed/s.state.speed*100)/100),m=y.computed(()=>`${s.state.speed}ms`);y.onBeforeUnmount(S);function _(){h.value||r("backward",I(-1))}function E(){u.value||(l.value=!0,r("play",I(1)))}function S(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function w(){d.value||r("forward",I(1))}async function v(){const M=C();r("speed",M)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",I(1))},s.state.speed)))}function I(M){let k=s.state.index+M;return k<0||k>=s.state.count&&(k=s.state.count-1),k}function C(){const{speed:M,step:k,baseSpeed:N,threshold:B}=s.state;let D=N/M+k;const P=B/N;return D>P&&(D=k),Math.round(N/D)}return t({handleBackward:_,handlePlay:E,handlePause:S,handleForward:w,handlePlayNext:g,handleSpeed:v}),(M,k)=>(y.openBlock(),y.createElementBlock("div",Z_,[y.createElementVNode("div",X_,[y.renderSlot(M.$slots,"caption",{state:M.state,currentPoint:M.currentPoint},()=>[y.createElementVNode("span",Y_,y.toDisplayString(M.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(M.state.index+1)+" / "+y.toDisplayString(M.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",q_,[y.renderSlot(M.$slots,"button",{state:M.state,currentPoint:M.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(H_),alt:""},null,8,Q_)],2),M.state.showPlay?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[l.value?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:S},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(G_),alt:""},null,8,J_)])):(y.openBlock(),y.createElementBlock("div",{key:0,class:y.normalizeClass(["playbar-box-button",{disabled:u.value}]),onClick:E},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(W_),alt:""},null,8,j_)],2))],64)):y.createCommentVNode("",!0),y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:d.value}]),onClick:w},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(V_),alt:""},null,8,K_)],2),M.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,$_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),ev={key:0,class:"vsleem-handle-tooltip"},nv=["innerHTML"],iv=Pn(y.defineComponent({name:"PlaybarSlider",__name:"PlaybarSlider",props:{min:{default:0},max:{default:100},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},step:{default:1},tipFormatter:{type:Function,default:n=>n},hideTip:{type:Boolean,default:!1},value:{default:0}},emits:["update:value","change","after-change"],setup(n,{emit:t}){const e=t,s=n,r=y.ref(!1),a=y.ref(0),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>_(h.value/(s.max-s.min)*s.step)),p=y.computed(()=>Math.round(a.value/d.value*s.step+s.min)),m=y.computed(()=>s.tipFormatter(p.value));y.watch(()=>s.value,S),y.watch(p,C=>{e("update:value",C),e("change",C)}),y.onMounted(()=>{E(),S()});function _(C){return parseFloat(C.toFixed(2))}function E(){h.value=l.value.offsetWidth}function S(){a.value=_((s.value-s.min)/s.step*d.value)}async function w(C){if(s.disabled)return;const M=Math.round(C.offsetX/d.value)*d.value;a.value=M,u.value.focus(),await y.nextTick(),e("after-change",y.unref(p))}function v(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;document.onmousemove=M=>{I(M,C)},document.onmouseup=async()=>{document.onmousemove=null,document.onmouseup=null,await y.nextTick(),e("after-change",y.unref(p))}}function g(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;u.value?.classList.remove("mouse-handle"),u.value?.classList.add("touch-handle"),document.ontouchmove=M=>{I(M.touches[0],C)},document.ontouchend=async()=>{document.ontouchmove=null,document.ontouchend=null,u.value?.classList.remove("touch-handle"),await y.nextTick(),e("after-change",y.unref(p))}}function I(C,M){const k=_(Math.round((C.clientX-M)/d.value)*d.value);k>h.value?a.value=h.value:0<=k&&k<=h.value?a.value=k:a.value=0}return(C,M)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:C.disabled}]),ref_key:"slider",ref:l},[M[1]||(M[1]=y.createElementVNode("div",{class:"playbar-silder-rail"},null,-1)),y.createElementVNode("div",{class:y.normalizeClass(["playbar-silder-track",{trackTransition:r.value}]),style:y.normalizeStyle(`left: 0px; right: auto; width: ${a.value}px;`)},null,6),y.createElementVNode("div",{class:"playbar-silder-step",onClick:y.withModifiers(w,["stop"])}),y.createElementVNode("div",{tabindex:"0",ref_key:"rightHandle",ref:u,class:y.normalizeClass(["playbar-silder-handle mouse-handle",{handleTransition:r.value}]),style:y.normalizeStyle(`left: ${a.value}px; right: auto; transform: translate(-50%, -50%);`),onMousedown:v,onTouchstart:g},[C.hideTip?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",ev,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,nv),M[0]||(M[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-72db022b"]]),Qh=Pn(y.defineComponent({name:"Playbar",__name:"Playbar",emits:["register","ready","backward","pause","play","forward","speed","slider","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(u))),p=y.computed(()=>y.unref(y.unref(h))),{getProps:m,getBindValue:_,playbarAction:E,formatter:S,handleReady:w,handleBackward:v,handlePause:g,handlePlay:I,handleForward:C,handleSlider:M,handleSpeed:k}=z_(d,p,a,l,s);y.watch(()=>y.unref(p)?.ready,N,{immediate:!0}),y.onMounted(V);function N(D){D&&(w(),r.value=E)}function B(D,P){u.value=D,h.value=P}function V(){s("register",r,B)}return t(E),(D,P)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(m)?.style)},[y.renderSlot(D.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(iv,{ref_key:"playSliderElRef",ref:l,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-silder","tip-formatter":y.unref(S),onAfterChange:y.unref(M)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(D.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(tv,{ref_key:"playBoxElRef",ref:a,state:y.unref(_).state,currentPoint:y.unref(_).currentPoint,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-player",onBackward:y.unref(v),onPlay:y.unref(I),onPause:y.unref(g),onForward:y.unref(C),onSpeed:y.unref(k)},{caption:y.withCtx(O=>[y.renderSlot(D.$slots,"caption",y.normalizeProps(y.guardReactiveProps(O)),void 0,!0)]),button:y.withCtx(O=>[y.renderSlot(D.$slots,"button",y.normalizeProps(y.guardReactiveProps(O)),void 0,!0)]),_:3},8,["state","currentPoint","max","value","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(D.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(_))),void 0,!0)],4))}}),[["__scopeId","data-v-01c48639"]]);/**
10
+ )`,u=e*2;Object.assign(t.style,{width:"100%",height:"100%",borderRadius:"50%",backgroundImage:`radial-gradient(circle at 50% 50%, ${s} 0%, transparent 100%)`,maskImage:h,WebkitMaskImage:h}),Object.assign(this.radarElement.style,{width:`${u}px`,height:`${u}px`,background:"transparent",border:"none",pointerEvents:"none"})}normalizeAngle(t){return(t%360+360)%360}updateIconSize=()=>{if(!this.map)return;const t=this.options.radius/this.getMeterPerPixel(),e=t*2,s=yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[e,e],iconAnchor:[t,t]});this.marker.setIcon(s)};getMeterPerPixel(){if(!this.map)return 1;const t=this.map.getCenter(),e=this.map.latLngToContainerPoint(t),s=this.map.latLngToContainerPoint(yn.latLng(t.lat,t.lng+.001)),r=Math.abs(s.x-e.x);return r>0?111.32/r:1}addTo(t){return this.marker.addTo(t),this}remove(){return this.marker.remove(),this}removeFrom(t){return this.marker.removeFrom(t),this}setOptions(t){let e=!1;return t.radius!==void 0&&(this.options.radius=t.radius,e=!0),t.color!==void 0&&(this.options.color=t.color),t.hFov!==void 0&&(this.options.hFov=t.hFov),t.angle!==void 0&&(this.options.angle=t.angle),t.latLng!==void 0&&this.setLatLng(t.latLng),t.className!==void 0&&(this.options.className=t.className,e=!0),this.updateRadarStyle(),e&&this.updateIconSize(),this}setLatLng(t){return this.marker.setLatLng(t),this}setRadius(t){return this.setOptions({radius:t})}setColor(t){return this.setOptions({color:t})}setHFov(t){return this.setOptions({hFov:t})}setAngle(t){return this.setOptions({angle:t})}getLatLng(){return this.marker.getLatLng()}getMarker(){return this.marker}on(t,e,s){return this.marker.on(t,e,s),this}off(t,e,s){return this.marker.off(t,e,s),this}}const O_={class:"vsleem-map-geo"},N_=Pn(y.defineComponent({name:"MapGeo",__name:"MapGeo",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const{debounce:s}=yt.utils,r=n,a=e,l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref([]),p=s(U,10),m=s(tt,10),_=y.computed(()=>(r.map.size??0)/(r.map.minSize??1)),E=y.computed(()=>Array.from(r.store?.dataSource?.keys()??[]).join(","));y.watch(()=>E.value,m),y.watch(()=>_.value,p),y.watch(()=>r.map.radarAngle,g),y.watch(()=>r.map.radarHFov,g),y.watch(()=>r.store?.currentPoint?.id,g),y.onMounted(()=>{S(),w(),C(),I(),v()}),y.onUnmounted(()=>{D()});function S(){const{currentPoint:F}=r.store||{},H={...Vh};if(F){const{point:q}=F;H.center=[q.lat,q.lon]}h.value=yn.map(l.value,H),a("ready",h.value)}function w(){const{tileLayers:F=el}=r.map||{};F.length&&h.value&&F?.forEach(H=>yn.tileLayer(H.url,H.options).addTo(h.value))}function v(){const{point:F}=r.store?.currentPoint||{};if(!r.map.showRadar||!h.value||!F)return;const{radarAngle:H,radarHFov:q}=r.map,j=yn.latLng(F.lat,F.lon);u.value?u.value.setOptions({latLng:j,hFov:q,angle:H}):(u.value=new U_({latLng:j,hFov:q,angle:H}),u.value?.addTo(h.value))}function g(){v()}async function I(){const{dataSource:F}=r.store||{},{showPoint:H,showMarker:q}=r.map;for(const j of F?.values()||[])for(const ct of j.trackPoints.values()){const{lon:W,lat:Et}=ct.point,lt=yn.latLng(Et,W);H&&M(ct,lt),q&&k(ct,lt)}}function C(){d.value.length&&d.value.forEach(F=>{h.value&&F.removeFrom(h.value)}),d.value=[]}function M(F,H){if(h.value){const q=yn.circleMarker(H,{fillColor:F.color,fillOpacity:1,radius:3,opacity:0}).addTo(h.value);d.value.push(q),N(q,F)}}function k(F,H){const q=r.store?.groupedMarkers.get(F);if(q?.length&&h.value){const j=yn.icon({iconUrl:q[0].markerIcon,iconSize:yn.point([30,35]),iconAnchor:yn.point([15,35])}),ct=yn.marker(H,{icon:j}).addTo(h.value);d.value.push(ct),B(ct,F,q)}}function N(F,H){F?.addEventListener("click",q=>{q.originalEvent.preventDefault(),q.originalEvent.stopPropagation(),V(H)})}function B(F,H,q){F?.addEventListener("click",j=>{j.originalEvent.preventDefault(),j.originalEvent.stopPropagation(),R(H,q)})}async function V(F){a("select-point",F)}function R(F,H){a("select-point",F,H)}function D(){h.value&&h.value.remove()}function U(){const{currentPoint:F}=r.store||{};if(F){const{point:H}=F,q=h.value?.getZoom()??17;h.value?.setView([H.lat,H.lon],q)}h.value?.invalidateSize(!0)}async function tt(){C(),I(),v()}return t({needUpdate:m}),(F,H)=>(y.openBlock(),y.createElementBlock("div",O_,[y.createElementVNode("div",{ref_key:"mapElRef",ref:l,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-ce267b94"]]),Yh=Pn(y.defineComponent({name:"Map",__name:"Map",emits:["register","ready","collapse","dragger","angle-updated","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref(),p=y.computed(()=>y.unref(y.unref(d))),m=y.computed(()=>y.unref(y.unref(u))),{getProps:_,getSize:E,getBindValue:S,mapAction:w,handleReady:v,handleCollapse:g,handleDragger:I,handleSelectPoint:C}=r_(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,M,{immediate:!0}),y.onMounted(N);function M(B){if(B){const{minSize:V}=_.value;r.value=w,r.value.setSize(V)}}function k(B,V){d.value=B,u.value=V}function N(){s("register",r,k)}return t(w),(B,V)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-map",style:y.normalizeStyle(y.unref(_).style)},[y.renderSlot(B.$slots,"left",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.createElementVNode("div",{class:"vsleem-map-content",style:y.normalizeStyle(y.unref(E))},[y.renderSlot(B.$slots,"extra",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(C_,{key:0,ref_key:"draggerElRef",ref:a,store:m.value,map:y.unref(_),onCollapse:y.unref(g),onDragger:y.unref(I)},null,8,["store","map","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(yt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(N_,{key:1,ref_key:"mapGeoElRef",ref:l,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"])):(y.openBlock(),y.createBlock(x_,{key:2,ref_key:"mapCadElRef",ref:h,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"]))],4),y.renderSlot(B.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.renderSlot(B.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)],4))}}),[["__scopeId","data-v-50f5a4e6"]]),{cloneDeep:qh,deepMergeProps:B_,getDiffProps:F_}=yt.utils;function z_(n,t,e,s,r){const a=y.ref(qh(_o)),l=y.computed(()=>{const{currentRecord:H,currentPoint:q}=y.unref(t)||{},j=H?.trackPoints?.size??0,ct=q?.index??0;return{...a.value,count:j,index:ct}}),h=y.computed(()=>{const{currentRecord:H}=y.unref(t)||{};return Array.from(H?.trackPoints?.values()||[])}),u=y.computed(()=>{const{dataSource:H,coordinateTree:q,mappedCoordinateTree:j,currentSpace:ct,currentModel:W,currentRecord:Et,currentPoint:lt,currentMarker:Mt,currentPointMarkers:Ot}=t.value||{};return{dataSource:H,coordinateTree:q,mappedCoordinateTree:j,currentSpace:ct,currentModel:W,currentRecord:Et,currentPoint:lt,currentPointMarkers:Ot,currentMarker:Mt,state:l.value}});y.watch(()=>qh(n.value?.playbar),d,{immediate:!0,deep:!0});function d(H,q){const j=F_(H,q);m(j)}function p(){return l.value}function m(H){H&&B_(a.value,H)}function _(H){return h.value[H]}function E(){r("ready")}function S(H){const q=_(H);q&&(M(q),r("backward",q))}function w(H){const q=_(H);q&&r("pause",q)}function v(H){const q=_(H);q&&(M(q),r("play",q))}function g(H){const q=_(H);q&&(M(q),r("forward",q))}function I(H){r("speed",H)}function C(H){const q=_(H);q&&(M(q),r("slider",q))}function M(H){y.unref(t)?.selectPoint(H),r("select-point",H)}function k(){y.unref(e)?.handleBackward?.()}function N(){y.unref(e)?.handlePlay?.()}function B(){y.unref(e)?.handlePause?.()}function V(){y.unref(e)?.handleForward?.()}function R(){y.unref(e)?.handleSpeed?.()}function D(){y.unref(e)?.handlePlayNext?.()}function U(){y.unref(s)?.handleSlider?.()}function tt(H=0){return _(H)?.uxTime?.split(" ")?.[1]||null}return{getProps:l,getBindValue:u,playbarAction:{getState:p,setState:m,backward:k,play:N,pause:B,forward:V,slider:U,speed:R,playNext:D},formatter:tt,handleReady:E,handleBackward:S,handlePause:w,handlePlay:v,handleForward:g,handleSlider:C,handleSpeed:I}}const H_="data:image/png;base64,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",V_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACgRJREFUeF7tnOF13TYMRqlNkk3aSdJM0maSNJPEm6SbqKZrp47tZxEQSIH87jsnJz8sUMYF7iMebXkrvCAAgZsENthAAAK3CSAI3QGBdwggCO0BAQShByDgI8AO4uNGlAgBBBEpNGn6CCCIjxtRIgQQRKTQpOkjgCA+bkSJEEAQkUKTpo8Agvi4ESVCAEFECk2aPgII4uNGlAgBBBEpNGn6CCCIjxtRIgQQRKTQpOkjgCA+bkSJEEAQkUKTpo8Agvi4ESVCAEFECk2aPgII4uNGlAgBBBEpNGn6CCCIjxtRIgQQRKTQpOkjgCA+bkSJEEAQkUKTpo8Agvi4ESVCAEFECk2aPgII4uNGlAgBBBEpNGn6CCCIjxtRIgQQRKTQpOkjgCA+bkSJEEAQkUKTpo8Agvi4ESVCAEFECk2aPgII4uNGlAgBBBEpNGn6CCCIjxtRIgQQRKTQpOkjgCA+bkSJEEAQkUKTpo8Agvi4ESVCAEFECk2aPgII4uNGlAgBBBEpNGn6CCCIjxtRIgRSC7Lv+9dSym+llH9KKV+2bbtTqMu+7zXnT6WUD6WUb/cM7rZtqwx4DSaQVpB9378/yvEcyV/btn0ZzGjo7R7lqLk/f1U5fkeSoaV4uFlKQfZ9r++cP27g+Ku+q67aLDfeGCoKJBnvR1pB/rxnUUW49aqj1ucVJdn3fT/og5r33xf0iuQts+4gR4LUYi0pSYMgNfflR80sNs4syJJjR6MgD5KsPGoiyDsE7pukZQd5vsIyY4dBkJp/HbXq6R4nXJ2Mmn0HeY5libHDKMiyo2anfjcvu5IgS4wdDkGWHDXNndwpYDVBph87nII8tUf9WYnED1M7+fBq2RUFmXrsOClIzX2Zz2OjJHjvPqsKMu3YESAIx8CBZq0syBOmjzOd8gQJssTnscA+dy+lIMhUY0egIFOPmu6ODg5UEWSasSNYkGlHzeA+dy+nJMgUY0cHQaYcNd0dHRyoJkj6saOjIFONmsF97l5OUZDUY0dnQaYZNd0dHRyoKkhaSQYIMsWoGdzn7uWUBXmCluoHa4MEST9qujs6OBBB/gOa5hcdBwqSdhcN7vFTyyHI//hSPF8xWBAkOdAHQX4FdPlTihcIknLUPPW2HxiMIK9hXirJhYKkGjUDe/zUUgjyNr7L/oLIxYJwwvWiHxDk/feX4SdcCQSpRHiU97EvEOR4Ax56wpVEEI6BEeTYjGdXDDvhSiQIJ1yJ/7Ki9a+amLrdefGQsSOZIE+oZB/lZcSy2dL9hCupIJXS8M9jttL0uRpB7Fy7nnAlFkTyGBhB7IJ0HTuSCyJ3DIwgfkG6jB0TCCJ1woUg5wQJHzsmEUTmhAtBzgsSOnZMJMgTuan+aoy13AhiJXb7+pATrgkF6TJqxpXl3EoIco7fy+jTJ1yTChI+asaWxb8agvjZ3Yo8JcnEgoSOmvFl8a2IID5uLVGuH6xNLshyJ1wI0tLq/mvMv+i4gCBLnXAhiL/5WyNNv+i4iCDLSIIgrW1+7rrmE66FBHki5ho1z+GOi0aQOJZHKzV9eF9QkKlPuBDkqK1jv34oyaKCTHvChSCxArSudnPsWFiQKU+4EKS1peOve/OEa3FBppMEQeIb37LiqxMuAUGmOuFCEEs797n2l0d5RQSZ5oQLQfo0vXXVn8fAYoJUTqmPgRHE2sr9rn844Sql/Oh3i7Qrm3/jYFQmCDKKdNt96meS+k/xlfK5EgTJ1Yp1F/mQ61sa9t2kHLUQZFj9m26kLEjKMQtBmvp22EX1ROuPYXfLdSNGrNZ63J/kZPzLiq3fvve6f7Zt+yh4ipX6JIsdxNvOsXF327bVE6wiKEjKzx5P5UWQ2Eb3rPZTDkFB0v/NXwTxtHRczN/btn1+vpzIDlIPI+rOUX9AmvqFINeV583RQkCQh89a12G33RlBbLyirr45WiwuyC/jZBTMnusgSE+6r9c+HC0WFuTVODkWve9uCOLj5ok6fJpw4Q/pKX8I2FJEBGmhdP6a5tFiwR0k/UnVe+VFkPPNf7RCsxyL7SCH4+QRuAxfR5C+VTCPFovsIEvIUVsDQfoJ4hotFhDEtGP2wx+zMoLEcHy5ikuOBUaspeRgB4mX4/RoMfEOYh4n4/HHr8gOEsc05N1zUkHcO2Yc/j4rIUgM1xA5Jh2xlpWDEStGjtDRYqId5PQ4GYO/7yrsIOf4hr97TiJI2I55Dn//aATxMw6XY5IRS0YORiyfHF1Hi+Q7SOg46cM/NoodxMa7+7tnYkFSPxprK2P71QjSzqq7HIlHrC7jZDv6665EkDb2w55lSLaDdB0n29BfexWCHPMfOlokEmSqR2OPy+i7AkHe5zZ8tEgiyJBx0teyY6MQ5G3el40WCQQZNk6ObXXf3RDkNbemR2N9uI+jLhZE7hj3qCII8iuhy0eLCwUZPk4eNWeGryPI/1W4XI6LjnkvGyczCHD0PSDIf4TSjBaDdxDkODAEQUpJNVoMFCTFjnn0Dn7119UFSSXHwBELORrNUxUk7WgxYAdJM0429uillykKkvrds7Mg6XbMS7u/4eZqgqSWo/OIhRwNQry8REmQKUaLDjtI2nHS0a/DQ1QEmebdM1iQ9Dvm8I433lBBkGnkCB6xkMMow1uXryzIlKNF0A4yxTgZ0L/dl1hVkGnfPQMEGfr8SvcOvfgGKwoyrRwBI9ZU4+TFvd90+9UEmf5ZBucOMuU42dShF1+0kiBLjBYOQXg0tqNEqwiyzGhhFGTqcbJjX4ctPbsgy40WBkGmHyfDurjjQjMLcumjsb1q0igIx7i9CvBi3ayC/FFK+foOg2VHi33ff5RSPryT+zLj5KAeP3WbrIL8Vkr5fiOzZeV4POatedf8X76WGydPde6g4JSCPDbKW++ky48W9yPWn6WUuoM+30WQY5AQL2+TVpBn76a1Ue5KKd+2bav/L//a970K8ulRkvph/MvySSdNMLUgSZnxbQkRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaieAIHZmRAgRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaieAIHZmRAgRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaieAIHZmRAgRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaieAIHZmRAgRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaieAIHZmRAgRQBChYpOqnQCC2JkRIUQAQYSKTap2AghiZ0aEEAEEESo2qdoJIIidGRFCBBBEqNikaifwL+vlUQVWdBAlAAAAAElFTkSuQmCC",G_="data:image/png;base64,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",W_="data:image/png;base64,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",Z_={class:"vsleem-playbar-box"},X_={class:"playbar-box-caption"},Y_={style:{flex:"1"}},q_={class:"playbar-box-btns"},Q_=["src"],j_=["src"],J_=["src"],K_=["src"],$_=["title"],tv=Pn(y.defineComponent({name:"PlaybarBox",__name:"PlaybarBox",props:{state:{},currentPoint:{}},emits:["backward","pause","play","forward","speed"],setup(n,{expose:t,emit:e}){const s=n,r=e;let a;const l=y.ref(!1),h=y.computed(()=>l.value||s.state.index<1),u=y.computed(()=>s.state.index>=s.state.count-1),d=y.computed(()=>l.value||u.value),p=y.computed(()=>Math.round(s.state.baseSpeed/s.state.speed*100)/100),m=y.computed(()=>`${s.state.speed}ms`);y.onBeforeUnmount(S);function _(){h.value||r("backward",I(-1))}function E(){u.value||(l.value=!0,r("play",I(1)))}function S(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function w(){d.value||r("forward",I(1))}async function v(){const M=C();r("speed",M)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",I(1))},s.state.speed)))}function I(M){let k=s.state.index+M;return k<0||k>=s.state.count&&(k=s.state.count-1),k}function C(){const{speed:M,step:k,baseSpeed:N,threshold:B}=s.state;let R=N/M+k;const D=B/N;return R>D&&(R=k),Math.round(N/R)}return t({handleBackward:_,handlePlay:E,handlePause:S,handleForward:w,handlePlayNext:g,handleSpeed:v}),(M,k)=>(y.openBlock(),y.createElementBlock("div",Z_,[y.createElementVNode("div",X_,[y.renderSlot(M.$slots,"caption",{state:M.state,currentPoint:M.currentPoint},()=>[y.createElementVNode("span",Y_,y.toDisplayString(M.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(M.state.index+1)+" / "+y.toDisplayString(M.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",q_,[y.renderSlot(M.$slots,"button",{state:M.state,currentPoint:M.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(H_),alt:""},null,8,Q_)],2),M.state.showPlay?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[l.value?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:S},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(G_),alt:""},null,8,J_)])):(y.openBlock(),y.createElementBlock("div",{key:0,class:y.normalizeClass(["playbar-box-button",{disabled:u.value}]),onClick:E},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(W_),alt:""},null,8,j_)],2))],64)):y.createCommentVNode("",!0),y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:d.value}]),onClick:w},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(V_),alt:""},null,8,K_)],2),M.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,$_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),ev={key:0,class:"vsleem-handle-tooltip"},nv=["innerHTML"],iv=Pn(y.defineComponent({name:"PlaybarSlider",__name:"PlaybarSlider",props:{min:{default:0},max:{default:100},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},step:{default:1},tipFormatter:{type:Function,default:n=>n},hideTip:{type:Boolean,default:!1},value:{default:0}},emits:["update:value","change","after-change"],setup(n,{emit:t}){const e=t,s=n,r=y.ref(!1),a=y.ref(0),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>_(h.value/(s.max-s.min)*s.step)),p=y.computed(()=>Math.round(a.value/d.value*s.step+s.min)),m=y.computed(()=>s.tipFormatter(p.value));y.watch(()=>s.value,S),y.watch(p,C=>{e("update:value",C),e("change",C)}),y.onMounted(()=>{E(),S()});function _(C){return parseFloat(C.toFixed(2))}function E(){h.value=l.value.offsetWidth}function S(){a.value=_((s.value-s.min)/s.step*d.value)}async function w(C){if(s.disabled)return;const M=Math.round(C.offsetX/d.value)*d.value;a.value=M,u.value.focus(),await y.nextTick(),e("after-change",y.unref(p))}function v(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;document.onmousemove=M=>{I(M,C)},document.onmouseup=async()=>{document.onmousemove=null,document.onmouseup=null,await y.nextTick(),e("after-change",y.unref(p))}}function g(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;u.value?.classList.remove("mouse-handle"),u.value?.classList.add("touch-handle"),document.ontouchmove=M=>{I(M.touches[0],C)},document.ontouchend=async()=>{document.ontouchmove=null,document.ontouchend=null,u.value?.classList.remove("touch-handle"),await y.nextTick(),e("after-change",y.unref(p))}}function I(C,M){const k=_(Math.round((C.clientX-M)/d.value)*d.value);k>h.value?a.value=h.value:0<=k&&k<=h.value?a.value=k:a.value=0}return(C,M)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:C.disabled}]),ref_key:"slider",ref:l},[M[1]||(M[1]=y.createElementVNode("div",{class:"playbar-silder-rail"},null,-1)),y.createElementVNode("div",{class:y.normalizeClass(["playbar-silder-track",{trackTransition:r.value}]),style:y.normalizeStyle(`left: 0px; right: auto; width: ${a.value}px;`)},null,6),y.createElementVNode("div",{class:"playbar-silder-step",onClick:y.withModifiers(w,["stop"])}),y.createElementVNode("div",{tabindex:"0",ref_key:"rightHandle",ref:u,class:y.normalizeClass(["playbar-silder-handle mouse-handle",{handleTransition:r.value}]),style:y.normalizeStyle(`left: ${a.value}px; right: auto; transform: translate(-50%, -50%);`),onMousedown:v,onTouchstart:g},[C.hideTip?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",ev,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,nv),M[0]||(M[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-72db022b"]]),Qh=Pn(y.defineComponent({name:"Playbar",__name:"Playbar",emits:["register","ready","backward","pause","play","forward","speed","slider","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(u))),p=y.computed(()=>y.unref(y.unref(h))),{getProps:m,getBindValue:_,playbarAction:E,formatter:S,handleReady:w,handleBackward:v,handlePause:g,handlePlay:I,handleForward:C,handleSlider:M,handleSpeed:k}=z_(d,p,a,l,s);y.watch(()=>y.unref(p)?.ready,N,{immediate:!0}),y.onMounted(V);function N(R){R&&(w(),r.value=E)}function B(R,D){u.value=R,h.value=D}function V(){s("register",r,B)}return t(E),(R,D)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(m)?.style)},[y.renderSlot(R.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(iv,{ref_key:"playSliderElRef",ref:l,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-silder","tip-formatter":y.unref(S),onAfterChange:y.unref(M)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(R.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(tv,{ref_key:"playBoxElRef",ref:a,state:y.unref(_).state,currentPoint:y.unref(_).currentPoint,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-player",onBackward:y.unref(v),onPlay:y.unref(I),onPause:y.unref(g),onForward:y.unref(C),onSpeed:y.unref(k)},{caption:y.withCtx(U=>[y.renderSlot(R.$slots,"caption",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),button:y.withCtx(U=>[y.renderSlot(R.$slots,"button",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),_:3},8,["state","currentPoint","max","value","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(R.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(_))),void 0,!0)],4))}}),[["__scopeId","data-v-01c48639"]]);/**
11
11
  * @license
12
12
  * Copyright 2010-2025 Three.js Authors
13
13
  * SPDX-License-Identifier: MIT
14
- */const il="179",sv=0,jh=1,rv=2,Jh=1,ov=2,li=3,Ai=0,fn=1,ci=2,Ci=0,Ss=1,Kh=2,$h=3,tu=4,av=5,ts=100,lv=101,cv=102,hv=103,uv=104,dv=200,fv=201,pv=202,mv=203,sl=204,rl=205,gv=206,_v=207,vv=208,yv=209,Ev=210,xv=211,wv=212,Sv=213,Mv=214,ol=0,al=1,ll=2,Ms=3,cl=4,hl=5,ul=6,dl=7,eu=0,Tv=1,bv=2,Pi=0,nu=1,Av=2,Cv=3,Pv=4,Rv=5,Lv=6,Iv=7,iu=300,Ts=301,bs=302,fl=303,pl=304,vo=306,ml=1e3,es=1001,gl=1002,Fn=1003,Dv=1004,yo=1005,En=1006,_l=1007,Ri=1008,hi=1009,su=1010,ru=1011,gr=1012,vl=1013,ns=1014,ui=1015,_r=1016,yl=1017,El=1018,vr=1020,ou=35902,au=1021,lu=1022,zn=1023,yr=1026,Er=1027,cu=1028,xl=1029,hu=1030,wl=1031,Sl=1033,Eo=33776,xo=33777,wo=33778,So=33779,Ml=35840,Tl=35841,bl=35842,Al=35843,Cl=36196,Pl=37492,Rl=37496,Ll=37808,Il=37809,Dl=37810,kl=37811,Ul=37812,Ol=37813,Nl=37814,Bl=37815,Fl=37816,zl=37817,Hl=37818,Vl=37819,Gl=37820,Wl=37821,Mo=36492,Zl=36494,Xl=36495,uu=36283,Yl=36284,ql=36285,Ql=36286,kv=3200,Uv=3201,Ov=0,Nv=1,Li="",Rn="srgb",is="srgb-linear",To="linear",Ie="srgb",As=7680,du=519,Bv=512,Fv=513,zv=514,fu=515,Hv=516,Vv=517,Gv=518,Wv=519,pu=35044,mu="300 es",jn=2e3,bo=2001;class Cs{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners;if(s===void 0)return;const r=s[t];if(r!==void 0){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const s=e[t.type];if(s!==void 0){t.target=this;const r=s.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,t);t.target=null}}}const sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let gu=1234567;const xr=Math.PI/180,wr=180/Math.PI;function Ps(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(sn[n&255]+sn[n>>8&255]+sn[n>>16&255]+sn[n>>24&255]+"-"+sn[t&255]+sn[t>>8&255]+"-"+sn[t>>16&15|64]+sn[t>>24&255]+"-"+sn[e&63|128]+sn[e>>8&255]+"-"+sn[e>>16&255]+sn[e>>24&255]+sn[s&255]+sn[s>>8&255]+sn[s>>16&255]+sn[s>>24&255]).toLowerCase()}function ge(n,t,e){return Math.max(t,Math.min(e,n))}function jl(n,t){return(n%t+t)%t}function Zv(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function Xv(n,t,e){return n!==t?(e-n)/(t-n):0}function Sr(n,t,e){return(1-e)*n+e*t}function Yv(n,t,e,s){return Sr(n,t,1-Math.exp(-e*s))}function qv(n,t=1){return t-Math.abs(jl(n,t*2)-t)}function Qv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function jv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function Jv(n,t){return n+Math.floor(Math.random()*(t-n+1))}function Kv(n,t){return n+Math.random()*(t-n)}function $v(n){return n*(.5-Math.random())}function t0(n){n!==void 0&&(gu=n);let t=gu+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function e0(n){return n*xr}function n0(n){return n*wr}function i0(n){return(n&n-1)===0&&n!==0}function s0(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function r0(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function o0(n,t,e,s,r){const a=Math.cos,l=Math.sin,h=a(e/2),u=l(e/2),d=a((t+s)/2),p=l((t+s)/2),m=a((t-s)/2),_=l((t-s)/2),E=a((s-t)/2),S=l((s-t)/2);switch(r){case"XYX":n.set(h*p,u*m,u*_,h*d);break;case"YZY":n.set(u*_,h*p,u*m,h*d);break;case"ZXZ":n.set(u*m,u*_,h*p,h*d);break;case"XZX":n.set(h*p,u*S,u*E,h*d);break;case"YXY":n.set(u*E,h*p,u*S,h*d);break;case"ZYZ":n.set(u*S,u*E,h*p,h*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Rs(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function on(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const we={DEG2RAD:xr,RAD2DEG:wr,generateUUID:Ps,clamp:ge,euclideanModulo:jl,mapLinear:Zv,inverseLerp:Xv,lerp:Sr,damp:Yv,pingpong:qv,smoothstep:Qv,smootherstep:jv,randInt:Jv,randFloat:Kv,randFloatSpread:$v,seededRandom:t0,degToRad:e0,radToDeg:n0,isPowerOfTwo:i0,ceilPowerOfTwo:s0,floorPowerOfTwo:r0,setQuaternionFromProperEuler:o0,normalize:on,denormalize:Rs};class be{constructor(t=0,e=0){be.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6],this.y=r[1]*e+r[4]*s+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(ge(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),r=Math.sin(e),a=this.x-t.x,l=this.y-t.y;return this.x=a*s-l*r+t.x,this.y=a*r+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ss{constructor(t=0,e=0,s=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=r}static slerpFlat(t,e,s,r,a,l,h){let u=s[r+0],d=s[r+1],p=s[r+2],m=s[r+3];const _=a[l+0],E=a[l+1],S=a[l+2],w=a[l+3];if(h===0){t[e+0]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m;return}if(h===1){t[e+0]=_,t[e+1]=E,t[e+2]=S,t[e+3]=w;return}if(m!==w||u!==_||d!==E||p!==S){let v=1-h;const g=u*_+d*E+p*S+m*w,I=g>=0?1:-1,C=1-g*g;if(C>Number.EPSILON){const k=Math.sqrt(C),N=Math.atan2(k,g*I);v=Math.sin(v*N)/k,h=Math.sin(h*N)/k}const M=h*I;if(u=u*v+_*M,d=d*v+E*M,p=p*v+S*M,m=m*v+w*M,v===1-h){const k=1/Math.sqrt(u*u+d*d+p*p+m*m);u*=k,d*=k,p*=k,m*=k}}t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m}static multiplyQuaternionsFlat(t,e,s,r,a,l){const h=s[r],u=s[r+1],d=s[r+2],p=s[r+3],m=a[l],_=a[l+1],E=a[l+2],S=a[l+3];return t[e]=h*S+p*m+u*E-d*_,t[e+1]=u*S+p*_+d*m-h*E,t[e+2]=d*S+p*E+h*_-u*m,t[e+3]=p*S-h*m-u*_-d*E,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,r){return this._x=t,this._y=e,this._z=s,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t._x,r=t._y,a=t._z,l=t._order,h=Math.cos,u=Math.sin,d=h(s/2),p=h(r/2),m=h(a/2),_=u(s/2),E=u(r/2),S=u(a/2);switch(l){case"XYZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"YXZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"ZXY":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"ZYX":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"YZX":this._x=_*p*m+d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m-_*E*S;break;case"XZY":this._x=_*p*m-d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m+_*E*S;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,r=Math.sin(s);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],r=e[4],a=e[8],l=e[1],h=e[5],u=e[9],d=e[2],p=e[6],m=e[10],_=s+h+m;if(_>0){const E=.5/Math.sqrt(_+1);this._w=.25/E,this._x=(p-u)*E,this._y=(a-d)*E,this._z=(l-r)*E}else if(s>h&&s>m){const E=2*Math.sqrt(1+s-h-m);this._w=(p-u)/E,this._x=.25*E,this._y=(r+l)/E,this._z=(a+d)/E}else if(h>m){const E=2*Math.sqrt(1+h-s-m);this._w=(a-d)/E,this._x=(r+l)/E,this._y=.25*E,this._z=(u+p)/E}else{const E=2*Math.sqrt(1+m-s-h);this._w=(l-r)/E,this._x=(a+d)/E,this._y=(u+p)/E,this._z=.25*E}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ge(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const r=Math.min(1,e/s);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,r=t._y,a=t._z,l=t._w,h=e._x,u=e._y,d=e._z,p=e._w;return this._x=s*p+l*h+r*d-a*u,this._y=r*p+l*u+a*h-s*d,this._z=a*p+l*d+s*u-r*h,this._w=l*p-s*h-r*u-a*d,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,r=this._y,a=this._z,l=this._w;let h=l*t._w+s*t._x+r*t._y+a*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=l,this._x=s,this._y=r,this._z=a,this;const u=1-h*h;if(u<=Number.EPSILON){const E=1-e;return this._w=E*l+e*this._w,this._x=E*s+e*this._x,this._y=E*r+e*this._y,this._z=E*a+e*this._z,this.normalize(),this}const d=Math.sqrt(u),p=Math.atan2(d,h),m=Math.sin((1-e)*p)/d,_=Math.sin(e*p)/d;return this._w=l*m+this._w*_,this._x=s*m+this._x*_,this._y=r*m+this._y*_,this._z=a*m+this._z*_,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),r=Math.sqrt(1-s),a=Math.sqrt(s);return this.set(r*Math.sin(t),r*Math.cos(t),a*Math.sin(e),a*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Q{constructor(t=0,e=0,s=0){Q.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(_u.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_u.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[3]*s+a[6]*r,this.y=a[1]*e+a[4]*s+a[7]*r,this.z=a[2]*e+a[5]*s+a[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=t.elements,l=1/(a[3]*e+a[7]*s+a[11]*r+a[15]);return this.x=(a[0]*e+a[4]*s+a[8]*r+a[12])*l,this.y=(a[1]*e+a[5]*s+a[9]*r+a[13])*l,this.z=(a[2]*e+a[6]*s+a[10]*r+a[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,r=this.z,a=t.x,l=t.y,h=t.z,u=t.w,d=2*(l*r-h*s),p=2*(h*e-a*r),m=2*(a*s-l*e);return this.x=e+u*d+l*m-h*p,this.y=s+u*p+h*d-a*m,this.z=r+u*m+a*p-l*d,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[4]*s+a[8]*r,this.y=a[1]*e+a[5]*s+a[9]*r,this.z=a[2]*e+a[6]*s+a[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this.z=ge(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this.z=ge(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,r=t.y,a=t.z,l=e.x,h=e.y,u=e.z;return this.x=r*u-a*h,this.y=a*l-s*u,this.z=s*h-r*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return Jl.copy(this).projectOnVector(t),this.sub(Jl)}reflect(t){return this.sub(Jl.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(ge(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return e*e+s*s+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const r=Math.sin(e)*t;return this.x=r*Math.sin(s),this.y=Math.cos(e)*t,this.z=r*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jl=new Q,_u=new ss;class ue{constructor(t,e,s,r,a,l,h,u,d){ue.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d)}set(t,e,s,r,a,l,h,u,d){const p=this.elements;return p[0]=t,p[1]=r,p[2]=h,p[3]=e,p[4]=a,p[5]=u,p[6]=s,p[7]=l,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],this}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[3],u=s[6],d=s[1],p=s[4],m=s[7],_=s[2],E=s[5],S=s[8],w=r[0],v=r[3],g=r[6],I=r[1],C=r[4],M=r[7],k=r[2],N=r[5],B=r[8];return a[0]=l*w+h*I+u*k,a[3]=l*v+h*C+u*N,a[6]=l*g+h*M+u*B,a[1]=d*w+p*I+m*k,a[4]=d*v+p*C+m*N,a[7]=d*g+p*M+m*B,a[2]=_*w+E*I+S*k,a[5]=_*v+E*C+S*N,a[8]=_*g+E*M+S*B,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8];return e*l*p-e*h*d-s*a*p+s*h*u+r*a*d-r*l*u}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=p*l-h*d,_=h*u-p*a,E=d*a-l*u,S=e*m+s*_+r*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/S;return t[0]=m*w,t[1]=(r*d-p*s)*w,t[2]=(h*s-r*l)*w,t[3]=_*w,t[4]=(p*e-r*u)*w,t[5]=(r*a-h*e)*w,t[6]=E*w,t[7]=(s*u-d*e)*w,t[8]=(l*e-s*a)*w,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,r,a,l,h){const u=Math.cos(a),d=Math.sin(a);return this.set(s*u,s*d,-s*(u*l+d*h)+l+t,-r*d,r*u,-r*(-d*l+u*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(Kl.makeScale(t,e)),this}rotate(t){return this.premultiply(Kl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kl.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<9;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<9;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Kl=new ue;function vu(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Mr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function a0(){const n=Mr("canvas");return n.style.display="block",n}const yu={};function Ls(n){n in yu||(yu[n]=!0,console.warn(n))}function l0(n,t,e){return new Promise(function(s,r){function a(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,e);break;default:s()}}setTimeout(a,e)})}const Eu=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xu=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function c0(){const n={enabled:!0,workingColorSpace:is,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ie&&(r.r=di(r.r),r.g=di(r.g),r.b=di(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ie&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Li?To:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],s=[.3127,.329];return n.define({[is]:{primaries:t,whitePoint:s,transfer:To,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Rn},outputColorSpaceConfig:{drawingBufferColorSpace:Rn}},[Rn]:{primaries:t,whitePoint:s,transfer:Ie,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Rn}}}),n}const Se=c0();function di(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Is(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ds;class h0{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Ds===void 0&&(Ds=Mr("canvas")),Ds.width=t.width,Ds.height=t.height;const r=Ds.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ds}return s.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Mr("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const r=s.getImageData(0,0,t.width,t.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=di(a[l]/255)*255;return s.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let s=0;s<e.length;s++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[s]=Math.floor(di(e[s]/255)*255):e[s]=di(e[s]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let u0=0;class $l{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:u0++}),this.uuid=Ps(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let l=0,h=r.length;l<h;l++)r[l].isDataTexture?a.push(tc(r[l].image)):a.push(tc(r[l]))}else a=tc(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function tc(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?h0.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let d0=0;const ec=new Q;class Je extends Cs{constructor(t=Je.DEFAULT_IMAGE,e=Je.DEFAULT_MAPPING,s=es,r=es,a=En,l=Ri,h=zn,u=hi,d=Je.DEFAULT_ANISOTROPY,p=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:d0++}),this.uuid=Ps(),this.name="",this.source=new $l(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=s,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=d,this.format=h,this.internalFormat=null,this.type=u,this.offset=new be(0,0),this.repeat=new be(1,1),this.center=new be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ue,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ec).x}get height(){return this.source.getSize(ec).y}get depth(){return this.source.getSize(ec).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&s&&r.isVector2&&s.isVector2||r&&s&&r.isVector3&&s.isVector3||r&&s&&r.isMatrix3&&s.isMatrix3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),e||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==iu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ml:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case gl:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ml:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case gl:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Je.DEFAULT_IMAGE=null,Je.DEFAULT_MAPPING=iu,Je.DEFAULT_ANISOTROPY=1;class He{constructor(t=0,e=0,s=0,r=1){He.prototype.isVector4=!0,this.x=t,this.y=e,this.z=s,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,s,r){return this.x=t,this.y=e,this.z=s,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=this.w,l=t.elements;return this.x=l[0]*e+l[4]*s+l[8]*r+l[12]*a,this.y=l[1]*e+l[5]*s+l[9]*r+l[13]*a,this.z=l[2]*e+l[6]*s+l[10]*r+l[14]*a,this.w=l[3]*e+l[7]*s+l[11]*r+l[15]*a,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,s,r,a;const u=t.elements,d=u[0],p=u[4],m=u[8],_=u[1],E=u[5],S=u[9],w=u[2],v=u[6],g=u[10];if(Math.abs(p-_)<.01&&Math.abs(m-w)<.01&&Math.abs(S-v)<.01){if(Math.abs(p+_)<.1&&Math.abs(m+w)<.1&&Math.abs(S+v)<.1&&Math.abs(d+E+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const C=(d+1)/2,M=(E+1)/2,k=(g+1)/2,N=(p+_)/4,B=(m+w)/4,V=(S+v)/4;return C>M&&C>k?C<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(C),r=N/s,a=B/s):M>k?M<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(M),s=N/r,a=V/r):k<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(k),s=B/a,r=V/a),this.set(s,r,a,e),this}let I=Math.sqrt((v-S)*(v-S)+(m-w)*(m-w)+(_-p)*(_-p));return Math.abs(I)<.001&&(I=1),this.x=(v-S)/I,this.y=(m-w)/I,this.z=(_-p)/I,this.w=Math.acos((d+E+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this.z=ge(this.z,t.z,e.z),this.w=ge(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this.z=ge(this.z,t,e),this.w=ge(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class f0 extends Cs{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:En,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=s.depth,this.scissor=new He(0,0,t,e),this.scissorTest=!1,this.viewport=new He(0,0,t,e);const r={width:t,height:e,depth:s.depth},a=new Je(r);this.textures=[];const l=s.count;for(let h=0;h<l;h++)this.textures[h]=a.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const e={minFilter:En,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,s=1){if(this.width!==t||this.height!==e||this.depth!==s){this.width=t,this.height=e,this.depth=s;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=s,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,s=t.textures.length;e<s;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const r=Object.assign({},t.textures[e].image);this.textures[e].source=new $l(r)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ii extends f0{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class wu extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class p0 extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ks{constructor(t=new Q(1/0,1/0,1/0),e=new Q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e+=3)this.expandByPoint(Hn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Hn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const s=Hn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const a=s.getAttribute("position");if(e===!0&&a!==void 0&&t.isInstancedMesh!==!0)for(let l=0,h=a.count;l<h;l++)t.isMesh===!0?t.getVertexPosition(l,Hn):Hn.fromBufferAttribute(a,l),Hn.applyMatrix4(t.matrixWorld),this.expandByPoint(Hn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ao.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ao.copy(s.boundingBox)),Ao.applyMatrix4(t.matrixWorld),this.union(Ao)}const r=t.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,s;return t.normal.x>0?(e=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),e<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tr),Co.subVectors(this.max,Tr),Us.subVectors(t.a,Tr),Os.subVectors(t.b,Tr),Ns.subVectors(t.c,Tr),Di.subVectors(Os,Us),ki.subVectors(Ns,Os),rs.subVectors(Us,Ns);let e=[0,-Di.z,Di.y,0,-ki.z,ki.y,0,-rs.z,rs.y,Di.z,0,-Di.x,ki.z,0,-ki.x,rs.z,0,-rs.x,-Di.y,Di.x,0,-ki.y,ki.x,0,-rs.y,rs.x,0];return!nc(e,Us,Os,Ns,Co)||(e=[1,0,0,0,1,0,0,0,1],!nc(e,Us,Os,Ns,Co))?!1:(Po.crossVectors(Di,ki),e=[Po.x,Po.y,Po.z],nc(e,Us,Os,Ns,Co))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const fi=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],Hn=new Q,Ao=new ks,Us=new Q,Os=new Q,Ns=new Q,Di=new Q,ki=new Q,rs=new Q,Tr=new Q,Co=new Q,Po=new Q,os=new Q;function nc(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){os.fromArray(n,a);const h=r.x*Math.abs(os.x)+r.y*Math.abs(os.y)+r.z*Math.abs(os.z),u=t.dot(os),d=e.dot(os),p=s.dot(os);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const m0=new ks,br=new Q,ic=new Q;class Ro{constructor(t=new Q,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const s=this.center;e!==void 0?s.copy(e):m0.setFromPoints(t).getCenter(s);let r=0;for(let a=0,l=t.length;a<l;a++)r=Math.max(r,s.distanceToSquared(t[a]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const s=this.center.distanceToSquared(t);return e.copy(t),s>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;br.subVectors(t,this.center);const e=br.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(br,r/s),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ic.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(br.copy(t.center).add(ic)),this.expandByPoint(br.copy(t.center).sub(ic))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const pi=new Q,sc=new Q,Lo=new Q,Ui=new Q,rc=new Q,Io=new Q,oc=new Q;class ac{constructor(t=new Q,e=new Q(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,pi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const s=e.dot(this.direction);return s<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=pi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(pi.copy(this.origin).addScaledVector(this.direction,e),pi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){sc.copy(t).add(e).multiplyScalar(.5),Lo.copy(e).sub(t).normalize(),Ui.copy(this.origin).sub(sc);const a=t.distanceTo(e)*.5,l=-this.direction.dot(Lo),h=Ui.dot(this.direction),u=-Ui.dot(Lo),d=Ui.lengthSq(),p=Math.abs(1-l*l);let m,_,E,S;if(p>0)if(m=l*u-h,_=l*h-u,S=a*p,m>=0)if(_>=-S)if(_<=S){const w=1/p;m*=w,_*=w,E=m*(m+l*_+2*h)+_*(l*m+_+2*u)+d}else _=a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _=-a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _<=-S?(m=Math.max(0,-(-l*a+h)),_=m>0?-a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d):_<=S?(m=0,_=Math.min(Math.max(-a,-u),a),E=_*(_+2*u)+d):(m=Math.max(0,-(l*a+h)),_=m>0?a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d);else _=l>0?-a:a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(sc).addScaledVector(Lo,_),E}intersectSphere(t,e){pi.subVectors(t.center,this.origin);const s=pi.dot(this.direction),r=pi.dot(pi)-s*s,a=t.radius*t.radius;if(r>a)return null;const l=Math.sqrt(a-r),h=s-l,u=s+l;return u<0?null:h<0?this.at(u,e):this.at(h,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/e;return s>=0?s:null}intersectPlane(t,e){const s=this.distanceToPlane(t);return s===null?null:this.at(s,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let s,r,a,l,h,u;const d=1/this.direction.x,p=1/this.direction.y,m=1/this.direction.z,_=this.origin;return d>=0?(s=(t.min.x-_.x)*d,r=(t.max.x-_.x)*d):(s=(t.max.x-_.x)*d,r=(t.min.x-_.x)*d),p>=0?(a=(t.min.y-_.y)*p,l=(t.max.y-_.y)*p):(a=(t.max.y-_.y)*p,l=(t.min.y-_.y)*p),s>l||a>r||((a>s||isNaN(s))&&(s=a),(l<r||isNaN(r))&&(r=l),m>=0?(h=(t.min.z-_.z)*m,u=(t.max.z-_.z)*m):(h=(t.max.z-_.z)*m,u=(t.min.z-_.z)*m),s>u||h>r)||((h>s||s!==s)&&(s=h),(u<r||r!==r)&&(r=u),r<0)?null:this.at(s>=0?s:r,e)}intersectsBox(t){return this.intersectBox(t,pi)!==null}intersectTriangle(t,e,s,r,a){rc.subVectors(e,t),Io.subVectors(s,t),oc.crossVectors(rc,Io);let l=this.direction.dot(oc),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Ui.subVectors(this.origin,t);const u=h*this.direction.dot(Io.crossVectors(Ui,Io));if(u<0)return null;const d=h*this.direction.dot(rc.cross(Ui));if(d<0||u+d>l)return null;const p=-h*Ui.dot(oc);return p<0?null:this.at(p/l,a)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Oe{constructor(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){Oe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v)}set(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){const g=this.elements;return g[0]=t,g[4]=e,g[8]=s,g[12]=r,g[1]=a,g[5]=l,g[9]=h,g[13]=u,g[2]=d,g[6]=p,g[10]=m,g[14]=_,g[3]=E,g[7]=S,g[11]=w,g[15]=v,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 Oe().fromArray(this.elements)}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],e[9]=s[9],e[10]=s[10],e[11]=s[11],e[12]=s[12],e[13]=s[13],e[14]=s[14],e[15]=s[15],this}copyPosition(t){const e=this.elements,s=t.elements;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,s=t.elements,r=1/Bs.setFromMatrixColumn(t,0).length(),a=1/Bs.setFromMatrixColumn(t,1).length(),l=1/Bs.setFromMatrixColumn(t,2).length();return e[0]=s[0]*r,e[1]=s[1]*r,e[2]=s[2]*r,e[3]=0,e[4]=s[4]*a,e[5]=s[5]*a,e[6]=s[6]*a,e[7]=0,e[8]=s[8]*l,e[9]=s[9]*l,e[10]=s[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,s=t.x,r=t.y,a=t.z,l=Math.cos(s),h=Math.sin(s),u=Math.cos(r),d=Math.sin(r),p=Math.cos(a),m=Math.sin(a);if(t.order==="XYZ"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=-u*m,e[8]=d,e[1]=E+S*d,e[5]=_-w*d,e[9]=-h*u,e[2]=w-_*d,e[6]=S+E*d,e[10]=l*u}else if(t.order==="YXZ"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_+w*h,e[4]=S*h-E,e[8]=l*d,e[1]=l*m,e[5]=l*p,e[9]=-h,e[2]=E*h-S,e[6]=w+_*h,e[10]=l*u}else if(t.order==="ZXY"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_-w*h,e[4]=-l*m,e[8]=S+E*h,e[1]=E+S*h,e[5]=l*p,e[9]=w-_*h,e[2]=-l*d,e[6]=h,e[10]=l*u}else if(t.order==="ZYX"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=S*d-E,e[8]=_*d+w,e[1]=u*m,e[5]=w*d+_,e[9]=E*d-S,e[2]=-d,e[6]=h*u,e[10]=l*u}else if(t.order==="YZX"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=w-_*m,e[8]=S*m+E,e[1]=m,e[5]=l*p,e[9]=-h*p,e[2]=-d*p,e[6]=E*m+S,e[10]=_-w*m}else if(t.order==="XZY"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=-m,e[8]=d*p,e[1]=_*m+w,e[5]=l*p,e[9]=E*m-S,e[2]=S*m-E,e[6]=h*p,e[10]=w*m+_}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(g0,t,_0)}lookAt(t,e,s){const r=this.elements;return xn.subVectors(t,e),xn.lengthSq()===0&&(xn.z=1),xn.normalize(),Oi.crossVectors(s,xn),Oi.lengthSq()===0&&(Math.abs(s.z)===1?xn.x+=1e-4:xn.z+=1e-4,xn.normalize(),Oi.crossVectors(s,xn)),Oi.normalize(),Do.crossVectors(xn,Oi),r[0]=Oi.x,r[4]=Do.x,r[8]=xn.x,r[1]=Oi.y,r[5]=Do.y,r[9]=xn.y,r[2]=Oi.z,r[6]=Do.z,r[10]=xn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[4],u=s[8],d=s[12],p=s[1],m=s[5],_=s[9],E=s[13],S=s[2],w=s[6],v=s[10],g=s[14],I=s[3],C=s[7],M=s[11],k=s[15],N=r[0],B=r[4],V=r[8],D=r[12],P=r[1],O=r[5],et=r[9],z=r[13],H=r[2],q=r[6],j=r[10],ct=r[14],W=r[3],St=r[7],at=r[11],Mt=r[15];return a[0]=l*N+h*P+u*H+d*W,a[4]=l*B+h*O+u*q+d*St,a[8]=l*V+h*et+u*j+d*at,a[12]=l*D+h*z+u*ct+d*Mt,a[1]=p*N+m*P+_*H+E*W,a[5]=p*B+m*O+_*q+E*St,a[9]=p*V+m*et+_*j+E*at,a[13]=p*D+m*z+_*ct+E*Mt,a[2]=S*N+w*P+v*H+g*W,a[6]=S*B+w*O+v*q+g*St,a[10]=S*V+w*et+v*j+g*at,a[14]=S*D+w*z+v*ct+g*Mt,a[3]=I*N+C*P+M*H+k*W,a[7]=I*B+C*O+M*q+k*St,a[11]=I*V+C*et+M*j+k*at,a[15]=I*D+C*z+M*ct+k*Mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],s=t[4],r=t[8],a=t[12],l=t[1],h=t[5],u=t[9],d=t[13],p=t[2],m=t[6],_=t[10],E=t[14],S=t[3],w=t[7],v=t[11],g=t[15];return S*(+a*u*m-r*d*m-a*h*_+s*d*_+r*h*E-s*u*E)+w*(+e*u*E-e*d*_+a*l*_-r*l*E+r*d*p-a*u*p)+v*(+e*d*m-e*h*E-a*l*m+s*l*E+a*h*p-s*d*p)+g*(-r*h*p-e*u*m+e*h*_+r*l*m-s*l*_+s*u*p)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=s),this}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=t[9],_=t[10],E=t[11],S=t[12],w=t[13],v=t[14],g=t[15],I=m*v*d-w*_*d+w*u*E-h*v*E-m*u*g+h*_*g,C=S*_*d-p*v*d-S*u*E+l*v*E+p*u*g-l*_*g,M=p*w*d-S*m*d+S*h*E-l*w*E-p*h*g+l*m*g,k=S*m*u-p*w*u-S*h*_+l*w*_+p*h*v-l*m*v,N=e*I+s*C+r*M+a*k;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/N;return t[0]=I*B,t[1]=(w*_*a-m*v*a-w*r*E+s*v*E+m*r*g-s*_*g)*B,t[2]=(h*v*a-w*u*a+w*r*d-s*v*d-h*r*g+s*u*g)*B,t[3]=(m*u*a-h*_*a-m*r*d+s*_*d+h*r*E-s*u*E)*B,t[4]=C*B,t[5]=(p*v*a-S*_*a+S*r*E-e*v*E-p*r*g+e*_*g)*B,t[6]=(S*u*a-l*v*a-S*r*d+e*v*d+l*r*g-e*u*g)*B,t[7]=(l*_*a-p*u*a+p*r*d-e*_*d-l*r*E+e*u*E)*B,t[8]=M*B,t[9]=(S*m*a-p*w*a-S*s*E+e*w*E+p*s*g-e*m*g)*B,t[10]=(l*w*a-S*h*a+S*s*d-e*w*d-l*s*g+e*h*g)*B,t[11]=(p*h*a-l*m*a-p*s*d+e*m*d+l*s*E-e*h*E)*B,t[12]=k*B,t[13]=(p*w*r-S*m*r+S*s*_-e*w*_-p*s*v+e*m*v)*B,t[14]=(S*h*r-l*w*r-S*s*u+e*w*u+l*s*v-e*h*v)*B,t[15]=(l*m*r-p*h*r+p*s*u-e*m*u-l*s*_+e*h*_)*B,this}scale(t){const e=this.elements,s=t.x,r=t.y,a=t.z;return e[0]*=s,e[4]*=r,e[8]*=a,e[1]*=s,e[5]*=r,e[9]*=a,e[2]*=s,e[6]*=r,e[10]*=a,e[3]*=s,e[7]*=r,e[11]*=a,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,r))}makeTranslation(t,e,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),r=Math.sin(e),a=1-s,l=t.x,h=t.y,u=t.z,d=a*l,p=a*h;return this.set(d*l+s,d*h-r*u,d*u+r*h,0,d*h+r*u,p*h+s,p*u-r*l,0,d*u-r*h,p*u+r*l,a*u*u+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,r,a,l){return this.set(1,s,a,0,t,1,l,0,e,r,1,0,0,0,0,1),this}compose(t,e,s){const r=this.elements,a=e._x,l=e._y,h=e._z,u=e._w,d=a+a,p=l+l,m=h+h,_=a*d,E=a*p,S=a*m,w=l*p,v=l*m,g=h*m,I=u*d,C=u*p,M=u*m,k=s.x,N=s.y,B=s.z;return r[0]=(1-(w+g))*k,r[1]=(E+M)*k,r[2]=(S-C)*k,r[3]=0,r[4]=(E-M)*N,r[5]=(1-(_+g))*N,r[6]=(v+I)*N,r[7]=0,r[8]=(S+C)*B,r[9]=(v-I)*B,r[10]=(1-(_+w))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,s){const r=this.elements;let a=Bs.set(r[0],r[1],r[2]).length();const l=Bs.set(r[4],r[5],r[6]).length(),h=Bs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),t.x=r[12],t.y=r[13],t.z=r[14],Vn.copy(this);const d=1/a,p=1/l,m=1/h;return Vn.elements[0]*=d,Vn.elements[1]*=d,Vn.elements[2]*=d,Vn.elements[4]*=p,Vn.elements[5]*=p,Vn.elements[6]*=p,Vn.elements[8]*=m,Vn.elements[9]*=m,Vn.elements[10]*=m,e.setFromRotationMatrix(Vn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2*a/(e-t),m=2*a/(s-r),_=(e+t)/(e-t),E=(s+r)/(s-r);let S,w;if(u)S=a/(l-a),w=l*a/(l-a);else if(h===jn)S=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(h===bo)S=-l/(l-a),w=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=_,d[12]=0,d[1]=0,d[5]=m,d[9]=E,d[13]=0,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2/(e-t),m=2/(s-r),_=-(e+t)/(e-t),E=-(s+r)/(s-r);let S,w;if(u)S=1/(l-a),w=l/(l-a);else if(h===jn)S=-2/(l-a),w=-(l+a)/(l-a);else if(h===bo)S=-1/(l-a),w=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=0,d[12]=_,d[1]=0,d[5]=m,d[9]=0,d[13]=E,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<16;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<16;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}}const Bs=new Q,Vn=new Oe,g0=new Q(0,0,0),_0=new Q(1,1,1),Oi=new Q,Do=new Q,xn=new Q,Su=new Oe,Mu=new ss;class Jn{constructor(t=0,e=0,s=0,r=Jn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=s,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,s,r=this._order){return this._x=t,this._y=e,this._z=s,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,s=!0){const r=t.elements,a=r[0],l=r[4],h=r[8],u=r[1],d=r[5],p=r[9],m=r[2],_=r[6],E=r[10];switch(e){case"XYZ":this._y=Math.asin(ge(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,E),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(_,d),this._z=0);break;case"YXZ":this._x=Math.asin(-ge(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(h,E),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(ge(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-m,E),this._z=Math.atan2(-l,d)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-ge(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(_,E),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,d));break;case"YZX":this._z=Math.asin(ge(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(h,E));break;case"XZY":this._z=Math.asin(-ge(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(_,d),this._y=Math.atan2(h,a)):(this._x=Math.atan2(-p,E),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,s){return Su.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Su,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mu.setFromEuler(this),this.setFromQuaternion(Mu,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Jn.DEFAULT_ORDER="XYZ";class lc{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let v0=0;const Tu=new Q,Fs=new ss,mi=new Oe,ko=new Q,Ar=new Q,y0=new Q,E0=new ss,bu=new Q(1,0,0),Au=new Q(0,1,0),Cu=new Q(0,0,1),Pu={type:"added"},x0={type:"removed"},zs={type:"childadded",child:null},cc={type:"childremoved",child:null};class an extends Cs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:v0++}),this.uuid=Ps(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=an.DEFAULT_UP.clone();const t=new Q,e=new Jn,s=new ss,r=new Q(1,1,1);function a(){s.setFromEuler(e,!1)}function l(){e.setFromQuaternion(s,void 0,!1)}e._onChange(a),s._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Oe},normalMatrix:{value:new ue}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=an.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new lc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.premultiply(Fs),this}rotateX(t){return this.rotateOnAxis(bu,t)}rotateY(t){return this.rotateOnAxis(Au,t)}rotateZ(t){return this.rotateOnAxis(Cu,t)}translateOnAxis(t,e){return Tu.copy(t).applyQuaternion(this.quaternion),this.position.add(Tu.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bu,t)}translateY(t){return this.translateOnAxis(Au,t)}translateZ(t){return this.translateOnAxis(Cu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(mi.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?ko.copy(t):ko.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),Ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?mi.lookAt(Ar,ko,this.up):mi.lookAt(ko,Ar,this.up),this.quaternion.setFromRotationMatrix(mi),r&&(mi.extractRotation(r.matrixWorld),Fs.setFromRotationMatrix(mi),this.quaternion.premultiply(Fs.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(x0),cc.child=t,this.dispatchEvent(cc),cc.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),mi.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),mi.multiply(t.parent.matrixWorld)),t.applyMatrix4(mi),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let s=0,r=this.children.length;s<r;s++){const l=this.children[s].getObjectByProperty(t,e);if(l!==void 0)return l}}getObjectsByProperty(t,e,s=[]){this[t]===e&&s.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(t,e,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,t,y0),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,E0,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].updateMatrixWorld(t)}updateWorldMatrix(t,e){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",s={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(h=>({...h})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(h,u){return h[u.uuid]===void 0&&(h[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(t.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const u=h.shapes;if(Array.isArray(u))for(let d=0,p=u.length;d<p;d++){const m=u[d];a(t.shapes,m)}else a(t.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let u=0,d=this.material.length;u<d;u++)h.push(a(t.materials,this.material[u]));r.material=h}else r.material=a(t.materials,this.material);if(this.children.length>0){r.children=[];for(let h=0;h<this.children.length;h++)r.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let h=0;h<this.animations.length;h++){const u=this.animations[h];r.animations.push(a(t.animations,u))}}if(e){const h=l(t.geometries),u=l(t.materials),d=l(t.textures),p=l(t.images),m=l(t.shapes),_=l(t.skeletons),E=l(t.animations),S=l(t.nodes);h.length>0&&(s.geometries=h),u.length>0&&(s.materials=u),d.length>0&&(s.textures=d),p.length>0&&(s.images=p),m.length>0&&(s.shapes=m),_.length>0&&(s.skeletons=_),E.length>0&&(s.animations=E),S.length>0&&(s.nodes=S)}return s.object=r,s;function l(h){const u=[];for(const d in h){const p=h[d];delete p.metadata,u.push(p)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let s=0;s<t.children.length;s++){const r=t.children[s];this.add(r.clone())}return this}}an.DEFAULT_UP=new Q(0,1,0),an.DEFAULT_MATRIX_AUTO_UPDATE=!0,an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Gn=new Q,gi=new Q,hc=new Q,_i=new Q,Hs=new Q,Vs=new Q,Ru=new Q,uc=new Q,dc=new Q,fc=new Q,pc=new He,mc=new He,gc=new He;class Wn{constructor(t=new Q,e=new Q,s=new Q){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Gn.subVectors(t,e),r.cross(Gn);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(t,e,s,r,a){Gn.subVectors(r,e),gi.subVectors(s,e),hc.subVectors(t,e);const l=Gn.dot(Gn),h=Gn.dot(gi),u=Gn.dot(hc),d=gi.dot(gi),p=gi.dot(hc),m=l*d-h*h;if(m===0)return a.set(0,0,0),null;const _=1/m,E=(d*u-h*p)*_,S=(l*p-h*u)*_;return a.set(1-E-S,S,E)}static containsPoint(t,e,s,r){return this.getBarycoord(t,e,s,r,_i)===null?!1:_i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,_i)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,_i.x),u.addScaledVector(l,_i.y),u.addScaledVector(h,_i.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return pc.setScalar(0),mc.setScalar(0),gc.setScalar(0),pc.fromBufferAttribute(t,e),mc.fromBufferAttribute(t,s),gc.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(pc,a.x),l.addScaledVector(mc,a.y),l.addScaledVector(gc,a.z),l}static isFrontFacing(t,e,s,r){return Gn.subVectors(s,e),gi.subVectors(t,e),Gn.cross(gi).dot(r)<0}set(t,e,s){return this.a.copy(t),this.b.copy(e),this.c.copy(s),this}setFromPointsAndIndices(t,e,s,r){return this.a.copy(t[e]),this.b.copy(t[s]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,s,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Gn.subVectors(this.c,this.b),gi.subVectors(this.a,this.b),Gn.cross(gi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Wn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Wn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return Wn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return Wn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Wn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const s=this.a,r=this.b,a=this.c;let l,h;Hs.subVectors(r,s),Vs.subVectors(a,s),uc.subVectors(t,s);const u=Hs.dot(uc),d=Vs.dot(uc);if(u<=0&&d<=0)return e.copy(s);dc.subVectors(t,r);const p=Hs.dot(dc),m=Vs.dot(dc);if(p>=0&&m<=p)return e.copy(r);const _=u*m-p*d;if(_<=0&&u>=0&&p<=0)return l=u/(u-p),e.copy(s).addScaledVector(Hs,l);fc.subVectors(t,a);const E=Hs.dot(fc),S=Vs.dot(fc);if(S>=0&&E<=S)return e.copy(a);const w=E*d-u*S;if(w<=0&&d>=0&&S<=0)return h=d/(d-S),e.copy(s).addScaledVector(Vs,h);const v=p*S-E*m;if(v<=0&&m-p>=0&&E-S>=0)return Ru.subVectors(a,r),h=(m-p)/(m-p+(E-S)),e.copy(r).addScaledVector(Ru,h);const g=1/(v+w+_);return l=w*g,h=_*g,e.copy(s).addScaledVector(Hs,l).addScaledVector(Vs,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Lu={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},Ni={h:0,s:0,l:0},Uo={h:0,s:0,l:0};function _c(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Ce{constructor(t,e,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,s)}set(t,e,s){if(e===void 0&&s===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=Se.workingColorSpace){return this.r=t,this.g=e,this.b=s,Se.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=Se.workingColorSpace){if(t=jl(t,1),e=ge(e,0,1),s=ge(s,0,1),e===0)this.r=this.g=this.b=s;else{const a=s<=.5?s*(1+e):s+e-s*e,l=2*s-a;this.r=_c(l,a,t+1/3),this.g=_c(l,a,t),this.b=_c(l,a,t-1/3)}return Se.colorSpaceToWorking(this,r),this}setStyle(t,e=Rn){function s(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let a;const l=r[1],h=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,e);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,e);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,e);if(l===6)return this.setHex(parseInt(a,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Rn){const s=Lu[t.toLowerCase()];return s!==void 0?this.setHex(s,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=di(t.r),this.g=di(t.g),this.b=di(t.b),this}copyLinearToSRGB(t){return this.r=Is(t.r),this.g=Is(t.g),this.b=Is(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rn){return Se.workingToColorSpace(rn.copy(this),t),Math.round(ge(rn.r*255,0,255))*65536+Math.round(ge(rn.g*255,0,255))*256+Math.round(ge(rn.b*255,0,255))}getHexString(t=Rn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.workingToColorSpace(rn.copy(this),e);const s=rn.r,r=rn.g,a=rn.b,l=Math.max(s,r,a),h=Math.min(s,r,a);let u,d;const p=(h+l)/2;if(h===l)u=0,d=0;else{const m=l-h;switch(d=p<=.5?m/(l+h):m/(2-l-h),l){case s:u=(r-a)/m+(r<a?6:0);break;case r:u=(a-s)/m+2;break;case a:u=(s-r)/m+4;break}u/=6}return t.h=u,t.s=d,t.l=p,t}getRGB(t,e=Se.workingColorSpace){return Se.workingToColorSpace(rn.copy(this),e),t.r=rn.r,t.g=rn.g,t.b=rn.b,t}getStyle(t=Rn){Se.workingToColorSpace(rn.copy(this),t);const e=rn.r,s=rn.g,r=rn.b;return t!==Rn?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(s*255)},${Math.round(r*255)})`}offsetHSL(t,e,s){return this.getHSL(Ni),this.setHSL(Ni.h+t,Ni.s+e,Ni.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,s){return this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}lerpHSL(t,e){this.getHSL(Ni),t.getHSL(Uo);const s=Sr(Ni.h,Uo.h,e),r=Sr(Ni.s,Uo.s,e),a=Sr(Ni.l,Uo.l,e);return this.setHSL(s,r,a),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,r=this.b,a=t.elements;return this.r=a[0]*e+a[3]*s+a[6]*r,this.g=a[1]*e+a[4]*s+a[7]*r,this.b=a[2]*e+a[5]*s+a[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const rn=new Ce;Ce.NAMES=Lu;let w0=0;class Cr extends Cs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:w0++}),this.uuid=Ps(),this.name="",this.type="Material",this.blending=Ss,this.side=Ai,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=sl,this.blendDst=rl,this.blendEquation=ts,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ce(0,0,0),this.blendAlpha=0,this.depthFunc=Ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=du,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=As,this.stencilZFail=As,this.stencilZPass=As,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Ss&&(s.blending=this.blending),this.side!==Ai&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==sl&&(s.blendSrc=this.blendSrc),this.blendDst!==rl&&(s.blendDst=this.blendDst),this.blendEquation!==ts&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Ms&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==du&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==As&&(s.stencilFail=this.stencilFail),this.stencilZFail!==As&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==As&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(a){const l=[];for(const h in a){const u=a[h];delete u.metadata,l.push(u)}return l}if(e){const a=r(t.textures),l=r(t.images);a.length>0&&(s.textures=a),l.length>0&&(s.images=l)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let s=null;if(e!==null){const r=e.length;s=new Array(r);for(let a=0;a!==r;++a)s[a]=e[a].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Bi extends Cr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jn,this.combine=eu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Ve=new Q,Oo=new be;let S0=0;class Kn{constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:S0++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=pu,this.updateRanges=[],this.gpuType=ui,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[t+r]=e.array[s+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Oo.fromBufferAttribute(this,e),Oo.applyMatrix3(t),this.setXY(e,Oo.x,Oo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Rs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=on(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Rs(e,this.array)),e}setX(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Rs(e,this.array)),e}setY(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Rs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Rs(e,this.array)),e}setW(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,r){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this}setXYZW(t,e,s,r,a){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array),a=on(a,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this.array[t+3]=a,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==pu&&(t.usage=this.usage),t}}class Iu extends Kn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class Du extends Kn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class wn extends Kn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let M0=0;const Ln=new Oe,vc=new an,Gs=new Q,Sn=new ks,Pr=new ks,Ye=new Q;class $n extends Cs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:M0++}),this.uuid=Ps(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(t){return Array.isArray(t)?this.index=new(vu(t)?Du:Iu)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,s=0){this.groups.push({start:t,count:e,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const a=new ue().getNormalMatrix(t);s.applyNormalMatrix(a),s.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ln.makeRotationFromQuaternion(t),this.applyMatrix4(Ln),this}rotateX(t){return Ln.makeRotationX(t),this.applyMatrix4(Ln),this}rotateY(t){return Ln.makeRotationY(t),this.applyMatrix4(Ln),this}rotateZ(t){return Ln.makeRotationZ(t),this.applyMatrix4(Ln),this}translate(t,e,s){return Ln.makeTranslation(t,e,s),this.applyMatrix4(Ln),this}scale(t,e,s){return Ln.makeScale(t,e,s),this.applyMatrix4(Ln),this}lookAt(t){return vc.lookAt(t),vc.updateMatrix(),this.applyMatrix4(vc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gs).negate(),this.translate(Gs.x,Gs.y,Gs.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const s=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];s.push(l.x,l.y,l.z||0)}this.setAttribute("position",new wn(s,3))}else{const s=Math.min(t.length,e.count);for(let r=0;r<s;r++){const a=t[r];e.setXYZ(r,a.x,a.y,a.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ks);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Q(-1/0,-1/0,-1/0),new Q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let s=0,r=e.length;s<r;s++){const a=e[s];Sn.setFromBufferAttribute(a),this.morphTargetsRelative?(Ye.addVectors(this.boundingBox.min,Sn.min),this.boundingBox.expandByPoint(Ye),Ye.addVectors(this.boundingBox.max,Sn.max),this.boundingBox.expandByPoint(Ye)):(this.boundingBox.expandByPoint(Sn.min),this.boundingBox.expandByPoint(Sn.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 Ro);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Q,1/0);return}if(t){const s=this.boundingSphere.center;if(Sn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];Pr.setFromBufferAttribute(h),this.morphTargetsRelative?(Ye.addVectors(Sn.min,Pr.min),Sn.expandByPoint(Ye),Ye.addVectors(Sn.max,Pr.max),Sn.expandByPoint(Ye)):(Sn.expandByPoint(Pr.min),Sn.expandByPoint(Pr.max))}Sn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Ye.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Ye));if(e)for(let a=0,l=e.length;a<l;a++){const h=e[a],u=this.morphTargetsRelative;for(let d=0,p=h.count;d<p;d++)Ye.fromBufferAttribute(h,d),u&&(Gs.fromBufferAttribute(t,d),Ye.add(Gs)),r=Math.max(r,s.distanceToSquared(Ye))}this.boundingSphere.radius=Math.sqrt(r),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 t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=e.position,r=e.normal,a=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Kn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let V=0;V<s.count;V++)h[V]=new Q,u[V]=new Q;const d=new Q,p=new Q,m=new Q,_=new be,E=new be,S=new be,w=new Q,v=new Q;function g(V,D,P){d.fromBufferAttribute(s,V),p.fromBufferAttribute(s,D),m.fromBufferAttribute(s,P),_.fromBufferAttribute(a,V),E.fromBufferAttribute(a,D),S.fromBufferAttribute(a,P),p.sub(d),m.sub(d),E.sub(_),S.sub(_);const O=1/(E.x*S.y-S.x*E.y);isFinite(O)&&(w.copy(p).multiplyScalar(S.y).addScaledVector(m,-E.y).multiplyScalar(O),v.copy(m).multiplyScalar(E.x).addScaledVector(p,-S.x).multiplyScalar(O),h[V].add(w),h[D].add(w),h[P].add(w),u[V].add(v),u[D].add(v),u[P].add(v))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let V=0,D=I.length;V<D;++V){const P=I[V],O=P.start,et=P.count;for(let z=O,H=O+et;z<H;z+=3)g(t.getX(z+0),t.getX(z+1),t.getX(z+2))}const C=new Q,M=new Q,k=new Q,N=new Q;function B(V){k.fromBufferAttribute(r,V),N.copy(k);const D=h[V];C.copy(D),C.sub(k.multiplyScalar(k.dot(D))).normalize(),M.crossVectors(N,D);const O=M.dot(u[V])<0?-1:1;l.setXYZW(V,C.x,C.y,C.z,O)}for(let V=0,D=I.length;V<D;++V){const P=I[V],O=P.start,et=P.count;for(let z=O,H=O+et;z<H;z+=3)B(t.getX(z+0)),B(t.getX(z+1)),B(t.getX(z+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new Kn(new Float32Array(e.count*3),3),this.setAttribute("normal",s);else for(let _=0,E=s.count;_<E;_++)s.setXYZ(_,0,0,0);const r=new Q,a=new Q,l=new Q,h=new Q,u=new Q,d=new Q,p=new Q,m=new Q;if(t)for(let _=0,E=t.count;_<E;_+=3){const S=t.getX(_+0),w=t.getX(_+1),v=t.getX(_+2);r.fromBufferAttribute(e,S),a.fromBufferAttribute(e,w),l.fromBufferAttribute(e,v),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),h.fromBufferAttribute(s,S),u.fromBufferAttribute(s,w),d.fromBufferAttribute(s,v),h.add(p),u.add(p),d.add(p),s.setXYZ(S,h.x,h.y,h.z),s.setXYZ(w,u.x,u.y,u.z),s.setXYZ(v,d.x,d.y,d.z)}else for(let _=0,E=e.count;_<E;_+=3)r.fromBufferAttribute(e,_+0),a.fromBufferAttribute(e,_+1),l.fromBufferAttribute(e,_+2),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),s.setXYZ(_+0,p.x,p.y,p.z),s.setXYZ(_+1,p.x,p.y,p.z),s.setXYZ(_+2,p.x,p.y,p.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,s=t.count;e<s;e++)Ye.fromBufferAttribute(t,e),Ye.normalize(),t.setXYZ(e,Ye.x,Ye.y,Ye.z)}toNonIndexed(){function t(h,u){const d=h.array,p=h.itemSize,m=h.normalized,_=new d.constructor(u.length*p);let E=0,S=0;for(let w=0,v=u.length;w<v;w++){h.isInterleavedBufferAttribute?E=u[w]*h.data.stride+h.offset:E=u[w]*p;for(let g=0;g<p;g++)_[S++]=d[E++]}return new Kn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new $n,s=this.index.array,r=this.attributes;for(const h in r){const u=r[h],d=t(u,s);e.setAttribute(h,d)}const a=this.morphAttributes;for(const h in a){const u=[],d=a[h];for(let p=0,m=d.length;p<m;p++){const _=d[p],E=t(_,s);u.push(E)}e.morphAttributes[h]=u}e.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,u=l.length;h<u;h++){const d=l[h];e.addGroup(d.start,d.count,d.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const d in u)u[d]!==void 0&&(t[d]=u[d]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const s=this.attributes;for(const u in s){const d=s[u];t.data.attributes[u]=d.toJSON(t.data)}const r={};let a=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],p=[];for(let m=0,_=d.length;m<_;m++){const E=d[m];p.push(E.toJSON(t.data))}p.length>0&&(r[u]=p,a=!0)}a&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(t.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(t.data.boundingSphere=h.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const r=t.attributes;for(const d in r){const p=r[d];this.setAttribute(d,p.clone(e))}const a=t.morphAttributes;for(const d in a){const p=[],m=a[d];for(let _=0,E=m.length;_<E;_++)p.push(m[_].clone(e));this.morphAttributes[d]=p}this.morphTargetsRelative=t.morphTargetsRelative;const l=t.groups;for(let d=0,p=l.length;d<p;d++){const m=l[d];this.addGroup(m.start,m.count,m.materialIndex)}const h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());const u=t.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ku=new Oe,as=new ac,No=new Ro,Uu=new Q,Bo=new Q,Fo=new Q,zo=new Q,yc=new Q,Ho=new Q,Ou=new Q,Vo=new Q;class pn extends an{constructor(t=new $n,e=new Bi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}getVertexPosition(t,e){const s=this.geometry,r=s.attributes.position,a=s.morphAttributes.position,l=s.morphTargetsRelative;e.fromBufferAttribute(r,t);const h=this.morphTargetInfluences;if(a&&h){Ho.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(yc.fromBufferAttribute(m,t),l?Ho.addScaledVector(yc,p):Ho.addScaledVector(yc.sub(e),p))}e.add(Ho)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),No.copy(s.boundingSphere),No.applyMatrix4(a),as.copy(t.ray).recast(t.near),!(No.containsPoint(as.origin)===!1&&(as.intersectSphere(No,Uu)===null||as.origin.distanceToSquared(Uu)>(t.far-t.near)**2))&&(ku.copy(a).invert(),as.copy(t.ray).applyMatrix4(ku),!(s.boundingBox!==null&&as.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,as)))}_computeIntersections(t,e,s){let r;const a=this.geometry,l=this.material,h=a.index,u=a.attributes.position,d=a.attributes.uv,p=a.attributes.uv1,m=a.attributes.normal,_=a.groups,E=a.drawRange;if(h!==null)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let M=I,k=C;M<k;M+=3){const N=h.getX(M),B=h.getX(M+1),V=h.getX(M+2);r=Go(this,g,t,s,d,p,m,N,B,V),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(h.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=h.getX(v),C=h.getX(v+1),M=h.getX(v+2);r=Go(this,l,t,s,d,p,m,I,C,M),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let M=I,k=C;M<k;M+=3){const N=M,B=M+1,V=M+2;r=Go(this,g,t,s,d,p,m,N,B,V),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(u.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=v,C=v+1,M=v+2;r=Go(this,l,t,s,d,p,m,I,C,M),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function T0(n,t,e,s,r,a,l,h){let u;if(t.side===fn?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Ai,h),u===null)return null;Vo.copy(h),Vo.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Vo);return d<e.near||d>e.far?null:{distance:d,point:Vo.clone(),object:n}}function Go(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,Bo),n.getVertexPosition(u,Fo),n.getVertexPosition(d,zo);const p=T0(n,t,e,s,Bo,Fo,zo,Ou);if(p){const m=new Q;Wn.getBarycoord(Ou,Bo,Fo,zo,m),r&&(p.uv=Wn.getInterpolatedAttribute(r,h,u,d,m,new be)),a&&(p.uv1=Wn.getInterpolatedAttribute(a,h,u,d,m,new be)),l&&(p.normal=Wn.getInterpolatedAttribute(l,h,u,d,m,new Q),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new Q,materialIndex:0};Wn.getNormal(Bo,Fo,zo,_.normal),p.face=_,p.barycoord=m}return p}class Rr extends $n{constructor(t=1,e=1,s=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:s,widthSegments:r,heightSegments:a,depthSegments:l};const h=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],d=[],p=[],m=[];let _=0,E=0;S("z","y","x",-1,-1,s,e,t,l,a,0),S("z","y","x",1,-1,s,e,-t,l,a,1),S("x","z","y",1,1,t,s,e,r,l,2),S("x","z","y",1,-1,t,s,-e,r,l,3),S("x","y","z",1,-1,t,e,s,r,a,4),S("x","y","z",-1,-1,t,e,-s,r,a,5),this.setIndex(u),this.setAttribute("position",new wn(d,3)),this.setAttribute("normal",new wn(p,3)),this.setAttribute("uv",new wn(m,2));function S(w,v,g,I,C,M,k,N,B,V,D){const P=M/B,O=k/V,et=M/2,z=k/2,H=N/2,q=B+1,j=V+1;let ct=0,W=0;const St=new Q;for(let at=0;at<j;at++){const Mt=at*O-z;for(let Ot=0;Ot<q;Ot++){const oe=Ot*P-et;St[w]=oe*I,St[v]=Mt*C,St[g]=H,d.push(St.x,St.y,St.z),St[w]=0,St[v]=0,St[g]=N>0?1:-1,p.push(St.x,St.y,St.z),m.push(Ot/B),m.push(1-at/V),ct+=1}}for(let at=0;at<V;at++)for(let Mt=0;Mt<B;Mt++){const Ot=_+Mt+q*at,oe=_+Mt+q*(at+1),Qt=_+(Mt+1)+q*(at+1),tt=_+(Mt+1)+q*at;u.push(Ot,oe,tt),u.push(oe,Qt,tt),W+=6}h.addGroup(E,W,D),E+=W,_+=ct}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ws(n){const t={};for(const e in n){t[e]={};for(const s in n[e]){const r=n[e][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][s]=null):t[e][s]=r.clone():Array.isArray(r)?t[e][s]=r.slice():t[e][s]=r}}return t}function ln(n){const t={};for(let e=0;e<n.length;e++){const s=Ws(n[e]);for(const r in s)t[r]=s[r]}return t}function b0(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function Nu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}const A0={clone:Ws,merge:ln};var C0=`void main() {
14
+ */const il="179",sv=0,jh=1,rv=2,Jh=1,ov=2,li=3,Ai=0,fn=1,ci=2,Ci=0,Ss=1,Kh=2,$h=3,tu=4,av=5,ts=100,lv=101,cv=102,hv=103,uv=104,dv=200,fv=201,pv=202,mv=203,sl=204,rl=205,gv=206,_v=207,vv=208,yv=209,Ev=210,xv=211,wv=212,Sv=213,Mv=214,ol=0,al=1,ll=2,Ms=3,cl=4,hl=5,ul=6,dl=7,eu=0,Tv=1,bv=2,Pi=0,nu=1,Av=2,Cv=3,Pv=4,Rv=5,Lv=6,Iv=7,iu=300,Ts=301,bs=302,fl=303,pl=304,vo=306,ml=1e3,es=1001,gl=1002,Fn=1003,Dv=1004,yo=1005,En=1006,_l=1007,Ri=1008,hi=1009,su=1010,ru=1011,gr=1012,vl=1013,ns=1014,ui=1015,_r=1016,yl=1017,El=1018,vr=1020,ou=35902,au=1021,lu=1022,zn=1023,yr=1026,Er=1027,cu=1028,xl=1029,hu=1030,wl=1031,Sl=1033,Eo=33776,xo=33777,wo=33778,So=33779,Ml=35840,Tl=35841,bl=35842,Al=35843,Cl=36196,Pl=37492,Rl=37496,Ll=37808,Il=37809,Dl=37810,kl=37811,Ul=37812,Ol=37813,Nl=37814,Bl=37815,Fl=37816,zl=37817,Hl=37818,Vl=37819,Gl=37820,Wl=37821,Mo=36492,Zl=36494,Xl=36495,uu=36283,Yl=36284,ql=36285,Ql=36286,kv=3200,Uv=3201,Ov=0,Nv=1,Li="",Rn="srgb",is="srgb-linear",To="linear",Ie="srgb",As=7680,du=519,Bv=512,Fv=513,zv=514,fu=515,Hv=516,Vv=517,Gv=518,Wv=519,pu=35044,mu="300 es",jn=2e3,bo=2001;class Cs{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners;if(s===void 0)return;const r=s[t];if(r!==void 0){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const s=e[t.type];if(s!==void 0){t.target=this;const r=s.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,t);t.target=null}}}const sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let gu=1234567;const xr=Math.PI/180,wr=180/Math.PI;function Ps(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(sn[n&255]+sn[n>>8&255]+sn[n>>16&255]+sn[n>>24&255]+"-"+sn[t&255]+sn[t>>8&255]+"-"+sn[t>>16&15|64]+sn[t>>24&255]+"-"+sn[e&63|128]+sn[e>>8&255]+"-"+sn[e>>16&255]+sn[e>>24&255]+sn[s&255]+sn[s>>8&255]+sn[s>>16&255]+sn[s>>24&255]).toLowerCase()}function ge(n,t,e){return Math.max(t,Math.min(e,n))}function jl(n,t){return(n%t+t)%t}function Zv(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function Xv(n,t,e){return n!==t?(e-n)/(t-n):0}function Sr(n,t,e){return(1-e)*n+e*t}function Yv(n,t,e,s){return Sr(n,t,1-Math.exp(-e*s))}function qv(n,t=1){return t-Math.abs(jl(n,t*2)-t)}function Qv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function jv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function Jv(n,t){return n+Math.floor(Math.random()*(t-n+1))}function Kv(n,t){return n+Math.random()*(t-n)}function $v(n){return n*(.5-Math.random())}function t0(n){n!==void 0&&(gu=n);let t=gu+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function e0(n){return n*xr}function n0(n){return n*wr}function i0(n){return(n&n-1)===0&&n!==0}function s0(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function r0(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function o0(n,t,e,s,r){const a=Math.cos,l=Math.sin,h=a(e/2),u=l(e/2),d=a((t+s)/2),p=l((t+s)/2),m=a((t-s)/2),_=l((t-s)/2),E=a((s-t)/2),S=l((s-t)/2);switch(r){case"XYX":n.set(h*p,u*m,u*_,h*d);break;case"YZY":n.set(u*_,h*p,u*m,h*d);break;case"ZXZ":n.set(u*m,u*_,h*p,h*d);break;case"XZX":n.set(h*p,u*S,u*E,h*d);break;case"YXY":n.set(u*E,h*p,u*S,h*d);break;case"ZYZ":n.set(u*S,u*E,h*p,h*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Rs(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function on(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const we={DEG2RAD:xr,RAD2DEG:wr,generateUUID:Ps,clamp:ge,euclideanModulo:jl,mapLinear:Zv,inverseLerp:Xv,lerp:Sr,damp:Yv,pingpong:qv,smoothstep:Qv,smootherstep:jv,randInt:Jv,randFloat:Kv,randFloatSpread:$v,seededRandom:t0,degToRad:e0,radToDeg:n0,isPowerOfTwo:i0,ceilPowerOfTwo:s0,floorPowerOfTwo:r0,setQuaternionFromProperEuler:o0,normalize:on,denormalize:Rs};class be{constructor(t=0,e=0){be.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6],this.y=r[1]*e+r[4]*s+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(ge(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),r=Math.sin(e),a=this.x-t.x,l=this.y-t.y;return this.x=a*s-l*r+t.x,this.y=a*r+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ss{constructor(t=0,e=0,s=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=r}static slerpFlat(t,e,s,r,a,l,h){let u=s[r+0],d=s[r+1],p=s[r+2],m=s[r+3];const _=a[l+0],E=a[l+1],S=a[l+2],w=a[l+3];if(h===0){t[e+0]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m;return}if(h===1){t[e+0]=_,t[e+1]=E,t[e+2]=S,t[e+3]=w;return}if(m!==w||u!==_||d!==E||p!==S){let v=1-h;const g=u*_+d*E+p*S+m*w,I=g>=0?1:-1,C=1-g*g;if(C>Number.EPSILON){const k=Math.sqrt(C),N=Math.atan2(k,g*I);v=Math.sin(v*N)/k,h=Math.sin(h*N)/k}const M=h*I;if(u=u*v+_*M,d=d*v+E*M,p=p*v+S*M,m=m*v+w*M,v===1-h){const k=1/Math.sqrt(u*u+d*d+p*p+m*m);u*=k,d*=k,p*=k,m*=k}}t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m}static multiplyQuaternionsFlat(t,e,s,r,a,l){const h=s[r],u=s[r+1],d=s[r+2],p=s[r+3],m=a[l],_=a[l+1],E=a[l+2],S=a[l+3];return t[e]=h*S+p*m+u*E-d*_,t[e+1]=u*S+p*_+d*m-h*E,t[e+2]=d*S+p*E+h*_-u*m,t[e+3]=p*S-h*m-u*_-d*E,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,s,r){return this._x=t,this._y=e,this._z=s,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t._x,r=t._y,a=t._z,l=t._order,h=Math.cos,u=Math.sin,d=h(s/2),p=h(r/2),m=h(a/2),_=u(s/2),E=u(r/2),S=u(a/2);switch(l){case"XYZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"YXZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"ZXY":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"ZYX":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"YZX":this._x=_*p*m+d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m-_*E*S;break;case"XZY":this._x=_*p*m-d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m+_*E*S;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,r=Math.sin(s);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],r=e[4],a=e[8],l=e[1],h=e[5],u=e[9],d=e[2],p=e[6],m=e[10],_=s+h+m;if(_>0){const E=.5/Math.sqrt(_+1);this._w=.25/E,this._x=(p-u)*E,this._y=(a-d)*E,this._z=(l-r)*E}else if(s>h&&s>m){const E=2*Math.sqrt(1+s-h-m);this._w=(p-u)/E,this._x=.25*E,this._y=(r+l)/E,this._z=(a+d)/E}else if(h>m){const E=2*Math.sqrt(1+h-s-m);this._w=(a-d)/E,this._x=(r+l)/E,this._y=.25*E,this._z=(u+p)/E}else{const E=2*Math.sqrt(1+m-s-h);this._w=(l-r)/E,this._x=(a+d)/E,this._y=(u+p)/E,this._z=.25*E}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ge(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const r=Math.min(1,e/s);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,r=t._y,a=t._z,l=t._w,h=e._x,u=e._y,d=e._z,p=e._w;return this._x=s*p+l*h+r*d-a*u,this._y=r*p+l*u+a*h-s*d,this._z=a*p+l*d+s*u-r*h,this._w=l*p-s*h-r*u-a*d,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,r=this._y,a=this._z,l=this._w;let h=l*t._w+s*t._x+r*t._y+a*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=l,this._x=s,this._y=r,this._z=a,this;const u=1-h*h;if(u<=Number.EPSILON){const E=1-e;return this._w=E*l+e*this._w,this._x=E*s+e*this._x,this._y=E*r+e*this._y,this._z=E*a+e*this._z,this.normalize(),this}const d=Math.sqrt(u),p=Math.atan2(d,h),m=Math.sin((1-e)*p)/d,_=Math.sin(e*p)/d;return this._w=l*m+this._w*_,this._x=s*m+this._x*_,this._y=r*m+this._y*_,this._z=a*m+this._z*_,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),r=Math.sqrt(1-s),a=Math.sqrt(s);return this.set(r*Math.sin(t),r*Math.cos(t),a*Math.sin(e),a*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Q{constructor(t=0,e=0,s=0){Q.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(_u.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_u.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[3]*s+a[6]*r,this.y=a[1]*e+a[4]*s+a[7]*r,this.z=a[2]*e+a[5]*s+a[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=t.elements,l=1/(a[3]*e+a[7]*s+a[11]*r+a[15]);return this.x=(a[0]*e+a[4]*s+a[8]*r+a[12])*l,this.y=(a[1]*e+a[5]*s+a[9]*r+a[13])*l,this.z=(a[2]*e+a[6]*s+a[10]*r+a[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,r=this.z,a=t.x,l=t.y,h=t.z,u=t.w,d=2*(l*r-h*s),p=2*(h*e-a*r),m=2*(a*s-l*e);return this.x=e+u*d+l*m-h*p,this.y=s+u*p+h*d-a*m,this.z=r+u*m+a*p-l*d,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[4]*s+a[8]*r,this.y=a[1]*e+a[5]*s+a[9]*r,this.z=a[2]*e+a[6]*s+a[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this.z=ge(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this.z=ge(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,r=t.y,a=t.z,l=e.x,h=e.y,u=e.z;return this.x=r*u-a*h,this.y=a*l-s*u,this.z=s*h-r*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return Jl.copy(this).projectOnVector(t),this.sub(Jl)}reflect(t){return this.sub(Jl.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(ge(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return e*e+s*s+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,s){const r=Math.sin(e)*t;return this.x=r*Math.sin(s),this.y=Math.cos(e)*t,this.z=r*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jl=new Q,_u=new ss;class ue{constructor(t,e,s,r,a,l,h,u,d){ue.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d)}set(t,e,s,r,a,l,h,u,d){const p=this.elements;return p[0]=t,p[1]=r,p[2]=h,p[3]=e,p[4]=a,p[5]=u,p[6]=s,p[7]=l,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],this}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[3],u=s[6],d=s[1],p=s[4],m=s[7],_=s[2],E=s[5],S=s[8],w=r[0],v=r[3],g=r[6],I=r[1],C=r[4],M=r[7],k=r[2],N=r[5],B=r[8];return a[0]=l*w+h*I+u*k,a[3]=l*v+h*C+u*N,a[6]=l*g+h*M+u*B,a[1]=d*w+p*I+m*k,a[4]=d*v+p*C+m*N,a[7]=d*g+p*M+m*B,a[2]=_*w+E*I+S*k,a[5]=_*v+E*C+S*N,a[8]=_*g+E*M+S*B,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8];return e*l*p-e*h*d-s*a*p+s*h*u+r*a*d-r*l*u}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=p*l-h*d,_=h*u-p*a,E=d*a-l*u,S=e*m+s*_+r*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/S;return t[0]=m*w,t[1]=(r*d-p*s)*w,t[2]=(h*s-r*l)*w,t[3]=_*w,t[4]=(p*e-r*u)*w,t[5]=(r*a-h*e)*w,t[6]=E*w,t[7]=(s*u-d*e)*w,t[8]=(l*e-s*a)*w,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,r,a,l,h){const u=Math.cos(a),d=Math.sin(a);return this.set(s*u,s*d,-s*(u*l+d*h)+l+t,-r*d,r*u,-r*(-d*l+u*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(Kl.makeScale(t,e)),this}rotate(t){return this.premultiply(Kl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kl.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<9;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<9;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Kl=new ue;function vu(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Mr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function a0(){const n=Mr("canvas");return n.style.display="block",n}const yu={};function Ls(n){n in yu||(yu[n]=!0,console.warn(n))}function l0(n,t,e){return new Promise(function(s,r){function a(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,e);break;default:s()}}setTimeout(a,e)})}const Eu=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xu=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function c0(){const n={enabled:!0,workingColorSpace:is,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ie&&(r.r=di(r.r),r.g=di(r.g),r.b=di(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ie&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Li?To:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],s=[.3127,.329];return n.define({[is]:{primaries:t,whitePoint:s,transfer:To,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Rn},outputColorSpaceConfig:{drawingBufferColorSpace:Rn}},[Rn]:{primaries:t,whitePoint:s,transfer:Ie,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Rn}}}),n}const Se=c0();function di(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Is(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ds;class h0{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Ds===void 0&&(Ds=Mr("canvas")),Ds.width=t.width,Ds.height=t.height;const r=Ds.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ds}return s.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Mr("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const r=s.getImageData(0,0,t.width,t.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=di(a[l]/255)*255;return s.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let s=0;s<e.length;s++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[s]=Math.floor(di(e[s]/255)*255):e[s]=di(e[s]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let u0=0;class $l{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:u0++}),this.uuid=Ps(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let l=0,h=r.length;l<h;l++)r[l].isDataTexture?a.push(tc(r[l].image)):a.push(tc(r[l]))}else a=tc(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function tc(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?h0.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let d0=0;const ec=new Q;class Je extends Cs{constructor(t=Je.DEFAULT_IMAGE,e=Je.DEFAULT_MAPPING,s=es,r=es,a=En,l=Ri,h=zn,u=hi,d=Je.DEFAULT_ANISOTROPY,p=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:d0++}),this.uuid=Ps(),this.name="",this.source=new $l(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=s,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=d,this.format=h,this.internalFormat=null,this.type=u,this.offset=new be(0,0),this.repeat=new be(1,1),this.center=new be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ue,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ec).x}get height(){return this.source.getSize(ec).y}get depth(){return this.source.getSize(ec).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&s&&r.isVector2&&s.isVector2||r&&s&&r.isVector3&&s.isVector3||r&&s&&r.isMatrix3&&s.isMatrix3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),e||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==iu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ml:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case gl:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ml:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case gl:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Je.DEFAULT_IMAGE=null,Je.DEFAULT_MAPPING=iu,Je.DEFAULT_ANISOTROPY=1;class He{constructor(t=0,e=0,s=0,r=1){He.prototype.isVector4=!0,this.x=t,this.y=e,this.z=s,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,s,r){return this.x=t,this.y=e,this.z=s,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=this.w,l=t.elements;return this.x=l[0]*e+l[4]*s+l[8]*r+l[12]*a,this.y=l[1]*e+l[5]*s+l[9]*r+l[13]*a,this.z=l[2]*e+l[6]*s+l[10]*r+l[14]*a,this.w=l[3]*e+l[7]*s+l[11]*r+l[15]*a,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,s,r,a;const u=t.elements,d=u[0],p=u[4],m=u[8],_=u[1],E=u[5],S=u[9],w=u[2],v=u[6],g=u[10];if(Math.abs(p-_)<.01&&Math.abs(m-w)<.01&&Math.abs(S-v)<.01){if(Math.abs(p+_)<.1&&Math.abs(m+w)<.1&&Math.abs(S+v)<.1&&Math.abs(d+E+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const C=(d+1)/2,M=(E+1)/2,k=(g+1)/2,N=(p+_)/4,B=(m+w)/4,V=(S+v)/4;return C>M&&C>k?C<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(C),r=N/s,a=B/s):M>k?M<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(M),s=N/r,a=V/r):k<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(k),s=B/a,r=V/a),this.set(s,r,a,e),this}let I=Math.sqrt((v-S)*(v-S)+(m-w)*(m-w)+(_-p)*(_-p));return Math.abs(I)<.001&&(I=1),this.x=(v-S)/I,this.y=(m-w)/I,this.z=(_-p)/I,this.w=Math.acos((d+E+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=ge(this.x,t.x,e.x),this.y=ge(this.y,t.y,e.y),this.z=ge(this.z,t.z,e.z),this.w=ge(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=ge(this.x,t,e),this.y=ge(this.y,t,e),this.z=ge(this.z,t,e),this.w=ge(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ge(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class f0 extends Cs{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:En,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=s.depth,this.scissor=new He(0,0,t,e),this.scissorTest=!1,this.viewport=new He(0,0,t,e);const r={width:t,height:e,depth:s.depth},a=new Je(r);this.textures=[];const l=s.count;for(let h=0;h<l;h++)this.textures[h]=a.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const e={minFilter:En,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,s=1){if(this.width!==t||this.height!==e||this.depth!==s){this.width=t,this.height=e,this.depth=s;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=s,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,s=t.textures.length;e<s;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const r=Object.assign({},t.textures[e].image);this.textures[e].source=new $l(r)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ii extends f0{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class wu extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class p0 extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ks{constructor(t=new Q(1/0,1/0,1/0),e=new Q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e+=3)this.expandByPoint(Hn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Hn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const s=Hn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const a=s.getAttribute("position");if(e===!0&&a!==void 0&&t.isInstancedMesh!==!0)for(let l=0,h=a.count;l<h;l++)t.isMesh===!0?t.getVertexPosition(l,Hn):Hn.fromBufferAttribute(a,l),Hn.applyMatrix4(t.matrixWorld),this.expandByPoint(Hn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ao.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ao.copy(s.boundingBox)),Ao.applyMatrix4(t.matrixWorld),this.union(Ao)}const r=t.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,s;return t.normal.x>0?(e=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),e<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tr),Co.subVectors(this.max,Tr),Us.subVectors(t.a,Tr),Os.subVectors(t.b,Tr),Ns.subVectors(t.c,Tr),Di.subVectors(Os,Us),ki.subVectors(Ns,Os),rs.subVectors(Us,Ns);let e=[0,-Di.z,Di.y,0,-ki.z,ki.y,0,-rs.z,rs.y,Di.z,0,-Di.x,ki.z,0,-ki.x,rs.z,0,-rs.x,-Di.y,Di.x,0,-ki.y,ki.x,0,-rs.y,rs.x,0];return!nc(e,Us,Os,Ns,Co)||(e=[1,0,0,0,1,0,0,0,1],!nc(e,Us,Os,Ns,Co))?!1:(Po.crossVectors(Di,ki),e=[Po.x,Po.y,Po.z],nc(e,Us,Os,Ns,Co))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const fi=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],Hn=new Q,Ao=new ks,Us=new Q,Os=new Q,Ns=new Q,Di=new Q,ki=new Q,rs=new Q,Tr=new Q,Co=new Q,Po=new Q,os=new Q;function nc(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){os.fromArray(n,a);const h=r.x*Math.abs(os.x)+r.y*Math.abs(os.y)+r.z*Math.abs(os.z),u=t.dot(os),d=e.dot(os),p=s.dot(os);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const m0=new ks,br=new Q,ic=new Q;class Ro{constructor(t=new Q,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const s=this.center;e!==void 0?s.copy(e):m0.setFromPoints(t).getCenter(s);let r=0;for(let a=0,l=t.length;a<l;a++)r=Math.max(r,s.distanceToSquared(t[a]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const s=this.center.distanceToSquared(t);return e.copy(t),s>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;br.subVectors(t,this.center);const e=br.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(br,r/s),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ic.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(br.copy(t.center).add(ic)),this.expandByPoint(br.copy(t.center).sub(ic))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const pi=new Q,sc=new Q,Lo=new Q,Ui=new Q,rc=new Q,Io=new Q,oc=new Q;class ac{constructor(t=new Q,e=new Q(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,pi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const s=e.dot(this.direction);return s<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=pi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(pi.copy(this.origin).addScaledVector(this.direction,e),pi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){sc.copy(t).add(e).multiplyScalar(.5),Lo.copy(e).sub(t).normalize(),Ui.copy(this.origin).sub(sc);const a=t.distanceTo(e)*.5,l=-this.direction.dot(Lo),h=Ui.dot(this.direction),u=-Ui.dot(Lo),d=Ui.lengthSq(),p=Math.abs(1-l*l);let m,_,E,S;if(p>0)if(m=l*u-h,_=l*h-u,S=a*p,m>=0)if(_>=-S)if(_<=S){const w=1/p;m*=w,_*=w,E=m*(m+l*_+2*h)+_*(l*m+_+2*u)+d}else _=a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _=-a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _<=-S?(m=Math.max(0,-(-l*a+h)),_=m>0?-a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d):_<=S?(m=0,_=Math.min(Math.max(-a,-u),a),E=_*(_+2*u)+d):(m=Math.max(0,-(l*a+h)),_=m>0?a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d);else _=l>0?-a:a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(sc).addScaledVector(Lo,_),E}intersectSphere(t,e){pi.subVectors(t.center,this.origin);const s=pi.dot(this.direction),r=pi.dot(pi)-s*s,a=t.radius*t.radius;if(r>a)return null;const l=Math.sqrt(a-r),h=s-l,u=s+l;return u<0?null:h<0?this.at(u,e):this.at(h,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/e;return s>=0?s:null}intersectPlane(t,e){const s=this.distanceToPlane(t);return s===null?null:this.at(s,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let s,r,a,l,h,u;const d=1/this.direction.x,p=1/this.direction.y,m=1/this.direction.z,_=this.origin;return d>=0?(s=(t.min.x-_.x)*d,r=(t.max.x-_.x)*d):(s=(t.max.x-_.x)*d,r=(t.min.x-_.x)*d),p>=0?(a=(t.min.y-_.y)*p,l=(t.max.y-_.y)*p):(a=(t.max.y-_.y)*p,l=(t.min.y-_.y)*p),s>l||a>r||((a>s||isNaN(s))&&(s=a),(l<r||isNaN(r))&&(r=l),m>=0?(h=(t.min.z-_.z)*m,u=(t.max.z-_.z)*m):(h=(t.max.z-_.z)*m,u=(t.min.z-_.z)*m),s>u||h>r)||((h>s||s!==s)&&(s=h),(u<r||r!==r)&&(r=u),r<0)?null:this.at(s>=0?s:r,e)}intersectsBox(t){return this.intersectBox(t,pi)!==null}intersectTriangle(t,e,s,r,a){rc.subVectors(e,t),Io.subVectors(s,t),oc.crossVectors(rc,Io);let l=this.direction.dot(oc),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Ui.subVectors(this.origin,t);const u=h*this.direction.dot(Io.crossVectors(Ui,Io));if(u<0)return null;const d=h*this.direction.dot(rc.cross(Ui));if(d<0||u+d>l)return null;const p=-h*Ui.dot(oc);return p<0?null:this.at(p/l,a)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Oe{constructor(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){Oe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v)}set(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){const g=this.elements;return g[0]=t,g[4]=e,g[8]=s,g[12]=r,g[1]=a,g[5]=l,g[9]=h,g[13]=u,g[2]=d,g[6]=p,g[10]=m,g[14]=_,g[3]=E,g[7]=S,g[11]=w,g[15]=v,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 Oe().fromArray(this.elements)}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],e[9]=s[9],e[10]=s[10],e[11]=s[11],e[12]=s[12],e[13]=s[13],e[14]=s[14],e[15]=s[15],this}copyPosition(t){const e=this.elements,s=t.elements;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,s=t.elements,r=1/Bs.setFromMatrixColumn(t,0).length(),a=1/Bs.setFromMatrixColumn(t,1).length(),l=1/Bs.setFromMatrixColumn(t,2).length();return e[0]=s[0]*r,e[1]=s[1]*r,e[2]=s[2]*r,e[3]=0,e[4]=s[4]*a,e[5]=s[5]*a,e[6]=s[6]*a,e[7]=0,e[8]=s[8]*l,e[9]=s[9]*l,e[10]=s[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,s=t.x,r=t.y,a=t.z,l=Math.cos(s),h=Math.sin(s),u=Math.cos(r),d=Math.sin(r),p=Math.cos(a),m=Math.sin(a);if(t.order==="XYZ"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=-u*m,e[8]=d,e[1]=E+S*d,e[5]=_-w*d,e[9]=-h*u,e[2]=w-_*d,e[6]=S+E*d,e[10]=l*u}else if(t.order==="YXZ"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_+w*h,e[4]=S*h-E,e[8]=l*d,e[1]=l*m,e[5]=l*p,e[9]=-h,e[2]=E*h-S,e[6]=w+_*h,e[10]=l*u}else if(t.order==="ZXY"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_-w*h,e[4]=-l*m,e[8]=S+E*h,e[1]=E+S*h,e[5]=l*p,e[9]=w-_*h,e[2]=-l*d,e[6]=h,e[10]=l*u}else if(t.order==="ZYX"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=S*d-E,e[8]=_*d+w,e[1]=u*m,e[5]=w*d+_,e[9]=E*d-S,e[2]=-d,e[6]=h*u,e[10]=l*u}else if(t.order==="YZX"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=w-_*m,e[8]=S*m+E,e[1]=m,e[5]=l*p,e[9]=-h*p,e[2]=-d*p,e[6]=E*m+S,e[10]=_-w*m}else if(t.order==="XZY"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=-m,e[8]=d*p,e[1]=_*m+w,e[5]=l*p,e[9]=E*m-S,e[2]=S*m-E,e[6]=h*p,e[10]=w*m+_}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(g0,t,_0)}lookAt(t,e,s){const r=this.elements;return xn.subVectors(t,e),xn.lengthSq()===0&&(xn.z=1),xn.normalize(),Oi.crossVectors(s,xn),Oi.lengthSq()===0&&(Math.abs(s.z)===1?xn.x+=1e-4:xn.z+=1e-4,xn.normalize(),Oi.crossVectors(s,xn)),Oi.normalize(),Do.crossVectors(xn,Oi),r[0]=Oi.x,r[4]=Do.x,r[8]=xn.x,r[1]=Oi.y,r[5]=Do.y,r[9]=xn.y,r[2]=Oi.z,r[6]=Do.z,r[10]=xn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[4],u=s[8],d=s[12],p=s[1],m=s[5],_=s[9],E=s[13],S=s[2],w=s[6],v=s[10],g=s[14],I=s[3],C=s[7],M=s[11],k=s[15],N=r[0],B=r[4],V=r[8],R=r[12],D=r[1],U=r[5],tt=r[9],F=r[13],H=r[2],q=r[6],j=r[10],ct=r[14],W=r[3],Et=r[7],lt=r[11],Mt=r[15];return a[0]=l*N+h*D+u*H+d*W,a[4]=l*B+h*U+u*q+d*Et,a[8]=l*V+h*tt+u*j+d*lt,a[12]=l*R+h*F+u*ct+d*Mt,a[1]=p*N+m*D+_*H+E*W,a[5]=p*B+m*U+_*q+E*Et,a[9]=p*V+m*tt+_*j+E*lt,a[13]=p*R+m*F+_*ct+E*Mt,a[2]=S*N+w*D+v*H+g*W,a[6]=S*B+w*U+v*q+g*Et,a[10]=S*V+w*tt+v*j+g*lt,a[14]=S*R+w*F+v*ct+g*Mt,a[3]=I*N+C*D+M*H+k*W,a[7]=I*B+C*U+M*q+k*Et,a[11]=I*V+C*tt+M*j+k*lt,a[15]=I*R+C*F+M*ct+k*Mt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],s=t[4],r=t[8],a=t[12],l=t[1],h=t[5],u=t[9],d=t[13],p=t[2],m=t[6],_=t[10],E=t[14],S=t[3],w=t[7],v=t[11],g=t[15];return S*(+a*u*m-r*d*m-a*h*_+s*d*_+r*h*E-s*u*E)+w*(+e*u*E-e*d*_+a*l*_-r*l*E+r*d*p-a*u*p)+v*(+e*d*m-e*h*E-a*l*m+s*l*E+a*h*p-s*d*p)+g*(-r*h*p-e*u*m+e*h*_+r*l*m-s*l*_+s*u*p)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=s),this}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=t[9],_=t[10],E=t[11],S=t[12],w=t[13],v=t[14],g=t[15],I=m*v*d-w*_*d+w*u*E-h*v*E-m*u*g+h*_*g,C=S*_*d-p*v*d-S*u*E+l*v*E+p*u*g-l*_*g,M=p*w*d-S*m*d+S*h*E-l*w*E-p*h*g+l*m*g,k=S*m*u-p*w*u-S*h*_+l*w*_+p*h*v-l*m*v,N=e*I+s*C+r*M+a*k;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/N;return t[0]=I*B,t[1]=(w*_*a-m*v*a-w*r*E+s*v*E+m*r*g-s*_*g)*B,t[2]=(h*v*a-w*u*a+w*r*d-s*v*d-h*r*g+s*u*g)*B,t[3]=(m*u*a-h*_*a-m*r*d+s*_*d+h*r*E-s*u*E)*B,t[4]=C*B,t[5]=(p*v*a-S*_*a+S*r*E-e*v*E-p*r*g+e*_*g)*B,t[6]=(S*u*a-l*v*a-S*r*d+e*v*d+l*r*g-e*u*g)*B,t[7]=(l*_*a-p*u*a+p*r*d-e*_*d-l*r*E+e*u*E)*B,t[8]=M*B,t[9]=(S*m*a-p*w*a-S*s*E+e*w*E+p*s*g-e*m*g)*B,t[10]=(l*w*a-S*h*a+S*s*d-e*w*d-l*s*g+e*h*g)*B,t[11]=(p*h*a-l*m*a-p*s*d+e*m*d+l*s*E-e*h*E)*B,t[12]=k*B,t[13]=(p*w*r-S*m*r+S*s*_-e*w*_-p*s*v+e*m*v)*B,t[14]=(S*h*r-l*w*r-S*s*u+e*w*u+l*s*v-e*h*v)*B,t[15]=(l*m*r-p*h*r+p*s*u-e*m*u-l*s*_+e*h*_)*B,this}scale(t){const e=this.elements,s=t.x,r=t.y,a=t.z;return e[0]*=s,e[4]*=r,e[8]*=a,e[1]*=s,e[5]*=r,e[9]*=a,e[2]*=s,e[6]*=r,e[10]*=a,e[3]*=s,e[7]*=r,e[11]*=a,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,r))}makeTranslation(t,e,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),r=Math.sin(e),a=1-s,l=t.x,h=t.y,u=t.z,d=a*l,p=a*h;return this.set(d*l+s,d*h-r*u,d*u+r*h,0,d*h+r*u,p*h+s,p*u-r*l,0,d*u-r*h,p*u+r*l,a*u*u+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,r,a,l){return this.set(1,s,a,0,t,1,l,0,e,r,1,0,0,0,0,1),this}compose(t,e,s){const r=this.elements,a=e._x,l=e._y,h=e._z,u=e._w,d=a+a,p=l+l,m=h+h,_=a*d,E=a*p,S=a*m,w=l*p,v=l*m,g=h*m,I=u*d,C=u*p,M=u*m,k=s.x,N=s.y,B=s.z;return r[0]=(1-(w+g))*k,r[1]=(E+M)*k,r[2]=(S-C)*k,r[3]=0,r[4]=(E-M)*N,r[5]=(1-(_+g))*N,r[6]=(v+I)*N,r[7]=0,r[8]=(S+C)*B,r[9]=(v-I)*B,r[10]=(1-(_+w))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,s){const r=this.elements;let a=Bs.set(r[0],r[1],r[2]).length();const l=Bs.set(r[4],r[5],r[6]).length(),h=Bs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),t.x=r[12],t.y=r[13],t.z=r[14],Vn.copy(this);const d=1/a,p=1/l,m=1/h;return Vn.elements[0]*=d,Vn.elements[1]*=d,Vn.elements[2]*=d,Vn.elements[4]*=p,Vn.elements[5]*=p,Vn.elements[6]*=p,Vn.elements[8]*=m,Vn.elements[9]*=m,Vn.elements[10]*=m,e.setFromRotationMatrix(Vn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2*a/(e-t),m=2*a/(s-r),_=(e+t)/(e-t),E=(s+r)/(s-r);let S,w;if(u)S=a/(l-a),w=l*a/(l-a);else if(h===jn)S=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(h===bo)S=-l/(l-a),w=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=_,d[12]=0,d[1]=0,d[5]=m,d[9]=E,d[13]=0,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2/(e-t),m=2/(s-r),_=-(e+t)/(e-t),E=-(s+r)/(s-r);let S,w;if(u)S=1/(l-a),w=l/(l-a);else if(h===jn)S=-2/(l-a),w=-(l+a)/(l-a);else if(h===bo)S=-1/(l-a),w=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=0,d[12]=_,d[1]=0,d[5]=m,d[9]=0,d[13]=E,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<16;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<16;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}}const Bs=new Q,Vn=new Oe,g0=new Q(0,0,0),_0=new Q(1,1,1),Oi=new Q,Do=new Q,xn=new Q,Su=new Oe,Mu=new ss;class Jn{constructor(t=0,e=0,s=0,r=Jn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=s,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,s,r=this._order){return this._x=t,this._y=e,this._z=s,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,s=!0){const r=t.elements,a=r[0],l=r[4],h=r[8],u=r[1],d=r[5],p=r[9],m=r[2],_=r[6],E=r[10];switch(e){case"XYZ":this._y=Math.asin(ge(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,E),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(_,d),this._z=0);break;case"YXZ":this._x=Math.asin(-ge(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(h,E),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(ge(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-m,E),this._z=Math.atan2(-l,d)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-ge(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(_,E),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,d));break;case"YZX":this._z=Math.asin(ge(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(h,E));break;case"XZY":this._z=Math.asin(-ge(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(_,d),this._y=Math.atan2(h,a)):(this._x=Math.atan2(-p,E),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,s){return Su.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Su,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mu.setFromEuler(this),this.setFromQuaternion(Mu,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Jn.DEFAULT_ORDER="XYZ";class lc{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let v0=0;const Tu=new Q,Fs=new ss,mi=new Oe,ko=new Q,Ar=new Q,y0=new Q,E0=new ss,bu=new Q(1,0,0),Au=new Q(0,1,0),Cu=new Q(0,0,1),Pu={type:"added"},x0={type:"removed"},zs={type:"childadded",child:null},cc={type:"childremoved",child:null};class an extends Cs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:v0++}),this.uuid=Ps(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=an.DEFAULT_UP.clone();const t=new Q,e=new Jn,s=new ss,r=new Q(1,1,1);function a(){s.setFromEuler(e,!1)}function l(){e.setFromQuaternion(s,void 0,!1)}e._onChange(a),s._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Oe},normalMatrix:{value:new ue}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=an.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new lc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.premultiply(Fs),this}rotateX(t){return this.rotateOnAxis(bu,t)}rotateY(t){return this.rotateOnAxis(Au,t)}rotateZ(t){return this.rotateOnAxis(Cu,t)}translateOnAxis(t,e){return Tu.copy(t).applyQuaternion(this.quaternion),this.position.add(Tu.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bu,t)}translateY(t){return this.translateOnAxis(Au,t)}translateZ(t){return this.translateOnAxis(Cu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(mi.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?ko.copy(t):ko.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),Ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?mi.lookAt(Ar,ko,this.up):mi.lookAt(ko,Ar,this.up),this.quaternion.setFromRotationMatrix(mi),r&&(mi.extractRotation(r.matrixWorld),Fs.setFromRotationMatrix(mi),this.quaternion.premultiply(Fs.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(x0),cc.child=t,this.dispatchEvent(cc),cc.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),mi.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),mi.multiply(t.parent.matrixWorld)),t.applyMatrix4(mi),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let s=0,r=this.children.length;s<r;s++){const l=this.children[s].getObjectByProperty(t,e);if(l!==void 0)return l}}getObjectsByProperty(t,e,s=[]){this[t]===e&&s.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(t,e,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,t,y0),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,E0,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].updateMatrixWorld(t)}updateWorldMatrix(t,e){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",s={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(h=>({...h})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(h,u){return h[u.uuid]===void 0&&(h[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(t.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const u=h.shapes;if(Array.isArray(u))for(let d=0,p=u.length;d<p;d++){const m=u[d];a(t.shapes,m)}else a(t.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let u=0,d=this.material.length;u<d;u++)h.push(a(t.materials,this.material[u]));r.material=h}else r.material=a(t.materials,this.material);if(this.children.length>0){r.children=[];for(let h=0;h<this.children.length;h++)r.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let h=0;h<this.animations.length;h++){const u=this.animations[h];r.animations.push(a(t.animations,u))}}if(e){const h=l(t.geometries),u=l(t.materials),d=l(t.textures),p=l(t.images),m=l(t.shapes),_=l(t.skeletons),E=l(t.animations),S=l(t.nodes);h.length>0&&(s.geometries=h),u.length>0&&(s.materials=u),d.length>0&&(s.textures=d),p.length>0&&(s.images=p),m.length>0&&(s.shapes=m),_.length>0&&(s.skeletons=_),E.length>0&&(s.animations=E),S.length>0&&(s.nodes=S)}return s.object=r,s;function l(h){const u=[];for(const d in h){const p=h[d];delete p.metadata,u.push(p)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let s=0;s<t.children.length;s++){const r=t.children[s];this.add(r.clone())}return this}}an.DEFAULT_UP=new Q(0,1,0),an.DEFAULT_MATRIX_AUTO_UPDATE=!0,an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Gn=new Q,gi=new Q,hc=new Q,_i=new Q,Hs=new Q,Vs=new Q,Ru=new Q,uc=new Q,dc=new Q,fc=new Q,pc=new He,mc=new He,gc=new He;class Wn{constructor(t=new Q,e=new Q,s=new Q){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Gn.subVectors(t,e),r.cross(Gn);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(t,e,s,r,a){Gn.subVectors(r,e),gi.subVectors(s,e),hc.subVectors(t,e);const l=Gn.dot(Gn),h=Gn.dot(gi),u=Gn.dot(hc),d=gi.dot(gi),p=gi.dot(hc),m=l*d-h*h;if(m===0)return a.set(0,0,0),null;const _=1/m,E=(d*u-h*p)*_,S=(l*p-h*u)*_;return a.set(1-E-S,S,E)}static containsPoint(t,e,s,r){return this.getBarycoord(t,e,s,r,_i)===null?!1:_i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,_i)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,_i.x),u.addScaledVector(l,_i.y),u.addScaledVector(h,_i.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return pc.setScalar(0),mc.setScalar(0),gc.setScalar(0),pc.fromBufferAttribute(t,e),mc.fromBufferAttribute(t,s),gc.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(pc,a.x),l.addScaledVector(mc,a.y),l.addScaledVector(gc,a.z),l}static isFrontFacing(t,e,s,r){return Gn.subVectors(s,e),gi.subVectors(t,e),Gn.cross(gi).dot(r)<0}set(t,e,s){return this.a.copy(t),this.b.copy(e),this.c.copy(s),this}setFromPointsAndIndices(t,e,s,r){return this.a.copy(t[e]),this.b.copy(t[s]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,s,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Gn.subVectors(this.c,this.b),gi.subVectors(this.a,this.b),Gn.cross(gi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Wn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Wn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return Wn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return Wn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Wn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const s=this.a,r=this.b,a=this.c;let l,h;Hs.subVectors(r,s),Vs.subVectors(a,s),uc.subVectors(t,s);const u=Hs.dot(uc),d=Vs.dot(uc);if(u<=0&&d<=0)return e.copy(s);dc.subVectors(t,r);const p=Hs.dot(dc),m=Vs.dot(dc);if(p>=0&&m<=p)return e.copy(r);const _=u*m-p*d;if(_<=0&&u>=0&&p<=0)return l=u/(u-p),e.copy(s).addScaledVector(Hs,l);fc.subVectors(t,a);const E=Hs.dot(fc),S=Vs.dot(fc);if(S>=0&&E<=S)return e.copy(a);const w=E*d-u*S;if(w<=0&&d>=0&&S<=0)return h=d/(d-S),e.copy(s).addScaledVector(Vs,h);const v=p*S-E*m;if(v<=0&&m-p>=0&&E-S>=0)return Ru.subVectors(a,r),h=(m-p)/(m-p+(E-S)),e.copy(r).addScaledVector(Ru,h);const g=1/(v+w+_);return l=w*g,h=_*g,e.copy(s).addScaledVector(Hs,l).addScaledVector(Vs,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Lu={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},Ni={h:0,s:0,l:0},Uo={h:0,s:0,l:0};function _c(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Ce{constructor(t,e,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,s)}set(t,e,s){if(e===void 0&&s===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=Se.workingColorSpace){return this.r=t,this.g=e,this.b=s,Se.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=Se.workingColorSpace){if(t=jl(t,1),e=ge(e,0,1),s=ge(s,0,1),e===0)this.r=this.g=this.b=s;else{const a=s<=.5?s*(1+e):s+e-s*e,l=2*s-a;this.r=_c(l,a,t+1/3),this.g=_c(l,a,t),this.b=_c(l,a,t-1/3)}return Se.colorSpaceToWorking(this,r),this}setStyle(t,e=Rn){function s(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let a;const l=r[1],h=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,e);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,e);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,e);if(l===6)return this.setHex(parseInt(a,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Rn){const s=Lu[t.toLowerCase()];return s!==void 0?this.setHex(s,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=di(t.r),this.g=di(t.g),this.b=di(t.b),this}copyLinearToSRGB(t){return this.r=Is(t.r),this.g=Is(t.g),this.b=Is(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rn){return Se.workingToColorSpace(rn.copy(this),t),Math.round(ge(rn.r*255,0,255))*65536+Math.round(ge(rn.g*255,0,255))*256+Math.round(ge(rn.b*255,0,255))}getHexString(t=Rn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.workingToColorSpace(rn.copy(this),e);const s=rn.r,r=rn.g,a=rn.b,l=Math.max(s,r,a),h=Math.min(s,r,a);let u,d;const p=(h+l)/2;if(h===l)u=0,d=0;else{const m=l-h;switch(d=p<=.5?m/(l+h):m/(2-l-h),l){case s:u=(r-a)/m+(r<a?6:0);break;case r:u=(a-s)/m+2;break;case a:u=(s-r)/m+4;break}u/=6}return t.h=u,t.s=d,t.l=p,t}getRGB(t,e=Se.workingColorSpace){return Se.workingToColorSpace(rn.copy(this),e),t.r=rn.r,t.g=rn.g,t.b=rn.b,t}getStyle(t=Rn){Se.workingToColorSpace(rn.copy(this),t);const e=rn.r,s=rn.g,r=rn.b;return t!==Rn?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(s*255)},${Math.round(r*255)})`}offsetHSL(t,e,s){return this.getHSL(Ni),this.setHSL(Ni.h+t,Ni.s+e,Ni.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,s){return this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}lerpHSL(t,e){this.getHSL(Ni),t.getHSL(Uo);const s=Sr(Ni.h,Uo.h,e),r=Sr(Ni.s,Uo.s,e),a=Sr(Ni.l,Uo.l,e);return this.setHSL(s,r,a),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,r=this.b,a=t.elements;return this.r=a[0]*e+a[3]*s+a[6]*r,this.g=a[1]*e+a[4]*s+a[7]*r,this.b=a[2]*e+a[5]*s+a[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const rn=new Ce;Ce.NAMES=Lu;let w0=0;class Cr extends Cs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:w0++}),this.uuid=Ps(),this.name="",this.type="Material",this.blending=Ss,this.side=Ai,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=sl,this.blendDst=rl,this.blendEquation=ts,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ce(0,0,0),this.blendAlpha=0,this.depthFunc=Ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=du,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=As,this.stencilZFail=As,this.stencilZPass=As,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Ss&&(s.blending=this.blending),this.side!==Ai&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==sl&&(s.blendSrc=this.blendSrc),this.blendDst!==rl&&(s.blendDst=this.blendDst),this.blendEquation!==ts&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Ms&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==du&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==As&&(s.stencilFail=this.stencilFail),this.stencilZFail!==As&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==As&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(a){const l=[];for(const h in a){const u=a[h];delete u.metadata,l.push(u)}return l}if(e){const a=r(t.textures),l=r(t.images);a.length>0&&(s.textures=a),l.length>0&&(s.images=l)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let s=null;if(e!==null){const r=e.length;s=new Array(r);for(let a=0;a!==r;++a)s[a]=e[a].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Bi extends Cr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Jn,this.combine=eu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Ve=new Q,Oo=new be;let S0=0;class Kn{constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:S0++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=pu,this.updateRanges=[],this.gpuType=ui,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[t+r]=e.array[s+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Oo.fromBufferAttribute(this,e),Oo.applyMatrix3(t),this.setXY(e,Oo.x,Oo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Rs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=on(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Rs(e,this.array)),e}setX(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Rs(e,this.array)),e}setY(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Rs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Rs(e,this.array)),e}setW(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,r){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this}setXYZW(t,e,s,r,a){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array),a=on(a,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this.array[t+3]=a,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==pu&&(t.usage=this.usage),t}}class Iu extends Kn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class Du extends Kn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class wn extends Kn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let M0=0;const Ln=new Oe,vc=new an,Gs=new Q,Sn=new ks,Pr=new ks,Ye=new Q;class $n extends Cs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:M0++}),this.uuid=Ps(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(t){return Array.isArray(t)?this.index=new(vu(t)?Du:Iu)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,s=0){this.groups.push({start:t,count:e,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const a=new ue().getNormalMatrix(t);s.applyNormalMatrix(a),s.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ln.makeRotationFromQuaternion(t),this.applyMatrix4(Ln),this}rotateX(t){return Ln.makeRotationX(t),this.applyMatrix4(Ln),this}rotateY(t){return Ln.makeRotationY(t),this.applyMatrix4(Ln),this}rotateZ(t){return Ln.makeRotationZ(t),this.applyMatrix4(Ln),this}translate(t,e,s){return Ln.makeTranslation(t,e,s),this.applyMatrix4(Ln),this}scale(t,e,s){return Ln.makeScale(t,e,s),this.applyMatrix4(Ln),this}lookAt(t){return vc.lookAt(t),vc.updateMatrix(),this.applyMatrix4(vc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gs).negate(),this.translate(Gs.x,Gs.y,Gs.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const s=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];s.push(l.x,l.y,l.z||0)}this.setAttribute("position",new wn(s,3))}else{const s=Math.min(t.length,e.count);for(let r=0;r<s;r++){const a=t[r];e.setXYZ(r,a.x,a.y,a.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ks);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Q(-1/0,-1/0,-1/0),new Q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let s=0,r=e.length;s<r;s++){const a=e[s];Sn.setFromBufferAttribute(a),this.morphTargetsRelative?(Ye.addVectors(this.boundingBox.min,Sn.min),this.boundingBox.expandByPoint(Ye),Ye.addVectors(this.boundingBox.max,Sn.max),this.boundingBox.expandByPoint(Ye)):(this.boundingBox.expandByPoint(Sn.min),this.boundingBox.expandByPoint(Sn.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 Ro);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Q,1/0);return}if(t){const s=this.boundingSphere.center;if(Sn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];Pr.setFromBufferAttribute(h),this.morphTargetsRelative?(Ye.addVectors(Sn.min,Pr.min),Sn.expandByPoint(Ye),Ye.addVectors(Sn.max,Pr.max),Sn.expandByPoint(Ye)):(Sn.expandByPoint(Pr.min),Sn.expandByPoint(Pr.max))}Sn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Ye.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Ye));if(e)for(let a=0,l=e.length;a<l;a++){const h=e[a],u=this.morphTargetsRelative;for(let d=0,p=h.count;d<p;d++)Ye.fromBufferAttribute(h,d),u&&(Gs.fromBufferAttribute(t,d),Ye.add(Gs)),r=Math.max(r,s.distanceToSquared(Ye))}this.boundingSphere.radius=Math.sqrt(r),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 t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=e.position,r=e.normal,a=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Kn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let V=0;V<s.count;V++)h[V]=new Q,u[V]=new Q;const d=new Q,p=new Q,m=new Q,_=new be,E=new be,S=new be,w=new Q,v=new Q;function g(V,R,D){d.fromBufferAttribute(s,V),p.fromBufferAttribute(s,R),m.fromBufferAttribute(s,D),_.fromBufferAttribute(a,V),E.fromBufferAttribute(a,R),S.fromBufferAttribute(a,D),p.sub(d),m.sub(d),E.sub(_),S.sub(_);const U=1/(E.x*S.y-S.x*E.y);isFinite(U)&&(w.copy(p).multiplyScalar(S.y).addScaledVector(m,-E.y).multiplyScalar(U),v.copy(m).multiplyScalar(E.x).addScaledVector(p,-S.x).multiplyScalar(U),h[V].add(w),h[R].add(w),h[D].add(w),u[V].add(v),u[R].add(v),u[D].add(v))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let V=0,R=I.length;V<R;++V){const D=I[V],U=D.start,tt=D.count;for(let F=U,H=U+tt;F<H;F+=3)g(t.getX(F+0),t.getX(F+1),t.getX(F+2))}const C=new Q,M=new Q,k=new Q,N=new Q;function B(V){k.fromBufferAttribute(r,V),N.copy(k);const R=h[V];C.copy(R),C.sub(k.multiplyScalar(k.dot(R))).normalize(),M.crossVectors(N,R);const U=M.dot(u[V])<0?-1:1;l.setXYZW(V,C.x,C.y,C.z,U)}for(let V=0,R=I.length;V<R;++V){const D=I[V],U=D.start,tt=D.count;for(let F=U,H=U+tt;F<H;F+=3)B(t.getX(F+0)),B(t.getX(F+1)),B(t.getX(F+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new Kn(new Float32Array(e.count*3),3),this.setAttribute("normal",s);else for(let _=0,E=s.count;_<E;_++)s.setXYZ(_,0,0,0);const r=new Q,a=new Q,l=new Q,h=new Q,u=new Q,d=new Q,p=new Q,m=new Q;if(t)for(let _=0,E=t.count;_<E;_+=3){const S=t.getX(_+0),w=t.getX(_+1),v=t.getX(_+2);r.fromBufferAttribute(e,S),a.fromBufferAttribute(e,w),l.fromBufferAttribute(e,v),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),h.fromBufferAttribute(s,S),u.fromBufferAttribute(s,w),d.fromBufferAttribute(s,v),h.add(p),u.add(p),d.add(p),s.setXYZ(S,h.x,h.y,h.z),s.setXYZ(w,u.x,u.y,u.z),s.setXYZ(v,d.x,d.y,d.z)}else for(let _=0,E=e.count;_<E;_+=3)r.fromBufferAttribute(e,_+0),a.fromBufferAttribute(e,_+1),l.fromBufferAttribute(e,_+2),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),s.setXYZ(_+0,p.x,p.y,p.z),s.setXYZ(_+1,p.x,p.y,p.z),s.setXYZ(_+2,p.x,p.y,p.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,s=t.count;e<s;e++)Ye.fromBufferAttribute(t,e),Ye.normalize(),t.setXYZ(e,Ye.x,Ye.y,Ye.z)}toNonIndexed(){function t(h,u){const d=h.array,p=h.itemSize,m=h.normalized,_=new d.constructor(u.length*p);let E=0,S=0;for(let w=0,v=u.length;w<v;w++){h.isInterleavedBufferAttribute?E=u[w]*h.data.stride+h.offset:E=u[w]*p;for(let g=0;g<p;g++)_[S++]=d[E++]}return new Kn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new $n,s=this.index.array,r=this.attributes;for(const h in r){const u=r[h],d=t(u,s);e.setAttribute(h,d)}const a=this.morphAttributes;for(const h in a){const u=[],d=a[h];for(let p=0,m=d.length;p<m;p++){const _=d[p],E=t(_,s);u.push(E)}e.morphAttributes[h]=u}e.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,u=l.length;h<u;h++){const d=l[h];e.addGroup(d.start,d.count,d.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const d in u)u[d]!==void 0&&(t[d]=u[d]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const s=this.attributes;for(const u in s){const d=s[u];t.data.attributes[u]=d.toJSON(t.data)}const r={};let a=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],p=[];for(let m=0,_=d.length;m<_;m++){const E=d[m];p.push(E.toJSON(t.data))}p.length>0&&(r[u]=p,a=!0)}a&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(t.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(t.data.boundingSphere=h.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const r=t.attributes;for(const d in r){const p=r[d];this.setAttribute(d,p.clone(e))}const a=t.morphAttributes;for(const d in a){const p=[],m=a[d];for(let _=0,E=m.length;_<E;_++)p.push(m[_].clone(e));this.morphAttributes[d]=p}this.morphTargetsRelative=t.morphTargetsRelative;const l=t.groups;for(let d=0,p=l.length;d<p;d++){const m=l[d];this.addGroup(m.start,m.count,m.materialIndex)}const h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());const u=t.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ku=new Oe,as=new ac,No=new Ro,Uu=new Q,Bo=new Q,Fo=new Q,zo=new Q,yc=new Q,Ho=new Q,Ou=new Q,Vo=new Q;class pn extends an{constructor(t=new $n,e=new Bi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}getVertexPosition(t,e){const s=this.geometry,r=s.attributes.position,a=s.morphAttributes.position,l=s.morphTargetsRelative;e.fromBufferAttribute(r,t);const h=this.morphTargetInfluences;if(a&&h){Ho.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(yc.fromBufferAttribute(m,t),l?Ho.addScaledVector(yc,p):Ho.addScaledVector(yc.sub(e),p))}e.add(Ho)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),No.copy(s.boundingSphere),No.applyMatrix4(a),as.copy(t.ray).recast(t.near),!(No.containsPoint(as.origin)===!1&&(as.intersectSphere(No,Uu)===null||as.origin.distanceToSquared(Uu)>(t.far-t.near)**2))&&(ku.copy(a).invert(),as.copy(t.ray).applyMatrix4(ku),!(s.boundingBox!==null&&as.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,as)))}_computeIntersections(t,e,s){let r;const a=this.geometry,l=this.material,h=a.index,u=a.attributes.position,d=a.attributes.uv,p=a.attributes.uv1,m=a.attributes.normal,_=a.groups,E=a.drawRange;if(h!==null)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let M=I,k=C;M<k;M+=3){const N=h.getX(M),B=h.getX(M+1),V=h.getX(M+2);r=Go(this,g,t,s,d,p,m,N,B,V),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(h.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=h.getX(v),C=h.getX(v+1),M=h.getX(v+2);r=Go(this,l,t,s,d,p,m,I,C,M),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let M=I,k=C;M<k;M+=3){const N=M,B=M+1,V=M+2;r=Go(this,g,t,s,d,p,m,N,B,V),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(u.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=v,C=v+1,M=v+2;r=Go(this,l,t,s,d,p,m,I,C,M),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function T0(n,t,e,s,r,a,l,h){let u;if(t.side===fn?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Ai,h),u===null)return null;Vo.copy(h),Vo.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Vo);return d<e.near||d>e.far?null:{distance:d,point:Vo.clone(),object:n}}function Go(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,Bo),n.getVertexPosition(u,Fo),n.getVertexPosition(d,zo);const p=T0(n,t,e,s,Bo,Fo,zo,Ou);if(p){const m=new Q;Wn.getBarycoord(Ou,Bo,Fo,zo,m),r&&(p.uv=Wn.getInterpolatedAttribute(r,h,u,d,m,new be)),a&&(p.uv1=Wn.getInterpolatedAttribute(a,h,u,d,m,new be)),l&&(p.normal=Wn.getInterpolatedAttribute(l,h,u,d,m,new Q),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new Q,materialIndex:0};Wn.getNormal(Bo,Fo,zo,_.normal),p.face=_,p.barycoord=m}return p}class Rr extends $n{constructor(t=1,e=1,s=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:s,widthSegments:r,heightSegments:a,depthSegments:l};const h=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],d=[],p=[],m=[];let _=0,E=0;S("z","y","x",-1,-1,s,e,t,l,a,0),S("z","y","x",1,-1,s,e,-t,l,a,1),S("x","z","y",1,1,t,s,e,r,l,2),S("x","z","y",1,-1,t,s,-e,r,l,3),S("x","y","z",1,-1,t,e,s,r,a,4),S("x","y","z",-1,-1,t,e,-s,r,a,5),this.setIndex(u),this.setAttribute("position",new wn(d,3)),this.setAttribute("normal",new wn(p,3)),this.setAttribute("uv",new wn(m,2));function S(w,v,g,I,C,M,k,N,B,V,R){const D=M/B,U=k/V,tt=M/2,F=k/2,H=N/2,q=B+1,j=V+1;let ct=0,W=0;const Et=new Q;for(let lt=0;lt<j;lt++){const Mt=lt*U-F;for(let Ot=0;Ot<q;Ot++){const oe=Ot*D-tt;Et[w]=oe*I,Et[v]=Mt*C,Et[g]=H,d.push(Et.x,Et.y,Et.z),Et[w]=0,Et[v]=0,Et[g]=N>0?1:-1,p.push(Et.x,Et.y,Et.z),m.push(Ot/B),m.push(1-lt/V),ct+=1}}for(let lt=0;lt<V;lt++)for(let Mt=0;Mt<B;Mt++){const Ot=_+Mt+q*lt,oe=_+Mt+q*(lt+1),Qt=_+(Mt+1)+q*(lt+1),et=_+(Mt+1)+q*lt;u.push(Ot,oe,et),u.push(oe,Qt,et),W+=6}h.addGroup(E,W,R),E+=W,_+=ct}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ws(n){const t={};for(const e in n){t[e]={};for(const s in n[e]){const r=n[e][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][s]=null):t[e][s]=r.clone():Array.isArray(r)?t[e][s]=r.slice():t[e][s]=r}}return t}function ln(n){const t={};for(let e=0;e<n.length;e++){const s=Ws(n[e]);for(const r in s)t[r]=s[r]}return t}function b0(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function Nu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}const A0={clone:Ws,merge:ln};var C0=`void main() {
15
15
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
16
16
  }`,P0=`void main() {
17
17
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -3593,7 +3593,7 @@ void main() {
3593
3593
  #include <tonemapping_fragment>
3594
3594
  #include <colorspace_fragment>
3595
3595
  #include <fog_fragment>
3596
- }`},Rt={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ue}},envmap:{envMap:{value:null},envMapRotation:{value:new ue},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ue}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ue}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ue},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ue},normalScale:{value:new be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ue},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ue}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ue}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ue}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0},uvTransform:{value:new ue}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}}},ti={basic:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.fog]),vertexShader:fe.meshbasic_vert,fragmentShader:fe.meshbasic_frag},lambert:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:fe.meshlambert_vert,fragmentShader:fe.meshlambert_frag},phong:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:fe.meshphong_vert,fragmentShader:fe.meshphong_frag},standard:{uniforms:ln([Rt.common,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.roughnessmap,Rt.metalnessmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag},toon:{uniforms:ln([Rt.common,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.gradientmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:fe.meshtoon_vert,fragmentShader:fe.meshtoon_frag},matcap:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,{matcap:{value:null}}]),vertexShader:fe.meshmatcap_vert,fragmentShader:fe.meshmatcap_frag},points:{uniforms:ln([Rt.points,Rt.fog]),vertexShader:fe.points_vert,fragmentShader:fe.points_frag},dashed:{uniforms:ln([Rt.common,Rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fe.linedashed_vert,fragmentShader:fe.linedashed_frag},depth:{uniforms:ln([Rt.common,Rt.displacementmap]),vertexShader:fe.depth_vert,fragmentShader:fe.depth_frag},normal:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,{opacity:{value:1}}]),vertexShader:fe.meshnormal_vert,fragmentShader:fe.meshnormal_frag},sprite:{uniforms:ln([Rt.sprite,Rt.fog]),vertexShader:fe.sprite_vert,fragmentShader:fe.sprite_frag},background:{uniforms:{uvTransform:{value:new ue},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:fe.background_vert,fragmentShader:fe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ue}},vertexShader:fe.backgroundCube_vert,fragmentShader:fe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:fe.cube_vert,fragmentShader:fe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fe.equirect_vert,fragmentShader:fe.equirect_frag},distanceRGBA:{uniforms:ln([Rt.common,Rt.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fe.distanceRGBA_vert,fragmentShader:fe.distanceRGBA_frag},shadow:{uniforms:ln([Rt.lights,Rt.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:fe.shadow_vert,fragmentShader:fe.shadow_frag}};ti.physical={uniforms:ln([ti.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ue},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ue},clearcoatNormalScale:{value:new be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ue},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ue},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ue},sheen:{value:0},sheenColor:{value:new Ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ue},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ue},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ue},transmissionSamplerSize:{value:new be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ue},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)},specularColor:{value:new Ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ue},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ue},anisotropyVector:{value:new be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ue}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag};const Qo={r:0,b:0,g:0},hs=new Jn,KE=new Oe;function $E(n,t,e,s,r,a,l){const h=new Ce(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function S(C){let M=C.isScene===!0?C.background:null;return M&&M.isTexture&&(M=(C.backgroundBlurriness>0?e:t).get(M)),M}function w(C){let M=!1;const k=S(C);k===null?g(h,u):k&&k.isColor&&(g(k,1),M=!0);const N=n.xr.getEnvironmentBlendMode();N==="additive"?s.buffers.color.setClear(0,0,0,1,l):N==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,l),(n.autoClear||M)&&(s.buffers.depth.setTest(!0),s.buffers.depth.setMask(!0),s.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function v(C,M){const k=S(M);k&&(k.isCubeTexture||k.mapping===vo)?(p===void 0&&(p=new pn(new Rr(1,1,1),new vi({name:"BackgroundCubeMaterial",uniforms:Ws(ti.backgroundCube.uniforms),vertexShader:ti.backgroundCube.vertexShader,fragmentShader:ti.backgroundCube.fragmentShader,side:fn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(N,B,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),hs.copy(M.backgroundRotation),hs.x*=-1,hs.y*=-1,hs.z*=-1,k.isCubeTexture&&k.isRenderTargetTexture===!1&&(hs.y*=-1,hs.z*=-1),p.material.uniforms.envMap.value=k,p.material.uniforms.flipEnvMap.value=k.isCubeTexture&&k.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(KE.makeRotationFromEuler(hs)),p.material.toneMapped=Se.getTransfer(k.colorSpace)!==Ie,(m!==k||_!==k.version||E!==n.toneMapping)&&(p.material.needsUpdate=!0,m=k,_=k.version,E=n.toneMapping),p.layers.enableAll(),C.unshift(p,p.geometry,p.material,0,0,null)):k&&k.isTexture&&(d===void 0&&(d=new pn(new Ir(2,2),new vi({name:"BackgroundMaterial",uniforms:Ws(ti.background.uniforms),vertexShader:ti.background.vertexShader,fragmentShader:ti.background.fragmentShader,side:Ai,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=k,d.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,d.material.toneMapped=Se.getTransfer(k.colorSpace)!==Ie,k.matrixAutoUpdate===!0&&k.updateMatrix(),d.material.uniforms.uvTransform.value.copy(k.matrix),(m!==k||_!==k.version||E!==n.toneMapping)&&(d.material.needsUpdate=!0,m=k,_=k.version,E=n.toneMapping),d.layers.enableAll(),C.unshift(d,d.geometry,d.material,0,0,null))}function g(C,M){C.getRGB(Qo,Nu(n)),s.buffers.color.setClear(Qo.r,Qo.g,Qo.b,M,l)}function I(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}return{getClearColor:function(){return h},setClearColor:function(C,M=1){h.set(C),u=M,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(C){u=C,g(h,u)},render:w,addToRenderList:v,dispose:I}}function tx(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(P,O,et,z,H){let q=!1;const j=m(z,et,O);a!==j&&(a=j,d(a.object)),q=E(P,z,et,H),q&&S(P,z,et,H),H!==null&&t.update(H,n.ELEMENT_ARRAY_BUFFER),(q||l)&&(l=!1,M(P,O,et,z),H!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(H).buffer))}function u(){return n.createVertexArray()}function d(P){return n.bindVertexArray(P)}function p(P){return n.deleteVertexArray(P)}function m(P,O,et){const z=et.wireframe===!0;let H=s[P.id];H===void 0&&(H={},s[P.id]=H);let q=H[O.id];q===void 0&&(q={},H[O.id]=q);let j=q[z];return j===void 0&&(j=_(u()),q[z]=j),j}function _(P){const O=[],et=[],z=[];for(let H=0;H<e;H++)O[H]=0,et[H]=0,z[H]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:O,enabledAttributes:et,attributeDivisors:z,object:P,attributes:{},index:null}}function E(P,O,et,z){const H=a.attributes,q=O.attributes;let j=0;const ct=et.getAttributes();for(const W in ct)if(ct[W].location>=0){const at=H[W];let Mt=q[W];if(Mt===void 0&&(W==="instanceMatrix"&&P.instanceMatrix&&(Mt=P.instanceMatrix),W==="instanceColor"&&P.instanceColor&&(Mt=P.instanceColor)),at===void 0||at.attribute!==Mt||Mt&&at.data!==Mt.data)return!0;j++}return a.attributesNum!==j||a.index!==z}function S(P,O,et,z){const H={},q=O.attributes;let j=0;const ct=et.getAttributes();for(const W in ct)if(ct[W].location>=0){let at=q[W];at===void 0&&(W==="instanceMatrix"&&P.instanceMatrix&&(at=P.instanceMatrix),W==="instanceColor"&&P.instanceColor&&(at=P.instanceColor));const Mt={};Mt.attribute=at,at&&at.data&&(Mt.data=at.data),H[W]=Mt,j++}a.attributes=H,a.attributesNum=j,a.index=z}function w(){const P=a.newAttributes;for(let O=0,et=P.length;O<et;O++)P[O]=0}function v(P){g(P,0)}function g(P,O){const et=a.newAttributes,z=a.enabledAttributes,H=a.attributeDivisors;et[P]=1,z[P]===0&&(n.enableVertexAttribArray(P),z[P]=1),H[P]!==O&&(n.vertexAttribDivisor(P,O),H[P]=O)}function I(){const P=a.newAttributes,O=a.enabledAttributes;for(let et=0,z=O.length;et<z;et++)O[et]!==P[et]&&(n.disableVertexAttribArray(et),O[et]=0)}function C(P,O,et,z,H,q,j){j===!0?n.vertexAttribIPointer(P,O,et,H,q):n.vertexAttribPointer(P,O,et,z,H,q)}function M(P,O,et,z){w();const H=z.attributes,q=et.getAttributes(),j=O.defaultAttributeValues;for(const ct in q){const W=q[ct];if(W.location>=0){let St=H[ct];if(St===void 0&&(ct==="instanceMatrix"&&P.instanceMatrix&&(St=P.instanceMatrix),ct==="instanceColor"&&P.instanceColor&&(St=P.instanceColor)),St!==void 0){const at=St.normalized,Mt=St.itemSize,Ot=t.get(St);if(Ot===void 0)continue;const oe=Ot.buffer,Qt=Ot.type,tt=Ot.bytesPerElement,ut=Qt===n.INT||Qt===n.UNSIGNED_INT||St.gpuType===vl;if(St.isInterleavedBufferAttribute){const _t=St.data,Nt=_t.stride,Zt=St.offset;if(_t.isInstancedInterleavedBuffer){for(let jt=0;jt<W.locationSize;jt++)g(W.location+jt,_t.meshPerAttribute);P.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=_t.meshPerAttribute*_t.count)}else for(let jt=0;jt<W.locationSize;jt++)v(W.location+jt);n.bindBuffer(n.ARRAY_BUFFER,oe);for(let jt=0;jt<W.locationSize;jt++)C(W.location+jt,Mt/W.locationSize,Qt,at,Nt*tt,(Zt+Mt/W.locationSize*jt)*tt,ut)}else{if(St.isInstancedBufferAttribute){for(let _t=0;_t<W.locationSize;_t++)g(W.location+_t,St.meshPerAttribute);P.isInstancedMesh!==!0&&z._maxInstanceCount===void 0&&(z._maxInstanceCount=St.meshPerAttribute*St.count)}else for(let _t=0;_t<W.locationSize;_t++)v(W.location+_t);n.bindBuffer(n.ARRAY_BUFFER,oe);for(let _t=0;_t<W.locationSize;_t++)C(W.location+_t,Mt/W.locationSize,Qt,at,Mt*tt,Mt/W.locationSize*_t*tt,ut)}}else if(j!==void 0){const at=j[ct];if(at!==void 0)switch(at.length){case 2:n.vertexAttrib2fv(W.location,at);break;case 3:n.vertexAttrib3fv(W.location,at);break;case 4:n.vertexAttrib4fv(W.location,at);break;default:n.vertexAttrib1fv(W.location,at)}}}}I()}function k(){V();for(const P in s){const O=s[P];for(const et in O){const z=O[et];for(const H in z)p(z[H].object),delete z[H];delete O[et]}delete s[P]}}function N(P){if(s[P.id]===void 0)return;const O=s[P.id];for(const et in O){const z=O[et];for(const H in z)p(z[H].object),delete z[H];delete O[et]}delete s[P.id]}function B(P){for(const O in s){const et=s[O];if(et[P.id]===void 0)continue;const z=et[P.id];for(const H in z)p(z[H].object),delete z[H];delete et[P.id]}}function V(){D(),l=!0,a!==r&&(a=r,d(a.object))}function D(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:V,resetDefaultState:D,dispose:k,releaseStatesOfGeometry:N,releaseStatesOfProgram:B,initAttributes:w,enableAttribute:v,disableUnusedAttributes:I}}function ex(n,t,e){let s;function r(d){s=d}function a(d,p){n.drawArrays(s,d,p),e.update(p,s,1)}function l(d,p,m){m!==0&&(n.drawArraysInstanced(s,d,p,m),e.update(p,s,m))}function h(d,p,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,d,0,p,0,m);let E=0;for(let S=0;S<m;S++)E+=p[S];e.update(E,s,1)}function u(d,p,m,_){if(m===0)return;const E=t.get("WEBGL_multi_draw");if(E===null)for(let S=0;S<d.length;S++)l(d[S],p[S],_[S]);else{E.multiDrawArraysInstancedWEBGL(s,d,0,p,0,_,0,m);let S=0;for(let w=0;w<m;w++)S+=p[w]*_[w];e.update(S,s,1)}}this.setMode=r,this.render=a,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function nx(n,t,e,s){let r;function a(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){const B=t.get("EXT_texture_filter_anisotropic");r=n.getParameter(B.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function l(B){return!(B!==zn&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(B){const V=B===_r&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(B!==hi&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&B!==ui&&!V)}function u(B){if(B==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=e.precision!==void 0?e.precision:"highp";const p=u(d);p!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=e.logarithmicDepthBuffer===!0,_=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),E=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),I=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),M=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),k=S>0,N=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:l,textureTypeReadable:h,precision:d,logarithmicDepthBuffer:m,reversedDepthBuffer:_,maxTextures:E,maxVertexTextures:S,maxTextureSize:w,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:I,maxVaryings:C,maxFragmentUniforms:M,vertexTextures:k,maxSamples:N}}function ix(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ls,h=new ue,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(m,_){const E=m.length!==0||_||s!==0||r;return r=_,s=m.length,E},this.beginShadows=function(){a=!0,p(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,_){e=p(m,_,0)},this.setState=function(m,_,E){const S=m.clippingPlanes,w=m.clipIntersection,v=m.clipShadows,g=n.get(m);if(!r||S===null||S.length===0||a&&!v)a?p(null):d();else{const I=a?0:s,C=I*4;let M=g.clippingState||null;u.value=M,M=p(S,_,C,E);for(let k=0;k!==C;++k)M[k]=e[k];g.clippingState=M,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=I}};function d(){u.value!==e&&(u.value=e,u.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function p(m,_,E,S){const w=m!==null?m.length:0;let v=null;if(w!==0){if(v=u.value,S!==!0||v===null){const g=E+w*4,I=_.matrixWorldInverse;h.getNormalMatrix(I),(v===null||v.length<g)&&(v=new Float32Array(g));for(let C=0,M=E;C!==w;++C,M+=4)l.copy(m[C]).applyMatrix4(I,h),l.normal.toArray(v,M),v[M+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=w,t.numIntersection=0,v}}function sx(n){let t=new WeakMap;function e(l,h){return h===fl?l.mapping=Ts:h===pl&&(l.mapping=bs),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===fl||h===pl)if(t.has(l)){const u=t.get(l).texture;return e(u,l.mapping)}else{const u=l.image;if(u&&u.height>0){const d=new L0(u.height);return d.fromEquirectangularTexture(n,l),t.set(l,d),l.addEventListener("dispose",r),e(d.texture,l.mapping)}else return null}}return l}function r(l){const h=l.target;h.removeEventListener("dispose",r);const u=t.get(h);u!==void 0&&(t.delete(h),u.dispose())}function a(){t=new WeakMap}return{get:s,dispose:a}}const Qs=4,Ku=[.125,.215,.35,.446,.526,.582],us=20,Ac=new q0,$u=new Ce;let Cc=null,Pc=0,Rc=0,Lc=!1;const ds=(1+Math.sqrt(5))/2,js=1/ds,td=[new Q(-ds,js,0),new Q(ds,js,0),new Q(-js,0,ds),new Q(js,0,ds),new Q(0,ds,-js),new Q(0,ds,js),new Q(-1,1,-1),new Q(1,1,-1),new Q(-1,1,1),new Q(1,1,1)],rx=new Q;class ed{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,s=.1,r=100,a={}){const{size:l=256,position:h=rx}=a;Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(t,s,r,u,h),e>0&&this._blur(u,0,0,e),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sd(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=id(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Cc,Pc,Rc),this._renderer.xr.enabled=Lc,t.scissorTest=!1,jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ts||t.mapping===bs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=e||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,s={magFilter:En,minFilter:En,generateMipmaps:!1,type:_r,format:zn,colorSpace:is,depthBuffer:!1},r=nd(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=nd(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=ox(a)),this._blurMaterial=ax(a,t,e)}return r}_compileMaterial(t){const e=new pn(this._lodPlanes[0],t);this._renderer.compile(e,Ac)}_sceneToCubeUV(t,e,s,r,a){const u=new In(90,1,e,s),d=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],m=this._renderer,_=m.autoClear,E=m.toneMapping;m.getClearColor($u),m.toneMapping=Pi,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const w=new Bi({name:"PMREM.Background",side:fn,depthWrite:!1,depthTest:!1}),v=new pn(new Rr,w);let g=!1;const I=t.background;I?I.isColor&&(w.color.copy(I),t.background=null,g=!0):(w.color.copy($u),g=!0);for(let C=0;C<6;C++){const M=C%3;M===0?(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x+p[C],a.y,a.z)):M===1?(u.up.set(0,0,d[C]),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y+p[C],a.z)):(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y,a.z+p[C]));const k=this._cubeSize;jo(r,M*k,C>2?k:0,k,k),m.setRenderTarget(r),g&&m.render(v,u),m.render(t,u)}v.geometry.dispose(),v.material.dispose(),m.toneMapping=E,m.autoClear=_,t.background=I}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===Ts||t.mapping===bs;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=sd()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=id());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new pn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;jo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,Ac)}_applyPMREM(t){const e=this._renderer,s=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const l=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),h=td[(r-a-1)%td.length];this._blur(t,a-1,a,l,h)}e.autoClear=s}_blur(t,e,s,r,a){const l=this._pingPongRenderTarget;this._halfBlur(t,l,e,s,r,"latitudinal",a),this._halfBlur(l,t,s,s,r,"longitudinal",a)}_halfBlur(t,e,s,r,a,l,h){const u=this._renderer,d=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,m=new pn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,S=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*us-1),w=a/S,v=isFinite(a)?1+Math.floor(p*w):us;v>us&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${us}`);const g=[];let I=0;for(let B=0;B<us;++B){const V=B/w,D=Math.exp(-V*V/2);g.push(D),B===0?I+=D:B<v&&(I+=2*D)}for(let B=0;B<g.length;B++)g[B]=g[B]/I;_.envMap.value=t.texture,_.samples.value=v,_.weights.value=g,_.latitudinal.value=l==="latitudinal",h&&(_.poleAxis.value=h);const{_lodMax:C}=this;_.dTheta.value=S,_.mipInt.value=C-s;const M=this._sizeLods[r],k=3*M*(r>C-Qs?r-C+Qs:0),N=4*(this._cubeSize-M);jo(e,k,N,3*M,2*M),u.setRenderTarget(e),u.render(m,Ac)}}function ox(n){const t=[],e=[],s=[];let r=n;const a=n-Qs+1+Ku.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-Qs?u=Ku[l-n+Qs-1]:l===0&&(u=0),s.push(u);const d=1/(h-2),p=-d,m=1+d,_=[p,p,m,p,m,m,p,p,m,m,p,m],E=6,S=6,w=3,v=2,g=1,I=new Float32Array(w*S*E),C=new Float32Array(v*S*E),M=new Float32Array(g*S*E);for(let N=0;N<E;N++){const B=N%3*2/3-1,V=N>2?0:-1,D=[B,V,0,B+2/3,V,0,B+2/3,V+1,0,B,V,0,B+2/3,V+1,0,B,V+1,0];I.set(D,w*S*N),C.set(_,v*S*N);const P=[N,N,N,N,N,N];M.set(P,g*S*N)}const k=new $n;k.setAttribute("position",new Kn(I,w)),k.setAttribute("uv",new Kn(C,v)),k.setAttribute("faceIndex",new Kn(M,g)),t.push(k),r>Qs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function nd(n,t,e){const s=new Ii(n,t,e);return s.texture.mapping=vo,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function jo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function ax(n,t,e){const s=new Float32Array(us),r=new Q(0,1,0);return new vi({name:"SphericalGaussianBlur",defines:{n:us,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ic(),fragmentShader:`
3596
+ }`},Rt={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ue}},envmap:{envMap:{value:null},envMapRotation:{value:new ue},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ue}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ue}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ue},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ue},normalScale:{value:new be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ue},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ue}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ue}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ue}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0},uvTransform:{value:new ue}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}}},ti={basic:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.fog]),vertexShader:fe.meshbasic_vert,fragmentShader:fe.meshbasic_frag},lambert:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:fe.meshlambert_vert,fragmentShader:fe.meshlambert_frag},phong:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:fe.meshphong_vert,fragmentShader:fe.meshphong_frag},standard:{uniforms:ln([Rt.common,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.roughnessmap,Rt.metalnessmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag},toon:{uniforms:ln([Rt.common,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.gradientmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:fe.meshtoon_vert,fragmentShader:fe.meshtoon_frag},matcap:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,{matcap:{value:null}}]),vertexShader:fe.meshmatcap_vert,fragmentShader:fe.meshmatcap_frag},points:{uniforms:ln([Rt.points,Rt.fog]),vertexShader:fe.points_vert,fragmentShader:fe.points_frag},dashed:{uniforms:ln([Rt.common,Rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fe.linedashed_vert,fragmentShader:fe.linedashed_frag},depth:{uniforms:ln([Rt.common,Rt.displacementmap]),vertexShader:fe.depth_vert,fragmentShader:fe.depth_frag},normal:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,{opacity:{value:1}}]),vertexShader:fe.meshnormal_vert,fragmentShader:fe.meshnormal_frag},sprite:{uniforms:ln([Rt.sprite,Rt.fog]),vertexShader:fe.sprite_vert,fragmentShader:fe.sprite_frag},background:{uniforms:{uvTransform:{value:new ue},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:fe.background_vert,fragmentShader:fe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ue}},vertexShader:fe.backgroundCube_vert,fragmentShader:fe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:fe.cube_vert,fragmentShader:fe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fe.equirect_vert,fragmentShader:fe.equirect_frag},distanceRGBA:{uniforms:ln([Rt.common,Rt.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fe.distanceRGBA_vert,fragmentShader:fe.distanceRGBA_frag},shadow:{uniforms:ln([Rt.lights,Rt.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:fe.shadow_vert,fragmentShader:fe.shadow_frag}};ti.physical={uniforms:ln([ti.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ue},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ue},clearcoatNormalScale:{value:new be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ue},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ue},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ue},sheen:{value:0},sheenColor:{value:new Ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ue},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ue},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ue},transmissionSamplerSize:{value:new be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ue},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)},specularColor:{value:new Ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ue},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ue},anisotropyVector:{value:new be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ue}}]),vertexShader:fe.meshphysical_vert,fragmentShader:fe.meshphysical_frag};const Qo={r:0,b:0,g:0},hs=new Jn,KE=new Oe;function $E(n,t,e,s,r,a,l){const h=new Ce(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function S(C){let M=C.isScene===!0?C.background:null;return M&&M.isTexture&&(M=(C.backgroundBlurriness>0?e:t).get(M)),M}function w(C){let M=!1;const k=S(C);k===null?g(h,u):k&&k.isColor&&(g(k,1),M=!0);const N=n.xr.getEnvironmentBlendMode();N==="additive"?s.buffers.color.setClear(0,0,0,1,l):N==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,l),(n.autoClear||M)&&(s.buffers.depth.setTest(!0),s.buffers.depth.setMask(!0),s.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function v(C,M){const k=S(M);k&&(k.isCubeTexture||k.mapping===vo)?(p===void 0&&(p=new pn(new Rr(1,1,1),new vi({name:"BackgroundCubeMaterial",uniforms:Ws(ti.backgroundCube.uniforms),vertexShader:ti.backgroundCube.vertexShader,fragmentShader:ti.backgroundCube.fragmentShader,side:fn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(N,B,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),hs.copy(M.backgroundRotation),hs.x*=-1,hs.y*=-1,hs.z*=-1,k.isCubeTexture&&k.isRenderTargetTexture===!1&&(hs.y*=-1,hs.z*=-1),p.material.uniforms.envMap.value=k,p.material.uniforms.flipEnvMap.value=k.isCubeTexture&&k.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(KE.makeRotationFromEuler(hs)),p.material.toneMapped=Se.getTransfer(k.colorSpace)!==Ie,(m!==k||_!==k.version||E!==n.toneMapping)&&(p.material.needsUpdate=!0,m=k,_=k.version,E=n.toneMapping),p.layers.enableAll(),C.unshift(p,p.geometry,p.material,0,0,null)):k&&k.isTexture&&(d===void 0&&(d=new pn(new Ir(2,2),new vi({name:"BackgroundMaterial",uniforms:Ws(ti.background.uniforms),vertexShader:ti.background.vertexShader,fragmentShader:ti.background.fragmentShader,side:Ai,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=k,d.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,d.material.toneMapped=Se.getTransfer(k.colorSpace)!==Ie,k.matrixAutoUpdate===!0&&k.updateMatrix(),d.material.uniforms.uvTransform.value.copy(k.matrix),(m!==k||_!==k.version||E!==n.toneMapping)&&(d.material.needsUpdate=!0,m=k,_=k.version,E=n.toneMapping),d.layers.enableAll(),C.unshift(d,d.geometry,d.material,0,0,null))}function g(C,M){C.getRGB(Qo,Nu(n)),s.buffers.color.setClear(Qo.r,Qo.g,Qo.b,M,l)}function I(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}return{getClearColor:function(){return h},setClearColor:function(C,M=1){h.set(C),u=M,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(C){u=C,g(h,u)},render:w,addToRenderList:v,dispose:I}}function tx(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(D,U,tt,F,H){let q=!1;const j=m(F,tt,U);a!==j&&(a=j,d(a.object)),q=E(D,F,tt,H),q&&S(D,F,tt,H),H!==null&&t.update(H,n.ELEMENT_ARRAY_BUFFER),(q||l)&&(l=!1,M(D,U,tt,F),H!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(H).buffer))}function u(){return n.createVertexArray()}function d(D){return n.bindVertexArray(D)}function p(D){return n.deleteVertexArray(D)}function m(D,U,tt){const F=tt.wireframe===!0;let H=s[D.id];H===void 0&&(H={},s[D.id]=H);let q=H[U.id];q===void 0&&(q={},H[U.id]=q);let j=q[F];return j===void 0&&(j=_(u()),q[F]=j),j}function _(D){const U=[],tt=[],F=[];for(let H=0;H<e;H++)U[H]=0,tt[H]=0,F[H]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:tt,attributeDivisors:F,object:D,attributes:{},index:null}}function E(D,U,tt,F){const H=a.attributes,q=U.attributes;let j=0;const ct=tt.getAttributes();for(const W in ct)if(ct[W].location>=0){const lt=H[W];let Mt=q[W];if(Mt===void 0&&(W==="instanceMatrix"&&D.instanceMatrix&&(Mt=D.instanceMatrix),W==="instanceColor"&&D.instanceColor&&(Mt=D.instanceColor)),lt===void 0||lt.attribute!==Mt||Mt&&lt.data!==Mt.data)return!0;j++}return a.attributesNum!==j||a.index!==F}function S(D,U,tt,F){const H={},q=U.attributes;let j=0;const ct=tt.getAttributes();for(const W in ct)if(ct[W].location>=0){let lt=q[W];lt===void 0&&(W==="instanceMatrix"&&D.instanceMatrix&&(lt=D.instanceMatrix),W==="instanceColor"&&D.instanceColor&&(lt=D.instanceColor));const Mt={};Mt.attribute=lt,lt&&lt.data&&(Mt.data=lt.data),H[W]=Mt,j++}a.attributes=H,a.attributesNum=j,a.index=F}function w(){const D=a.newAttributes;for(let U=0,tt=D.length;U<tt;U++)D[U]=0}function v(D){g(D,0)}function g(D,U){const tt=a.newAttributes,F=a.enabledAttributes,H=a.attributeDivisors;tt[D]=1,F[D]===0&&(n.enableVertexAttribArray(D),F[D]=1),H[D]!==U&&(n.vertexAttribDivisor(D,U),H[D]=U)}function I(){const D=a.newAttributes,U=a.enabledAttributes;for(let tt=0,F=U.length;tt<F;tt++)U[tt]!==D[tt]&&(n.disableVertexAttribArray(tt),U[tt]=0)}function C(D,U,tt,F,H,q,j){j===!0?n.vertexAttribIPointer(D,U,tt,H,q):n.vertexAttribPointer(D,U,tt,F,H,q)}function M(D,U,tt,F){w();const H=F.attributes,q=tt.getAttributes(),j=U.defaultAttributeValues;for(const ct in q){const W=q[ct];if(W.location>=0){let Et=H[ct];if(Et===void 0&&(ct==="instanceMatrix"&&D.instanceMatrix&&(Et=D.instanceMatrix),ct==="instanceColor"&&D.instanceColor&&(Et=D.instanceColor)),Et!==void 0){const lt=Et.normalized,Mt=Et.itemSize,Ot=t.get(Et);if(Ot===void 0)continue;const oe=Ot.buffer,Qt=Ot.type,et=Ot.bytesPerElement,ut=Qt===n.INT||Qt===n.UNSIGNED_INT||Et.gpuType===vl;if(Et.isInterleavedBufferAttribute){const _t=Et.data,Nt=_t.stride,Zt=Et.offset;if(_t.isInstancedInterleavedBuffer){for(let jt=0;jt<W.locationSize;jt++)g(W.location+jt,_t.meshPerAttribute);D.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=_t.meshPerAttribute*_t.count)}else for(let jt=0;jt<W.locationSize;jt++)v(W.location+jt);n.bindBuffer(n.ARRAY_BUFFER,oe);for(let jt=0;jt<W.locationSize;jt++)C(W.location+jt,Mt/W.locationSize,Qt,lt,Nt*et,(Zt+Mt/W.locationSize*jt)*et,ut)}else{if(Et.isInstancedBufferAttribute){for(let _t=0;_t<W.locationSize;_t++)g(W.location+_t,Et.meshPerAttribute);D.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=Et.meshPerAttribute*Et.count)}else for(let _t=0;_t<W.locationSize;_t++)v(W.location+_t);n.bindBuffer(n.ARRAY_BUFFER,oe);for(let _t=0;_t<W.locationSize;_t++)C(W.location+_t,Mt/W.locationSize,Qt,lt,Mt*et,Mt/W.locationSize*_t*et,ut)}}else if(j!==void 0){const lt=j[ct];if(lt!==void 0)switch(lt.length){case 2:n.vertexAttrib2fv(W.location,lt);break;case 3:n.vertexAttrib3fv(W.location,lt);break;case 4:n.vertexAttrib4fv(W.location,lt);break;default:n.vertexAttrib1fv(W.location,lt)}}}}I()}function k(){V();for(const D in s){const U=s[D];for(const tt in U){const F=U[tt];for(const H in F)p(F[H].object),delete F[H];delete U[tt]}delete s[D]}}function N(D){if(s[D.id]===void 0)return;const U=s[D.id];for(const tt in U){const F=U[tt];for(const H in F)p(F[H].object),delete F[H];delete U[tt]}delete s[D.id]}function B(D){for(const U in s){const tt=s[U];if(tt[D.id]===void 0)continue;const F=tt[D.id];for(const H in F)p(F[H].object),delete F[H];delete tt[D.id]}}function V(){R(),l=!0,a!==r&&(a=r,d(a.object))}function R(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:V,resetDefaultState:R,dispose:k,releaseStatesOfGeometry:N,releaseStatesOfProgram:B,initAttributes:w,enableAttribute:v,disableUnusedAttributes:I}}function ex(n,t,e){let s;function r(d){s=d}function a(d,p){n.drawArrays(s,d,p),e.update(p,s,1)}function l(d,p,m){m!==0&&(n.drawArraysInstanced(s,d,p,m),e.update(p,s,m))}function h(d,p,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,d,0,p,0,m);let E=0;for(let S=0;S<m;S++)E+=p[S];e.update(E,s,1)}function u(d,p,m,_){if(m===0)return;const E=t.get("WEBGL_multi_draw");if(E===null)for(let S=0;S<d.length;S++)l(d[S],p[S],_[S]);else{E.multiDrawArraysInstancedWEBGL(s,d,0,p,0,_,0,m);let S=0;for(let w=0;w<m;w++)S+=p[w]*_[w];e.update(S,s,1)}}this.setMode=r,this.render=a,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function nx(n,t,e,s){let r;function a(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){const B=t.get("EXT_texture_filter_anisotropic");r=n.getParameter(B.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function l(B){return!(B!==zn&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(B){const V=B===_r&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(B!==hi&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&B!==ui&&!V)}function u(B){if(B==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=e.precision!==void 0?e.precision:"highp";const p=u(d);p!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=e.logarithmicDepthBuffer===!0,_=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),E=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),I=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),M=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),k=S>0,N=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:l,textureTypeReadable:h,precision:d,logarithmicDepthBuffer:m,reversedDepthBuffer:_,maxTextures:E,maxVertexTextures:S,maxTextureSize:w,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:I,maxVaryings:C,maxFragmentUniforms:M,vertexTextures:k,maxSamples:N}}function ix(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ls,h=new ue,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(m,_){const E=m.length!==0||_||s!==0||r;return r=_,s=m.length,E},this.beginShadows=function(){a=!0,p(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,_){e=p(m,_,0)},this.setState=function(m,_,E){const S=m.clippingPlanes,w=m.clipIntersection,v=m.clipShadows,g=n.get(m);if(!r||S===null||S.length===0||a&&!v)a?p(null):d();else{const I=a?0:s,C=I*4;let M=g.clippingState||null;u.value=M,M=p(S,_,C,E);for(let k=0;k!==C;++k)M[k]=e[k];g.clippingState=M,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=I}};function d(){u.value!==e&&(u.value=e,u.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function p(m,_,E,S){const w=m!==null?m.length:0;let v=null;if(w!==0){if(v=u.value,S!==!0||v===null){const g=E+w*4,I=_.matrixWorldInverse;h.getNormalMatrix(I),(v===null||v.length<g)&&(v=new Float32Array(g));for(let C=0,M=E;C!==w;++C,M+=4)l.copy(m[C]).applyMatrix4(I,h),l.normal.toArray(v,M),v[M+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=w,t.numIntersection=0,v}}function sx(n){let t=new WeakMap;function e(l,h){return h===fl?l.mapping=Ts:h===pl&&(l.mapping=bs),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===fl||h===pl)if(t.has(l)){const u=t.get(l).texture;return e(u,l.mapping)}else{const u=l.image;if(u&&u.height>0){const d=new L0(u.height);return d.fromEquirectangularTexture(n,l),t.set(l,d),l.addEventListener("dispose",r),e(d.texture,l.mapping)}else return null}}return l}function r(l){const h=l.target;h.removeEventListener("dispose",r);const u=t.get(h);u!==void 0&&(t.delete(h),u.dispose())}function a(){t=new WeakMap}return{get:s,dispose:a}}const Qs=4,Ku=[.125,.215,.35,.446,.526,.582],us=20,Ac=new q0,$u=new Ce;let Cc=null,Pc=0,Rc=0,Lc=!1;const ds=(1+Math.sqrt(5))/2,js=1/ds,td=[new Q(-ds,js,0),new Q(ds,js,0),new Q(-js,0,ds),new Q(js,0,ds),new Q(0,ds,-js),new Q(0,ds,js),new Q(-1,1,-1),new Q(1,1,-1),new Q(-1,1,1),new Q(1,1,1)],rx=new Q;class ed{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,s=.1,r=100,a={}){const{size:l=256,position:h=rx}=a;Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(t,s,r,u,h),e>0&&this._blur(u,0,0,e),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sd(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=id(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Cc,Pc,Rc),this._renderer.xr.enabled=Lc,t.scissorTest=!1,jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ts||t.mapping===bs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=e||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,s={magFilter:En,minFilter:En,generateMipmaps:!1,type:_r,format:zn,colorSpace:is,depthBuffer:!1},r=nd(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=nd(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=ox(a)),this._blurMaterial=ax(a,t,e)}return r}_compileMaterial(t){const e=new pn(this._lodPlanes[0],t);this._renderer.compile(e,Ac)}_sceneToCubeUV(t,e,s,r,a){const u=new In(90,1,e,s),d=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],m=this._renderer,_=m.autoClear,E=m.toneMapping;m.getClearColor($u),m.toneMapping=Pi,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const w=new Bi({name:"PMREM.Background",side:fn,depthWrite:!1,depthTest:!1}),v=new pn(new Rr,w);let g=!1;const I=t.background;I?I.isColor&&(w.color.copy(I),t.background=null,g=!0):(w.color.copy($u),g=!0);for(let C=0;C<6;C++){const M=C%3;M===0?(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x+p[C],a.y,a.z)):M===1?(u.up.set(0,0,d[C]),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y+p[C],a.z)):(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y,a.z+p[C]));const k=this._cubeSize;jo(r,M*k,C>2?k:0,k,k),m.setRenderTarget(r),g&&m.render(v,u),m.render(t,u)}v.geometry.dispose(),v.material.dispose(),m.toneMapping=E,m.autoClear=_,t.background=I}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===Ts||t.mapping===bs;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=sd()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=id());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new pn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;jo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,Ac)}_applyPMREM(t){const e=this._renderer,s=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const l=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),h=td[(r-a-1)%td.length];this._blur(t,a-1,a,l,h)}e.autoClear=s}_blur(t,e,s,r,a){const l=this._pingPongRenderTarget;this._halfBlur(t,l,e,s,r,"latitudinal",a),this._halfBlur(l,t,s,s,r,"longitudinal",a)}_halfBlur(t,e,s,r,a,l,h){const u=this._renderer,d=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,m=new pn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,S=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*us-1),w=a/S,v=isFinite(a)?1+Math.floor(p*w):us;v>us&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${us}`);const g=[];let I=0;for(let B=0;B<us;++B){const V=B/w,R=Math.exp(-V*V/2);g.push(R),B===0?I+=R:B<v&&(I+=2*R)}for(let B=0;B<g.length;B++)g[B]=g[B]/I;_.envMap.value=t.texture,_.samples.value=v,_.weights.value=g,_.latitudinal.value=l==="latitudinal",h&&(_.poleAxis.value=h);const{_lodMax:C}=this;_.dTheta.value=S,_.mipInt.value=C-s;const M=this._sizeLods[r],k=3*M*(r>C-Qs?r-C+Qs:0),N=4*(this._cubeSize-M);jo(e,k,N,3*M,2*M),u.setRenderTarget(e),u.render(m,Ac)}}function ox(n){const t=[],e=[],s=[];let r=n;const a=n-Qs+1+Ku.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-Qs?u=Ku[l-n+Qs-1]:l===0&&(u=0),s.push(u);const d=1/(h-2),p=-d,m=1+d,_=[p,p,m,p,m,m,p,p,m,m,p,m],E=6,S=6,w=3,v=2,g=1,I=new Float32Array(w*S*E),C=new Float32Array(v*S*E),M=new Float32Array(g*S*E);for(let N=0;N<E;N++){const B=N%3*2/3-1,V=N>2?0:-1,R=[B,V,0,B+2/3,V,0,B+2/3,V+1,0,B,V,0,B+2/3,V+1,0,B,V+1,0];I.set(R,w*S*N),C.set(_,v*S*N);const D=[N,N,N,N,N,N];M.set(D,g*S*N)}const k=new $n;k.setAttribute("position",new Kn(I,w)),k.setAttribute("uv",new Kn(C,v)),k.setAttribute("faceIndex",new Kn(M,g)),t.push(k),r>Qs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function nd(n,t,e){const s=new Ii(n,t,e);return s.texture.mapping=vo,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function jo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function ax(n,t,e){const s=new Float32Array(us),r=new Q(0,1,0);return new vi({name:"SphericalGaussianBlur",defines:{n:us,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ic(),fragmentShader:`
3597
3597
 
3598
3598
  precision mediump float;
3599
3599
  precision mediump int;
@@ -3743,7 +3743,7 @@ void main() {
3743
3743
  gl_Position = vec4( position, 1.0 );
3744
3744
 
3745
3745
  }
3746
- `}function lx(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===fl||u===pl,p=u===Ts||u===bs;if(d||p){let m=t.get(h);const _=m!==void 0?m.texture.pmremVersion:0;if(h.isRenderTargetTexture&&h.pmremVersion!==_)return e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h,m):e.fromCubemap(h,m),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),m.texture;if(m!==void 0)return m.texture;{const E=h.image;return d&&E&&E.height>0||p&&E&&r(E)?(e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h):e.fromCubemap(h),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),h.addEventListener("dispose",a),m.texture):null}}}return h}function r(h){let u=0;const d=6;for(let p=0;p<d;p++)h[p]!==void 0&&u++;return u===d}function a(h){const u=h.target;u.removeEventListener("dispose",a);const d=t.get(u);d!==void 0&&(t.delete(u),d.dispose())}function l(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:s,dispose:l}}function cx(n){const t={};function e(s){if(t[s]!==void 0)return t[s];let r;switch(s){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=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":r=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":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(s)}return t[s]=r,r}return{has:function(s){return e(s)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(s){const r=e(s);return r===null&&Ls("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function hx(n,t,e,s){const r={},a=new WeakMap;function l(m){const _=m.target;_.index!==null&&t.remove(_.index);for(const S in _.attributes)t.remove(_.attributes[S]);_.removeEventListener("dispose",l),delete r[_.id];const E=a.get(_);E&&(t.remove(E),a.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,e.memory.geometries--}function h(m,_){return r[_.id]===!0||(_.addEventListener("dispose",l),r[_.id]=!0,e.memory.geometries++),_}function u(m){const _=m.attributes;for(const E in _)t.update(_[E],n.ARRAY_BUFFER)}function d(m){const _=[],E=m.index,S=m.attributes.position;let w=0;if(E!==null){const I=E.array;w=E.version;for(let C=0,M=I.length;C<M;C+=3){const k=I[C+0],N=I[C+1],B=I[C+2];_.push(k,N,N,B,B,k)}}else if(S!==void 0){const I=S.array;w=S.version;for(let C=0,M=I.length/3-1;C<M;C+=3){const k=C+0,N=C+1,B=C+2;_.push(k,N,N,B,B,k)}}else return;const v=new(vu(_)?Du:Iu)(_,1);v.version=w;const g=a.get(m);g&&t.remove(g),a.set(m,v)}function p(m){const _=a.get(m);if(_){const E=m.index;E!==null&&_.version<E.version&&d(m)}else d(m);return a.get(m)}return{get:h,update:u,getWireframeAttribute:p}}function ux(n,t,e){let s;function r(_){s=_}let a,l;function h(_){a=_.type,l=_.bytesPerElement}function u(_,E){n.drawElements(s,E,a,_*l),e.update(E,s,1)}function d(_,E,S){S!==0&&(n.drawElementsInstanced(s,E,a,_*l,S),e.update(E,s,S))}function p(_,E,S){if(S===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,E,0,a,_,0,S);let v=0;for(let g=0;g<S;g++)v+=E[g];e.update(v,s,1)}function m(_,E,S,w){if(S===0)return;const v=t.get("WEBGL_multi_draw");if(v===null)for(let g=0;g<_.length;g++)d(_[g]/l,E[g],w[g]);else{v.multiDrawElementsInstancedWEBGL(s,E,0,a,_,0,w,0,S);let g=0;for(let I=0;I<S;I++)g+=E[I]*w[I];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function dx(n){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function s(a,l,h){switch(e.calls++,l){case n.TRIANGLES:e.triangles+=h*(a/3);break;case n.LINES:e.lines+=h*(a/2);break;case n.LINE_STRIP:e.lines+=h*(a-1);break;case n.LINE_LOOP:e.lines+=h*a;break;case n.POINTS:e.points+=h*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:r,update:s}}function fx(n,t,e){const s=new WeakMap,r=new He;function a(l,h,u){const d=l.morphTargetInfluences,p=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,m=p!==void 0?p.length:0;let _=s.get(h);if(_===void 0||_.count!==m){let D=function(){B.dispose(),s.delete(h),h.removeEventListener("dispose",D)};_!==void 0&&_.texture.dispose();const E=h.morphAttributes.position!==void 0,S=h.morphAttributes.normal!==void 0,w=h.morphAttributes.color!==void 0,v=h.morphAttributes.position||[],g=h.morphAttributes.normal||[],I=h.morphAttributes.color||[];let C=0;E===!0&&(C=1),S===!0&&(C=2),w===!0&&(C=3);let M=h.attributes.position.count*C,k=1;M>t.maxTextureSize&&(k=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);const N=new Float32Array(M*k*4*m),B=new wu(N,M,k,m);B.type=ui,B.needsUpdate=!0;const V=C*4;for(let P=0;P<m;P++){const O=v[P],et=g[P],z=I[P],H=M*k*4*P;for(let q=0;q<O.count;q++){const j=q*V;E===!0&&(r.fromBufferAttribute(O,q),N[H+j+0]=r.x,N[H+j+1]=r.y,N[H+j+2]=r.z,N[H+j+3]=0),S===!0&&(r.fromBufferAttribute(et,q),N[H+j+4]=r.x,N[H+j+5]=r.y,N[H+j+6]=r.z,N[H+j+7]=0),w===!0&&(r.fromBufferAttribute(z,q),N[H+j+8]=r.x,N[H+j+9]=r.y,N[H+j+10]=r.z,N[H+j+11]=z.itemSize===4?r.w:1)}}_={count:m,texture:B,size:new be(M,k)},s.set(h,_),h.addEventListener("dispose",D)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)u.getUniforms().setValue(n,"morphTexture",l.morphTexture,e);else{let E=0;for(let w=0;w<d.length;w++)E+=d[w];const S=h.morphTargetsRelative?1:1-E;u.getUniforms().setValue(n,"morphTargetBaseInfluence",S),u.getUniforms().setValue(n,"morphTargetInfluences",d)}u.getUniforms().setValue(n,"morphTargetsTexture",_.texture,e),u.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}return{update:a}}function px(n,t,e,s){let r=new WeakMap;function a(u){const d=s.render.frame,p=u.geometry,m=t.get(u,p);if(r.get(m)!==d&&(t.update(m),r.set(m,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",h)===!1&&u.addEventListener("dispose",h),r.get(u)!==d&&(e.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&e.update(u.instanceColor,n.ARRAY_BUFFER),r.set(u,d))),u.isSkinnedMesh){const _=u.skeleton;r.get(_)!==d&&(_.update(),r.set(_,d))}return m}function l(){r=new WeakMap}function h(u){const d=u.target;d.removeEventListener("dispose",h),e.remove(d.instanceMatrix),d.instanceColor!==null&&e.remove(d.instanceColor)}return{update:a,dispose:l}}const rd=new Je,od=new Xu(1,1),ad=new wu,ld=new p0,cd=new Hu,hd=[],ud=[],dd=new Float32Array(16),fd=new Float32Array(9),pd=new Float32Array(4);function Js(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=hd[r];if(a===void 0&&(a=new Float32Array(r),hd[r]=a),t!==0){s.toArray(a,0);for(let l=1,h=0;l!==t;++l)h+=e,n[l].toArray(a,h)}return a}function Ze(n,t){if(n.length!==t.length)return!1;for(let e=0,s=n.length;e<s;e++)if(n[e]!==t[e])return!1;return!0}function Xe(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Jo(n,t){let e=ud[t];e===void 0&&(e=new Int32Array(t),ud[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function mx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function gx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2fv(this.addr,t),Xe(e,t)}}function _x(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(n.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Ze(e,t))return;n.uniform3fv(this.addr,t),Xe(e,t)}}function vx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4fv(this.addr,t),Xe(e,t)}}function yx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;pd.set(s),n.uniformMatrix2fv(this.addr,!1,pd),Xe(e,s)}}function Ex(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;fd.set(s),n.uniformMatrix3fv(this.addr,!1,fd),Xe(e,s)}}function xx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;dd.set(s),n.uniformMatrix4fv(this.addr,!1,dd),Xe(e,s)}}function wx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function Sx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2iv(this.addr,t),Xe(e,t)}}function Mx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3iv(this.addr,t),Xe(e,t)}}function Tx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4iv(this.addr,t),Xe(e,t)}}function bx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function Ax(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2uiv(this.addr,t),Xe(e,t)}}function Cx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3uiv(this.addr,t),Xe(e,t)}}function Px(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4uiv(this.addr,t),Xe(e,t)}}function Rx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r);let a;this.type===n.SAMPLER_2D_SHADOW?(od.compareFunction=fu,a=od):a=rd,e.setTexture2D(t||a,r)}function Lx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||ld,r)}function Ix(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||cd,r)}function Dx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||ad,r)}function kx(n){switch(n){case 5126:return mx;case 35664:return gx;case 35665:return _x;case 35666:return vx;case 35674:return yx;case 35675:return Ex;case 35676:return xx;case 5124:case 35670:return wx;case 35667:case 35671:return Sx;case 35668:case 35672:return Mx;case 35669:case 35673:return Tx;case 5125:return bx;case 36294:return Ax;case 36295:return Cx;case 36296:return Px;case 35678:case 36198:case 36298:case 36306:case 35682:return Rx;case 35679:case 36299:case 36307:return Lx;case 35680:case 36300:case 36308:case 36293:return Ix;case 36289:case 36303:case 36311:case 36292:return Dx}}function Ux(n,t){n.uniform1fv(this.addr,t)}function Ox(n,t){const e=Js(t,this.size,2);n.uniform2fv(this.addr,e)}function Nx(n,t){const e=Js(t,this.size,3);n.uniform3fv(this.addr,e)}function Bx(n,t){const e=Js(t,this.size,4);n.uniform4fv(this.addr,e)}function Fx(n,t){const e=Js(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function zx(n,t){const e=Js(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function Hx(n,t){const e=Js(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function Vx(n,t){n.uniform1iv(this.addr,t)}function Gx(n,t){n.uniform2iv(this.addr,t)}function Wx(n,t){n.uniform3iv(this.addr,t)}function Zx(n,t){n.uniform4iv(this.addr,t)}function Xx(n,t){n.uniform1uiv(this.addr,t)}function Yx(n,t){n.uniform2uiv(this.addr,t)}function qx(n,t){n.uniform3uiv(this.addr,t)}function Qx(n,t){n.uniform4uiv(this.addr,t)}function jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||rd,a[l])}function Jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||ld,a[l])}function Kx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||cd,a[l])}function $x(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||ad,a[l])}function tw(n){switch(n){case 5126:return Ux;case 35664:return Ox;case 35665:return Nx;case 35666:return Bx;case 35674:return Fx;case 35675:return zx;case 35676:return Hx;case 5124:case 35670:return Vx;case 35667:case 35671:return Gx;case 35668:case 35672:return Wx;case 35669:case 35673:return Zx;case 5125:return Xx;case 36294:return Yx;case 36295:return qx;case 36296:return Qx;case 35678:case 36198:case 36298:case 36306:case 35682:return jx;case 35679:case 36299:case 36307:return Jx;case 35680:case 36300:case 36308:case 36293:return Kx;case 36289:case 36303:case 36311:case 36292:return $x}}class ew{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=kx(e.type)}}class nw{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=tw(e.type)}}class iw{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,s){const r=this.seq;for(let a=0,l=r.length;a!==l;++a){const h=r[a];h.setValue(t,e[h.id],s)}}}const Dc=/(\w+)(\])?(\[|\.)?/g;function md(n,t){n.seq.push(t),n.map[t.id]=t}function sw(n,t,e){const s=n.name,r=s.length;for(Dc.lastIndex=0;;){const a=Dc.exec(s),l=Dc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){md(e,d===void 0?new ew(h,n,t):new nw(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new iw(h),md(e,m)),e=m}}}class Ko{constructor(t,e){this.seq=[],this.map={};const s=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<s;++r){const a=t.getActiveUniform(e,r),l=t.getUniformLocation(e,a.name);sw(a,l,this)}}setValue(t,e,s,r){const a=this.map[e];a!==void 0&&a.setValue(t,s,r)}setOptional(t,e,s){const r=e[s];r!==void 0&&this.setValue(t,s,r)}static upload(t,e,s,r){for(let a=0,l=e.length;a!==l;++a){const h=e[a],u=s[h.id];u.needsUpdate!==!1&&h.setValue(t,u.value,r)}}static seqWithValue(t,e){const s=[];for(let r=0,a=t.length;r!==a;++r){const l=t[r];l.id in e&&s.push(l)}return s}}function gd(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const rw=37297;let ow=0;function aw(n,t){const e=n.split(`
3746
+ `}function lx(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===fl||u===pl,p=u===Ts||u===bs;if(d||p){let m=t.get(h);const _=m!==void 0?m.texture.pmremVersion:0;if(h.isRenderTargetTexture&&h.pmremVersion!==_)return e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h,m):e.fromCubemap(h,m),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),m.texture;if(m!==void 0)return m.texture;{const E=h.image;return d&&E&&E.height>0||p&&E&&r(E)?(e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h):e.fromCubemap(h),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),h.addEventListener("dispose",a),m.texture):null}}}return h}function r(h){let u=0;const d=6;for(let p=0;p<d;p++)h[p]!==void 0&&u++;return u===d}function a(h){const u=h.target;u.removeEventListener("dispose",a);const d=t.get(u);d!==void 0&&(t.delete(u),d.dispose())}function l(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:s,dispose:l}}function cx(n){const t={};function e(s){if(t[s]!==void 0)return t[s];let r;switch(s){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=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":r=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":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(s)}return t[s]=r,r}return{has:function(s){return e(s)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(s){const r=e(s);return r===null&&Ls("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function hx(n,t,e,s){const r={},a=new WeakMap;function l(m){const _=m.target;_.index!==null&&t.remove(_.index);for(const S in _.attributes)t.remove(_.attributes[S]);_.removeEventListener("dispose",l),delete r[_.id];const E=a.get(_);E&&(t.remove(E),a.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,e.memory.geometries--}function h(m,_){return r[_.id]===!0||(_.addEventListener("dispose",l),r[_.id]=!0,e.memory.geometries++),_}function u(m){const _=m.attributes;for(const E in _)t.update(_[E],n.ARRAY_BUFFER)}function d(m){const _=[],E=m.index,S=m.attributes.position;let w=0;if(E!==null){const I=E.array;w=E.version;for(let C=0,M=I.length;C<M;C+=3){const k=I[C+0],N=I[C+1],B=I[C+2];_.push(k,N,N,B,B,k)}}else if(S!==void 0){const I=S.array;w=S.version;for(let C=0,M=I.length/3-1;C<M;C+=3){const k=C+0,N=C+1,B=C+2;_.push(k,N,N,B,B,k)}}else return;const v=new(vu(_)?Du:Iu)(_,1);v.version=w;const g=a.get(m);g&&t.remove(g),a.set(m,v)}function p(m){const _=a.get(m);if(_){const E=m.index;E!==null&&_.version<E.version&&d(m)}else d(m);return a.get(m)}return{get:h,update:u,getWireframeAttribute:p}}function ux(n,t,e){let s;function r(_){s=_}let a,l;function h(_){a=_.type,l=_.bytesPerElement}function u(_,E){n.drawElements(s,E,a,_*l),e.update(E,s,1)}function d(_,E,S){S!==0&&(n.drawElementsInstanced(s,E,a,_*l,S),e.update(E,s,S))}function p(_,E,S){if(S===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,E,0,a,_,0,S);let v=0;for(let g=0;g<S;g++)v+=E[g];e.update(v,s,1)}function m(_,E,S,w){if(S===0)return;const v=t.get("WEBGL_multi_draw");if(v===null)for(let g=0;g<_.length;g++)d(_[g]/l,E[g],w[g]);else{v.multiDrawElementsInstancedWEBGL(s,E,0,a,_,0,w,0,S);let g=0;for(let I=0;I<S;I++)g+=E[I]*w[I];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function dx(n){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function s(a,l,h){switch(e.calls++,l){case n.TRIANGLES:e.triangles+=h*(a/3);break;case n.LINES:e.lines+=h*(a/2);break;case n.LINE_STRIP:e.lines+=h*(a-1);break;case n.LINE_LOOP:e.lines+=h*a;break;case n.POINTS:e.points+=h*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:r,update:s}}function fx(n,t,e){const s=new WeakMap,r=new He;function a(l,h,u){const d=l.morphTargetInfluences,p=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,m=p!==void 0?p.length:0;let _=s.get(h);if(_===void 0||_.count!==m){let R=function(){B.dispose(),s.delete(h),h.removeEventListener("dispose",R)};_!==void 0&&_.texture.dispose();const E=h.morphAttributes.position!==void 0,S=h.morphAttributes.normal!==void 0,w=h.morphAttributes.color!==void 0,v=h.morphAttributes.position||[],g=h.morphAttributes.normal||[],I=h.morphAttributes.color||[];let C=0;E===!0&&(C=1),S===!0&&(C=2),w===!0&&(C=3);let M=h.attributes.position.count*C,k=1;M>t.maxTextureSize&&(k=Math.ceil(M/t.maxTextureSize),M=t.maxTextureSize);const N=new Float32Array(M*k*4*m),B=new wu(N,M,k,m);B.type=ui,B.needsUpdate=!0;const V=C*4;for(let D=0;D<m;D++){const U=v[D],tt=g[D],F=I[D],H=M*k*4*D;for(let q=0;q<U.count;q++){const j=q*V;E===!0&&(r.fromBufferAttribute(U,q),N[H+j+0]=r.x,N[H+j+1]=r.y,N[H+j+2]=r.z,N[H+j+3]=0),S===!0&&(r.fromBufferAttribute(tt,q),N[H+j+4]=r.x,N[H+j+5]=r.y,N[H+j+6]=r.z,N[H+j+7]=0),w===!0&&(r.fromBufferAttribute(F,q),N[H+j+8]=r.x,N[H+j+9]=r.y,N[H+j+10]=r.z,N[H+j+11]=F.itemSize===4?r.w:1)}}_={count:m,texture:B,size:new be(M,k)},s.set(h,_),h.addEventListener("dispose",R)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)u.getUniforms().setValue(n,"morphTexture",l.morphTexture,e);else{let E=0;for(let w=0;w<d.length;w++)E+=d[w];const S=h.morphTargetsRelative?1:1-E;u.getUniforms().setValue(n,"morphTargetBaseInfluence",S),u.getUniforms().setValue(n,"morphTargetInfluences",d)}u.getUniforms().setValue(n,"morphTargetsTexture",_.texture,e),u.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}return{update:a}}function px(n,t,e,s){let r=new WeakMap;function a(u){const d=s.render.frame,p=u.geometry,m=t.get(u,p);if(r.get(m)!==d&&(t.update(m),r.set(m,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",h)===!1&&u.addEventListener("dispose",h),r.get(u)!==d&&(e.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&e.update(u.instanceColor,n.ARRAY_BUFFER),r.set(u,d))),u.isSkinnedMesh){const _=u.skeleton;r.get(_)!==d&&(_.update(),r.set(_,d))}return m}function l(){r=new WeakMap}function h(u){const d=u.target;d.removeEventListener("dispose",h),e.remove(d.instanceMatrix),d.instanceColor!==null&&e.remove(d.instanceColor)}return{update:a,dispose:l}}const rd=new Je,od=new Xu(1,1),ad=new wu,ld=new p0,cd=new Hu,hd=[],ud=[],dd=new Float32Array(16),fd=new Float32Array(9),pd=new Float32Array(4);function Js(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=hd[r];if(a===void 0&&(a=new Float32Array(r),hd[r]=a),t!==0){s.toArray(a,0);for(let l=1,h=0;l!==t;++l)h+=e,n[l].toArray(a,h)}return a}function Ze(n,t){if(n.length!==t.length)return!1;for(let e=0,s=n.length;e<s;e++)if(n[e]!==t[e])return!1;return!0}function Xe(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Jo(n,t){let e=ud[t];e===void 0&&(e=new Int32Array(t),ud[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function mx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function gx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2fv(this.addr,t),Xe(e,t)}}function _x(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(n.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Ze(e,t))return;n.uniform3fv(this.addr,t),Xe(e,t)}}function vx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4fv(this.addr,t),Xe(e,t)}}function yx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;pd.set(s),n.uniformMatrix2fv(this.addr,!1,pd),Xe(e,s)}}function Ex(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;fd.set(s),n.uniformMatrix3fv(this.addr,!1,fd),Xe(e,s)}}function xx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;dd.set(s),n.uniformMatrix4fv(this.addr,!1,dd),Xe(e,s)}}function wx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function Sx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2iv(this.addr,t),Xe(e,t)}}function Mx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3iv(this.addr,t),Xe(e,t)}}function Tx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4iv(this.addr,t),Xe(e,t)}}function bx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function Ax(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2uiv(this.addr,t),Xe(e,t)}}function Cx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3uiv(this.addr,t),Xe(e,t)}}function Px(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4uiv(this.addr,t),Xe(e,t)}}function Rx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r);let a;this.type===n.SAMPLER_2D_SHADOW?(od.compareFunction=fu,a=od):a=rd,e.setTexture2D(t||a,r)}function Lx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||ld,r)}function Ix(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||cd,r)}function Dx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||ad,r)}function kx(n){switch(n){case 5126:return mx;case 35664:return gx;case 35665:return _x;case 35666:return vx;case 35674:return yx;case 35675:return Ex;case 35676:return xx;case 5124:case 35670:return wx;case 35667:case 35671:return Sx;case 35668:case 35672:return Mx;case 35669:case 35673:return Tx;case 5125:return bx;case 36294:return Ax;case 36295:return Cx;case 36296:return Px;case 35678:case 36198:case 36298:case 36306:case 35682:return Rx;case 35679:case 36299:case 36307:return Lx;case 35680:case 36300:case 36308:case 36293:return Ix;case 36289:case 36303:case 36311:case 36292:return Dx}}function Ux(n,t){n.uniform1fv(this.addr,t)}function Ox(n,t){const e=Js(t,this.size,2);n.uniform2fv(this.addr,e)}function Nx(n,t){const e=Js(t,this.size,3);n.uniform3fv(this.addr,e)}function Bx(n,t){const e=Js(t,this.size,4);n.uniform4fv(this.addr,e)}function Fx(n,t){const e=Js(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function zx(n,t){const e=Js(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function Hx(n,t){const e=Js(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function Vx(n,t){n.uniform1iv(this.addr,t)}function Gx(n,t){n.uniform2iv(this.addr,t)}function Wx(n,t){n.uniform3iv(this.addr,t)}function Zx(n,t){n.uniform4iv(this.addr,t)}function Xx(n,t){n.uniform1uiv(this.addr,t)}function Yx(n,t){n.uniform2uiv(this.addr,t)}function qx(n,t){n.uniform3uiv(this.addr,t)}function Qx(n,t){n.uniform4uiv(this.addr,t)}function jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||rd,a[l])}function Jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||ld,a[l])}function Kx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||cd,a[l])}function $x(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||ad,a[l])}function tw(n){switch(n){case 5126:return Ux;case 35664:return Ox;case 35665:return Nx;case 35666:return Bx;case 35674:return Fx;case 35675:return zx;case 35676:return Hx;case 5124:case 35670:return Vx;case 35667:case 35671:return Gx;case 35668:case 35672:return Wx;case 35669:case 35673:return Zx;case 5125:return Xx;case 36294:return Yx;case 36295:return qx;case 36296:return Qx;case 35678:case 36198:case 36298:case 36306:case 35682:return jx;case 35679:case 36299:case 36307:return Jx;case 35680:case 36300:case 36308:case 36293:return Kx;case 36289:case 36303:case 36311:case 36292:return $x}}class ew{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=kx(e.type)}}class nw{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=tw(e.type)}}class iw{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,s){const r=this.seq;for(let a=0,l=r.length;a!==l;++a){const h=r[a];h.setValue(t,e[h.id],s)}}}const Dc=/(\w+)(\])?(\[|\.)?/g;function md(n,t){n.seq.push(t),n.map[t.id]=t}function sw(n,t,e){const s=n.name,r=s.length;for(Dc.lastIndex=0;;){const a=Dc.exec(s),l=Dc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){md(e,d===void 0?new ew(h,n,t):new nw(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new iw(h),md(e,m)),e=m}}}class Ko{constructor(t,e){this.seq=[],this.map={};const s=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<s;++r){const a=t.getActiveUniform(e,r),l=t.getUniformLocation(e,a.name);sw(a,l,this)}}setValue(t,e,s,r){const a=this.map[e];a!==void 0&&a.setValue(t,s,r)}setOptional(t,e,s){const r=e[s];r!==void 0&&this.setValue(t,s,r)}static upload(t,e,s,r){for(let a=0,l=e.length;a!==l;++a){const h=e[a],u=s[h.id];u.needsUpdate!==!1&&h.setValue(t,u.value,r)}}static seqWithValue(t,e){const s=[];for(let r=0,a=t.length;r!==a;++r){const l=t[r];l.id in e&&s.push(l)}return s}}function gd(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const rw=37297;let ow=0;function aw(n,t){const e=n.split(`
3747
3747
  `),s=[],r=Math.max(t-6,0),a=Math.min(t+6,e.length);for(let l=r;l<a;l++){const h=l+1;s.push(`${h===t?">":" "} ${h}: ${e[l]}`)}return s.join(`
3748
3748
  `)}const _d=new ue;function lw(n){Se._getMatrix(_d,Se.workingColorSpace,n);const t=`mat3( ${_d.elements.map(e=>e.toFixed(4))} )`;switch(Se.getTransfer(n)){case To:return[t,"LinearTransferOETF"];case Ie:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function vd(n,t,e){const s=n.getShaderParameter(t,n.COMPILE_STATUS),a=(n.getShaderInfoLog(t)||"").trim();if(s&&a==="")return"";const l=/ERROR: 0:(\d+)/.exec(a);if(l){const h=parseInt(l[1]);return e.toUpperCase()+`
3749
3749
 
@@ -3787,14 +3787,14 @@ void main() {
3787
3787
  `)+`
3788
3788
  `+v,g=["#define varying in",e.glslVersion===mu?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===mu?"":"#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(`
3789
3789
  `)+`
3790
- `+g);const C=I+v+l,M=I+g+h,k=gd(r,r.VERTEX_SHADER,C),N=gd(r,r.FRAGMENT_SHADER,M);r.attachShader(w,k),r.attachShader(w,N),e.index0AttributeName!==void 0?r.bindAttribLocation(w,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(w,0,"position"),r.linkProgram(w);function B(O){if(n.debug.checkShaderErrors){const et=r.getProgramInfoLog(w)||"",z=r.getShaderInfoLog(k)||"",H=r.getShaderInfoLog(N)||"",q=et.trim(),j=z.trim(),ct=H.trim();let W=!0,St=!0;if(r.getProgramParameter(w,r.LINK_STATUS)===!1)if(W=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,w,k,N);else{const at=vd(r,k,"vertex"),Mt=vd(r,N,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(w,r.VALIDATE_STATUS)+`
3790
+ `+g);const C=I+v+l,M=I+g+h,k=gd(r,r.VERTEX_SHADER,C),N=gd(r,r.FRAGMENT_SHADER,M);r.attachShader(w,k),r.attachShader(w,N),e.index0AttributeName!==void 0?r.bindAttribLocation(w,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(w,0,"position"),r.linkProgram(w);function B(U){if(n.debug.checkShaderErrors){const tt=r.getProgramInfoLog(w)||"",F=r.getShaderInfoLog(k)||"",H=r.getShaderInfoLog(N)||"",q=tt.trim(),j=F.trim(),ct=H.trim();let W=!0,Et=!0;if(r.getProgramParameter(w,r.LINK_STATUS)===!1)if(W=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,w,k,N);else{const lt=vd(r,k,"vertex"),Mt=vd(r,N,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(w,r.VALIDATE_STATUS)+`
3791
3791
 
3792
- Material Name: `+O.name+`
3793
- Material Type: `+O.type+`
3792
+ Material Name: `+U.name+`
3793
+ Material Type: `+U.type+`
3794
3794
 
3795
3795
  Program Info Log: `+q+`
3796
- `+at+`
3797
- `+Mt)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(j===""||ct==="")&&(St=!1);St&&(O.diagnostics={runnable:W,programLog:q,vertexShader:{log:j,prefix:v},fragmentShader:{log:ct,prefix:g}})}r.deleteShader(k),r.deleteShader(N),V=new Ko(r,w),D=pw(r,w)}let V;this.getUniforms=function(){return V===void 0&&B(this),V};let D;this.getAttributes=function(){return D===void 0&&B(this),D};let P=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=r.getProgramParameter(w,rw)),P},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=ow++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=k,this.fragmentShader=N,this}let bw=0;class Aw{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,s=t.fragmentShader,r=this._getShaderStage(e),a=this._getShaderStage(s),l=this._getShaderCacheForMaterial(t);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const s of e)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let s=e.get(t);return s===void 0&&(s=new Set,e.set(t,s)),s}_getShaderStage(t){const e=this.shaderCache;let s=e.get(t);return s===void 0&&(s=new Cw(t),e.set(t,s)),s}}class Cw{constructor(t){this.id=bw++,this.code=t,this.usedTimes=0}}function Pw(n,t,e,s,r,a,l){const h=new lc,u=new Aw,d=new Set,p=[],m=r.logarithmicDepthBuffer,_=r.vertexTextures;let E=r.precision;const S={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"};function w(D){return d.add(D),D===0?"uv":`uv${D}`}function v(D,P,O,et,z){const H=et.fog,q=z.geometry,j=D.isMeshStandardMaterial?et.environment:null,ct=(D.isMeshStandardMaterial?e:t).get(D.envMap||j),W=ct&&ct.mapping===vo?ct.image.height:null,St=S[D.type];D.precision!==null&&(E=r.getMaxPrecision(D.precision),E!==D.precision&&console.warn("THREE.WebGLProgram.getParameters:",D.precision,"not supported, using",E,"instead."));const at=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,Mt=at!==void 0?at.length:0;let Ot=0;q.morphAttributes.position!==void 0&&(Ot=1),q.morphAttributes.normal!==void 0&&(Ot=2),q.morphAttributes.color!==void 0&&(Ot=3);let oe,Qt,tt,ut;if(St){const Me=ti[St];oe=Me.vertexShader,Qt=Me.fragmentShader}else oe=D.vertexShader,Qt=D.fragmentShader,u.update(D),tt=u.getVertexShaderID(D),ut=u.getFragmentShaderID(D);const _t=n.getRenderTarget(),Nt=n.state.buffers.depth.getReversed(),Zt=z.isInstancedMesh===!0,jt=z.isBatchedMesh===!0,Re=!!D.map,dt=!!D.matcap,T=!!ct,Z=!!D.aoMap,$=!!D.lightMap,ht=!!D.bumpMap,lt=!!D.normalMap,Tt=!!D.displacementMap,pt=!!D.emissiveMap,bt=!!D.metalnessMap,re=!!D.roughnessMap,de=D.anisotropy>0,U=D.clearcoat>0,b=D.dispersion>0,J=D.iridescence>0,rt=D.sheen>0,gt=D.transmission>0,ot=de&&!!D.anisotropyMap,Ht=U&&!!D.clearcoatMap,At=U&&!!D.clearcoatNormalMap,Bt=U&&!!D.clearcoatRoughnessMap,Vt=J&&!!D.iridescenceMap,xt=J&&!!D.iridescenceThicknessMap,Lt=rt&&!!D.sheenColorMap,ne=rt&&!!D.sheenRoughnessMap,Gt=!!D.specularMap,Pt=!!D.specularColorMap,ce=!!D.specularIntensityMap,G=gt&&!!D.transmissionMap,wt=gt&&!!D.thicknessMap,Ct=!!D.gradientMap,Ut=!!D.alphaMap,vt=D.alphaTest>0,ft=!!D.alphaHash,zt=!!D.extensions;let le=Pi;D.toneMapped&&(_t===null||_t.isXRRenderTarget===!0)&&(le=n.toneMapping);const De={shaderID:St,shaderType:D.type,shaderName:D.name,vertexShader:oe,fragmentShader:Qt,defines:D.defines,customVertexShaderID:tt,customFragmentShaderID:ut,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:E,batching:jt,batchingColor:jt&&z._colorsTexture!==null,instancing:Zt,instancingColor:Zt&&z.instanceColor!==null,instancingMorph:Zt&&z.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:_t===null?n.outputColorSpace:_t.isXRRenderTarget===!0?_t.texture.colorSpace:is,alphaToCoverage:!!D.alphaToCoverage,map:Re,matcap:dt,envMap:T,envMapMode:T&&ct.mapping,envMapCubeUVHeight:W,aoMap:Z,lightMap:$,bumpMap:ht,normalMap:lt,displacementMap:_&&Tt,emissiveMap:pt,normalMapObjectSpace:lt&&D.normalMapType===Nv,normalMapTangentSpace:lt&&D.normalMapType===Ov,metalnessMap:bt,roughnessMap:re,anisotropy:de,anisotropyMap:ot,clearcoat:U,clearcoatMap:Ht,clearcoatNormalMap:At,clearcoatRoughnessMap:Bt,dispersion:b,iridescence:J,iridescenceMap:Vt,iridescenceThicknessMap:xt,sheen:rt,sheenColorMap:Lt,sheenRoughnessMap:ne,specularMap:Gt,specularColorMap:Pt,specularIntensityMap:ce,transmission:gt,transmissionMap:G,thicknessMap:wt,gradientMap:Ct,opaque:D.transparent===!1&&D.blending===Ss&&D.alphaToCoverage===!1,alphaMap:Ut,alphaTest:vt,alphaHash:ft,combine:D.combine,mapUv:Re&&w(D.map.channel),aoMapUv:Z&&w(D.aoMap.channel),lightMapUv:$&&w(D.lightMap.channel),bumpMapUv:ht&&w(D.bumpMap.channel),normalMapUv:lt&&w(D.normalMap.channel),displacementMapUv:Tt&&w(D.displacementMap.channel),emissiveMapUv:pt&&w(D.emissiveMap.channel),metalnessMapUv:bt&&w(D.metalnessMap.channel),roughnessMapUv:re&&w(D.roughnessMap.channel),anisotropyMapUv:ot&&w(D.anisotropyMap.channel),clearcoatMapUv:Ht&&w(D.clearcoatMap.channel),clearcoatNormalMapUv:At&&w(D.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Bt&&w(D.clearcoatRoughnessMap.channel),iridescenceMapUv:Vt&&w(D.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&w(D.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&w(D.sheenColorMap.channel),sheenRoughnessMapUv:ne&&w(D.sheenRoughnessMap.channel),specularMapUv:Gt&&w(D.specularMap.channel),specularColorMapUv:Pt&&w(D.specularColorMap.channel),specularIntensityMapUv:ce&&w(D.specularIntensityMap.channel),transmissionMapUv:G&&w(D.transmissionMap.channel),thicknessMapUv:wt&&w(D.thicknessMap.channel),alphaMapUv:Ut&&w(D.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(lt||de),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!q.attributes.uv&&(Re||Ut),fog:!!H,useFog:D.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:D.flatShading===!0&&D.wireframe===!1,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Nt,skinning:z.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:Ot,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:D.dithering,shadowMapEnabled:n.shadowMap.enabled&&O.length>0,shadowMapType:n.shadowMap.type,toneMapping:le,decodeVideoTexture:Re&&D.map.isVideoTexture===!0&&Se.getTransfer(D.map.colorSpace)===Ie,decodeVideoTextureEmissive:pt&&D.emissiveMap.isVideoTexture===!0&&Se.getTransfer(D.emissiveMap.colorSpace)===Ie,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===ci,flipSided:D.side===fn,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:zt&&D.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(zt&&D.extensions.multiDraw===!0||jt)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return De.vertexUv1s=d.has(1),De.vertexUv2s=d.has(2),De.vertexUv3s=d.has(3),d.clear(),De}function g(D){const P=[];if(D.shaderID?P.push(D.shaderID):(P.push(D.customVertexShaderID),P.push(D.customFragmentShaderID)),D.defines!==void 0)for(const O in D.defines)P.push(O),P.push(D.defines[O]);return D.isRawShaderMaterial===!1&&(I(P,D),C(P,D),P.push(n.outputColorSpace)),P.push(D.customProgramCacheKey),P.join()}function I(D,P){D.push(P.precision),D.push(P.outputColorSpace),D.push(P.envMapMode),D.push(P.envMapCubeUVHeight),D.push(P.mapUv),D.push(P.alphaMapUv),D.push(P.lightMapUv),D.push(P.aoMapUv),D.push(P.bumpMapUv),D.push(P.normalMapUv),D.push(P.displacementMapUv),D.push(P.emissiveMapUv),D.push(P.metalnessMapUv),D.push(P.roughnessMapUv),D.push(P.anisotropyMapUv),D.push(P.clearcoatMapUv),D.push(P.clearcoatNormalMapUv),D.push(P.clearcoatRoughnessMapUv),D.push(P.iridescenceMapUv),D.push(P.iridescenceThicknessMapUv),D.push(P.sheenColorMapUv),D.push(P.sheenRoughnessMapUv),D.push(P.specularMapUv),D.push(P.specularColorMapUv),D.push(P.specularIntensityMapUv),D.push(P.transmissionMapUv),D.push(P.thicknessMapUv),D.push(P.combine),D.push(P.fogExp2),D.push(P.sizeAttenuation),D.push(P.morphTargetsCount),D.push(P.morphAttributeCount),D.push(P.numDirLights),D.push(P.numPointLights),D.push(P.numSpotLights),D.push(P.numSpotLightMaps),D.push(P.numHemiLights),D.push(P.numRectAreaLights),D.push(P.numDirLightShadows),D.push(P.numPointLightShadows),D.push(P.numSpotLightShadows),D.push(P.numSpotLightShadowsWithMaps),D.push(P.numLightProbes),D.push(P.shadowMapType),D.push(P.toneMapping),D.push(P.numClippingPlanes),D.push(P.numClipIntersection),D.push(P.depthPacking)}function C(D,P){h.disableAll(),P.supportsVertexTextures&&h.enable(0),P.instancing&&h.enable(1),P.instancingColor&&h.enable(2),P.instancingMorph&&h.enable(3),P.matcap&&h.enable(4),P.envMap&&h.enable(5),P.normalMapObjectSpace&&h.enable(6),P.normalMapTangentSpace&&h.enable(7),P.clearcoat&&h.enable(8),P.iridescence&&h.enable(9),P.alphaTest&&h.enable(10),P.vertexColors&&h.enable(11),P.vertexAlphas&&h.enable(12),P.vertexUv1s&&h.enable(13),P.vertexUv2s&&h.enable(14),P.vertexUv3s&&h.enable(15),P.vertexTangents&&h.enable(16),P.anisotropy&&h.enable(17),P.alphaHash&&h.enable(18),P.batching&&h.enable(19),P.dispersion&&h.enable(20),P.batchingColor&&h.enable(21),P.gradientMap&&h.enable(22),D.push(h.mask),h.disableAll(),P.fog&&h.enable(0),P.useFog&&h.enable(1),P.flatShading&&h.enable(2),P.logarithmicDepthBuffer&&h.enable(3),P.reversedDepthBuffer&&h.enable(4),P.skinning&&h.enable(5),P.morphTargets&&h.enable(6),P.morphNormals&&h.enable(7),P.morphColors&&h.enable(8),P.premultipliedAlpha&&h.enable(9),P.shadowMapEnabled&&h.enable(10),P.doubleSided&&h.enable(11),P.flipSided&&h.enable(12),P.useDepthPacking&&h.enable(13),P.dithering&&h.enable(14),P.transmission&&h.enable(15),P.sheen&&h.enable(16),P.opaque&&h.enable(17),P.pointsUvs&&h.enable(18),P.decodeVideoTexture&&h.enable(19),P.decodeVideoTextureEmissive&&h.enable(20),P.alphaToCoverage&&h.enable(21),D.push(h.mask)}function M(D){const P=S[D.type];let O;if(P){const et=ti[P];O=A0.clone(et.uniforms)}else O=D.uniforms;return O}function k(D,P){let O;for(let et=0,z=p.length;et<z;et++){const H=p[et];if(H.cacheKey===P){O=H,++O.usedTimes;break}}return O===void 0&&(O=new Tw(n,P,D,a),p.push(O)),O}function N(D){if(--D.usedTimes===0){const P=p.indexOf(D);p[P]=p[p.length-1],p.pop(),D.destroy()}}function B(D){u.remove(D)}function V(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:M,acquireProgram:k,releaseProgram:N,releaseShaderCache:B,programs:p,dispose:V}}function Rw(){let n=new WeakMap;function t(l){return n.has(l)}function e(l){let h=n.get(l);return h===void 0&&(h={},n.set(l,h)),h}function s(l){n.delete(l)}function r(l,h,u){n.get(l)[h]=u}function a(){n=new WeakMap}return{has:t,get:e,remove:s,update:r,dispose:a}}function Lw(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function Sd(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function Md(){const n=[];let t=0;const e=[],s=[],r=[];function a(){t=0,e.length=0,s.length=0,r.length=0}function l(m,_,E,S,w,v){let g=n[t];return g===void 0?(g={id:m.id,object:m,geometry:_,material:E,groupOrder:S,renderOrder:m.renderOrder,z:w,group:v},n[t]=g):(g.id=m.id,g.object=m,g.geometry=_,g.material=E,g.groupOrder=S,g.renderOrder=m.renderOrder,g.z=w,g.group=v),t++,g}function h(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.push(g):E.transparent===!0?r.push(g):e.push(g)}function u(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.unshift(g):E.transparent===!0?r.unshift(g):e.unshift(g)}function d(m,_){e.length>1&&e.sort(m||Lw),s.length>1&&s.sort(_||Sd),r.length>1&&r.sort(_||Sd)}function p(){for(let m=t,_=n.length;m<_;m++){const E=n[m];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:e,transmissive:s,transparent:r,init:a,push:h,unshift:u,finish:p,sort:d}}function Iw(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new Md,n.set(s,[l])):r>=a.length?(l=new Md,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Dw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new Q,color:new Ce};break;case"SpotLight":e={position:new Q,direction:new Q,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new Q,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new Q,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":e={color:new Ce,position:new Q,halfWidth:new Q,halfHeight:new Q};break}return n[t.id]=e,e}}}function kw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let Uw=0;function Ow(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Nw(n){const t=new Dw,e=kw(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)s.probe.push(new Q);const r=new Q,a=new Oe,l=new Oe;function h(d){let p=0,m=0,_=0;for(let D=0;D<9;D++)s.probe[D].set(0,0,0);let E=0,S=0,w=0,v=0,g=0,I=0,C=0,M=0,k=0,N=0,B=0;d.sort(Ow);for(let D=0,P=d.length;D<P;D++){const O=d[D],et=O.color,z=O.intensity,H=O.distance,q=O.shadow&&O.shadow.map?O.shadow.map.texture:null;if(O.isAmbientLight)p+=et.r*z,m+=et.g*z,_+=et.b*z;else if(O.isLightProbe){for(let j=0;j<9;j++)s.probe[j].addScaledVector(O.sh.coefficients[j],z);B++}else if(O.isDirectionalLight){const j=t.get(O);if(j.color.copy(O.color).multiplyScalar(O.intensity),O.castShadow){const ct=O.shadow,W=e.get(O);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,s.directionalShadow[E]=W,s.directionalShadowMap[E]=q,s.directionalShadowMatrix[E]=O.shadow.matrix,I++}s.directional[E]=j,E++}else if(O.isSpotLight){const j=t.get(O);j.position.setFromMatrixPosition(O.matrixWorld),j.color.copy(et).multiplyScalar(z),j.distance=H,j.coneCos=Math.cos(O.angle),j.penumbraCos=Math.cos(O.angle*(1-O.penumbra)),j.decay=O.decay,s.spot[w]=j;const ct=O.shadow;if(O.map&&(s.spotLightMap[k]=O.map,k++,ct.updateMatrices(O),O.castShadow&&N++),s.spotLightMatrix[w]=ct.matrix,O.castShadow){const W=e.get(O);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,s.spotShadow[w]=W,s.spotShadowMap[w]=q,M++}w++}else if(O.isRectAreaLight){const j=t.get(O);j.color.copy(et).multiplyScalar(z),j.halfWidth.set(O.width*.5,0,0),j.halfHeight.set(0,O.height*.5,0),s.rectArea[v]=j,v++}else if(O.isPointLight){const j=t.get(O);if(j.color.copy(O.color).multiplyScalar(O.intensity),j.distance=O.distance,j.decay=O.decay,O.castShadow){const ct=O.shadow,W=e.get(O);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,W.shadowCameraNear=ct.camera.near,W.shadowCameraFar=ct.camera.far,s.pointShadow[S]=W,s.pointShadowMap[S]=q,s.pointShadowMatrix[S]=O.shadow.matrix,C++}s.point[S]=j,S++}else if(O.isHemisphereLight){const j=t.get(O);j.skyColor.copy(O.color).multiplyScalar(z),j.groundColor.copy(O.groundColor).multiplyScalar(z),s.hemi[g]=j,g++}}v>0&&(n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Rt.LTC_FLOAT_1,s.rectAreaLTC2=Rt.LTC_FLOAT_2):(s.rectAreaLTC1=Rt.LTC_HALF_1,s.rectAreaLTC2=Rt.LTC_HALF_2)),s.ambient[0]=p,s.ambient[1]=m,s.ambient[2]=_;const V=s.hash;(V.directionalLength!==E||V.pointLength!==S||V.spotLength!==w||V.rectAreaLength!==v||V.hemiLength!==g||V.numDirectionalShadows!==I||V.numPointShadows!==C||V.numSpotShadows!==M||V.numSpotMaps!==k||V.numLightProbes!==B)&&(s.directional.length=E,s.spot.length=w,s.rectArea.length=v,s.point.length=S,s.hemi.length=g,s.directionalShadow.length=I,s.directionalShadowMap.length=I,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=M,s.spotShadowMap.length=M,s.directionalShadowMatrix.length=I,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=M+k-N,s.spotLightMap.length=k,s.numSpotLightShadowsWithMaps=N,s.numLightProbes=B,V.directionalLength=E,V.pointLength=S,V.spotLength=w,V.rectAreaLength=v,V.hemiLength=g,V.numDirectionalShadows=I,V.numPointShadows=C,V.numSpotShadows=M,V.numSpotMaps=k,V.numLightProbes=B,s.version=Uw++)}function u(d,p){let m=0,_=0,E=0,S=0,w=0;const v=p.matrixWorldInverse;for(let g=0,I=d.length;g<I;g++){const C=d[g];if(C.isDirectionalLight){const M=s.directional[m];M.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(v),m++}else if(C.isSpotLight){const M=s.spot[E];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),M.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(v),E++}else if(C.isRectAreaLight){const M=s.rectArea[S];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),l.identity(),a.copy(C.matrixWorld),a.premultiply(v),l.extractRotation(a),M.halfWidth.set(C.width*.5,0,0),M.halfHeight.set(0,C.height*.5,0),M.halfWidth.applyMatrix4(l),M.halfHeight.applyMatrix4(l),S++}else if(C.isPointLight){const M=s.point[_];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),_++}else if(C.isHemisphereLight){const M=s.hemi[w];M.direction.setFromMatrixPosition(C.matrixWorld),M.direction.transformDirection(v),w++}}}return{setup:h,setupView:u,state:s}}function Td(n){const t=new Nw(n),e=[],s=[];function r(p){d.camera=p,e.length=0,s.length=0}function a(p){e.push(p)}function l(p){s.push(p)}function h(){t.setup(e)}function u(p){t.setupView(e,p)}const d={lightsArray:e,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:d,setupLights:h,setupLightsView:u,pushLight:a,pushShadow:l}}function Bw(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new Td(n),t.set(r,[h])):a>=l.length?(h=new Td(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const Fw=`void main() {
3796
+ `+lt+`
3797
+ `+Mt)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(j===""||ct==="")&&(Et=!1);Et&&(U.diagnostics={runnable:W,programLog:q,vertexShader:{log:j,prefix:v},fragmentShader:{log:ct,prefix:g}})}r.deleteShader(k),r.deleteShader(N),V=new Ko(r,w),R=pw(r,w)}let V;this.getUniforms=function(){return V===void 0&&B(this),V};let R;this.getAttributes=function(){return R===void 0&&B(this),R};let D=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return D===!1&&(D=r.getProgramParameter(w,rw)),D},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=ow++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=k,this.fragmentShader=N,this}let bw=0;class Aw{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,s=t.fragmentShader,r=this._getShaderStage(e),a=this._getShaderStage(s),l=this._getShaderCacheForMaterial(t);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const s of e)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let s=e.get(t);return s===void 0&&(s=new Set,e.set(t,s)),s}_getShaderStage(t){const e=this.shaderCache;let s=e.get(t);return s===void 0&&(s=new Cw(t),e.set(t,s)),s}}class Cw{constructor(t){this.id=bw++,this.code=t,this.usedTimes=0}}function Pw(n,t,e,s,r,a,l){const h=new lc,u=new Aw,d=new Set,p=[],m=r.logarithmicDepthBuffer,_=r.vertexTextures;let E=r.precision;const S={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"};function w(R){return d.add(R),R===0?"uv":`uv${R}`}function v(R,D,U,tt,F){const H=tt.fog,q=F.geometry,j=R.isMeshStandardMaterial?tt.environment:null,ct=(R.isMeshStandardMaterial?e:t).get(R.envMap||j),W=ct&&ct.mapping===vo?ct.image.height:null,Et=S[R.type];R.precision!==null&&(E=r.getMaxPrecision(R.precision),E!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",E,"instead."));const lt=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,Mt=lt!==void 0?lt.length:0;let Ot=0;q.morphAttributes.position!==void 0&&(Ot=1),q.morphAttributes.normal!==void 0&&(Ot=2),q.morphAttributes.color!==void 0&&(Ot=3);let oe,Qt,et,ut;if(Et){const Me=ti[Et];oe=Me.vertexShader,Qt=Me.fragmentShader}else oe=R.vertexShader,Qt=R.fragmentShader,u.update(R),et=u.getVertexShaderID(R),ut=u.getFragmentShaderID(R);const _t=n.getRenderTarget(),Nt=n.state.buffers.depth.getReversed(),Zt=F.isInstancedMesh===!0,jt=F.isBatchedMesh===!0,Re=!!R.map,ft=!!R.matcap,T=!!ct,Z=!!R.aoMap,$=!!R.lightMap,ht=!!R.bumpMap,rt=!!R.normalMap,Tt=!!R.displacementMap,pt=!!R.emissiveMap,At=!!R.metalnessMap,ne=!!R.roughnessMap,de=R.anisotropy>0,O=R.clearcoat>0,b=R.dispersion>0,J=R.iridescence>0,ot=R.sheen>0,gt=R.transmission>0,at=de&&!!R.anisotropyMap,Ht=O&&!!R.clearcoatMap,bt=O&&!!R.clearcoatNormalMap,Bt=O&&!!R.clearcoatRoughnessMap,Vt=J&&!!R.iridescenceMap,wt=J&&!!R.iridescenceThicknessMap,Lt=ot&&!!R.sheenColorMap,ie=ot&&!!R.sheenRoughnessMap,Gt=!!R.specularMap,Pt=!!R.specularColorMap,ce=!!R.specularIntensityMap,G=gt&&!!R.transmissionMap,St=gt&&!!R.thicknessMap,Ct=!!R.gradientMap,Ut=!!R.alphaMap,vt=R.alphaTest>0,dt=!!R.alphaHash,zt=!!R.extensions;let le=Pi;R.toneMapped&&(_t===null||_t.isXRRenderTarget===!0)&&(le=n.toneMapping);const De={shaderID:Et,shaderType:R.type,shaderName:R.name,vertexShader:oe,fragmentShader:Qt,defines:R.defines,customVertexShaderID:et,customFragmentShaderID:ut,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:E,batching:jt,batchingColor:jt&&F._colorsTexture!==null,instancing:Zt,instancingColor:Zt&&F.instanceColor!==null,instancingMorph:Zt&&F.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:_t===null?n.outputColorSpace:_t.isXRRenderTarget===!0?_t.texture.colorSpace:is,alphaToCoverage:!!R.alphaToCoverage,map:Re,matcap:ft,envMap:T,envMapMode:T&&ct.mapping,envMapCubeUVHeight:W,aoMap:Z,lightMap:$,bumpMap:ht,normalMap:rt,displacementMap:_&&Tt,emissiveMap:pt,normalMapObjectSpace:rt&&R.normalMapType===Nv,normalMapTangentSpace:rt&&R.normalMapType===Ov,metalnessMap:At,roughnessMap:ne,anisotropy:de,anisotropyMap:at,clearcoat:O,clearcoatMap:Ht,clearcoatNormalMap:bt,clearcoatRoughnessMap:Bt,dispersion:b,iridescence:J,iridescenceMap:Vt,iridescenceThicknessMap:wt,sheen:ot,sheenColorMap:Lt,sheenRoughnessMap:ie,specularMap:Gt,specularColorMap:Pt,specularIntensityMap:ce,transmission:gt,transmissionMap:G,thicknessMap:St,gradientMap:Ct,opaque:R.transparent===!1&&R.blending===Ss&&R.alphaToCoverage===!1,alphaMap:Ut,alphaTest:vt,alphaHash:dt,combine:R.combine,mapUv:Re&&w(R.map.channel),aoMapUv:Z&&w(R.aoMap.channel),lightMapUv:$&&w(R.lightMap.channel),bumpMapUv:ht&&w(R.bumpMap.channel),normalMapUv:rt&&w(R.normalMap.channel),displacementMapUv:Tt&&w(R.displacementMap.channel),emissiveMapUv:pt&&w(R.emissiveMap.channel),metalnessMapUv:At&&w(R.metalnessMap.channel),roughnessMapUv:ne&&w(R.roughnessMap.channel),anisotropyMapUv:at&&w(R.anisotropyMap.channel),clearcoatMapUv:Ht&&w(R.clearcoatMap.channel),clearcoatNormalMapUv:bt&&w(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Bt&&w(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Vt&&w(R.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&w(R.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&w(R.sheenColorMap.channel),sheenRoughnessMapUv:ie&&w(R.sheenRoughnessMap.channel),specularMapUv:Gt&&w(R.specularMap.channel),specularColorMapUv:Pt&&w(R.specularColorMap.channel),specularIntensityMapUv:ce&&w(R.specularIntensityMap.channel),transmissionMapUv:G&&w(R.transmissionMap.channel),thicknessMapUv:St&&w(R.thicknessMap.channel),alphaMapUv:Ut&&w(R.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(rt||de),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!q.attributes.uv&&(Re||Ut),fog:!!H,useFog:R.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:R.flatShading===!0&&R.wireframe===!1,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Nt,skinning:F.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:Ot,numDirLights:D.directional.length,numPointLights:D.point.length,numSpotLights:D.spot.length,numSpotLightMaps:D.spotLightMap.length,numRectAreaLights:D.rectArea.length,numHemiLights:D.hemi.length,numDirLightShadows:D.directionalShadowMap.length,numPointLightShadows:D.pointShadowMap.length,numSpotLightShadows:D.spotShadowMap.length,numSpotLightShadowsWithMaps:D.numSpotLightShadowsWithMaps,numLightProbes:D.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:R.dithering,shadowMapEnabled:n.shadowMap.enabled&&U.length>0,shadowMapType:n.shadowMap.type,toneMapping:le,decodeVideoTexture:Re&&R.map.isVideoTexture===!0&&Se.getTransfer(R.map.colorSpace)===Ie,decodeVideoTextureEmissive:pt&&R.emissiveMap.isVideoTexture===!0&&Se.getTransfer(R.emissiveMap.colorSpace)===Ie,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===ci,flipSided:R.side===fn,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionClipCullDistance:zt&&R.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(zt&&R.extensions.multiDraw===!0||jt)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()};return De.vertexUv1s=d.has(1),De.vertexUv2s=d.has(2),De.vertexUv3s=d.has(3),d.clear(),De}function g(R){const D=[];if(R.shaderID?D.push(R.shaderID):(D.push(R.customVertexShaderID),D.push(R.customFragmentShaderID)),R.defines!==void 0)for(const U in R.defines)D.push(U),D.push(R.defines[U]);return R.isRawShaderMaterial===!1&&(I(D,R),C(D,R),D.push(n.outputColorSpace)),D.push(R.customProgramCacheKey),D.join()}function I(R,D){R.push(D.precision),R.push(D.outputColorSpace),R.push(D.envMapMode),R.push(D.envMapCubeUVHeight),R.push(D.mapUv),R.push(D.alphaMapUv),R.push(D.lightMapUv),R.push(D.aoMapUv),R.push(D.bumpMapUv),R.push(D.normalMapUv),R.push(D.displacementMapUv),R.push(D.emissiveMapUv),R.push(D.metalnessMapUv),R.push(D.roughnessMapUv),R.push(D.anisotropyMapUv),R.push(D.clearcoatMapUv),R.push(D.clearcoatNormalMapUv),R.push(D.clearcoatRoughnessMapUv),R.push(D.iridescenceMapUv),R.push(D.iridescenceThicknessMapUv),R.push(D.sheenColorMapUv),R.push(D.sheenRoughnessMapUv),R.push(D.specularMapUv),R.push(D.specularColorMapUv),R.push(D.specularIntensityMapUv),R.push(D.transmissionMapUv),R.push(D.thicknessMapUv),R.push(D.combine),R.push(D.fogExp2),R.push(D.sizeAttenuation),R.push(D.morphTargetsCount),R.push(D.morphAttributeCount),R.push(D.numDirLights),R.push(D.numPointLights),R.push(D.numSpotLights),R.push(D.numSpotLightMaps),R.push(D.numHemiLights),R.push(D.numRectAreaLights),R.push(D.numDirLightShadows),R.push(D.numPointLightShadows),R.push(D.numSpotLightShadows),R.push(D.numSpotLightShadowsWithMaps),R.push(D.numLightProbes),R.push(D.shadowMapType),R.push(D.toneMapping),R.push(D.numClippingPlanes),R.push(D.numClipIntersection),R.push(D.depthPacking)}function C(R,D){h.disableAll(),D.supportsVertexTextures&&h.enable(0),D.instancing&&h.enable(1),D.instancingColor&&h.enable(2),D.instancingMorph&&h.enable(3),D.matcap&&h.enable(4),D.envMap&&h.enable(5),D.normalMapObjectSpace&&h.enable(6),D.normalMapTangentSpace&&h.enable(7),D.clearcoat&&h.enable(8),D.iridescence&&h.enable(9),D.alphaTest&&h.enable(10),D.vertexColors&&h.enable(11),D.vertexAlphas&&h.enable(12),D.vertexUv1s&&h.enable(13),D.vertexUv2s&&h.enable(14),D.vertexUv3s&&h.enable(15),D.vertexTangents&&h.enable(16),D.anisotropy&&h.enable(17),D.alphaHash&&h.enable(18),D.batching&&h.enable(19),D.dispersion&&h.enable(20),D.batchingColor&&h.enable(21),D.gradientMap&&h.enable(22),R.push(h.mask),h.disableAll(),D.fog&&h.enable(0),D.useFog&&h.enable(1),D.flatShading&&h.enable(2),D.logarithmicDepthBuffer&&h.enable(3),D.reversedDepthBuffer&&h.enable(4),D.skinning&&h.enable(5),D.morphTargets&&h.enable(6),D.morphNormals&&h.enable(7),D.morphColors&&h.enable(8),D.premultipliedAlpha&&h.enable(9),D.shadowMapEnabled&&h.enable(10),D.doubleSided&&h.enable(11),D.flipSided&&h.enable(12),D.useDepthPacking&&h.enable(13),D.dithering&&h.enable(14),D.transmission&&h.enable(15),D.sheen&&h.enable(16),D.opaque&&h.enable(17),D.pointsUvs&&h.enable(18),D.decodeVideoTexture&&h.enable(19),D.decodeVideoTextureEmissive&&h.enable(20),D.alphaToCoverage&&h.enable(21),R.push(h.mask)}function M(R){const D=S[R.type];let U;if(D){const tt=ti[D];U=A0.clone(tt.uniforms)}else U=R.uniforms;return U}function k(R,D){let U;for(let tt=0,F=p.length;tt<F;tt++){const H=p[tt];if(H.cacheKey===D){U=H,++U.usedTimes;break}}return U===void 0&&(U=new Tw(n,D,R,a),p.push(U)),U}function N(R){if(--R.usedTimes===0){const D=p.indexOf(R);p[D]=p[p.length-1],p.pop(),R.destroy()}}function B(R){u.remove(R)}function V(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:M,acquireProgram:k,releaseProgram:N,releaseShaderCache:B,programs:p,dispose:V}}function Rw(){let n=new WeakMap;function t(l){return n.has(l)}function e(l){let h=n.get(l);return h===void 0&&(h={},n.set(l,h)),h}function s(l){n.delete(l)}function r(l,h,u){n.get(l)[h]=u}function a(){n=new WeakMap}return{has:t,get:e,remove:s,update:r,dispose:a}}function Lw(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function Sd(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function Md(){const n=[];let t=0;const e=[],s=[],r=[];function a(){t=0,e.length=0,s.length=0,r.length=0}function l(m,_,E,S,w,v){let g=n[t];return g===void 0?(g={id:m.id,object:m,geometry:_,material:E,groupOrder:S,renderOrder:m.renderOrder,z:w,group:v},n[t]=g):(g.id=m.id,g.object=m,g.geometry=_,g.material=E,g.groupOrder=S,g.renderOrder=m.renderOrder,g.z=w,g.group=v),t++,g}function h(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.push(g):E.transparent===!0?r.push(g):e.push(g)}function u(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.unshift(g):E.transparent===!0?r.unshift(g):e.unshift(g)}function d(m,_){e.length>1&&e.sort(m||Lw),s.length>1&&s.sort(_||Sd),r.length>1&&r.sort(_||Sd)}function p(){for(let m=t,_=n.length;m<_;m++){const E=n[m];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:e,transmissive:s,transparent:r,init:a,push:h,unshift:u,finish:p,sort:d}}function Iw(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new Md,n.set(s,[l])):r>=a.length?(l=new Md,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Dw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new Q,color:new Ce};break;case"SpotLight":e={position:new Q,direction:new Q,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new Q,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new Q,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":e={color:new Ce,position:new Q,halfWidth:new Q,halfHeight:new Q};break}return n[t.id]=e,e}}}function kw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let Uw=0;function Ow(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Nw(n){const t=new Dw,e=kw(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)s.probe.push(new Q);const r=new Q,a=new Oe,l=new Oe;function h(d){let p=0,m=0,_=0;for(let R=0;R<9;R++)s.probe[R].set(0,0,0);let E=0,S=0,w=0,v=0,g=0,I=0,C=0,M=0,k=0,N=0,B=0;d.sort(Ow);for(let R=0,D=d.length;R<D;R++){const U=d[R],tt=U.color,F=U.intensity,H=U.distance,q=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)p+=tt.r*F,m+=tt.g*F,_+=tt.b*F;else if(U.isLightProbe){for(let j=0;j<9;j++)s.probe[j].addScaledVector(U.sh.coefficients[j],F);B++}else if(U.isDirectionalLight){const j=t.get(U);if(j.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){const ct=U.shadow,W=e.get(U);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,s.directionalShadow[E]=W,s.directionalShadowMap[E]=q,s.directionalShadowMatrix[E]=U.shadow.matrix,I++}s.directional[E]=j,E++}else if(U.isSpotLight){const j=t.get(U);j.position.setFromMatrixPosition(U.matrixWorld),j.color.copy(tt).multiplyScalar(F),j.distance=H,j.coneCos=Math.cos(U.angle),j.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),j.decay=U.decay,s.spot[w]=j;const ct=U.shadow;if(U.map&&(s.spotLightMap[k]=U.map,k++,ct.updateMatrices(U),U.castShadow&&N++),s.spotLightMatrix[w]=ct.matrix,U.castShadow){const W=e.get(U);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,s.spotShadow[w]=W,s.spotShadowMap[w]=q,M++}w++}else if(U.isRectAreaLight){const j=t.get(U);j.color.copy(tt).multiplyScalar(F),j.halfWidth.set(U.width*.5,0,0),j.halfHeight.set(0,U.height*.5,0),s.rectArea[v]=j,v++}else if(U.isPointLight){const j=t.get(U);if(j.color.copy(U.color).multiplyScalar(U.intensity),j.distance=U.distance,j.decay=U.decay,U.castShadow){const ct=U.shadow,W=e.get(U);W.shadowIntensity=ct.intensity,W.shadowBias=ct.bias,W.shadowNormalBias=ct.normalBias,W.shadowRadius=ct.radius,W.shadowMapSize=ct.mapSize,W.shadowCameraNear=ct.camera.near,W.shadowCameraFar=ct.camera.far,s.pointShadow[S]=W,s.pointShadowMap[S]=q,s.pointShadowMatrix[S]=U.shadow.matrix,C++}s.point[S]=j,S++}else if(U.isHemisphereLight){const j=t.get(U);j.skyColor.copy(U.color).multiplyScalar(F),j.groundColor.copy(U.groundColor).multiplyScalar(F),s.hemi[g]=j,g++}}v>0&&(n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Rt.LTC_FLOAT_1,s.rectAreaLTC2=Rt.LTC_FLOAT_2):(s.rectAreaLTC1=Rt.LTC_HALF_1,s.rectAreaLTC2=Rt.LTC_HALF_2)),s.ambient[0]=p,s.ambient[1]=m,s.ambient[2]=_;const V=s.hash;(V.directionalLength!==E||V.pointLength!==S||V.spotLength!==w||V.rectAreaLength!==v||V.hemiLength!==g||V.numDirectionalShadows!==I||V.numPointShadows!==C||V.numSpotShadows!==M||V.numSpotMaps!==k||V.numLightProbes!==B)&&(s.directional.length=E,s.spot.length=w,s.rectArea.length=v,s.point.length=S,s.hemi.length=g,s.directionalShadow.length=I,s.directionalShadowMap.length=I,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=M,s.spotShadowMap.length=M,s.directionalShadowMatrix.length=I,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=M+k-N,s.spotLightMap.length=k,s.numSpotLightShadowsWithMaps=N,s.numLightProbes=B,V.directionalLength=E,V.pointLength=S,V.spotLength=w,V.rectAreaLength=v,V.hemiLength=g,V.numDirectionalShadows=I,V.numPointShadows=C,V.numSpotShadows=M,V.numSpotMaps=k,V.numLightProbes=B,s.version=Uw++)}function u(d,p){let m=0,_=0,E=0,S=0,w=0;const v=p.matrixWorldInverse;for(let g=0,I=d.length;g<I;g++){const C=d[g];if(C.isDirectionalLight){const M=s.directional[m];M.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(v),m++}else if(C.isSpotLight){const M=s.spot[E];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),M.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(v),E++}else if(C.isRectAreaLight){const M=s.rectArea[S];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),l.identity(),a.copy(C.matrixWorld),a.premultiply(v),l.extractRotation(a),M.halfWidth.set(C.width*.5,0,0),M.halfHeight.set(0,C.height*.5,0),M.halfWidth.applyMatrix4(l),M.halfHeight.applyMatrix4(l),S++}else if(C.isPointLight){const M=s.point[_];M.position.setFromMatrixPosition(C.matrixWorld),M.position.applyMatrix4(v),_++}else if(C.isHemisphereLight){const M=s.hemi[w];M.direction.setFromMatrixPosition(C.matrixWorld),M.direction.transformDirection(v),w++}}}return{setup:h,setupView:u,state:s}}function Td(n){const t=new Nw(n),e=[],s=[];function r(p){d.camera=p,e.length=0,s.length=0}function a(p){e.push(p)}function l(p){s.push(p)}function h(){t.setup(e)}function u(p){t.setupView(e,p)}const d={lightsArray:e,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:d,setupLights:h,setupLightsView:u,pushLight:a,pushShadow:l}}function Bw(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new Td(n),t.set(r,[h])):a>=l.length?(h=new Td(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const Fw=`void main() {
3798
3798
  gl_Position = vec4( position, 1.0 );
3799
3799
  }`,zw=`uniform sampler2D shadow_pass;
3800
3800
  uniform vec2 resolution;
@@ -3822,7 +3822,7 @@ void main() {
3822
3822
  squared_mean = squared_mean / samples;
3823
3823
  float std_dev = sqrt( squared_mean - mean * mean );
3824
3824
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3825
- }`;function Hw(n,t,e){let s=new Sc;const r=new be,a=new be,l=new He,h=new H0({depthPacking:Uv}),u=new V0,d={},p=e.maxTextureSize,m={[Ai]:fn,[fn]:Ai,[ci]:ci},_=new vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:Fw,fragmentShader:zw}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const S=new $n;S.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new pn(S,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jh;let g=this.type;this.render=function(N,B,V){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||N.length===0)return;const D=n.getRenderTarget(),P=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),et=n.state;et.setBlending(Ci),et.buffers.depth.getReversed()?et.buffers.color.setClear(0,0,0,0):et.buffers.color.setClear(1,1,1,1),et.buffers.depth.setTest(!0),et.setScissorTest(!1);const z=g!==li&&this.type===li,H=g===li&&this.type!==li;for(let q=0,j=N.length;q<j;q++){const ct=N[q],W=ct.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",ct,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;r.copy(W.mapSize);const St=W.getFrameExtents();if(r.multiply(St),a.copy(W.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/St.x),r.x=a.x*St.x,W.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/St.y),r.y=a.y*St.y,W.mapSize.y=a.y)),W.map===null||z===!0||H===!0){const Mt=this.type!==li?{minFilter:Fn,magFilter:Fn}:{};W.map!==null&&W.map.dispose(),W.map=new Ii(r.x,r.y,Mt),W.map.texture.name=ct.name+".shadowMap",W.camera.updateProjectionMatrix()}n.setRenderTarget(W.map),n.clear();const at=W.getViewportCount();for(let Mt=0;Mt<at;Mt++){const Ot=W.getViewport(Mt);l.set(a.x*Ot.x,a.y*Ot.y,a.x*Ot.z,a.y*Ot.w),et.viewport(l),W.updateMatrices(ct,Mt),s=W.getFrustum(),M(B,V,W.camera,ct,this.type)}W.isPointLightShadow!==!0&&this.type===li&&I(W,V),W.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(D,P,O)};function I(N,B){const V=t.update(w);_.defines.VSM_SAMPLES!==N.blurSamples&&(_.defines.VSM_SAMPLES=N.blurSamples,E.defines.VSM_SAMPLES=N.blurSamples,_.needsUpdate=!0,E.needsUpdate=!0),N.mapPass===null&&(N.mapPass=new Ii(r.x,r.y)),_.uniforms.shadow_pass.value=N.map.texture,_.uniforms.resolution.value=N.mapSize,_.uniforms.radius.value=N.radius,n.setRenderTarget(N.mapPass),n.clear(),n.renderBufferDirect(B,null,V,_,w,null),E.uniforms.shadow_pass.value=N.mapPass.texture,E.uniforms.resolution.value=N.mapSize,E.uniforms.radius.value=N.radius,n.setRenderTarget(N.map),n.clear(),n.renderBufferDirect(B,null,V,E,w,null)}function C(N,B,V,D){let P=null;const O=V.isPointLight===!0?N.customDistanceMaterial:N.customDepthMaterial;if(O!==void 0)P=O;else if(P=V.isPointLight===!0?u:h,n.localClippingEnabled&&B.clipShadows===!0&&Array.isArray(B.clippingPlanes)&&B.clippingPlanes.length!==0||B.displacementMap&&B.displacementScale!==0||B.alphaMap&&B.alphaTest>0||B.map&&B.alphaTest>0||B.alphaToCoverage===!0){const et=P.uuid,z=B.uuid;let H=d[et];H===void 0&&(H={},d[et]=H);let q=H[z];q===void 0&&(q=P.clone(),H[z]=q,B.addEventListener("dispose",k)),P=q}if(P.visible=B.visible,P.wireframe=B.wireframe,D===li?P.side=B.shadowSide!==null?B.shadowSide:B.side:P.side=B.shadowSide!==null?B.shadowSide:m[B.side],P.alphaMap=B.alphaMap,P.alphaTest=B.alphaToCoverage===!0?.5:B.alphaTest,P.map=B.map,P.clipShadows=B.clipShadows,P.clippingPlanes=B.clippingPlanes,P.clipIntersection=B.clipIntersection,P.displacementMap=B.displacementMap,P.displacementScale=B.displacementScale,P.displacementBias=B.displacementBias,P.wireframeLinewidth=B.wireframeLinewidth,P.linewidth=B.linewidth,V.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const et=n.properties.get(P);et.light=V}return P}function M(N,B,V,D,P){if(N.visible===!1)return;if(N.layers.test(B.layers)&&(N.isMesh||N.isLine||N.isPoints)&&(N.castShadow||N.receiveShadow&&P===li)&&(!N.frustumCulled||s.intersectsObject(N))){N.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,N.matrixWorld);const z=t.update(N),H=N.material;if(Array.isArray(H)){const q=z.groups;for(let j=0,ct=q.length;j<ct;j++){const W=q[j],St=H[W.materialIndex];if(St&&St.visible){const at=C(N,St,D,P);N.onBeforeShadow(n,N,B,V,z,at,W),n.renderBufferDirect(V,null,z,at,N,W),N.onAfterShadow(n,N,B,V,z,at,W)}}}else if(H.visible){const q=C(N,H,D,P);N.onBeforeShadow(n,N,B,V,z,q,null),n.renderBufferDirect(V,null,z,q,N,null),N.onAfterShadow(n,N,B,V,z,q,null)}}const et=N.children;for(let z=0,H=et.length;z<H;z++)M(et[z],B,V,D,P)}function k(N){N.target.removeEventListener("dispose",k);for(const V in d){const D=d[V],P=N.target.uuid;P in D&&(D[P].dispose(),delete D[P])}}}const Vw={[ol]:al,[ll]:ul,[cl]:dl,[Ms]:hl,[al]:ol,[ul]:ll,[dl]:cl,[hl]:Ms};function Gw(n,t){function e(){let G=!1;const wt=new He;let Ct=null;const Ut=new He(0,0,0,0);return{setMask:function(vt){Ct!==vt&&!G&&(n.colorMask(vt,vt,vt,vt),Ct=vt)},setLocked:function(vt){G=vt},setClear:function(vt,ft,zt,le,De){De===!0&&(vt*=le,ft*=le,zt*=le),wt.set(vt,ft,zt,le),Ut.equals(wt)===!1&&(n.clearColor(vt,ft,zt,le),Ut.copy(wt))},reset:function(){G=!1,Ct=null,Ut.set(-1,0,0,0)}}}function s(){let G=!1,wt=!1,Ct=null,Ut=null,vt=null;return{setReversed:function(ft){if(wt!==ft){const zt=t.get("EXT_clip_control");ft?zt.clipControlEXT(zt.LOWER_LEFT_EXT,zt.ZERO_TO_ONE_EXT):zt.clipControlEXT(zt.LOWER_LEFT_EXT,zt.NEGATIVE_ONE_TO_ONE_EXT),wt=ft;const le=vt;vt=null,this.setClear(le)}},getReversed:function(){return wt},setTest:function(ft){ft?_t(n.DEPTH_TEST):Nt(n.DEPTH_TEST)},setMask:function(ft){Ct!==ft&&!G&&(n.depthMask(ft),Ct=ft)},setFunc:function(ft){if(wt&&(ft=Vw[ft]),Ut!==ft){switch(ft){case ol:n.depthFunc(n.NEVER);break;case al:n.depthFunc(n.ALWAYS);break;case ll:n.depthFunc(n.LESS);break;case Ms:n.depthFunc(n.LEQUAL);break;case cl:n.depthFunc(n.EQUAL);break;case hl:n.depthFunc(n.GEQUAL);break;case ul:n.depthFunc(n.GREATER);break;case dl:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ut=ft}},setLocked:function(ft){G=ft},setClear:function(ft){vt!==ft&&(wt&&(ft=1-ft),n.clearDepth(ft),vt=ft)},reset:function(){G=!1,Ct=null,Ut=null,vt=null,wt=!1}}}function r(){let G=!1,wt=null,Ct=null,Ut=null,vt=null,ft=null,zt=null,le=null,De=null;return{setTest:function(Me){G||(Me?_t(n.STENCIL_TEST):Nt(n.STENCIL_TEST))},setMask:function(Me){wt!==Me&&!G&&(n.stencilMask(Me),wt=Me)},setFunc:function(Me,bn,On){(Ct!==Me||Ut!==bn||vt!==On)&&(n.stencilFunc(Me,bn,On),Ct=Me,Ut=bn,vt=On)},setOp:function(Me,bn,On){(ft!==Me||zt!==bn||le!==On)&&(n.stencilOp(Me,bn,On),ft=Me,zt=bn,le=On)},setLocked:function(Me){G=Me},setClear:function(Me){De!==Me&&(n.clearStencil(Me),De=Me)},reset:function(){G=!1,wt=null,Ct=null,Ut=null,vt=null,ft=null,zt=null,le=null,De=null}}}const a=new e,l=new s,h=new r,u=new WeakMap,d=new WeakMap;let p={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,M=null,k=null,N=null,B=new Ce(0,0,0),V=0,D=!1,P=null,O=null,et=null,z=null,H=null;const q=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let j=!1,ct=0;const W=n.getParameter(n.VERSION);W.indexOf("WebGL")!==-1?(ct=parseFloat(/^WebGL (\d)/.exec(W)[1]),j=ct>=1):W.indexOf("OpenGL ES")!==-1&&(ct=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),j=ct>=2);let St=null,at={};const Mt=n.getParameter(n.SCISSOR_BOX),Ot=n.getParameter(n.VIEWPORT),oe=new He().fromArray(Mt),Qt=new He().fromArray(Ot);function tt(G,wt,Ct,Ut){const vt=new Uint8Array(4),ft=n.createTexture();n.bindTexture(G,ft),n.texParameteri(G,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(G,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let zt=0;zt<Ct;zt++)G===n.TEXTURE_3D||G===n.TEXTURE_2D_ARRAY?n.texImage3D(wt,0,n.RGBA,1,1,Ut,0,n.RGBA,n.UNSIGNED_BYTE,vt):n.texImage2D(wt+zt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,vt);return ft}const ut={};ut[n.TEXTURE_2D]=tt(n.TEXTURE_2D,n.TEXTURE_2D,1),ut[n.TEXTURE_CUBE_MAP]=tt(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),ut[n.TEXTURE_2D_ARRAY]=tt(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),ut[n.TEXTURE_3D]=tt(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),_t(n.DEPTH_TEST),l.setFunc(Ms),ht(!1),lt(jh),_t(n.CULL_FACE),Z(Ci);function _t(G){p[G]!==!0&&(n.enable(G),p[G]=!0)}function Nt(G){p[G]!==!1&&(n.disable(G),p[G]=!1)}function Zt(G,wt){return m[G]!==wt?(n.bindFramebuffer(G,wt),m[G]=wt,G===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=wt),G===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=wt),!0):!1}function jt(G,wt){let Ct=E,Ut=!1;if(G){Ct=_.get(wt),Ct===void 0&&(Ct=[],_.set(wt,Ct));const vt=G.textures;if(Ct.length!==vt.length||Ct[0]!==n.COLOR_ATTACHMENT0){for(let ft=0,zt=vt.length;ft<zt;ft++)Ct[ft]=n.COLOR_ATTACHMENT0+ft;Ct.length=vt.length,Ut=!0}}else Ct[0]!==n.BACK&&(Ct[0]=n.BACK,Ut=!0);Ut&&n.drawBuffers(Ct)}function Re(G){return S!==G?(n.useProgram(G),S=G,!0):!1}const dt={[ts]:n.FUNC_ADD,[lv]:n.FUNC_SUBTRACT,[cv]:n.FUNC_REVERSE_SUBTRACT};dt[hv]=n.MIN,dt[uv]=n.MAX;const T={[dv]:n.ZERO,[fv]:n.ONE,[pv]:n.SRC_COLOR,[sl]:n.SRC_ALPHA,[Ev]:n.SRC_ALPHA_SATURATE,[vv]:n.DST_COLOR,[gv]:n.DST_ALPHA,[mv]:n.ONE_MINUS_SRC_COLOR,[rl]:n.ONE_MINUS_SRC_ALPHA,[yv]:n.ONE_MINUS_DST_COLOR,[_v]:n.ONE_MINUS_DST_ALPHA,[xv]:n.CONSTANT_COLOR,[wv]:n.ONE_MINUS_CONSTANT_COLOR,[Sv]:n.CONSTANT_ALPHA,[Mv]:n.ONE_MINUS_CONSTANT_ALPHA};function Z(G,wt,Ct,Ut,vt,ft,zt,le,De,Me){if(G===Ci){w===!0&&(Nt(n.BLEND),w=!1);return}if(w===!1&&(_t(n.BLEND),w=!0),G!==av){if(G!==v||Me!==D){if((g!==ts||M!==ts)&&(n.blendEquation(n.FUNC_ADD),g=ts,M=ts),Me)switch(G){case Ss:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFunc(n.ONE,n.ONE);break;case $h:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case tu:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}else switch(G){case Ss:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case $h:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case tu:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}I=null,C=null,k=null,N=null,B.set(0,0,0),V=0,v=G,D=Me}return}vt=vt||wt,ft=ft||Ct,zt=zt||Ut,(wt!==g||vt!==M)&&(n.blendEquationSeparate(dt[wt],dt[vt]),g=wt,M=vt),(Ct!==I||Ut!==C||ft!==k||zt!==N)&&(n.blendFuncSeparate(T[Ct],T[Ut],T[ft],T[zt]),I=Ct,C=Ut,k=ft,N=zt),(le.equals(B)===!1||De!==V)&&(n.blendColor(le.r,le.g,le.b,De),B.copy(le),V=De),v=G,D=!1}function $(G,wt){G.side===ci?Nt(n.CULL_FACE):_t(n.CULL_FACE);let Ct=G.side===fn;wt&&(Ct=!Ct),ht(Ct),G.blending===Ss&&G.transparent===!1?Z(Ci):Z(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),l.setFunc(G.depthFunc),l.setTest(G.depthTest),l.setMask(G.depthWrite),a.setMask(G.colorWrite);const Ut=G.stencilWrite;h.setTest(Ut),Ut&&(h.setMask(G.stencilWriteMask),h.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),h.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),pt(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?_t(n.SAMPLE_ALPHA_TO_COVERAGE):Nt(n.SAMPLE_ALPHA_TO_COVERAGE)}function ht(G){P!==G&&(G?n.frontFace(n.CW):n.frontFace(n.CCW),P=G)}function lt(G){G!==sv?(_t(n.CULL_FACE),G!==O&&(G===jh?n.cullFace(n.BACK):G===rv?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Nt(n.CULL_FACE),O=G}function Tt(G){G!==et&&(j&&n.lineWidth(G),et=G)}function pt(G,wt,Ct){G?(_t(n.POLYGON_OFFSET_FILL),(z!==wt||H!==Ct)&&(n.polygonOffset(wt,Ct),z=wt,H=Ct)):Nt(n.POLYGON_OFFSET_FILL)}function bt(G){G?_t(n.SCISSOR_TEST):Nt(n.SCISSOR_TEST)}function re(G){G===void 0&&(G=n.TEXTURE0+q-1),St!==G&&(n.activeTexture(G),St=G)}function de(G,wt,Ct){Ct===void 0&&(St===null?Ct=n.TEXTURE0+q-1:Ct=St);let Ut=at[Ct];Ut===void 0&&(Ut={type:void 0,texture:void 0},at[Ct]=Ut),(Ut.type!==G||Ut.texture!==wt)&&(St!==Ct&&(n.activeTexture(Ct),St=Ct),n.bindTexture(G,wt||ut[G]),Ut.type=G,Ut.texture=wt)}function U(){const G=at[St];G!==void 0&&G.type!==void 0&&(n.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function b(){try{n.compressedTexImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function J(){try{n.compressedTexImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function rt(){try{n.texSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function gt(){try{n.texSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function ot(){try{n.compressedTexSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Ht(){try{n.compressedTexSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function At(){try{n.texStorage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Bt(){try{n.texStorage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Vt(){try{n.texImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function xt(){try{n.texImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Lt(G){oe.equals(G)===!1&&(n.scissor(G.x,G.y,G.z,G.w),oe.copy(G))}function ne(G){Qt.equals(G)===!1&&(n.viewport(G.x,G.y,G.z,G.w),Qt.copy(G))}function Gt(G,wt){let Ct=d.get(wt);Ct===void 0&&(Ct=new WeakMap,d.set(wt,Ct));let Ut=Ct.get(G);Ut===void 0&&(Ut=n.getUniformBlockIndex(wt,G.name),Ct.set(G,Ut))}function Pt(G,wt){const Ut=d.get(wt).get(G);u.get(wt)!==Ut&&(n.uniformBlockBinding(wt,Ut,G.__bindingPointIndex),u.set(wt,Ut))}function ce(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),l.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,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),p={},St=null,at={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,M=null,k=null,N=null,B=new Ce(0,0,0),V=0,D=!1,P=null,O=null,et=null,z=null,H=null,oe.set(0,0,n.canvas.width,n.canvas.height),Qt.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:_t,disable:Nt,bindFramebuffer:Zt,drawBuffers:jt,useProgram:Re,setBlending:Z,setMaterial:$,setFlipSided:ht,setCullFace:lt,setLineWidth:Tt,setPolygonOffset:pt,setScissorTest:bt,activeTexture:re,bindTexture:de,unbindTexture:U,compressedTexImage2D:b,compressedTexImage3D:J,texImage2D:Vt,texImage3D:xt,updateUBOMapping:Gt,uniformBlockBinding:Pt,texStorage2D:At,texStorage3D:Bt,texSubImage2D:rt,texSubImage3D:gt,compressedTexSubImage2D:ot,compressedTexSubImage3D:Ht,scissor:Lt,viewport:ne,reset:ce}}function Ww(n,t,e,s,r,a,l){const h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new be,p=new WeakMap;let m;const _=new WeakMap;let E=!1;try{E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(U,b){return E?new OffscreenCanvas(U,b):Mr("canvas")}function w(U,b,J){let rt=1;const gt=de(U);if((gt.width>J||gt.height>J)&&(rt=J/Math.max(gt.width,gt.height)),rt<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const ot=Math.floor(rt*gt.width),Ht=Math.floor(rt*gt.height);m===void 0&&(m=S(ot,Ht));const At=b?S(ot,Ht):m;return At.width=ot,At.height=Ht,At.getContext("2d").drawImage(U,0,0,ot,Ht),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+gt.width+"x"+gt.height+") to ("+ot+"x"+Ht+")."),At}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+gt.width+"x"+gt.height+")."),U;return U}function v(U){return U.generateMipmaps}function g(U){n.generateMipmap(U)}function I(U){return U.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:U.isWebGL3DRenderTarget?n.TEXTURE_3D:U.isWebGLArrayRenderTarget||U.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function C(U,b,J,rt,gt=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let ot=b;if(b===n.RED&&(J===n.FLOAT&&(ot=n.R32F),J===n.HALF_FLOAT&&(ot=n.R16F),J===n.UNSIGNED_BYTE&&(ot=n.R8)),b===n.RED_INTEGER&&(J===n.UNSIGNED_BYTE&&(ot=n.R8UI),J===n.UNSIGNED_SHORT&&(ot=n.R16UI),J===n.UNSIGNED_INT&&(ot=n.R32UI),J===n.BYTE&&(ot=n.R8I),J===n.SHORT&&(ot=n.R16I),J===n.INT&&(ot=n.R32I)),b===n.RG&&(J===n.FLOAT&&(ot=n.RG32F),J===n.HALF_FLOAT&&(ot=n.RG16F),J===n.UNSIGNED_BYTE&&(ot=n.RG8)),b===n.RG_INTEGER&&(J===n.UNSIGNED_BYTE&&(ot=n.RG8UI),J===n.UNSIGNED_SHORT&&(ot=n.RG16UI),J===n.UNSIGNED_INT&&(ot=n.RG32UI),J===n.BYTE&&(ot=n.RG8I),J===n.SHORT&&(ot=n.RG16I),J===n.INT&&(ot=n.RG32I)),b===n.RGB_INTEGER&&(J===n.UNSIGNED_BYTE&&(ot=n.RGB8UI),J===n.UNSIGNED_SHORT&&(ot=n.RGB16UI),J===n.UNSIGNED_INT&&(ot=n.RGB32UI),J===n.BYTE&&(ot=n.RGB8I),J===n.SHORT&&(ot=n.RGB16I),J===n.INT&&(ot=n.RGB32I)),b===n.RGBA_INTEGER&&(J===n.UNSIGNED_BYTE&&(ot=n.RGBA8UI),J===n.UNSIGNED_SHORT&&(ot=n.RGBA16UI),J===n.UNSIGNED_INT&&(ot=n.RGBA32UI),J===n.BYTE&&(ot=n.RGBA8I),J===n.SHORT&&(ot=n.RGBA16I),J===n.INT&&(ot=n.RGBA32I)),b===n.RGB&&J===n.UNSIGNED_INT_5_9_9_9_REV&&(ot=n.RGB9_E5),b===n.RGBA){const Ht=gt?To:Se.getTransfer(rt);J===n.FLOAT&&(ot=n.RGBA32F),J===n.HALF_FLOAT&&(ot=n.RGBA16F),J===n.UNSIGNED_BYTE&&(ot=Ht===Ie?n.SRGB8_ALPHA8:n.RGBA8),J===n.UNSIGNED_SHORT_4_4_4_4&&(ot=n.RGBA4),J===n.UNSIGNED_SHORT_5_5_5_1&&(ot=n.RGB5_A1)}return(ot===n.R16F||ot===n.R32F||ot===n.RG16F||ot===n.RG32F||ot===n.RGBA16F||ot===n.RGBA32F)&&t.get("EXT_color_buffer_float"),ot}function M(U,b){let J;return U?b===null||b===ns||b===vr?J=n.DEPTH24_STENCIL8:b===ui?J=n.DEPTH32F_STENCIL8:b===gr&&(J=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===ns||b===vr?J=n.DEPTH_COMPONENT24:b===ui?J=n.DEPTH_COMPONENT32F:b===gr&&(J=n.DEPTH_COMPONENT16),J}function k(U,b){return v(U)===!0||U.isFramebufferTexture&&U.minFilter!==Fn&&U.minFilter!==En?Math.log2(Math.max(b.width,b.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?b.mipmaps.length:1}function N(U){const b=U.target;b.removeEventListener("dispose",N),V(b),b.isVideoTexture&&p.delete(b)}function B(U){const b=U.target;b.removeEventListener("dispose",B),P(b)}function V(U){const b=s.get(U);if(b.__webglInit===void 0)return;const J=U.source,rt=_.get(J);if(rt){const gt=rt[b.__cacheKey];gt.usedTimes--,gt.usedTimes===0&&D(U),Object.keys(rt).length===0&&_.delete(J)}s.remove(U)}function D(U){const b=s.get(U);n.deleteTexture(b.__webglTexture);const J=U.source,rt=_.get(J);delete rt[b.__cacheKey],l.memory.textures--}function P(U){const b=s.get(U);if(U.depthTexture&&(U.depthTexture.dispose(),s.remove(U.depthTexture)),U.isWebGLCubeRenderTarget)for(let rt=0;rt<6;rt++){if(Array.isArray(b.__webglFramebuffer[rt]))for(let gt=0;gt<b.__webglFramebuffer[rt].length;gt++)n.deleteFramebuffer(b.__webglFramebuffer[rt][gt]);else n.deleteFramebuffer(b.__webglFramebuffer[rt]);b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer[rt])}else{if(Array.isArray(b.__webglFramebuffer))for(let rt=0;rt<b.__webglFramebuffer.length;rt++)n.deleteFramebuffer(b.__webglFramebuffer[rt]);else n.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&n.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let rt=0;rt<b.__webglColorRenderbuffer.length;rt++)b.__webglColorRenderbuffer[rt]&&n.deleteRenderbuffer(b.__webglColorRenderbuffer[rt]);b.__webglDepthRenderbuffer&&n.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const J=U.textures;for(let rt=0,gt=J.length;rt<gt;rt++){const ot=s.get(J[rt]);ot.__webglTexture&&(n.deleteTexture(ot.__webglTexture),l.memory.textures--),s.remove(J[rt])}s.remove(U)}let O=0;function et(){O=0}function z(){const U=O;return U>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),O+=1,U}function H(U){const b=[];return b.push(U.wrapS),b.push(U.wrapT),b.push(U.wrapR||0),b.push(U.magFilter),b.push(U.minFilter),b.push(U.anisotropy),b.push(U.internalFormat),b.push(U.format),b.push(U.type),b.push(U.generateMipmaps),b.push(U.premultiplyAlpha),b.push(U.flipY),b.push(U.unpackAlignment),b.push(U.colorSpace),b.join()}function q(U,b){const J=s.get(U);if(U.isVideoTexture&&bt(U),U.isRenderTargetTexture===!1&&U.isExternalTexture!==!0&&U.version>0&&J.__version!==U.version){const rt=U.image;if(rt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(rt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ut(J,U,b);return}}else U.isExternalTexture&&(J.__webglTexture=U.sourceTexture?U.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,J.__webglTexture,n.TEXTURE0+b)}function j(U,b){const J=s.get(U);if(U.isRenderTargetTexture===!1&&U.version>0&&J.__version!==U.version){ut(J,U,b);return}e.bindTexture(n.TEXTURE_2D_ARRAY,J.__webglTexture,n.TEXTURE0+b)}function ct(U,b){const J=s.get(U);if(U.isRenderTargetTexture===!1&&U.version>0&&J.__version!==U.version){ut(J,U,b);return}e.bindTexture(n.TEXTURE_3D,J.__webglTexture,n.TEXTURE0+b)}function W(U,b){const J=s.get(U);if(U.version>0&&J.__version!==U.version){_t(J,U,b);return}e.bindTexture(n.TEXTURE_CUBE_MAP,J.__webglTexture,n.TEXTURE0+b)}const St={[ml]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[gl]:n.MIRRORED_REPEAT},at={[Fn]:n.NEAREST,[Dv]:n.NEAREST_MIPMAP_NEAREST,[yo]:n.NEAREST_MIPMAP_LINEAR,[En]:n.LINEAR,[_l]:n.LINEAR_MIPMAP_NEAREST,[Ri]:n.LINEAR_MIPMAP_LINEAR},Mt={[Bv]:n.NEVER,[Wv]:n.ALWAYS,[Fv]:n.LESS,[fu]:n.LEQUAL,[zv]:n.EQUAL,[Gv]:n.GEQUAL,[Hv]:n.GREATER,[Vv]:n.NOTEQUAL};function Ot(U,b){if(b.type===ui&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===En||b.magFilter===_l||b.magFilter===yo||b.magFilter===Ri||b.minFilter===En||b.minFilter===_l||b.minFilter===yo||b.minFilter===Ri)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,St[b.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,St[b.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,St[b.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,at[b.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,at[b.minFilter]),b.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,Mt[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Fn||b.minFilter!==yo&&b.minFilter!==Ri||b.type===ui&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const J=t.get("EXT_texture_filter_anisotropic");n.texParameterf(U,J.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function oe(U,b){let J=!1;U.__webglInit===void 0&&(U.__webglInit=!0,b.addEventListener("dispose",N));const rt=b.source;let gt=_.get(rt);gt===void 0&&(gt={},_.set(rt,gt));const ot=H(b);if(ot!==U.__cacheKey){gt[ot]===void 0&&(gt[ot]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,J=!0),gt[ot].usedTimes++;const Ht=gt[U.__cacheKey];Ht!==void 0&&(gt[U.__cacheKey].usedTimes--,Ht.usedTimes===0&&D(b)),U.__cacheKey=ot,U.__webglTexture=gt[ot].texture}return J}function Qt(U,b,J){return Math.floor(Math.floor(U/J)/b)}function tt(U,b,J,rt){const ot=U.updateRanges;if(ot.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,b.width,b.height,J,rt,b.data);else{ot.sort((xt,Lt)=>xt.start-Lt.start);let Ht=0;for(let xt=1;xt<ot.length;xt++){const Lt=ot[Ht],ne=ot[xt],Gt=Lt.start+Lt.count,Pt=Qt(ne.start,b.width,4),ce=Qt(Lt.start,b.width,4);ne.start<=Gt+1&&Pt===ce&&Qt(ne.start+ne.count-1,b.width,4)===Pt?Lt.count=Math.max(Lt.count,ne.start+ne.count-Lt.start):(++Ht,ot[Ht]=ne)}ot.length=Ht+1;const At=n.getParameter(n.UNPACK_ROW_LENGTH),Bt=n.getParameter(n.UNPACK_SKIP_PIXELS),Vt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,b.width);for(let xt=0,Lt=ot.length;xt<Lt;xt++){const ne=ot[xt],Gt=Math.floor(ne.start/4),Pt=Math.ceil(ne.count/4),ce=Gt%b.width,G=Math.floor(Gt/b.width),wt=Pt,Ct=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,G),e.texSubImage2D(n.TEXTURE_2D,0,ce,G,wt,Ct,J,rt,b.data)}U.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,At),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Bt),n.pixelStorei(n.UNPACK_SKIP_ROWS,Vt)}}function ut(U,b,J){let rt=n.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(rt=n.TEXTURE_2D_ARRAY),b.isData3DTexture&&(rt=n.TEXTURE_3D);const gt=oe(U,b),ot=b.source;e.bindTexture(rt,U.__webglTexture,n.TEXTURE0+J);const Ht=s.get(ot);if(ot.version!==Ht.__version||gt===!0){e.activeTexture(n.TEXTURE0+J);const At=Se.getPrimaries(Se.workingColorSpace),Bt=b.colorSpace===Li?null:Se.getPrimaries(b.colorSpace),Vt=b.colorSpace===Li||At===Bt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Vt);let xt=w(b.image,!1,r.maxTextureSize);xt=re(b,xt);const Lt=a.convert(b.format,b.colorSpace),ne=a.convert(b.type);let Gt=C(b.internalFormat,Lt,ne,b.colorSpace,b.isVideoTexture);Ot(rt,b);let Pt;const ce=b.mipmaps,G=b.isVideoTexture!==!0,wt=Ht.__version===void 0||gt===!0,Ct=ot.dataReady,Ut=k(b,xt);if(b.isDepthTexture)Gt=M(b.format===Er,b.type),wt&&(G?e.texStorage2D(n.TEXTURE_2D,1,Gt,xt.width,xt.height):e.texImage2D(n.TEXTURE_2D,0,Gt,xt.width,xt.height,0,Lt,ne,null));else if(b.isDataTexture)if(ce.length>0){G&&wt&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,ce[0].width,ce[0].height);for(let vt=0,ft=ce.length;vt<ft;vt++)Pt=ce[vt],G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,ne,Pt.data):e.texImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Lt,ne,Pt.data);b.generateMipmaps=!1}else G?(wt&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,xt.width,xt.height),Ct&&tt(b,xt,Lt,ne)):e.texImage2D(n.TEXTURE_2D,0,Gt,xt.width,xt.height,0,Lt,ne,xt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){G&&wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ut,Gt,ce[0].width,ce[0].height,xt.depth);for(let vt=0,ft=ce.length;vt<ft;vt++)if(Pt=ce[vt],b.format!==zn)if(Lt!==null)if(G){if(Ct)if(b.layerUpdates.size>0){const zt=ju(Pt.width,Pt.height,b.format,b.type);for(const le of b.layerUpdates){const De=Pt.data.subarray(le*zt/Pt.data.BYTES_PER_ELEMENT,(le+1)*zt/Pt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,le,Pt.width,Pt.height,1,Lt,De)}b.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Pt.width,Pt.height,xt.depth,Lt,Pt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,vt,Gt,Pt.width,Pt.height,xt.depth,0,Pt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?Ct&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Pt.width,Pt.height,xt.depth,Lt,ne,Pt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,vt,Gt,Pt.width,Pt.height,xt.depth,0,Lt,ne,Pt.data)}else{G&&wt&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,ce[0].width,ce[0].height);for(let vt=0,ft=ce.length;vt<ft;vt++)Pt=ce[vt],b.format!==zn?Lt!==null?G?Ct&&e.compressedTexSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,Pt.data):e.compressedTexImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Pt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,ne,Pt.data):e.texImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Lt,ne,Pt.data)}else if(b.isDataArrayTexture)if(G){if(wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ut,Gt,xt.width,xt.height,xt.depth),Ct)if(b.layerUpdates.size>0){const vt=ju(xt.width,xt.height,b.format,b.type);for(const ft of b.layerUpdates){const zt=xt.data.subarray(ft*vt/xt.data.BYTES_PER_ELEMENT,(ft+1)*vt/xt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ft,xt.width,xt.height,1,Lt,ne,zt)}b.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,Lt,ne,xt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Gt,xt.width,xt.height,xt.depth,0,Lt,ne,xt.data);else if(b.isData3DTexture)G?(wt&&e.texStorage3D(n.TEXTURE_3D,Ut,Gt,xt.width,xt.height,xt.depth),Ct&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,Lt,ne,xt.data)):e.texImage3D(n.TEXTURE_3D,0,Gt,xt.width,xt.height,xt.depth,0,Lt,ne,xt.data);else if(b.isFramebufferTexture){if(wt)if(G)e.texStorage2D(n.TEXTURE_2D,Ut,Gt,xt.width,xt.height);else{let vt=xt.width,ft=xt.height;for(let zt=0;zt<Ut;zt++)e.texImage2D(n.TEXTURE_2D,zt,Gt,vt,ft,0,Lt,ne,null),vt>>=1,ft>>=1}}else if(ce.length>0){if(G&&wt){const vt=de(ce[0]);e.texStorage2D(n.TEXTURE_2D,Ut,Gt,vt.width,vt.height)}for(let vt=0,ft=ce.length;vt<ft;vt++)Pt=ce[vt],G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Lt,ne,Pt):e.texImage2D(n.TEXTURE_2D,vt,Gt,Lt,ne,Pt);b.generateMipmaps=!1}else if(G){if(wt){const vt=de(xt);e.texStorage2D(n.TEXTURE_2D,Ut,Gt,vt.width,vt.height)}Ct&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,Lt,ne,xt)}else e.texImage2D(n.TEXTURE_2D,0,Gt,Lt,ne,xt);v(b)&&g(rt),Ht.__version=ot.version,b.onUpdate&&b.onUpdate(b)}U.__version=b.version}function _t(U,b,J){if(b.image.length!==6)return;const rt=oe(U,b),gt=b.source;e.bindTexture(n.TEXTURE_CUBE_MAP,U.__webglTexture,n.TEXTURE0+J);const ot=s.get(gt);if(gt.version!==ot.__version||rt===!0){e.activeTexture(n.TEXTURE0+J);const Ht=Se.getPrimaries(Se.workingColorSpace),At=b.colorSpace===Li?null:Se.getPrimaries(b.colorSpace),Bt=b.colorSpace===Li||Ht===At?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Bt);const Vt=b.isCompressedTexture||b.image[0].isCompressedTexture,xt=b.image[0]&&b.image[0].isDataTexture,Lt=[];for(let ft=0;ft<6;ft++)!Vt&&!xt?Lt[ft]=w(b.image[ft],!0,r.maxCubemapSize):Lt[ft]=xt?b.image[ft].image:b.image[ft],Lt[ft]=re(b,Lt[ft]);const ne=Lt[0],Gt=a.convert(b.format,b.colorSpace),Pt=a.convert(b.type),ce=C(b.internalFormat,Gt,Pt,b.colorSpace),G=b.isVideoTexture!==!0,wt=ot.__version===void 0||rt===!0,Ct=gt.dataReady;let Ut=k(b,ne);Ot(n.TEXTURE_CUBE_MAP,b);let vt;if(Vt){G&&wt&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ut,ce,ne.width,ne.height);for(let ft=0;ft<6;ft++){vt=Lt[ft].mipmaps;for(let zt=0;zt<vt.length;zt++){const le=vt[zt];b.format!==zn?Gt!==null?G?Ct&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt,0,0,le.width,le.height,Gt,le.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt,ce,le.width,le.height,0,le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt,0,0,le.width,le.height,Gt,Pt,le.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt,ce,le.width,le.height,0,Gt,Pt,le.data)}}}else{if(vt=b.mipmaps,G&&wt){vt.length>0&&Ut++;const ft=de(Lt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ut,ce,ft.width,ft.height)}for(let ft=0;ft<6;ft++)if(xt){G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0,0,0,Lt[ft].width,Lt[ft].height,Gt,Pt,Lt[ft].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0,ce,Lt[ft].width,Lt[ft].height,0,Gt,Pt,Lt[ft].data);for(let zt=0;zt<vt.length;zt++){const De=vt[zt].image[ft].image;G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt+1,0,0,De.width,De.height,Gt,Pt,De.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt+1,ce,De.width,De.height,0,Gt,Pt,De.data)}}else{G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0,0,0,Gt,Pt,Lt[ft]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,0,ce,Gt,Pt,Lt[ft]);for(let zt=0;zt<vt.length;zt++){const le=vt[zt];G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt+1,0,0,Gt,Pt,le.image[ft]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ft,zt+1,ce,Gt,Pt,le.image[ft])}}}v(b)&&g(n.TEXTURE_CUBE_MAP),ot.__version=gt.version,b.onUpdate&&b.onUpdate(b)}U.__version=b.version}function Nt(U,b,J,rt,gt,ot){const Ht=a.convert(J.format,J.colorSpace),At=a.convert(J.type),Bt=C(J.internalFormat,Ht,At,J.colorSpace),Vt=s.get(b),xt=s.get(J);if(xt.__renderTarget=b,!Vt.__hasExternalTextures){const Lt=Math.max(1,b.width>>ot),ne=Math.max(1,b.height>>ot);gt===n.TEXTURE_3D||gt===n.TEXTURE_2D_ARRAY?e.texImage3D(gt,ot,Bt,Lt,ne,b.depth,0,Ht,At,null):e.texImage2D(gt,ot,Bt,Lt,ne,0,Ht,At,null)}e.bindFramebuffer(n.FRAMEBUFFER,U),pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,rt,gt,xt.__webglTexture,0,Tt(b)):(gt===n.TEXTURE_2D||gt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&gt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,rt,gt,xt.__webglTexture,ot),e.bindFramebuffer(n.FRAMEBUFFER,null)}function Zt(U,b,J){if(n.bindRenderbuffer(n.RENDERBUFFER,U),b.depthBuffer){const rt=b.depthTexture,gt=rt&&rt.isDepthTexture?rt.type:null,ot=M(b.stencilBuffer,gt),Ht=b.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,At=Tt(b);pt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,At,ot,b.width,b.height):J?n.renderbufferStorageMultisample(n.RENDERBUFFER,At,ot,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,ot,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ht,n.RENDERBUFFER,U)}else{const rt=b.textures;for(let gt=0;gt<rt.length;gt++){const ot=rt[gt],Ht=a.convert(ot.format,ot.colorSpace),At=a.convert(ot.type),Bt=C(ot.internalFormat,Ht,At,ot.colorSpace),Vt=Tt(b);J&&pt(b)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Vt,Bt,b.width,b.height):pt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Vt,Bt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,Bt,b.width,b.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function jt(U,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(n.FRAMEBUFFER,U),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const rt=s.get(b.depthTexture);rt.__renderTarget=b,(!rt.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),q(b.depthTexture,0);const gt=rt.__webglTexture,ot=Tt(b);if(b.depthTexture.format===yr)pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0,ot):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0);else if(b.depthTexture.format===Er)pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0,ot):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0);else throw new Error("Unknown depthTexture format")}function Re(U){const b=s.get(U),J=U.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==U.depthTexture){const rt=U.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),rt){const gt=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,rt.removeEventListener("dispose",gt)};rt.addEventListener("dispose",gt),b.__depthDisposeCallback=gt}b.__boundDepthTexture=rt}if(U.depthTexture&&!b.__autoAllocateDepthBuffer){if(J)throw new Error("target.depthTexture not supported in Cube render targets");const rt=U.texture.mipmaps;rt&&rt.length>0?jt(b.__webglFramebuffer[0],U):jt(b.__webglFramebuffer,U)}else if(J){b.__webglDepthbuffer=[];for(let rt=0;rt<6;rt++)if(e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[rt]),b.__webglDepthbuffer[rt]===void 0)b.__webglDepthbuffer[rt]=n.createRenderbuffer(),Zt(b.__webglDepthbuffer[rt],U,!1);else{const gt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ot=b.__webglDepthbuffer[rt];n.bindRenderbuffer(n.RENDERBUFFER,ot),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,ot)}}else{const rt=U.texture.mipmaps;if(rt&&rt.length>0?e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[0]):e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=n.createRenderbuffer(),Zt(b.__webglDepthbuffer,U,!1);else{const gt=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ot=b.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ot),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,ot)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function dt(U,b,J){const rt=s.get(U);b!==void 0&&Nt(rt.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),J!==void 0&&Re(U)}function T(U){const b=U.texture,J=s.get(U),rt=s.get(b);U.addEventListener("dispose",B);const gt=U.textures,ot=U.isWebGLCubeRenderTarget===!0,Ht=gt.length>1;if(Ht||(rt.__webglTexture===void 0&&(rt.__webglTexture=n.createTexture()),rt.__version=b.version,l.memory.textures++),ot){J.__webglFramebuffer=[];for(let At=0;At<6;At++)if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer[At]=[];for(let Bt=0;Bt<b.mipmaps.length;Bt++)J.__webglFramebuffer[At][Bt]=n.createFramebuffer()}else J.__webglFramebuffer[At]=n.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer=[];for(let At=0;At<b.mipmaps.length;At++)J.__webglFramebuffer[At]=n.createFramebuffer()}else J.__webglFramebuffer=n.createFramebuffer();if(Ht)for(let At=0,Bt=gt.length;At<Bt;At++){const Vt=s.get(gt[At]);Vt.__webglTexture===void 0&&(Vt.__webglTexture=n.createTexture(),l.memory.textures++)}if(U.samples>0&&pt(U)===!1){J.__webglMultisampledFramebuffer=n.createFramebuffer(),J.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,J.__webglMultisampledFramebuffer);for(let At=0;At<gt.length;At++){const Bt=gt[At];J.__webglColorRenderbuffer[At]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,J.__webglColorRenderbuffer[At]);const Vt=a.convert(Bt.format,Bt.colorSpace),xt=a.convert(Bt.type),Lt=C(Bt.internalFormat,Vt,xt,Bt.colorSpace,U.isXRRenderTarget===!0),ne=Tt(U);n.renderbufferStorageMultisample(n.RENDERBUFFER,ne,Lt,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+At,n.RENDERBUFFER,J.__webglColorRenderbuffer[At])}n.bindRenderbuffer(n.RENDERBUFFER,null),U.depthBuffer&&(J.__webglDepthRenderbuffer=n.createRenderbuffer(),Zt(J.__webglDepthRenderbuffer,U,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(ot){e.bindTexture(n.TEXTURE_CUBE_MAP,rt.__webglTexture),Ot(n.TEXTURE_CUBE_MAP,b);for(let At=0;At<6;At++)if(b.mipmaps&&b.mipmaps.length>0)for(let Bt=0;Bt<b.mipmaps.length;Bt++)Nt(J.__webglFramebuffer[At][Bt],U,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+At,Bt);else Nt(J.__webglFramebuffer[At],U,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0);v(b)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Ht){for(let At=0,Bt=gt.length;At<Bt;At++){const Vt=gt[At],xt=s.get(Vt);let Lt=n.TEXTURE_2D;(U.isWebGL3DRenderTarget||U.isWebGLArrayRenderTarget)&&(Lt=U.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(Lt,xt.__webglTexture),Ot(Lt,Vt),Nt(J.__webglFramebuffer,U,Vt,n.COLOR_ATTACHMENT0+At,Lt,0),v(Vt)&&g(Lt)}e.unbindTexture()}else{let At=n.TEXTURE_2D;if((U.isWebGL3DRenderTarget||U.isWebGLArrayRenderTarget)&&(At=U.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(At,rt.__webglTexture),Ot(At,b),b.mipmaps&&b.mipmaps.length>0)for(let Bt=0;Bt<b.mipmaps.length;Bt++)Nt(J.__webglFramebuffer[Bt],U,b,n.COLOR_ATTACHMENT0,At,Bt);else Nt(J.__webglFramebuffer,U,b,n.COLOR_ATTACHMENT0,At,0);v(b)&&g(At),e.unbindTexture()}U.depthBuffer&&Re(U)}function Z(U){const b=U.textures;for(let J=0,rt=b.length;J<rt;J++){const gt=b[J];if(v(gt)){const ot=I(U),Ht=s.get(gt).__webglTexture;e.bindTexture(ot,Ht),g(ot),e.unbindTexture()}}}const $=[],ht=[];function lt(U){if(U.samples>0){if(pt(U)===!1){const b=U.textures,J=U.width,rt=U.height;let gt=n.COLOR_BUFFER_BIT;const ot=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ht=s.get(U),At=b.length>1;if(At)for(let Vt=0;Vt<b.length;Vt++)e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Ht.__webglMultisampledFramebuffer);const Bt=U.texture.mipmaps;Bt&&Bt.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglFramebuffer);for(let Vt=0;Vt<b.length;Vt++){if(U.resolveDepthBuffer&&(U.depthBuffer&&(gt|=n.DEPTH_BUFFER_BIT),U.stencilBuffer&&U.resolveStencilBuffer&&(gt|=n.STENCIL_BUFFER_BIT)),At){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Ht.__webglColorRenderbuffer[Vt]);const xt=s.get(b[Vt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,xt,0)}n.blitFramebuffer(0,0,J,rt,0,0,J,rt,gt,n.NEAREST),u===!0&&($.length=0,ht.length=0,$.push(n.COLOR_ATTACHMENT0+Vt),U.depthBuffer&&U.resolveDepthBuffer===!1&&($.push(ot),ht.push(ot),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,ht)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,$))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),At)for(let Vt=0;Vt<b.length;Vt++){e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.RENDERBUFFER,Ht.__webglColorRenderbuffer[Vt]);const xt=s.get(b[Vt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.TEXTURE_2D,xt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglMultisampledFramebuffer)}else if(U.depthBuffer&&U.resolveDepthBuffer===!1&&u){const b=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[b])}}}function Tt(U){return Math.min(r.maxSamples,U.samples)}function pt(U){const b=s.get(U);return U.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function bt(U){const b=l.render.frame;p.get(U)!==b&&(p.set(U,b),U.update())}function re(U,b){const J=U.colorSpace,rt=U.format,gt=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||J!==is&&J!==Li&&(Se.getTransfer(J)===Ie?(rt!==zn||gt!==hi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",J)),b}function de(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(d.width=U.naturalWidth||U.width,d.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(d.width=U.displayWidth,d.height=U.displayHeight):(d.width=U.width,d.height=U.height),d}this.allocateTextureUnit=z,this.resetTextureUnits=et,this.setTexture2D=q,this.setTexture2DArray=j,this.setTexture3D=ct,this.setTextureCube=W,this.rebindTextures=dt,this.setupRenderTarget=T,this.updateRenderTargetMipmap=Z,this.updateMultisampleRenderTarget=lt,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=Nt,this.useMultisampledRTT=pt}function Zw(n,t){function e(s,r=Li){let a;const l=Se.getTransfer(r);if(s===hi)return n.UNSIGNED_BYTE;if(s===yl)return n.UNSIGNED_SHORT_4_4_4_4;if(s===El)return n.UNSIGNED_SHORT_5_5_5_1;if(s===ou)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===su)return n.BYTE;if(s===ru)return n.SHORT;if(s===gr)return n.UNSIGNED_SHORT;if(s===vl)return n.INT;if(s===ns)return n.UNSIGNED_INT;if(s===ui)return n.FLOAT;if(s===_r)return n.HALF_FLOAT;if(s===au)return n.ALPHA;if(s===lu)return n.RGB;if(s===zn)return n.RGBA;if(s===yr)return n.DEPTH_COMPONENT;if(s===Er)return n.DEPTH_STENCIL;if(s===cu)return n.RED;if(s===xl)return n.RED_INTEGER;if(s===hu)return n.RG;if(s===wl)return n.RG_INTEGER;if(s===Sl)return n.RGBA_INTEGER;if(s===Eo||s===xo||s===wo||s===So)if(l===Ie)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Eo)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Eo)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ml||s===Tl||s===bl||s===Al)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Ml)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Tl)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===bl)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Al)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Cl||s===Pl||s===Rl)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Cl||s===Pl)return l===Ie?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Rl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Ll||s===Il||s===Dl||s===kl||s===Ul||s===Ol||s===Nl||s===Bl||s===Fl||s===zl||s===Hl||s===Vl||s===Gl||s===Wl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Ll)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Il)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Dl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===kl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ul)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Ol)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Nl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Bl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Fl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===zl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Hl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Vl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Gl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Wl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Mo||s===Zl||s===Xl)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===Mo)return l===Ie?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Zl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Xl)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===uu||s===Yl||s===ql||s===Ql)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===Mo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Yl)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ql)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Ql)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===vr?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class bd extends Je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const Xw=`
3825
+ }`;function Hw(n,t,e){let s=new Sc;const r=new be,a=new be,l=new He,h=new H0({depthPacking:Uv}),u=new V0,d={},p=e.maxTextureSize,m={[Ai]:fn,[fn]:Ai,[ci]:ci},_=new vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:Fw,fragmentShader:zw}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const S=new $n;S.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new pn(S,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jh;let g=this.type;this.render=function(N,B,V){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||N.length===0)return;const R=n.getRenderTarget(),D=n.getActiveCubeFace(),U=n.getActiveMipmapLevel(),tt=n.state;tt.setBlending(Ci),tt.buffers.depth.getReversed()?tt.buffers.color.setClear(0,0,0,0):tt.buffers.color.setClear(1,1,1,1),tt.buffers.depth.setTest(!0),tt.setScissorTest(!1);const F=g!==li&&this.type===li,H=g===li&&this.type!==li;for(let q=0,j=N.length;q<j;q++){const ct=N[q],W=ct.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",ct,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;r.copy(W.mapSize);const Et=W.getFrameExtents();if(r.multiply(Et),a.copy(W.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/Et.x),r.x=a.x*Et.x,W.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/Et.y),r.y=a.y*Et.y,W.mapSize.y=a.y)),W.map===null||F===!0||H===!0){const Mt=this.type!==li?{minFilter:Fn,magFilter:Fn}:{};W.map!==null&&W.map.dispose(),W.map=new Ii(r.x,r.y,Mt),W.map.texture.name=ct.name+".shadowMap",W.camera.updateProjectionMatrix()}n.setRenderTarget(W.map),n.clear();const lt=W.getViewportCount();for(let Mt=0;Mt<lt;Mt++){const Ot=W.getViewport(Mt);l.set(a.x*Ot.x,a.y*Ot.y,a.x*Ot.z,a.y*Ot.w),tt.viewport(l),W.updateMatrices(ct,Mt),s=W.getFrustum(),M(B,V,W.camera,ct,this.type)}W.isPointLightShadow!==!0&&this.type===li&&I(W,V),W.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(R,D,U)};function I(N,B){const V=t.update(w);_.defines.VSM_SAMPLES!==N.blurSamples&&(_.defines.VSM_SAMPLES=N.blurSamples,E.defines.VSM_SAMPLES=N.blurSamples,_.needsUpdate=!0,E.needsUpdate=!0),N.mapPass===null&&(N.mapPass=new Ii(r.x,r.y)),_.uniforms.shadow_pass.value=N.map.texture,_.uniforms.resolution.value=N.mapSize,_.uniforms.radius.value=N.radius,n.setRenderTarget(N.mapPass),n.clear(),n.renderBufferDirect(B,null,V,_,w,null),E.uniforms.shadow_pass.value=N.mapPass.texture,E.uniforms.resolution.value=N.mapSize,E.uniforms.radius.value=N.radius,n.setRenderTarget(N.map),n.clear(),n.renderBufferDirect(B,null,V,E,w,null)}function C(N,B,V,R){let D=null;const U=V.isPointLight===!0?N.customDistanceMaterial:N.customDepthMaterial;if(U!==void 0)D=U;else if(D=V.isPointLight===!0?u:h,n.localClippingEnabled&&B.clipShadows===!0&&Array.isArray(B.clippingPlanes)&&B.clippingPlanes.length!==0||B.displacementMap&&B.displacementScale!==0||B.alphaMap&&B.alphaTest>0||B.map&&B.alphaTest>0||B.alphaToCoverage===!0){const tt=D.uuid,F=B.uuid;let H=d[tt];H===void 0&&(H={},d[tt]=H);let q=H[F];q===void 0&&(q=D.clone(),H[F]=q,B.addEventListener("dispose",k)),D=q}if(D.visible=B.visible,D.wireframe=B.wireframe,R===li?D.side=B.shadowSide!==null?B.shadowSide:B.side:D.side=B.shadowSide!==null?B.shadowSide:m[B.side],D.alphaMap=B.alphaMap,D.alphaTest=B.alphaToCoverage===!0?.5:B.alphaTest,D.map=B.map,D.clipShadows=B.clipShadows,D.clippingPlanes=B.clippingPlanes,D.clipIntersection=B.clipIntersection,D.displacementMap=B.displacementMap,D.displacementScale=B.displacementScale,D.displacementBias=B.displacementBias,D.wireframeLinewidth=B.wireframeLinewidth,D.linewidth=B.linewidth,V.isPointLight===!0&&D.isMeshDistanceMaterial===!0){const tt=n.properties.get(D);tt.light=V}return D}function M(N,B,V,R,D){if(N.visible===!1)return;if(N.layers.test(B.layers)&&(N.isMesh||N.isLine||N.isPoints)&&(N.castShadow||N.receiveShadow&&D===li)&&(!N.frustumCulled||s.intersectsObject(N))){N.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,N.matrixWorld);const F=t.update(N),H=N.material;if(Array.isArray(H)){const q=F.groups;for(let j=0,ct=q.length;j<ct;j++){const W=q[j],Et=H[W.materialIndex];if(Et&&Et.visible){const lt=C(N,Et,R,D);N.onBeforeShadow(n,N,B,V,F,lt,W),n.renderBufferDirect(V,null,F,lt,N,W),N.onAfterShadow(n,N,B,V,F,lt,W)}}}else if(H.visible){const q=C(N,H,R,D);N.onBeforeShadow(n,N,B,V,F,q,null),n.renderBufferDirect(V,null,F,q,N,null),N.onAfterShadow(n,N,B,V,F,q,null)}}const tt=N.children;for(let F=0,H=tt.length;F<H;F++)M(tt[F],B,V,R,D)}function k(N){N.target.removeEventListener("dispose",k);for(const V in d){const R=d[V],D=N.target.uuid;D in R&&(R[D].dispose(),delete R[D])}}}const Vw={[ol]:al,[ll]:ul,[cl]:dl,[Ms]:hl,[al]:ol,[ul]:ll,[dl]:cl,[hl]:Ms};function Gw(n,t){function e(){let G=!1;const St=new He;let Ct=null;const Ut=new He(0,0,0,0);return{setMask:function(vt){Ct!==vt&&!G&&(n.colorMask(vt,vt,vt,vt),Ct=vt)},setLocked:function(vt){G=vt},setClear:function(vt,dt,zt,le,De){De===!0&&(vt*=le,dt*=le,zt*=le),St.set(vt,dt,zt,le),Ut.equals(St)===!1&&(n.clearColor(vt,dt,zt,le),Ut.copy(St))},reset:function(){G=!1,Ct=null,Ut.set(-1,0,0,0)}}}function s(){let G=!1,St=!1,Ct=null,Ut=null,vt=null;return{setReversed:function(dt){if(St!==dt){const zt=t.get("EXT_clip_control");dt?zt.clipControlEXT(zt.LOWER_LEFT_EXT,zt.ZERO_TO_ONE_EXT):zt.clipControlEXT(zt.LOWER_LEFT_EXT,zt.NEGATIVE_ONE_TO_ONE_EXT),St=dt;const le=vt;vt=null,this.setClear(le)}},getReversed:function(){return St},setTest:function(dt){dt?_t(n.DEPTH_TEST):Nt(n.DEPTH_TEST)},setMask:function(dt){Ct!==dt&&!G&&(n.depthMask(dt),Ct=dt)},setFunc:function(dt){if(St&&(dt=Vw[dt]),Ut!==dt){switch(dt){case ol:n.depthFunc(n.NEVER);break;case al:n.depthFunc(n.ALWAYS);break;case ll:n.depthFunc(n.LESS);break;case Ms:n.depthFunc(n.LEQUAL);break;case cl:n.depthFunc(n.EQUAL);break;case hl:n.depthFunc(n.GEQUAL);break;case ul:n.depthFunc(n.GREATER);break;case dl:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ut=dt}},setLocked:function(dt){G=dt},setClear:function(dt){vt!==dt&&(St&&(dt=1-dt),n.clearDepth(dt),vt=dt)},reset:function(){G=!1,Ct=null,Ut=null,vt=null,St=!1}}}function r(){let G=!1,St=null,Ct=null,Ut=null,vt=null,dt=null,zt=null,le=null,De=null;return{setTest:function(Me){G||(Me?_t(n.STENCIL_TEST):Nt(n.STENCIL_TEST))},setMask:function(Me){St!==Me&&!G&&(n.stencilMask(Me),St=Me)},setFunc:function(Me,bn,On){(Ct!==Me||Ut!==bn||vt!==On)&&(n.stencilFunc(Me,bn,On),Ct=Me,Ut=bn,vt=On)},setOp:function(Me,bn,On){(dt!==Me||zt!==bn||le!==On)&&(n.stencilOp(Me,bn,On),dt=Me,zt=bn,le=On)},setLocked:function(Me){G=Me},setClear:function(Me){De!==Me&&(n.clearStencil(Me),De=Me)},reset:function(){G=!1,St=null,Ct=null,Ut=null,vt=null,dt=null,zt=null,le=null,De=null}}}const a=new e,l=new s,h=new r,u=new WeakMap,d=new WeakMap;let p={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,M=null,k=null,N=null,B=new Ce(0,0,0),V=0,R=!1,D=null,U=null,tt=null,F=null,H=null;const q=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let j=!1,ct=0;const W=n.getParameter(n.VERSION);W.indexOf("WebGL")!==-1?(ct=parseFloat(/^WebGL (\d)/.exec(W)[1]),j=ct>=1):W.indexOf("OpenGL ES")!==-1&&(ct=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),j=ct>=2);let Et=null,lt={};const Mt=n.getParameter(n.SCISSOR_BOX),Ot=n.getParameter(n.VIEWPORT),oe=new He().fromArray(Mt),Qt=new He().fromArray(Ot);function et(G,St,Ct,Ut){const vt=new Uint8Array(4),dt=n.createTexture();n.bindTexture(G,dt),n.texParameteri(G,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(G,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let zt=0;zt<Ct;zt++)G===n.TEXTURE_3D||G===n.TEXTURE_2D_ARRAY?n.texImage3D(St,0,n.RGBA,1,1,Ut,0,n.RGBA,n.UNSIGNED_BYTE,vt):n.texImage2D(St+zt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,vt);return dt}const ut={};ut[n.TEXTURE_2D]=et(n.TEXTURE_2D,n.TEXTURE_2D,1),ut[n.TEXTURE_CUBE_MAP]=et(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),ut[n.TEXTURE_2D_ARRAY]=et(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),ut[n.TEXTURE_3D]=et(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),_t(n.DEPTH_TEST),l.setFunc(Ms),ht(!1),rt(jh),_t(n.CULL_FACE),Z(Ci);function _t(G){p[G]!==!0&&(n.enable(G),p[G]=!0)}function Nt(G){p[G]!==!1&&(n.disable(G),p[G]=!1)}function Zt(G,St){return m[G]!==St?(n.bindFramebuffer(G,St),m[G]=St,G===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=St),G===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=St),!0):!1}function jt(G,St){let Ct=E,Ut=!1;if(G){Ct=_.get(St),Ct===void 0&&(Ct=[],_.set(St,Ct));const vt=G.textures;if(Ct.length!==vt.length||Ct[0]!==n.COLOR_ATTACHMENT0){for(let dt=0,zt=vt.length;dt<zt;dt++)Ct[dt]=n.COLOR_ATTACHMENT0+dt;Ct.length=vt.length,Ut=!0}}else Ct[0]!==n.BACK&&(Ct[0]=n.BACK,Ut=!0);Ut&&n.drawBuffers(Ct)}function Re(G){return S!==G?(n.useProgram(G),S=G,!0):!1}const ft={[ts]:n.FUNC_ADD,[lv]:n.FUNC_SUBTRACT,[cv]:n.FUNC_REVERSE_SUBTRACT};ft[hv]=n.MIN,ft[uv]=n.MAX;const T={[dv]:n.ZERO,[fv]:n.ONE,[pv]:n.SRC_COLOR,[sl]:n.SRC_ALPHA,[Ev]:n.SRC_ALPHA_SATURATE,[vv]:n.DST_COLOR,[gv]:n.DST_ALPHA,[mv]:n.ONE_MINUS_SRC_COLOR,[rl]:n.ONE_MINUS_SRC_ALPHA,[yv]:n.ONE_MINUS_DST_COLOR,[_v]:n.ONE_MINUS_DST_ALPHA,[xv]:n.CONSTANT_COLOR,[wv]:n.ONE_MINUS_CONSTANT_COLOR,[Sv]:n.CONSTANT_ALPHA,[Mv]:n.ONE_MINUS_CONSTANT_ALPHA};function Z(G,St,Ct,Ut,vt,dt,zt,le,De,Me){if(G===Ci){w===!0&&(Nt(n.BLEND),w=!1);return}if(w===!1&&(_t(n.BLEND),w=!0),G!==av){if(G!==v||Me!==R){if((g!==ts||M!==ts)&&(n.blendEquation(n.FUNC_ADD),g=ts,M=ts),Me)switch(G){case Ss:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFunc(n.ONE,n.ONE);break;case $h:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case tu:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}else switch(G){case Ss:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case $h:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case tu:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",G);break}I=null,C=null,k=null,N=null,B.set(0,0,0),V=0,v=G,R=Me}return}vt=vt||St,dt=dt||Ct,zt=zt||Ut,(St!==g||vt!==M)&&(n.blendEquationSeparate(ft[St],ft[vt]),g=St,M=vt),(Ct!==I||Ut!==C||dt!==k||zt!==N)&&(n.blendFuncSeparate(T[Ct],T[Ut],T[dt],T[zt]),I=Ct,C=Ut,k=dt,N=zt),(le.equals(B)===!1||De!==V)&&(n.blendColor(le.r,le.g,le.b,De),B.copy(le),V=De),v=G,R=!1}function $(G,St){G.side===ci?Nt(n.CULL_FACE):_t(n.CULL_FACE);let Ct=G.side===fn;St&&(Ct=!Ct),ht(Ct),G.blending===Ss&&G.transparent===!1?Z(Ci):Z(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),l.setFunc(G.depthFunc),l.setTest(G.depthTest),l.setMask(G.depthWrite),a.setMask(G.colorWrite);const Ut=G.stencilWrite;h.setTest(Ut),Ut&&(h.setMask(G.stencilWriteMask),h.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),h.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),pt(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?_t(n.SAMPLE_ALPHA_TO_COVERAGE):Nt(n.SAMPLE_ALPHA_TO_COVERAGE)}function ht(G){D!==G&&(G?n.frontFace(n.CW):n.frontFace(n.CCW),D=G)}function rt(G){G!==sv?(_t(n.CULL_FACE),G!==U&&(G===jh?n.cullFace(n.BACK):G===rv?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Nt(n.CULL_FACE),U=G}function Tt(G){G!==tt&&(j&&n.lineWidth(G),tt=G)}function pt(G,St,Ct){G?(_t(n.POLYGON_OFFSET_FILL),(F!==St||H!==Ct)&&(n.polygonOffset(St,Ct),F=St,H=Ct)):Nt(n.POLYGON_OFFSET_FILL)}function At(G){G?_t(n.SCISSOR_TEST):Nt(n.SCISSOR_TEST)}function ne(G){G===void 0&&(G=n.TEXTURE0+q-1),Et!==G&&(n.activeTexture(G),Et=G)}function de(G,St,Ct){Ct===void 0&&(Et===null?Ct=n.TEXTURE0+q-1:Ct=Et);let Ut=lt[Ct];Ut===void 0&&(Ut={type:void 0,texture:void 0},lt[Ct]=Ut),(Ut.type!==G||Ut.texture!==St)&&(Et!==Ct&&(n.activeTexture(Ct),Et=Ct),n.bindTexture(G,St||ut[G]),Ut.type=G,Ut.texture=St)}function O(){const G=lt[Et];G!==void 0&&G.type!==void 0&&(n.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function b(){try{n.compressedTexImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function J(){try{n.compressedTexImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function ot(){try{n.texSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function gt(){try{n.texSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function at(){try{n.compressedTexSubImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Ht(){try{n.compressedTexSubImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function bt(){try{n.texStorage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Bt(){try{n.texStorage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Vt(){try{n.texImage2D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function wt(){try{n.texImage3D(...arguments)}catch(G){console.error("THREE.WebGLState:",G)}}function Lt(G){oe.equals(G)===!1&&(n.scissor(G.x,G.y,G.z,G.w),oe.copy(G))}function ie(G){Qt.equals(G)===!1&&(n.viewport(G.x,G.y,G.z,G.w),Qt.copy(G))}function Gt(G,St){let Ct=d.get(St);Ct===void 0&&(Ct=new WeakMap,d.set(St,Ct));let Ut=Ct.get(G);Ut===void 0&&(Ut=n.getUniformBlockIndex(St,G.name),Ct.set(G,Ut))}function Pt(G,St){const Ut=d.get(St).get(G);u.get(St)!==Ut&&(n.uniformBlockBinding(St,Ut,G.__bindingPointIndex),u.set(St,Ut))}function ce(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),l.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,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),p={},Et=null,lt={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,M=null,k=null,N=null,B=new Ce(0,0,0),V=0,R=!1,D=null,U=null,tt=null,F=null,H=null,oe.set(0,0,n.canvas.width,n.canvas.height),Qt.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:_t,disable:Nt,bindFramebuffer:Zt,drawBuffers:jt,useProgram:Re,setBlending:Z,setMaterial:$,setFlipSided:ht,setCullFace:rt,setLineWidth:Tt,setPolygonOffset:pt,setScissorTest:At,activeTexture:ne,bindTexture:de,unbindTexture:O,compressedTexImage2D:b,compressedTexImage3D:J,texImage2D:Vt,texImage3D:wt,updateUBOMapping:Gt,uniformBlockBinding:Pt,texStorage2D:bt,texStorage3D:Bt,texSubImage2D:ot,texSubImage3D:gt,compressedTexSubImage2D:at,compressedTexSubImage3D:Ht,scissor:Lt,viewport:ie,reset:ce}}function Ww(n,t,e,s,r,a,l){const h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new be,p=new WeakMap;let m;const _=new WeakMap;let E=!1;try{E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(O,b){return E?new OffscreenCanvas(O,b):Mr("canvas")}function w(O,b,J){let ot=1;const gt=de(O);if((gt.width>J||gt.height>J)&&(ot=J/Math.max(gt.width,gt.height)),ot<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const at=Math.floor(ot*gt.width),Ht=Math.floor(ot*gt.height);m===void 0&&(m=S(at,Ht));const bt=b?S(at,Ht):m;return bt.width=at,bt.height=Ht,bt.getContext("2d").drawImage(O,0,0,at,Ht),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+gt.width+"x"+gt.height+") to ("+at+"x"+Ht+")."),bt}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+gt.width+"x"+gt.height+")."),O;return O}function v(O){return O.generateMipmaps}function g(O){n.generateMipmap(O)}function I(O){return O.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?n.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function C(O,b,J,ot,gt=!1){if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let at=b;if(b===n.RED&&(J===n.FLOAT&&(at=n.R32F),J===n.HALF_FLOAT&&(at=n.R16F),J===n.UNSIGNED_BYTE&&(at=n.R8)),b===n.RED_INTEGER&&(J===n.UNSIGNED_BYTE&&(at=n.R8UI),J===n.UNSIGNED_SHORT&&(at=n.R16UI),J===n.UNSIGNED_INT&&(at=n.R32UI),J===n.BYTE&&(at=n.R8I),J===n.SHORT&&(at=n.R16I),J===n.INT&&(at=n.R32I)),b===n.RG&&(J===n.FLOAT&&(at=n.RG32F),J===n.HALF_FLOAT&&(at=n.RG16F),J===n.UNSIGNED_BYTE&&(at=n.RG8)),b===n.RG_INTEGER&&(J===n.UNSIGNED_BYTE&&(at=n.RG8UI),J===n.UNSIGNED_SHORT&&(at=n.RG16UI),J===n.UNSIGNED_INT&&(at=n.RG32UI),J===n.BYTE&&(at=n.RG8I),J===n.SHORT&&(at=n.RG16I),J===n.INT&&(at=n.RG32I)),b===n.RGB_INTEGER&&(J===n.UNSIGNED_BYTE&&(at=n.RGB8UI),J===n.UNSIGNED_SHORT&&(at=n.RGB16UI),J===n.UNSIGNED_INT&&(at=n.RGB32UI),J===n.BYTE&&(at=n.RGB8I),J===n.SHORT&&(at=n.RGB16I),J===n.INT&&(at=n.RGB32I)),b===n.RGBA_INTEGER&&(J===n.UNSIGNED_BYTE&&(at=n.RGBA8UI),J===n.UNSIGNED_SHORT&&(at=n.RGBA16UI),J===n.UNSIGNED_INT&&(at=n.RGBA32UI),J===n.BYTE&&(at=n.RGBA8I),J===n.SHORT&&(at=n.RGBA16I),J===n.INT&&(at=n.RGBA32I)),b===n.RGB&&J===n.UNSIGNED_INT_5_9_9_9_REV&&(at=n.RGB9_E5),b===n.RGBA){const Ht=gt?To:Se.getTransfer(ot);J===n.FLOAT&&(at=n.RGBA32F),J===n.HALF_FLOAT&&(at=n.RGBA16F),J===n.UNSIGNED_BYTE&&(at=Ht===Ie?n.SRGB8_ALPHA8:n.RGBA8),J===n.UNSIGNED_SHORT_4_4_4_4&&(at=n.RGBA4),J===n.UNSIGNED_SHORT_5_5_5_1&&(at=n.RGB5_A1)}return(at===n.R16F||at===n.R32F||at===n.RG16F||at===n.RG32F||at===n.RGBA16F||at===n.RGBA32F)&&t.get("EXT_color_buffer_float"),at}function M(O,b){let J;return O?b===null||b===ns||b===vr?J=n.DEPTH24_STENCIL8:b===ui?J=n.DEPTH32F_STENCIL8:b===gr&&(J=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===ns||b===vr?J=n.DEPTH_COMPONENT24:b===ui?J=n.DEPTH_COMPONENT32F:b===gr&&(J=n.DEPTH_COMPONENT16),J}function k(O,b){return v(O)===!0||O.isFramebufferTexture&&O.minFilter!==Fn&&O.minFilter!==En?Math.log2(Math.max(b.width,b.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?b.mipmaps.length:1}function N(O){const b=O.target;b.removeEventListener("dispose",N),V(b),b.isVideoTexture&&p.delete(b)}function B(O){const b=O.target;b.removeEventListener("dispose",B),D(b)}function V(O){const b=s.get(O);if(b.__webglInit===void 0)return;const J=O.source,ot=_.get(J);if(ot){const gt=ot[b.__cacheKey];gt.usedTimes--,gt.usedTimes===0&&R(O),Object.keys(ot).length===0&&_.delete(J)}s.remove(O)}function R(O){const b=s.get(O);n.deleteTexture(b.__webglTexture);const J=O.source,ot=_.get(J);delete ot[b.__cacheKey],l.memory.textures--}function D(O){const b=s.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),s.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let ot=0;ot<6;ot++){if(Array.isArray(b.__webglFramebuffer[ot]))for(let gt=0;gt<b.__webglFramebuffer[ot].length;gt++)n.deleteFramebuffer(b.__webglFramebuffer[ot][gt]);else n.deleteFramebuffer(b.__webglFramebuffer[ot]);b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer[ot])}else{if(Array.isArray(b.__webglFramebuffer))for(let ot=0;ot<b.__webglFramebuffer.length;ot++)n.deleteFramebuffer(b.__webglFramebuffer[ot]);else n.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&n.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let ot=0;ot<b.__webglColorRenderbuffer.length;ot++)b.__webglColorRenderbuffer[ot]&&n.deleteRenderbuffer(b.__webglColorRenderbuffer[ot]);b.__webglDepthRenderbuffer&&n.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const J=O.textures;for(let ot=0,gt=J.length;ot<gt;ot++){const at=s.get(J[ot]);at.__webglTexture&&(n.deleteTexture(at.__webglTexture),l.memory.textures--),s.remove(J[ot])}s.remove(O)}let U=0;function tt(){U=0}function F(){const O=U;return O>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+r.maxTextures),U+=1,O}function H(O){const b=[];return b.push(O.wrapS),b.push(O.wrapT),b.push(O.wrapR||0),b.push(O.magFilter),b.push(O.minFilter),b.push(O.anisotropy),b.push(O.internalFormat),b.push(O.format),b.push(O.type),b.push(O.generateMipmaps),b.push(O.premultiplyAlpha),b.push(O.flipY),b.push(O.unpackAlignment),b.push(O.colorSpace),b.join()}function q(O,b){const J=s.get(O);if(O.isVideoTexture&&At(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&J.__version!==O.version){const ot=O.image;if(ot===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ot.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ut(J,O,b);return}}else O.isExternalTexture&&(J.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,J.__webglTexture,n.TEXTURE0+b)}function j(O,b){const J=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&J.__version!==O.version){ut(J,O,b);return}e.bindTexture(n.TEXTURE_2D_ARRAY,J.__webglTexture,n.TEXTURE0+b)}function ct(O,b){const J=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&J.__version!==O.version){ut(J,O,b);return}e.bindTexture(n.TEXTURE_3D,J.__webglTexture,n.TEXTURE0+b)}function W(O,b){const J=s.get(O);if(O.version>0&&J.__version!==O.version){_t(J,O,b);return}e.bindTexture(n.TEXTURE_CUBE_MAP,J.__webglTexture,n.TEXTURE0+b)}const Et={[ml]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[gl]:n.MIRRORED_REPEAT},lt={[Fn]:n.NEAREST,[Dv]:n.NEAREST_MIPMAP_NEAREST,[yo]:n.NEAREST_MIPMAP_LINEAR,[En]:n.LINEAR,[_l]:n.LINEAR_MIPMAP_NEAREST,[Ri]:n.LINEAR_MIPMAP_LINEAR},Mt={[Bv]:n.NEVER,[Wv]:n.ALWAYS,[Fv]:n.LESS,[fu]:n.LEQUAL,[zv]:n.EQUAL,[Gv]:n.GEQUAL,[Hv]:n.GREATER,[Vv]:n.NOTEQUAL};function Ot(O,b){if(b.type===ui&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===En||b.magFilter===_l||b.magFilter===yo||b.magFilter===Ri||b.minFilter===En||b.minFilter===_l||b.minFilter===yo||b.minFilter===Ri)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(O,n.TEXTURE_WRAP_S,Et[b.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,Et[b.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,Et[b.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,lt[b.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,lt[b.minFilter]),b.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,Mt[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Fn||b.minFilter!==yo&&b.minFilter!==Ri||b.type===ui&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const J=t.get("EXT_texture_filter_anisotropic");n.texParameterf(O,J.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function oe(O,b){let J=!1;O.__webglInit===void 0&&(O.__webglInit=!0,b.addEventListener("dispose",N));const ot=b.source;let gt=_.get(ot);gt===void 0&&(gt={},_.set(ot,gt));const at=H(b);if(at!==O.__cacheKey){gt[at]===void 0&&(gt[at]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,J=!0),gt[at].usedTimes++;const Ht=gt[O.__cacheKey];Ht!==void 0&&(gt[O.__cacheKey].usedTimes--,Ht.usedTimes===0&&R(b)),O.__cacheKey=at,O.__webglTexture=gt[at].texture}return J}function Qt(O,b,J){return Math.floor(Math.floor(O/J)/b)}function et(O,b,J,ot){const at=O.updateRanges;if(at.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,b.width,b.height,J,ot,b.data);else{at.sort((wt,Lt)=>wt.start-Lt.start);let Ht=0;for(let wt=1;wt<at.length;wt++){const Lt=at[Ht],ie=at[wt],Gt=Lt.start+Lt.count,Pt=Qt(ie.start,b.width,4),ce=Qt(Lt.start,b.width,4);ie.start<=Gt+1&&Pt===ce&&Qt(ie.start+ie.count-1,b.width,4)===Pt?Lt.count=Math.max(Lt.count,ie.start+ie.count-Lt.start):(++Ht,at[Ht]=ie)}at.length=Ht+1;const bt=n.getParameter(n.UNPACK_ROW_LENGTH),Bt=n.getParameter(n.UNPACK_SKIP_PIXELS),Vt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,b.width);for(let wt=0,Lt=at.length;wt<Lt;wt++){const ie=at[wt],Gt=Math.floor(ie.start/4),Pt=Math.ceil(ie.count/4),ce=Gt%b.width,G=Math.floor(Gt/b.width),St=Pt,Ct=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,G),e.texSubImage2D(n.TEXTURE_2D,0,ce,G,St,Ct,J,ot,b.data)}O.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,bt),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Bt),n.pixelStorei(n.UNPACK_SKIP_ROWS,Vt)}}function ut(O,b,J){let ot=n.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(ot=n.TEXTURE_2D_ARRAY),b.isData3DTexture&&(ot=n.TEXTURE_3D);const gt=oe(O,b),at=b.source;e.bindTexture(ot,O.__webglTexture,n.TEXTURE0+J);const Ht=s.get(at);if(at.version!==Ht.__version||gt===!0){e.activeTexture(n.TEXTURE0+J);const bt=Se.getPrimaries(Se.workingColorSpace),Bt=b.colorSpace===Li?null:Se.getPrimaries(b.colorSpace),Vt=b.colorSpace===Li||bt===Bt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Vt);let wt=w(b.image,!1,r.maxTextureSize);wt=ne(b,wt);const Lt=a.convert(b.format,b.colorSpace),ie=a.convert(b.type);let Gt=C(b.internalFormat,Lt,ie,b.colorSpace,b.isVideoTexture);Ot(ot,b);let Pt;const ce=b.mipmaps,G=b.isVideoTexture!==!0,St=Ht.__version===void 0||gt===!0,Ct=at.dataReady,Ut=k(b,wt);if(b.isDepthTexture)Gt=M(b.format===Er,b.type),St&&(G?e.texStorage2D(n.TEXTURE_2D,1,Gt,wt.width,wt.height):e.texImage2D(n.TEXTURE_2D,0,Gt,wt.width,wt.height,0,Lt,ie,null));else if(b.isDataTexture)if(ce.length>0){G&&St&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,ce[0].width,ce[0].height);for(let vt=0,dt=ce.length;vt<dt;vt++)Pt=ce[vt],G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,ie,Pt.data):e.texImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Lt,ie,Pt.data);b.generateMipmaps=!1}else G?(St&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,wt.width,wt.height),Ct&&et(b,wt,Lt,ie)):e.texImage2D(n.TEXTURE_2D,0,Gt,wt.width,wt.height,0,Lt,ie,wt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){G&&St&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ut,Gt,ce[0].width,ce[0].height,wt.depth);for(let vt=0,dt=ce.length;vt<dt;vt++)if(Pt=ce[vt],b.format!==zn)if(Lt!==null)if(G){if(Ct)if(b.layerUpdates.size>0){const zt=ju(Pt.width,Pt.height,b.format,b.type);for(const le of b.layerUpdates){const De=Pt.data.subarray(le*zt/Pt.data.BYTES_PER_ELEMENT,(le+1)*zt/Pt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,le,Pt.width,Pt.height,1,Lt,De)}b.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Pt.width,Pt.height,wt.depth,Lt,Pt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,vt,Gt,Pt.width,Pt.height,wt.depth,0,Pt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?Ct&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Pt.width,Pt.height,wt.depth,Lt,ie,Pt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,vt,Gt,Pt.width,Pt.height,wt.depth,0,Lt,ie,Pt.data)}else{G&&St&&e.texStorage2D(n.TEXTURE_2D,Ut,Gt,ce[0].width,ce[0].height);for(let vt=0,dt=ce.length;vt<dt;vt++)Pt=ce[vt],b.format!==zn?Lt!==null?G?Ct&&e.compressedTexSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,Pt.data):e.compressedTexImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Pt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Pt.width,Pt.height,Lt,ie,Pt.data):e.texImage2D(n.TEXTURE_2D,vt,Gt,Pt.width,Pt.height,0,Lt,ie,Pt.data)}else if(b.isDataArrayTexture)if(G){if(St&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ut,Gt,wt.width,wt.height,wt.depth),Ct)if(b.layerUpdates.size>0){const vt=ju(wt.width,wt.height,b.format,b.type);for(const dt of b.layerUpdates){const zt=wt.data.subarray(dt*vt/wt.data.BYTES_PER_ELEMENT,(dt+1)*vt/wt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,dt,wt.width,wt.height,1,Lt,ie,zt)}b.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,wt.width,wt.height,wt.depth,Lt,ie,wt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Gt,wt.width,wt.height,wt.depth,0,Lt,ie,wt.data);else if(b.isData3DTexture)G?(St&&e.texStorage3D(n.TEXTURE_3D,Ut,Gt,wt.width,wt.height,wt.depth),Ct&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,wt.width,wt.height,wt.depth,Lt,ie,wt.data)):e.texImage3D(n.TEXTURE_3D,0,Gt,wt.width,wt.height,wt.depth,0,Lt,ie,wt.data);else if(b.isFramebufferTexture){if(St)if(G)e.texStorage2D(n.TEXTURE_2D,Ut,Gt,wt.width,wt.height);else{let vt=wt.width,dt=wt.height;for(let zt=0;zt<Ut;zt++)e.texImage2D(n.TEXTURE_2D,zt,Gt,vt,dt,0,Lt,ie,null),vt>>=1,dt>>=1}}else if(ce.length>0){if(G&&St){const vt=de(ce[0]);e.texStorage2D(n.TEXTURE_2D,Ut,Gt,vt.width,vt.height)}for(let vt=0,dt=ce.length;vt<dt;vt++)Pt=ce[vt],G?Ct&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Lt,ie,Pt):e.texImage2D(n.TEXTURE_2D,vt,Gt,Lt,ie,Pt);b.generateMipmaps=!1}else if(G){if(St){const vt=de(wt);e.texStorage2D(n.TEXTURE_2D,Ut,Gt,vt.width,vt.height)}Ct&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,Lt,ie,wt)}else e.texImage2D(n.TEXTURE_2D,0,Gt,Lt,ie,wt);v(b)&&g(ot),Ht.__version=at.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function _t(O,b,J){if(b.image.length!==6)return;const ot=oe(O,b),gt=b.source;e.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+J);const at=s.get(gt);if(gt.version!==at.__version||ot===!0){e.activeTexture(n.TEXTURE0+J);const Ht=Se.getPrimaries(Se.workingColorSpace),bt=b.colorSpace===Li?null:Se.getPrimaries(b.colorSpace),Bt=b.colorSpace===Li||Ht===bt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Bt);const Vt=b.isCompressedTexture||b.image[0].isCompressedTexture,wt=b.image[0]&&b.image[0].isDataTexture,Lt=[];for(let dt=0;dt<6;dt++)!Vt&&!wt?Lt[dt]=w(b.image[dt],!0,r.maxCubemapSize):Lt[dt]=wt?b.image[dt].image:b.image[dt],Lt[dt]=ne(b,Lt[dt]);const ie=Lt[0],Gt=a.convert(b.format,b.colorSpace),Pt=a.convert(b.type),ce=C(b.internalFormat,Gt,Pt,b.colorSpace),G=b.isVideoTexture!==!0,St=at.__version===void 0||ot===!0,Ct=gt.dataReady;let Ut=k(b,ie);Ot(n.TEXTURE_CUBE_MAP,b);let vt;if(Vt){G&&St&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ut,ce,ie.width,ie.height);for(let dt=0;dt<6;dt++){vt=Lt[dt].mipmaps;for(let zt=0;zt<vt.length;zt++){const le=vt[zt];b.format!==zn?Gt!==null?G?Ct&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt,0,0,le.width,le.height,Gt,le.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt,ce,le.width,le.height,0,le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt,0,0,le.width,le.height,Gt,Pt,le.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt,ce,le.width,le.height,0,Gt,Pt,le.data)}}}else{if(vt=b.mipmaps,G&&St){vt.length>0&&Ut++;const dt=de(Lt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ut,ce,dt.width,dt.height)}for(let dt=0;dt<6;dt++)if(wt){G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,Lt[dt].width,Lt[dt].height,Gt,Pt,Lt[dt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,ce,Lt[dt].width,Lt[dt].height,0,Gt,Pt,Lt[dt].data);for(let zt=0;zt<vt.length;zt++){const De=vt[zt].image[dt].image;G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt+1,0,0,De.width,De.height,Gt,Pt,De.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt+1,ce,De.width,De.height,0,Gt,Pt,De.data)}}else{G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,Gt,Pt,Lt[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,ce,Gt,Pt,Lt[dt]);for(let zt=0;zt<vt.length;zt++){const le=vt[zt];G?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt+1,0,0,Gt,Pt,le.image[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,zt+1,ce,Gt,Pt,le.image[dt])}}}v(b)&&g(n.TEXTURE_CUBE_MAP),at.__version=gt.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function Nt(O,b,J,ot,gt,at){const Ht=a.convert(J.format,J.colorSpace),bt=a.convert(J.type),Bt=C(J.internalFormat,Ht,bt,J.colorSpace),Vt=s.get(b),wt=s.get(J);if(wt.__renderTarget=b,!Vt.__hasExternalTextures){const Lt=Math.max(1,b.width>>at),ie=Math.max(1,b.height>>at);gt===n.TEXTURE_3D||gt===n.TEXTURE_2D_ARRAY?e.texImage3D(gt,at,Bt,Lt,ie,b.depth,0,Ht,bt,null):e.texImage2D(gt,at,Bt,Lt,ie,0,Ht,bt,null)}e.bindFramebuffer(n.FRAMEBUFFER,O),pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ot,gt,wt.__webglTexture,0,Tt(b)):(gt===n.TEXTURE_2D||gt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&gt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ot,gt,wt.__webglTexture,at),e.bindFramebuffer(n.FRAMEBUFFER,null)}function Zt(O,b,J){if(n.bindRenderbuffer(n.RENDERBUFFER,O),b.depthBuffer){const ot=b.depthTexture,gt=ot&&ot.isDepthTexture?ot.type:null,at=M(b.stencilBuffer,gt),Ht=b.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,bt=Tt(b);pt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,bt,at,b.width,b.height):J?n.renderbufferStorageMultisample(n.RENDERBUFFER,bt,at,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,at,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ht,n.RENDERBUFFER,O)}else{const ot=b.textures;for(let gt=0;gt<ot.length;gt++){const at=ot[gt],Ht=a.convert(at.format,at.colorSpace),bt=a.convert(at.type),Bt=C(at.internalFormat,Ht,bt,at.colorSpace),Vt=Tt(b);J&&pt(b)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Vt,Bt,b.width,b.height):pt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Vt,Bt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,Bt,b.width,b.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function jt(O,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(n.FRAMEBUFFER,O),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ot=s.get(b.depthTexture);ot.__renderTarget=b,(!ot.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),q(b.depthTexture,0);const gt=ot.__webglTexture,at=Tt(b);if(b.depthTexture.format===yr)pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0,at):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0);else if(b.depthTexture.format===Er)pt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0,at):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0);else throw new Error("Unknown depthTexture format")}function Re(O){const b=s.get(O),J=O.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==O.depthTexture){const ot=O.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),ot){const gt=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,ot.removeEventListener("dispose",gt)};ot.addEventListener("dispose",gt),b.__depthDisposeCallback=gt}b.__boundDepthTexture=ot}if(O.depthTexture&&!b.__autoAllocateDepthBuffer){if(J)throw new Error("target.depthTexture not supported in Cube render targets");const ot=O.texture.mipmaps;ot&&ot.length>0?jt(b.__webglFramebuffer[0],O):jt(b.__webglFramebuffer,O)}else if(J){b.__webglDepthbuffer=[];for(let ot=0;ot<6;ot++)if(e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[ot]),b.__webglDepthbuffer[ot]===void 0)b.__webglDepthbuffer[ot]=n.createRenderbuffer(),Zt(b.__webglDepthbuffer[ot],O,!1);else{const gt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,at=b.__webglDepthbuffer[ot];n.bindRenderbuffer(n.RENDERBUFFER,at),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,at)}}else{const ot=O.texture.mipmaps;if(ot&&ot.length>0?e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[0]):e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=n.createRenderbuffer(),Zt(b.__webglDepthbuffer,O,!1);else{const gt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,at=b.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,at),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,at)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function ft(O,b,J){const ot=s.get(O);b!==void 0&&Nt(ot.__webglFramebuffer,O,O.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),J!==void 0&&Re(O)}function T(O){const b=O.texture,J=s.get(O),ot=s.get(b);O.addEventListener("dispose",B);const gt=O.textures,at=O.isWebGLCubeRenderTarget===!0,Ht=gt.length>1;if(Ht||(ot.__webglTexture===void 0&&(ot.__webglTexture=n.createTexture()),ot.__version=b.version,l.memory.textures++),at){J.__webglFramebuffer=[];for(let bt=0;bt<6;bt++)if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer[bt]=[];for(let Bt=0;Bt<b.mipmaps.length;Bt++)J.__webglFramebuffer[bt][Bt]=n.createFramebuffer()}else J.__webglFramebuffer[bt]=n.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer=[];for(let bt=0;bt<b.mipmaps.length;bt++)J.__webglFramebuffer[bt]=n.createFramebuffer()}else J.__webglFramebuffer=n.createFramebuffer();if(Ht)for(let bt=0,Bt=gt.length;bt<Bt;bt++){const Vt=s.get(gt[bt]);Vt.__webglTexture===void 0&&(Vt.__webglTexture=n.createTexture(),l.memory.textures++)}if(O.samples>0&&pt(O)===!1){J.__webglMultisampledFramebuffer=n.createFramebuffer(),J.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,J.__webglMultisampledFramebuffer);for(let bt=0;bt<gt.length;bt++){const Bt=gt[bt];J.__webglColorRenderbuffer[bt]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,J.__webglColorRenderbuffer[bt]);const Vt=a.convert(Bt.format,Bt.colorSpace),wt=a.convert(Bt.type),Lt=C(Bt.internalFormat,Vt,wt,Bt.colorSpace,O.isXRRenderTarget===!0),ie=Tt(O);n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,Lt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+bt,n.RENDERBUFFER,J.__webglColorRenderbuffer[bt])}n.bindRenderbuffer(n.RENDERBUFFER,null),O.depthBuffer&&(J.__webglDepthRenderbuffer=n.createRenderbuffer(),Zt(J.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(at){e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture),Ot(n.TEXTURE_CUBE_MAP,b);for(let bt=0;bt<6;bt++)if(b.mipmaps&&b.mipmaps.length>0)for(let Bt=0;Bt<b.mipmaps.length;Bt++)Nt(J.__webglFramebuffer[bt][Bt],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+bt,Bt);else Nt(J.__webglFramebuffer[bt],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0);v(b)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Ht){for(let bt=0,Bt=gt.length;bt<Bt;bt++){const Vt=gt[bt],wt=s.get(Vt);let Lt=n.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Lt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(Lt,wt.__webglTexture),Ot(Lt,Vt),Nt(J.__webglFramebuffer,O,Vt,n.COLOR_ATTACHMENT0+bt,Lt,0),v(Vt)&&g(Lt)}e.unbindTexture()}else{let bt=n.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(bt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(bt,ot.__webglTexture),Ot(bt,b),b.mipmaps&&b.mipmaps.length>0)for(let Bt=0;Bt<b.mipmaps.length;Bt++)Nt(J.__webglFramebuffer[Bt],O,b,n.COLOR_ATTACHMENT0,bt,Bt);else Nt(J.__webglFramebuffer,O,b,n.COLOR_ATTACHMENT0,bt,0);v(b)&&g(bt),e.unbindTexture()}O.depthBuffer&&Re(O)}function Z(O){const b=O.textures;for(let J=0,ot=b.length;J<ot;J++){const gt=b[J];if(v(gt)){const at=I(O),Ht=s.get(gt).__webglTexture;e.bindTexture(at,Ht),g(at),e.unbindTexture()}}}const $=[],ht=[];function rt(O){if(O.samples>0){if(pt(O)===!1){const b=O.textures,J=O.width,ot=O.height;let gt=n.COLOR_BUFFER_BIT;const at=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ht=s.get(O),bt=b.length>1;if(bt)for(let Vt=0;Vt<b.length;Vt++)e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Ht.__webglMultisampledFramebuffer);const Bt=O.texture.mipmaps;Bt&&Bt.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglFramebuffer);for(let Vt=0;Vt<b.length;Vt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(gt|=n.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(gt|=n.STENCIL_BUFFER_BIT)),bt){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Ht.__webglColorRenderbuffer[Vt]);const wt=s.get(b[Vt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,wt,0)}n.blitFramebuffer(0,0,J,ot,0,0,J,ot,gt,n.NEAREST),u===!0&&($.length=0,ht.length=0,$.push(n.COLOR_ATTACHMENT0+Vt),O.depthBuffer&&O.resolveDepthBuffer===!1&&($.push(at),ht.push(at),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,ht)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,$))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),bt)for(let Vt=0;Vt<b.length;Vt++){e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.RENDERBUFFER,Ht.__webglColorRenderbuffer[Vt]);const wt=s.get(b[Vt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Ht.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Vt,n.TEXTURE_2D,wt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ht.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&u){const b=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[b])}}}function Tt(O){return Math.min(r.maxSamples,O.samples)}function pt(O){const b=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function At(O){const b=l.render.frame;p.get(O)!==b&&(p.set(O,b),O.update())}function ne(O,b){const J=O.colorSpace,ot=O.format,gt=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||J!==is&&J!==Li&&(Se.getTransfer(J)===Ie?(ot!==zn||gt!==hi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",J)),b}function de(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(d.width=O.naturalWidth||O.width,d.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(d.width=O.displayWidth,d.height=O.displayHeight):(d.width=O.width,d.height=O.height),d}this.allocateTextureUnit=F,this.resetTextureUnits=tt,this.setTexture2D=q,this.setTexture2DArray=j,this.setTexture3D=ct,this.setTextureCube=W,this.rebindTextures=ft,this.setupRenderTarget=T,this.updateRenderTargetMipmap=Z,this.updateMultisampleRenderTarget=rt,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=Nt,this.useMultisampledRTT=pt}function Zw(n,t){function e(s,r=Li){let a;const l=Se.getTransfer(r);if(s===hi)return n.UNSIGNED_BYTE;if(s===yl)return n.UNSIGNED_SHORT_4_4_4_4;if(s===El)return n.UNSIGNED_SHORT_5_5_5_1;if(s===ou)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===su)return n.BYTE;if(s===ru)return n.SHORT;if(s===gr)return n.UNSIGNED_SHORT;if(s===vl)return n.INT;if(s===ns)return n.UNSIGNED_INT;if(s===ui)return n.FLOAT;if(s===_r)return n.HALF_FLOAT;if(s===au)return n.ALPHA;if(s===lu)return n.RGB;if(s===zn)return n.RGBA;if(s===yr)return n.DEPTH_COMPONENT;if(s===Er)return n.DEPTH_STENCIL;if(s===cu)return n.RED;if(s===xl)return n.RED_INTEGER;if(s===hu)return n.RG;if(s===wl)return n.RG_INTEGER;if(s===Sl)return n.RGBA_INTEGER;if(s===Eo||s===xo||s===wo||s===So)if(l===Ie)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Eo)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Eo)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ml||s===Tl||s===bl||s===Al)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Ml)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Tl)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===bl)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Al)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Cl||s===Pl||s===Rl)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Cl||s===Pl)return l===Ie?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Rl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Ll||s===Il||s===Dl||s===kl||s===Ul||s===Ol||s===Nl||s===Bl||s===Fl||s===zl||s===Hl||s===Vl||s===Gl||s===Wl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Ll)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Il)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Dl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===kl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ul)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Ol)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Nl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Bl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Fl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===zl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Hl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Vl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Gl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Wl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Mo||s===Zl||s===Xl)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===Mo)return l===Ie?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Zl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Xl)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===uu||s===Yl||s===ql||s===Ql)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===Mo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Yl)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ql)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Ql)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===vr?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class bd extends Je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const Xw=`
3826
3826
  void main() {
3827
3827
 
3828
3828
  gl_Position = vec4( position, 1.0 );
@@ -3846,7 +3846,7 @@ void main() {
3846
3846
 
3847
3847
  }
3848
3848
 
3849
- }`;class qw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new bd(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,s=new vi({vertexShader:Xw,fragmentShader:Yw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new pn(new Ir(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Qw extends Cs{constructor(t,e){super();const s=this;let r=null,a=1,l=null,h="local-floor",u=1,d=null,p=null,m=null,_=null,E=null,S=null;const w=new qw,v={},g=e.getContextAttributes();let I=null,C=null;const M=[],k=[],N=new be;let B=null;const V=new In;V.viewport=new He;const D=new In;D.viewport=new He;const P=[V,D],O=new Q0;let et=null,z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(tt){let ut=M[tt];return ut===void 0&&(ut=new Ec,M[tt]=ut),ut.getTargetRaySpace()},this.getControllerGrip=function(tt){let ut=M[tt];return ut===void 0&&(ut=new Ec,M[tt]=ut),ut.getGripSpace()},this.getHand=function(tt){let ut=M[tt];return ut===void 0&&(ut=new Ec,M[tt]=ut),ut.getHandSpace()};function H(tt){const ut=k.indexOf(tt.inputSource);if(ut===-1)return;const _t=M[ut];_t!==void 0&&(_t.update(tt.inputSource,tt.frame,d||l),_t.dispatchEvent({type:tt.type,data:tt.inputSource}))}function q(){r.removeEventListener("select",H),r.removeEventListener("selectstart",H),r.removeEventListener("selectend",H),r.removeEventListener("squeeze",H),r.removeEventListener("squeezestart",H),r.removeEventListener("squeezeend",H),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",j);for(let tt=0;tt<M.length;tt++){const ut=k[tt];ut!==null&&(k[tt]=null,M[tt].disconnect(ut))}et=null,z=null,w.reset();for(const tt in v)delete v[tt];t.setRenderTarget(I),E=null,_=null,m=null,r=null,C=null,Qt.stop(),s.isPresenting=!1,t.setPixelRatio(B),t.setSize(N.width,N.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(tt){a=tt,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(tt){h=tt,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(tt){d=tt},this.getBaseLayer=function(){return _!==null?_:E},this.getBinding=function(){return m},this.getFrame=function(){return S},this.getSession=function(){return r},this.setSession=async function(tt){if(r=tt,r!==null){if(I=t.getRenderTarget(),r.addEventListener("select",H),r.addEventListener("selectstart",H),r.addEventListener("selectend",H),r.addEventListener("squeeze",H),r.addEventListener("squeezestart",H),r.addEventListener("squeezeend",H),r.addEventListener("end",q),r.addEventListener("inputsourceschange",j),g.xrCompatible!==!0&&await e.makeXRCompatible(),B=t.getPixelRatio(),t.getSize(N),typeof XRWebGLBinding<"u"&&(m=new XRWebGLBinding(r,e)),m!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let _t=null,Nt=null,Zt=null;g.depth&&(Zt=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,_t=g.stencil?Er:yr,Nt=g.stencil?vr:ns);const jt={colorFormat:e.RGBA8,depthFormat:Zt,scaleFactor:a};_=m.createProjectionLayer(jt),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),C=new Ii(_.textureWidth,_.textureHeight,{format:zn,type:hi,depthTexture:new Xu(_.textureWidth,_.textureHeight,Nt,void 0,void 0,void 0,void 0,void 0,void 0,_t),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const _t={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,_t),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),C=new Ii(E.framebufferWidth,E.framebufferHeight,{format:zn,type:hi,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:E.ignoreDepthValues===!1,resolveStencilBuffer:E.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(u),d=null,l=await r.requestReferenceSpace(h),Qt.setContext(r),Qt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return w.getDepthTexture()};function j(tt){for(let ut=0;ut<tt.removed.length;ut++){const _t=tt.removed[ut],Nt=k.indexOf(_t);Nt>=0&&(k[Nt]=null,M[Nt].disconnect(_t))}for(let ut=0;ut<tt.added.length;ut++){const _t=tt.added[ut];let Nt=k.indexOf(_t);if(Nt===-1){for(let jt=0;jt<M.length;jt++)if(jt>=k.length){k.push(_t),Nt=jt;break}else if(k[jt]===null){k[jt]=_t,Nt=jt;break}if(Nt===-1)break}const Zt=M[Nt];Zt&&Zt.connect(_t)}}const ct=new Q,W=new Q;function St(tt,ut,_t){ct.setFromMatrixPosition(ut.matrixWorld),W.setFromMatrixPosition(_t.matrixWorld);const Nt=ct.distanceTo(W),Zt=ut.projectionMatrix.elements,jt=_t.projectionMatrix.elements,Re=Zt[14]/(Zt[10]-1),dt=Zt[14]/(Zt[10]+1),T=(Zt[9]+1)/Zt[5],Z=(Zt[9]-1)/Zt[5],$=(Zt[8]-1)/Zt[0],ht=(jt[8]+1)/jt[0],lt=Re*$,Tt=Re*ht,pt=Nt/(-$+ht),bt=pt*-$;if(ut.matrixWorld.decompose(tt.position,tt.quaternion,tt.scale),tt.translateX(bt),tt.translateZ(pt),tt.matrixWorld.compose(tt.position,tt.quaternion,tt.scale),tt.matrixWorldInverse.copy(tt.matrixWorld).invert(),Zt[10]===-1)tt.projectionMatrix.copy(ut.projectionMatrix),tt.projectionMatrixInverse.copy(ut.projectionMatrixInverse);else{const re=Re+pt,de=dt+pt,U=lt-bt,b=Tt+(Nt-bt),J=T*dt/de*re,rt=Z*dt/de*re;tt.projectionMatrix.makePerspective(U,b,J,rt,re,de),tt.projectionMatrixInverse.copy(tt.projectionMatrix).invert()}}function at(tt,ut){ut===null?tt.matrixWorld.copy(tt.matrix):tt.matrixWorld.multiplyMatrices(ut.matrixWorld,tt.matrix),tt.matrixWorldInverse.copy(tt.matrixWorld).invert()}this.updateCamera=function(tt){if(r===null)return;let ut=tt.near,_t=tt.far;w.texture!==null&&(w.depthNear>0&&(ut=w.depthNear),w.depthFar>0&&(_t=w.depthFar)),O.near=D.near=V.near=ut,O.far=D.far=V.far=_t,(et!==O.near||z!==O.far)&&(r.updateRenderState({depthNear:O.near,depthFar:O.far}),et=O.near,z=O.far),O.layers.mask=tt.layers.mask|6,V.layers.mask=O.layers.mask&3,D.layers.mask=O.layers.mask&5;const Nt=tt.parent,Zt=O.cameras;at(O,Nt);for(let jt=0;jt<Zt.length;jt++)at(Zt[jt],Nt);Zt.length===2?St(O,V,D):O.projectionMatrix.copy(V.projectionMatrix),Mt(tt,O,Nt)};function Mt(tt,ut,_t){_t===null?tt.matrix.copy(ut.matrixWorld):(tt.matrix.copy(_t.matrixWorld),tt.matrix.invert(),tt.matrix.multiply(ut.matrixWorld)),tt.matrix.decompose(tt.position,tt.quaternion,tt.scale),tt.updateMatrixWorld(!0),tt.projectionMatrix.copy(ut.projectionMatrix),tt.projectionMatrixInverse.copy(ut.projectionMatrixInverse),tt.isPerspectiveCamera&&(tt.fov=wr*2*Math.atan(1/tt.projectionMatrix.elements[5]),tt.zoom=1)}this.getCamera=function(){return O},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(tt){u=tt,_!==null&&(_.fixedFoveation=tt),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=tt)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(O)},this.getCameraTexture=function(tt){return v[tt]};let Ot=null;function oe(tt,ut){if(p=ut.getViewerPose(d||l),S=ut,p!==null){const _t=p.views;E!==null&&(t.setRenderTargetFramebuffer(C,E.framebuffer),t.setRenderTarget(C));let Nt=!1;_t.length!==O.cameras.length&&(O.cameras.length=0,Nt=!0);for(let dt=0;dt<_t.length;dt++){const T=_t[dt];let Z=null;if(E!==null)Z=E.getViewport(T);else{const ht=m.getViewSubImage(_,T);Z=ht.viewport,dt===0&&(t.setRenderTargetTextures(C,ht.colorTexture,ht.depthStencilTexture),t.setRenderTarget(C))}let $=P[dt];$===void 0&&($=new In,$.layers.enable(dt),$.viewport=new He,P[dt]=$),$.matrix.fromArray(T.transform.matrix),$.matrix.decompose($.position,$.quaternion,$.scale),$.projectionMatrix.fromArray(T.projectionMatrix),$.projectionMatrixInverse.copy($.projectionMatrix).invert(),$.viewport.set(Z.x,Z.y,Z.width,Z.height),dt===0&&(O.matrix.copy($.matrix),O.matrix.decompose(O.position,O.quaternion,O.scale)),Nt===!0&&O.cameras.push($)}const Zt=r.enabledFeatures;if(Zt&&Zt.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const dt=m.getDepthInformation(_t[0]);dt&&dt.isValid&&dt.texture&&w.init(dt,r.renderState)}if(Zt&&Zt.includes("camera-access")&&(t.state.unbindTexture(),m))for(let dt=0;dt<_t.length;dt++){const T=_t[dt].camera;if(T){let Z=v[T];Z||(Z=new bd,v[T]=Z);const $=m.getCameraImage(T);Z.sourceTexture=$}}}for(let _t=0;_t<M.length;_t++){const Nt=k[_t],Zt=M[_t];Nt!==null&&Zt!==void 0&&Zt.update(Nt,ut,d||l)}Ot&&Ot(tt,ut),ut.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:ut}),S=null}const Qt=new Ju;Qt.setAnimationLoop(oe),this.setAnimationLoop=function(tt){Ot=tt},this.dispose=function(){}}}const fs=new Jn,jw=new Oe;function Jw(n,t){function e(v,g){v.matrixAutoUpdate===!0&&v.updateMatrix(),g.value.copy(v.matrix)}function s(v,g){g.color.getRGB(v.fogColor.value,Nu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,I,C,M){g.isMeshBasicMaterial||g.isMeshLambertMaterial?a(v,g):g.isMeshToonMaterial?(a(v,g),m(v,g)):g.isMeshPhongMaterial?(a(v,g),p(v,g)):g.isMeshStandardMaterial?(a(v,g),_(v,g),g.isMeshPhysicalMaterial&&E(v,g,M)):g.isMeshMatcapMaterial?(a(v,g),S(v,g)):g.isMeshDepthMaterial?a(v,g):g.isMeshDistanceMaterial?(a(v,g),w(v,g)):g.isMeshNormalMaterial?a(v,g):g.isLineBasicMaterial?(l(v,g),g.isLineDashedMaterial&&h(v,g)):g.isPointsMaterial?u(v,g,I,C):g.isSpriteMaterial?d(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function a(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,e(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,g.side===fn&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===fn&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,e(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,e(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const I=t.get(g),C=I.envMap,M=I.envMapRotation;C&&(v.envMap.value=C,fs.copy(M),fs.x*=-1,fs.y*=-1,fs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(fs.y*=-1,fs.z*=-1),v.envMapRotation.value.setFromMatrix4(jw.makeRotationFromEuler(fs)),v.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,v.lightMapTransform)),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,v.aoMapTransform))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform))}function h(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function u(v,g,I,C){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*I,v.scale.value=C*.5,g.map&&(v.map.value=g.map,e(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function d(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function p(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}function m(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}function _(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,v.roughnessMapTransform)),g.envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function E(v,g,I){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fn&&v.clearcoatNormalScale.value.negate())),g.dispersion>0&&(v.dispersion.value=g.dispersion),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=I.texture,v.transmissionSamplerSize.value.set(I.width,I.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,v.specularIntensityMapTransform))}function S(v,g){g.matcap&&(v.matcap.value=g.matcap)}function w(v,g){const I=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(I.matrixWorld),v.nearDistance.value=I.shadow.camera.near,v.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function Kw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(I,C){const M=C.program;s.uniformBlockBinding(I,M)}function d(I,C){let M=r[I.id];M===void 0&&(S(I),M=p(I),r[I.id]=M,I.addEventListener("dispose",v));const k=C.program;s.updateUBOMapping(I,k);const N=t.render.frame;a[I.id]!==N&&(_(I),a[I.id]=N)}function p(I){const C=m();I.__bindingPointIndex=C;const M=n.createBuffer(),k=I.__size,N=I.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,k,N),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,M),M}function m(){for(let I=0;I<h;I++)if(l.indexOf(I)===-1)return l.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(I){const C=r[I.id],M=I.uniforms,k=I.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let N=0,B=M.length;N<B;N++){const V=Array.isArray(M[N])?M[N]:[M[N]];for(let D=0,P=V.length;D<P;D++){const O=V[D];if(E(O,N,D,k)===!0){const et=O.__offset,z=Array.isArray(O.value)?O.value:[O.value];let H=0;for(let q=0;q<z.length;q++){const j=z[q],ct=w(j);typeof j=="number"||typeof j=="boolean"?(O.__data[0]=j,n.bufferSubData(n.UNIFORM_BUFFER,et+H,O.__data)):j.isMatrix3?(O.__data[0]=j.elements[0],O.__data[1]=j.elements[1],O.__data[2]=j.elements[2],O.__data[3]=0,O.__data[4]=j.elements[3],O.__data[5]=j.elements[4],O.__data[6]=j.elements[5],O.__data[7]=0,O.__data[8]=j.elements[6],O.__data[9]=j.elements[7],O.__data[10]=j.elements[8],O.__data[11]=0):(j.toArray(O.__data,H),H+=ct.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,et,O.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(I,C,M,k){const N=I.value,B=C+"_"+M;if(k[B]===void 0)return typeof N=="number"||typeof N=="boolean"?k[B]=N:k[B]=N.clone(),!0;{const V=k[B];if(typeof N=="number"||typeof N=="boolean"){if(V!==N)return k[B]=N,!0}else if(V.equals(N)===!1)return V.copy(N),!0}return!1}function S(I){const C=I.uniforms;let M=0;const k=16;for(let B=0,V=C.length;B<V;B++){const D=Array.isArray(C[B])?C[B]:[C[B]];for(let P=0,O=D.length;P<O;P++){const et=D[P],z=Array.isArray(et.value)?et.value:[et.value];for(let H=0,q=z.length;H<q;H++){const j=z[H],ct=w(j),W=M%k,St=W%ct.boundary,at=W+St;M+=St,at!==0&&k-at<ct.storage&&(M+=k-at),et.__data=new Float32Array(ct.storage/Float32Array.BYTES_PER_ELEMENT),et.__offset=M,M+=ct.storage}}}const N=M%k;return N>0&&(M+=k-N),I.__size=M,I.__cache={},this}function w(I){const C={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(C.boundary=4,C.storage=4):I.isVector2?(C.boundary=8,C.storage=8):I.isVector3||I.isColor?(C.boundary=16,C.storage=12):I.isVector4?(C.boundary=16,C.storage=16):I.isMatrix3?(C.boundary=48,C.storage=48):I.isMatrix4?(C.boundary=64,C.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),C}function v(I){const C=I.target;C.removeEventListener("dispose",v);const M=l.indexOf(C.__bindingPointIndex);l.splice(M,1),n.deleteBuffer(r[C.id]),delete r[C.id],delete a[C.id]}function g(){for(const I in r)n.deleteBuffer(r[I]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class $w{constructor(t={}){const{canvas:e=a0(),context:s=null,depth:r=!0,stencil:a=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:_=!1}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=l;const S=new Uint32Array(4),w=new Int32Array(4);let v=null,g=null;const I=[],C=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Pi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const M=this;let k=!1;this._outputColorSpace=Rn;let N=0,B=0,V=null,D=-1,P=null;const O=new He,et=new He;let z=null;const H=new Ce(0);let q=0,j=e.width,ct=e.height,W=1,St=null,at=null;const Mt=new He(0,0,j,ct),Ot=new He(0,0,j,ct);let oe=!1;const Qt=new Sc;let tt=!1,ut=!1;const _t=new Oe,Nt=new Q,Zt=new He,jt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Re=!1;function dt(){return V===null?W:1}let T=s;function Z(R,X){return e.getContext(R,X)}try{const R={alpha:!0,depth:r,stencil:a,antialias:h,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${il}`),e.addEventListener("webglcontextlost",Ct,!1),e.addEventListener("webglcontextrestored",Ut,!1),e.addEventListener("webglcontextcreationerror",vt,!1),T===null){const X="webgl2";if(T=Z(X,R),T===null)throw Z(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw console.error("THREE.WebGLRenderer: "+R.message),R}let $,ht,lt,Tt,pt,bt,re,de,U,b,J,rt,gt,ot,Ht,At,Bt,Vt,xt,Lt,ne,Gt,Pt,ce;function G(){$=new cx(T),$.init(),Gt=new Zw(T,$),ht=new nx(T,$,t,Gt),lt=new Gw(T,$),ht.reversedDepthBuffer&&_&&lt.buffers.depth.setReversed(!0),Tt=new dx(T),pt=new Rw,bt=new Ww(T,$,lt,pt,ht,Gt,Tt),re=new sx(M),de=new lx(M),U=new K0(T),Pt=new tx(T,U),b=new hx(T,U,Tt,Pt),J=new px(T,b,U,Tt),xt=new fx(T,ht,bt),At=new ix(pt),rt=new Pw(M,re,de,$,ht,Pt,At),gt=new Jw(M,pt),ot=new Iw,Ht=new Bw($),Vt=new $E(M,re,de,lt,J,E,u),Bt=new Hw(M,J,ht),ce=new Kw(T,Tt,ht,lt),Lt=new ex(T,$,Tt),ne=new ux(T,$,Tt),Tt.programs=rt.programs,M.capabilities=ht,M.extensions=$,M.properties=pt,M.renderLists=ot,M.shadowMap=Bt,M.state=lt,M.info=Tt}G();const wt=new Qw(M,T);this.xr=wt,this.getContext=function(){return T},this.getContextAttributes=function(){return T.getContextAttributes()},this.forceContextLoss=function(){const R=$.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=$.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(R){R!==void 0&&(W=R,this.setSize(j,ct,!1))},this.getSize=function(R){return R.set(j,ct)},this.setSize=function(R,X,it=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}j=R,ct=X,e.width=Math.floor(R*W),e.height=Math.floor(X*W),it===!0&&(e.style.width=R+"px",e.style.height=X+"px"),this.setViewport(0,0,R,X)},this.getDrawingBufferSize=function(R){return R.set(j*W,ct*W).floor()},this.setDrawingBufferSize=function(R,X,it){j=R,ct=X,W=it,e.width=Math.floor(R*it),e.height=Math.floor(X*it),this.setViewport(0,0,R,X)},this.getCurrentViewport=function(R){return R.copy(O)},this.getViewport=function(R){return R.copy(Mt)},this.setViewport=function(R,X,it,nt){R.isVector4?Mt.set(R.x,R.y,R.z,R.w):Mt.set(R,X,it,nt),lt.viewport(O.copy(Mt).multiplyScalar(W).round())},this.getScissor=function(R){return R.copy(Ot)},this.setScissor=function(R,X,it,nt){R.isVector4?Ot.set(R.x,R.y,R.z,R.w):Ot.set(R,X,it,nt),lt.scissor(et.copy(Ot).multiplyScalar(W).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(R){lt.setScissorTest(oe=R)},this.setOpaqueSort=function(R){St=R},this.setTransparentSort=function(R){at=R},this.getClearColor=function(R){return R.copy(Vt.getClearColor())},this.setClearColor=function(){Vt.setClearColor(...arguments)},this.getClearAlpha=function(){return Vt.getClearAlpha()},this.setClearAlpha=function(){Vt.setClearAlpha(...arguments)},this.clear=function(R=!0,X=!0,it=!0){let nt=0;if(R){let Y=!1;if(V!==null){const Et=V.texture.format;Y=Et===Sl||Et===wl||Et===xl}if(Y){const Et=V.texture.type,It=Et===hi||Et===ns||Et===gr||Et===vr||Et===yl||Et===El,Ft=Vt.getClearColor(),kt=Vt.getClearAlpha(),te=Ft.r,ee=Ft.g,qt=Ft.b;It?(S[0]=te,S[1]=ee,S[2]=qt,S[3]=kt,T.clearBufferuiv(T.COLOR,0,S)):(w[0]=te,w[1]=ee,w[2]=qt,w[3]=kt,T.clearBufferiv(T.COLOR,0,w))}else nt|=T.COLOR_BUFFER_BIT}X&&(nt|=T.DEPTH_BUFFER_BIT),it&&(nt|=T.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),T.clear(nt)},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",Ct,!1),e.removeEventListener("webglcontextrestored",Ut,!1),e.removeEventListener("webglcontextcreationerror",vt,!1),Vt.dispose(),ot.dispose(),Ht.dispose(),pt.dispose(),re.dispose(),de.dispose(),J.dispose(),Pt.dispose(),ce.dispose(),rt.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",On),wt.removeEventListener("sessionend",Ba),wi.stop()};function Ct(R){R.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),k=!0}function Ut(){console.log("THREE.WebGLRenderer: Context Restored."),k=!1;const R=Tt.autoReset,X=Bt.enabled,it=Bt.autoUpdate,nt=Bt.needsUpdate,Y=Bt.type;G(),Tt.autoReset=R,Bt.enabled=X,Bt.autoUpdate=it,Bt.needsUpdate=nt,Bt.type=Y}function vt(R){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",R.statusMessage)}function ft(R){const X=R.target;X.removeEventListener("dispose",ft),zt(X)}function zt(R){le(R),pt.remove(R)}function le(R){const X=pt.get(R).programs;X!==void 0&&(X.forEach(function(it){rt.releaseProgram(it)}),R.isShaderMaterial&&rt.releaseShaderCache(R))}this.renderBufferDirect=function(R,X,it,nt,Y,Et){X===null&&(X=jt);const It=Y.isMesh&&Y.matrixWorld.determinant()<0,Ft=Fa(R,X,it,nt,Y);lt.setMaterial(nt,It);let kt=it.index,te=1;if(nt.wireframe===!0){if(kt=b.getWireframeAttribute(it),kt===void 0)return;te=2}const ee=it.drawRange,qt=it.attributes.position;let pe=ee.start*te,Ee=(ee.start+ee.count)*te;Et!==null&&(pe=Math.max(pe,Et.start*te),Ee=Math.min(Ee,(Et.start+Et.count)*te)),kt!==null?(pe=Math.max(pe,0),Ee=Math.min(Ee,kt.count)):qt!=null&&(pe=Math.max(pe,0),Ee=Math.min(Ee,qt.count));const Jt=Ee-pe;if(Jt<0||Jt===1/0)return;Pt.setup(Y,nt,Ft,it,kt);let ie,Te=Lt;if(kt!==null&&(ie=U.get(kt),Te=ne,Te.setIndex(ie)),Y.isMesh)nt.wireframe===!0?(lt.setLineWidth(nt.wireframeLinewidth*dt()),Te.setMode(T.LINES)):Te.setMode(T.TRIANGLES);else if(Y.isLine){let Xt=nt.linewidth;Xt===void 0&&(Xt=1),lt.setLineWidth(Xt*dt()),Y.isLineSegments?Te.setMode(T.LINES):Y.isLineLoop?Te.setMode(T.LINE_LOOP):Te.setMode(T.LINE_STRIP)}else Y.isPoints?Te.setMode(T.POINTS):Y.isSprite&&Te.setMode(T.TRIANGLES);if(Y.isBatchedMesh)if(Y._multiDrawInstances!==null)Ls("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Te.renderMultiDrawInstances(Y._multiDrawStarts,Y._multiDrawCounts,Y._multiDrawCount,Y._multiDrawInstances);else if($.get("WEBGL_multi_draw"))Te.renderMultiDraw(Y._multiDrawStarts,Y._multiDrawCounts,Y._multiDrawCount);else{const Xt=Y._multiDrawStarts,Le=Y._multiDrawCounts,_e=Y._multiDrawCount,$t=kt?U.get(kt).bytesPerElement:1,ke=pt.get(nt).currentProgram.getUniforms();for(let tn=0;tn<_e;tn++)ke.setValue(T,"_gl_DrawID",tn),Te.render(Xt[tn]/$t,Le[tn])}else if(Y.isInstancedMesh)Te.renderInstances(pe,Jt,Y.count);else if(it.isInstancedBufferGeometry){const Xt=it._maxInstanceCount!==void 0?it._maxInstanceCount:1/0,Le=Math.min(it.instanceCount,Xt);Te.renderInstances(pe,Jt,Le)}else Te.render(pe,Jt)};function De(R,X,it){R.transparent===!0&&R.side===ci&&R.forceSinglePass===!1?(R.side=fn,R.needsUpdate=!0,vs(R,X,it),R.side=Ai,R.needsUpdate=!0,vs(R,X,it),R.side=ci):vs(R,X,it)}this.compile=function(R,X,it=null){it===null&&(it=R),g=Ht.get(it),g.init(X),C.push(g),it.traverseVisible(function(Y){Y.isLight&&Y.layers.test(X.layers)&&(g.pushLight(Y),Y.castShadow&&g.pushShadow(Y))}),R!==it&&R.traverseVisible(function(Y){Y.isLight&&Y.layers.test(X.layers)&&(g.pushLight(Y),Y.castShadow&&g.pushShadow(Y))}),g.setupLights();const nt=new Set;return R.traverse(function(Y){if(!(Y.isMesh||Y.isPoints||Y.isLine||Y.isSprite))return;const Et=Y.material;if(Et)if(Array.isArray(Et))for(let It=0;It<Et.length;It++){const Ft=Et[It];De(Ft,it,Y),nt.add(Ft)}else De(Et,it,Y),nt.add(Et)}),g=C.pop(),nt},this.compileAsync=function(R,X,it=null){const nt=this.compile(R,X,it);return new Promise(Y=>{function Et(){if(nt.forEach(function(It){pt.get(It).currentProgram.isReady()&&nt.delete(It)}),nt.size===0){Y(R);return}setTimeout(Et,10)}$.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let Me=null;function bn(R){Me&&Me(R)}function On(){wi.stop()}function Ba(){wi.start()}const wi=new Ju;wi.setAnimationLoop(bn),typeof self<"u"&&wi.setContext(self),this.setAnimationLoop=function(R){Me=R,wt.setAnimationLoop(R),R===null?wi.stop():wi.start()},wt.addEventListener("sessionstart",On),wt.addEventListener("sessionend",Ba),this.render=function(R,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(k===!0)return;if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(X),X=wt.getCamera()),R.isScene===!0&&R.onBeforeRender(M,R,X,V),g=Ht.get(R,C.length),g.init(X),C.push(g),_t.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Qt.setFromProjectionMatrix(_t,jn,X.reversedDepth),ut=this.localClippingEnabled,tt=At.init(this.clippingPlanes,ut),v=ot.get(R,I.length),v.init(),I.push(v),wt.enabled===!0&&wt.isPresenting===!0){const Et=M.xr.getDepthSensingMesh();Et!==null&&io(Et,X,-1/0,M.sortObjects)}io(R,X,0,M.sortObjects),v.finish(),M.sortObjects===!0&&v.sort(St,at),Re=wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1,Re&&Vt.addToRenderList(v,R),this.info.render.frame++,tt===!0&&At.beginShadows();const it=g.state.shadowsArray;Bt.render(it,R,X),tt===!0&&At.endShadows(),this.info.autoReset===!0&&this.info.reset();const nt=v.opaque,Y=v.transmissive;if(g.setupLights(),X.isArrayCamera){const Et=X.cameras;if(Y.length>0)for(let It=0,Ft=Et.length;It<Ft;It++){const kt=Et[It];Wt(nt,Y,R,kt)}Re&&Vt.render(R);for(let It=0,Ft=Et.length;It<Ft;It++){const kt=Et[It];An(v,R,kt,kt.viewport)}}else Y.length>0&&Wt(nt,Y,R,X),Re&&Vt.render(R),An(v,R,X);V!==null&&B===0&&(bt.updateMultisampleRenderTarget(V),bt.updateRenderTargetMipmap(V)),R.isScene===!0&&R.onAfterRender(M,R,X),Pt.resetDefaultState(),D=-1,P=null,C.pop(),C.length>0?(g=C[C.length-1],tt===!0&&At.setGlobalState(M.clippingPlanes,g.state.camera)):g=null,I.pop(),I.length>0?v=I[I.length-1]:v=null};function io(R,X,it,nt){if(R.visible===!1)return;if(R.layers.test(X.layers)){if(R.isGroup)it=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(X);else if(R.isLight)g.pushLight(R),R.castShadow&&g.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||Qt.intersectsSprite(R)){nt&&Zt.setFromMatrixPosition(R.matrixWorld).applyMatrix4(_t);const It=J.update(R),Ft=R.material;Ft.visible&&v.push(R,It,Ft,it,Zt.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||Qt.intersectsObject(R))){const It=J.update(R),Ft=R.material;if(nt&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),Zt.copy(R.boundingSphere.center)):(It.boundingSphere===null&&It.computeBoundingSphere(),Zt.copy(It.boundingSphere.center)),Zt.applyMatrix4(R.matrixWorld).applyMatrix4(_t)),Array.isArray(Ft)){const kt=It.groups;for(let te=0,ee=kt.length;te<ee;te++){const qt=kt[te],pe=Ft[qt.materialIndex];pe&&pe.visible&&v.push(R,It,pe,it,Zt.z,qt)}}else Ft.visible&&v.push(R,It,Ft,it,Zt.z,null)}}const Et=R.children;for(let It=0,Ft=Et.length;It<Ft;It++)io(Et[It],X,it,nt)}function An(R,X,it,nt){const Y=R.opaque,Et=R.transmissive,It=R.transparent;g.setupLightsView(it),tt===!0&&At.setGlobalState(M.clippingPlanes,it),nt&&lt.viewport(O.copy(nt)),Y.length>0&&_s(Y,X,it),Et.length>0&&_s(Et,X,it),It.length>0&&_s(It,X,it),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1)}function Wt(R,X,it,nt){if((it.isScene===!0?it.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[nt.id]===void 0&&(g.state.transmissionRenderTarget[nt.id]=new Ii(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?_r:hi,minFilter:Ri,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Se.workingColorSpace}));const Et=g.state.transmissionRenderTarget[nt.id],It=nt.viewport||O;Et.setSize(It.z*M.transmissionResolutionScale,It.w*M.transmissionResolutionScale);const Ft=M.getRenderTarget(),kt=M.getActiveCubeFace(),te=M.getActiveMipmapLevel();M.setRenderTarget(Et),M.getClearColor(H),q=M.getClearAlpha(),q<1&&M.setClearColor(16777215,.5),M.clear(),Re&&Vt.render(it);const ee=M.toneMapping;M.toneMapping=Pi;const qt=nt.viewport;if(nt.viewport!==void 0&&(nt.viewport=void 0),g.setupLightsView(nt),tt===!0&&At.setGlobalState(M.clippingPlanes,nt),_s(R,it,nt),bt.updateMultisampleRenderTarget(Et),bt.updateRenderTargetMipmap(Et),$.has("WEBGL_multisampled_render_to_texture")===!1){let pe=!1;for(let Ee=0,Jt=X.length;Ee<Jt;Ee++){const ie=X[Ee],Te=ie.object,Xt=ie.geometry,Le=ie.material,_e=ie.group;if(Le.side===ci&&Te.layers.test(nt.layers)){const $t=Le.side;Le.side=fn,Le.needsUpdate=!0,so(Te,it,nt,Xt,Le,_e),Le.side=$t,Le.needsUpdate=!0,pe=!0}}pe===!0&&(bt.updateMultisampleRenderTarget(Et),bt.updateRenderTargetMipmap(Et))}M.setRenderTarget(Ft,kt,te),M.setClearColor(H,q),qt!==void 0&&(nt.viewport=qt),M.toneMapping=ee}function _s(R,X,it){const nt=X.isScene===!0?X.overrideMaterial:null;for(let Y=0,Et=R.length;Y<Et;Y++){const It=R[Y],Ft=It.object,kt=It.geometry,te=It.group;let ee=It.material;ee.allowOverride===!0&&nt!==null&&(ee=nt),Ft.layers.test(it.layers)&&so(Ft,X,it,kt,ee,te)}}function so(R,X,it,nt,Y,Et){R.onBeforeRender(M,X,it,nt,Y,Et),R.modelViewMatrix.multiplyMatrices(it.matrixWorldInverse,R.matrixWorld),R.normalMatrix.getNormalMatrix(R.modelViewMatrix),Y.onBeforeRender(M,X,it,nt,R,Et),Y.transparent===!0&&Y.side===ci&&Y.forceSinglePass===!1?(Y.side=fn,Y.needsUpdate=!0,M.renderBufferDirect(it,X,nt,Y,R,Et),Y.side=Ai,Y.needsUpdate=!0,M.renderBufferDirect(it,X,nt,Y,R,Et),Y.side=ci):M.renderBufferDirect(it,X,nt,Y,R,Et),R.onAfterRender(M,X,it,nt,Y,Et)}function vs(R,X,it){X.isScene!==!0&&(X=jt);const nt=pt.get(R),Y=g.state.lights,Et=g.state.shadowsArray,It=Y.state.version,Ft=rt.getParameters(R,Y.state,Et,X,it),kt=rt.getProgramCacheKey(Ft);let te=nt.programs;nt.environment=R.isMeshStandardMaterial?X.environment:null,nt.fog=X.fog,nt.envMap=(R.isMeshStandardMaterial?de:re).get(R.envMap||nt.environment),nt.envMapRotation=nt.environment!==null&&R.envMap===null?X.environmentRotation:R.envMapRotation,te===void 0&&(R.addEventListener("dispose",ft),te=new Map,nt.programs=te);let ee=te.get(kt);if(ee!==void 0){if(nt.currentProgram===ee&&nt.lightsStateVersion===It)return lr(R,Ft),ee}else Ft.uniforms=rt.getUniforms(R),R.onBeforeCompile(Ft,M),ee=rt.acquireProgram(Ft,kt),te.set(kt,ee),nt.uniforms=Ft.uniforms;const qt=nt.uniforms;return(!R.isShaderMaterial&&!R.isRawShaderMaterial||R.clipping===!0)&&(qt.clippingPlanes=At.uniform),lr(R,Ft),nt.needsLights=za(R),nt.lightsStateVersion=It,nt.needsLights&&(qt.ambientLightColor.value=Y.state.ambient,qt.lightProbe.value=Y.state.probe,qt.directionalLights.value=Y.state.directional,qt.directionalLightShadows.value=Y.state.directionalShadow,qt.spotLights.value=Y.state.spot,qt.spotLightShadows.value=Y.state.spotShadow,qt.rectAreaLights.value=Y.state.rectArea,qt.ltc_1.value=Y.state.rectAreaLTC1,qt.ltc_2.value=Y.state.rectAreaLTC2,qt.pointLights.value=Y.state.point,qt.pointLightShadows.value=Y.state.pointShadow,qt.hemisphereLights.value=Y.state.hemi,qt.directionalShadowMap.value=Y.state.directionalShadowMap,qt.directionalShadowMatrix.value=Y.state.directionalShadowMatrix,qt.spotShadowMap.value=Y.state.spotShadowMap,qt.spotLightMatrix.value=Y.state.spotLightMatrix,qt.spotLightMap.value=Y.state.spotLightMap,qt.pointShadowMap.value=Y.state.pointShadowMap,qt.pointShadowMatrix.value=Y.state.pointShadowMatrix),nt.currentProgram=ee,nt.uniformsList=null,ee}function ro(R){if(R.uniformsList===null){const X=R.currentProgram.getUniforms();R.uniformsList=Ko.seqWithValue(X.seq,R.uniforms)}return R.uniformsList}function lr(R,X){const it=pt.get(R);it.outputColorSpace=X.outputColorSpace,it.batching=X.batching,it.batchingColor=X.batchingColor,it.instancing=X.instancing,it.instancingColor=X.instancingColor,it.instancingMorph=X.instancingMorph,it.skinning=X.skinning,it.morphTargets=X.morphTargets,it.morphNormals=X.morphNormals,it.morphColors=X.morphColors,it.morphTargetsCount=X.morphTargetsCount,it.numClippingPlanes=X.numClippingPlanes,it.numIntersection=X.numClipIntersection,it.vertexAlphas=X.vertexAlphas,it.vertexTangents=X.vertexTangents,it.toneMapping=X.toneMapping}function Fa(R,X,it,nt,Y){X.isScene!==!0&&(X=jt),bt.resetTextureUnits();const Et=X.fog,It=nt.isMeshStandardMaterial?X.environment:null,Ft=V===null?M.outputColorSpace:V.isXRRenderTarget===!0?V.texture.colorSpace:is,kt=(nt.isMeshStandardMaterial?de:re).get(nt.envMap||It),te=nt.vertexColors===!0&&!!it.attributes.color&&it.attributes.color.itemSize===4,ee=!!it.attributes.tangent&&(!!nt.normalMap||nt.anisotropy>0),qt=!!it.morphAttributes.position,pe=!!it.morphAttributes.normal,Ee=!!it.morphAttributes.color;let Jt=Pi;nt.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(Jt=M.toneMapping);const ie=it.morphAttributes.position||it.morphAttributes.normal||it.morphAttributes.color,Te=ie!==void 0?ie.length:0,Xt=pt.get(nt),Le=g.state.lights;if(tt===!0&&(ut===!0||R!==P)){const Fe=R===P&&nt.id===D;At.setState(nt,R,Fe)}let _e=!1;nt.version===Xt.__version?(Xt.needsLights&&Xt.lightsStateVersion!==Le.state.version||Xt.outputColorSpace!==Ft||Y.isBatchedMesh&&Xt.batching===!1||!Y.isBatchedMesh&&Xt.batching===!0||Y.isBatchedMesh&&Xt.batchingColor===!0&&Y.colorTexture===null||Y.isBatchedMesh&&Xt.batchingColor===!1&&Y.colorTexture!==null||Y.isInstancedMesh&&Xt.instancing===!1||!Y.isInstancedMesh&&Xt.instancing===!0||Y.isSkinnedMesh&&Xt.skinning===!1||!Y.isSkinnedMesh&&Xt.skinning===!0||Y.isInstancedMesh&&Xt.instancingColor===!0&&Y.instanceColor===null||Y.isInstancedMesh&&Xt.instancingColor===!1&&Y.instanceColor!==null||Y.isInstancedMesh&&Xt.instancingMorph===!0&&Y.morphTexture===null||Y.isInstancedMesh&&Xt.instancingMorph===!1&&Y.morphTexture!==null||Xt.envMap!==kt||nt.fog===!0&&Xt.fog!==Et||Xt.numClippingPlanes!==void 0&&(Xt.numClippingPlanes!==At.numPlanes||Xt.numIntersection!==At.numIntersection)||Xt.vertexAlphas!==te||Xt.vertexTangents!==ee||Xt.morphTargets!==qt||Xt.morphNormals!==pe||Xt.morphColors!==Ee||Xt.toneMapping!==Jt||Xt.morphTargetsCount!==Te)&&(_e=!0):(_e=!0,Xt.__version=nt.version);let $t=Xt.currentProgram;_e===!0&&($t=vs(nt,X,Y));let ke=!1,tn=!1,si=!1;const ve=$t.getUniforms(),_n=Xt.uniforms;if(lt.useProgram($t.program)&&(ke=!0,tn=!0,si=!0),nt.id!==D&&(D=nt.id,tn=!0),ke||P!==R){lt.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),ve.setValue(T,"projectionMatrix",R.projectionMatrix),ve.setValue(T,"viewMatrix",R.matrixWorldInverse);const ye=ve.map.cameraPosition;ye!==void 0&&ye.setValue(T,Nt.setFromMatrixPosition(R.matrixWorld)),ht.logarithmicDepthBuffer&&ve.setValue(T,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(nt.isMeshPhongMaterial||nt.isMeshToonMaterial||nt.isMeshLambertMaterial||nt.isMeshBasicMaterial||nt.isMeshStandardMaterial||nt.isShaderMaterial)&&ve.setValue(T,"isOrthographic",R.isOrthographicCamera===!0),P!==R&&(P=R,tn=!0,si=!0)}if(Y.isSkinnedMesh){ve.setOptional(T,Y,"bindMatrix"),ve.setOptional(T,Y,"bindMatrixInverse");const Fe=Y.skeleton;Fe&&(Fe.boneTexture===null&&Fe.computeBoneTexture(),ve.setValue(T,"boneTexture",Fe.boneTexture,bt))}Y.isBatchedMesh&&(ve.setOptional(T,Y,"batchingTexture"),ve.setValue(T,"batchingTexture",Y._matricesTexture,bt),ve.setOptional(T,Y,"batchingIdTexture"),ve.setValue(T,"batchingIdTexture",Y._indirectTexture,bt),ve.setOptional(T,Y,"batchingColorTexture"),Y._colorsTexture!==null&&ve.setValue(T,"batchingColorTexture",Y._colorsTexture,bt));const en=it.morphAttributes;if((en.position!==void 0||en.normal!==void 0||en.color!==void 0)&&xt.update(Y,it,$t),(tn||Xt.receiveShadow!==Y.receiveShadow)&&(Xt.receiveShadow=Y.receiveShadow,ve.setValue(T,"receiveShadow",Y.receiveShadow)),nt.isMeshGouraudMaterial&&nt.envMap!==null&&(_n.envMap.value=kt,_n.flipEnvMap.value=kt.isCubeTexture&&kt.isRenderTargetTexture===!1?-1:1),nt.isMeshStandardMaterial&&nt.envMap===null&&X.environment!==null&&(_n.envMapIntensity.value=X.environmentIntensity),tn&&(ve.setValue(T,"toneMappingExposure",M.toneMappingExposure),Xt.needsLights&&Ji(_n,si),Et&&nt.fog===!0&&gt.refreshFogUniforms(_n,Et),gt.refreshMaterialUniforms(_n,nt,W,ct,g.state.transmissionRenderTarget[R.id]),Ko.upload(T,ro(Xt),_n,bt)),nt.isShaderMaterial&&nt.uniformsNeedUpdate===!0&&(Ko.upload(T,ro(Xt),_n,bt),nt.uniformsNeedUpdate=!1),nt.isSpriteMaterial&&ve.setValue(T,"center",Y.center),ve.setValue(T,"modelViewMatrix",Y.modelViewMatrix),ve.setValue(T,"normalMatrix",Y.normalMatrix),ve.setValue(T,"modelMatrix",Y.matrixWorld),nt.isShaderMaterial||nt.isRawShaderMaterial){const Fe=nt.uniformsGroups;for(let ye=0,Yn=Fe.length;ye<Yn;ye++){const Cn=Fe[ye];ce.update(Cn,$t),ce.bind(Cn,$t)}}return $t}function Ji(R,X){R.ambientLightColor.needsUpdate=X,R.lightProbe.needsUpdate=X,R.directionalLights.needsUpdate=X,R.directionalLightShadows.needsUpdate=X,R.pointLights.needsUpdate=X,R.pointLightShadows.needsUpdate=X,R.spotLights.needsUpdate=X,R.spotLightShadows.needsUpdate=X,R.rectAreaLights.needsUpdate=X,R.hemisphereLights.needsUpdate=X}function za(R){return R.isMeshLambertMaterial||R.isMeshToonMaterial||R.isMeshPhongMaterial||R.isMeshStandardMaterial||R.isShadowMaterial||R.isShaderMaterial&&R.lights===!0}this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return V},this.setRenderTargetTextures=function(R,X,it){const nt=pt.get(R);nt.__autoAllocateDepthBuffer=R.resolveDepthBuffer===!1,nt.__autoAllocateDepthBuffer===!1&&(nt.__useRenderToTexture=!1),pt.get(R.texture).__webglTexture=X,pt.get(R.depthTexture).__webglTexture=nt.__autoAllocateDepthBuffer?void 0:it,nt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(R,X){const it=pt.get(R);it.__webglFramebuffer=X,it.__useDefaultFramebuffer=X===void 0};const ph=T.createFramebuffer();this.setRenderTarget=function(R,X=0,it=0){V=R,N=X,B=it;let nt=!0,Y=null,Et=!1,It=!1;if(R){const kt=pt.get(R);if(kt.__useDefaultFramebuffer!==void 0)lt.bindFramebuffer(T.FRAMEBUFFER,null),nt=!1;else if(kt.__webglFramebuffer===void 0)bt.setupRenderTarget(R);else if(kt.__hasExternalTextures)bt.rebindTextures(R,pt.get(R.texture).__webglTexture,pt.get(R.depthTexture).__webglTexture);else if(R.depthBuffer){const qt=R.depthTexture;if(kt.__boundDepthTexture!==qt){if(qt!==null&&pt.has(qt)&&(R.width!==qt.image.width||R.height!==qt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");bt.setupDepthRenderbuffer(R)}}const te=R.texture;(te.isData3DTexture||te.isDataArrayTexture||te.isCompressedArrayTexture)&&(It=!0);const ee=pt.get(R).__webglFramebuffer;R.isWebGLCubeRenderTarget?(Array.isArray(ee[X])?Y=ee[X][it]:Y=ee[X],Et=!0):R.samples>0&&bt.useMultisampledRTT(R)===!1?Y=pt.get(R).__webglMultisampledFramebuffer:Array.isArray(ee)?Y=ee[it]:Y=ee,O.copy(R.viewport),et.copy(R.scissor),z=R.scissorTest}else O.copy(Mt).multiplyScalar(W).floor(),et.copy(Ot).multiplyScalar(W).floor(),z=oe;if(it!==0&&(Y=ph),lt.bindFramebuffer(T.FRAMEBUFFER,Y)&&nt&&lt.drawBuffers(R,Y),lt.viewport(O),lt.scissor(et),lt.setScissorTest(z),Et){const kt=pt.get(R.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+X,kt.__webglTexture,it)}else if(It){const kt=X;for(let te=0;te<R.textures.length;te++){const ee=pt.get(R.textures[te]);T.framebufferTextureLayer(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0+te,ee.__webglTexture,it,kt)}}else if(R!==null&&it!==0){const kt=pt.get(R.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,kt.__webglTexture,it)}D=-1},this.readRenderTargetPixels=function(R,X,it,nt,Y,Et,It,Ft=0){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let kt=pt.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&It!==void 0&&(kt=kt[It]),kt){lt.bindFramebuffer(T.FRAMEBUFFER,kt);try{const te=R.textures[Ft],ee=te.format,qt=te.type;if(!ht.textureFormatReadable(ee)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ht.textureTypeReadable(qt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=R.width-nt&&it>=0&&it<=R.height-Y&&(R.textures.length>1&&T.readBuffer(T.COLOR_ATTACHMENT0+Ft),T.readPixels(X,it,nt,Y,Gt.convert(ee),Gt.convert(qt),Et))}finally{const te=V!==null?pt.get(V).__webglFramebuffer:null;lt.bindFramebuffer(T.FRAMEBUFFER,te)}}},this.readRenderTargetPixelsAsync=async function(R,X,it,nt,Y,Et,It,Ft=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let kt=pt.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&It!==void 0&&(kt=kt[It]),kt)if(X>=0&&X<=R.width-nt&&it>=0&&it<=R.height-Y){lt.bindFramebuffer(T.FRAMEBUFFER,kt);const te=R.textures[Ft],ee=te.format,qt=te.type;if(!ht.textureFormatReadable(ee))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ht.textureTypeReadable(qt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const pe=T.createBuffer();T.bindBuffer(T.PIXEL_PACK_BUFFER,pe),T.bufferData(T.PIXEL_PACK_BUFFER,Et.byteLength,T.STREAM_READ),R.textures.length>1&&T.readBuffer(T.COLOR_ATTACHMENT0+Ft),T.readPixels(X,it,nt,Y,Gt.convert(ee),Gt.convert(qt),0);const Ee=V!==null?pt.get(V).__webglFramebuffer:null;lt.bindFramebuffer(T.FRAMEBUFFER,Ee);const Jt=T.fenceSync(T.SYNC_GPU_COMMANDS_COMPLETE,0);return T.flush(),await l0(T,Jt,4),T.bindBuffer(T.PIXEL_PACK_BUFFER,pe),T.getBufferSubData(T.PIXEL_PACK_BUFFER,0,Et),T.deleteBuffer(pe),T.deleteSync(Jt),Et}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,X=null,it=0){const nt=Math.pow(2,-it),Y=Math.floor(R.image.width*nt),Et=Math.floor(R.image.height*nt),It=X!==null?X.x:0,Ft=X!==null?X.y:0;bt.setTexture2D(R,0),T.copyTexSubImage2D(T.TEXTURE_2D,it,0,0,It,Ft,Y,Et),lt.unbindTexture()};const mh=T.createFramebuffer(),gh=T.createFramebuffer();this.copyTextureToTexture=function(R,X,it=null,nt=null,Y=0,Et=null){Et===null&&(Y!==0?(Ls("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Et=Y,Y=0):Et=0);let It,Ft,kt,te,ee,qt,pe,Ee,Jt;const ie=R.isCompressedTexture?R.mipmaps[Et]:R.image;if(it!==null)It=it.max.x-it.min.x,Ft=it.max.y-it.min.y,kt=it.isBox3?it.max.z-it.min.z:1,te=it.min.x,ee=it.min.y,qt=it.isBox3?it.min.z:0;else{const en=Math.pow(2,-Y);It=Math.floor(ie.width*en),Ft=Math.floor(ie.height*en),R.isDataArrayTexture?kt=ie.depth:R.isData3DTexture?kt=Math.floor(ie.depth*en):kt=1,te=0,ee=0,qt=0}nt!==null?(pe=nt.x,Ee=nt.y,Jt=nt.z):(pe=0,Ee=0,Jt=0);const Te=Gt.convert(X.format),Xt=Gt.convert(X.type);let Le;X.isData3DTexture?(bt.setTexture3D(X,0),Le=T.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(bt.setTexture2DArray(X,0),Le=T.TEXTURE_2D_ARRAY):(bt.setTexture2D(X,0),Le=T.TEXTURE_2D),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,X.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,X.unpackAlignment);const _e=T.getParameter(T.UNPACK_ROW_LENGTH),$t=T.getParameter(T.UNPACK_IMAGE_HEIGHT),ke=T.getParameter(T.UNPACK_SKIP_PIXELS),tn=T.getParameter(T.UNPACK_SKIP_ROWS),si=T.getParameter(T.UNPACK_SKIP_IMAGES);T.pixelStorei(T.UNPACK_ROW_LENGTH,ie.width),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,ie.height),T.pixelStorei(T.UNPACK_SKIP_PIXELS,te),T.pixelStorei(T.UNPACK_SKIP_ROWS,ee),T.pixelStorei(T.UNPACK_SKIP_IMAGES,qt);const ve=R.isDataArrayTexture||R.isData3DTexture,_n=X.isDataArrayTexture||X.isData3DTexture;if(R.isDepthTexture){const en=pt.get(R),Fe=pt.get(X),ye=pt.get(en.__renderTarget),Yn=pt.get(Fe.__renderTarget);lt.bindFramebuffer(T.READ_FRAMEBUFFER,ye.__webglFramebuffer),lt.bindFramebuffer(T.DRAW_FRAMEBUFFER,Yn.__webglFramebuffer);for(let Cn=0;Cn<kt;Cn++)ve&&(T.framebufferTextureLayer(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,pt.get(R).__webglTexture,Y,qt+Cn),T.framebufferTextureLayer(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,pt.get(X).__webglTexture,Et,Jt+Cn)),T.blitFramebuffer(te,ee,It,Ft,pe,Ee,It,Ft,T.DEPTH_BUFFER_BIT,T.NEAREST);lt.bindFramebuffer(T.READ_FRAMEBUFFER,null),lt.bindFramebuffer(T.DRAW_FRAMEBUFFER,null)}else if(Y!==0||R.isRenderTargetTexture||pt.has(R)){const en=pt.get(R),Fe=pt.get(X);lt.bindFramebuffer(T.READ_FRAMEBUFFER,mh),lt.bindFramebuffer(T.DRAW_FRAMEBUFFER,gh);for(let ye=0;ye<kt;ye++)ve?T.framebufferTextureLayer(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,en.__webglTexture,Y,qt+ye):T.framebufferTexture2D(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,en.__webglTexture,Y),_n?T.framebufferTextureLayer(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,Fe.__webglTexture,Et,Jt+ye):T.framebufferTexture2D(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,Fe.__webglTexture,Et),Y!==0?T.blitFramebuffer(te,ee,It,Ft,pe,Ee,It,Ft,T.COLOR_BUFFER_BIT,T.NEAREST):_n?T.copyTexSubImage3D(Le,Et,pe,Ee,Jt+ye,te,ee,It,Ft):T.copyTexSubImage2D(Le,Et,pe,Ee,te,ee,It,Ft);lt.bindFramebuffer(T.READ_FRAMEBUFFER,null),lt.bindFramebuffer(T.DRAW_FRAMEBUFFER,null)}else _n?R.isDataTexture||R.isData3DTexture?T.texSubImage3D(Le,Et,pe,Ee,Jt,It,Ft,kt,Te,Xt,ie.data):X.isCompressedArrayTexture?T.compressedTexSubImage3D(Le,Et,pe,Ee,Jt,It,Ft,kt,Te,ie.data):T.texSubImage3D(Le,Et,pe,Ee,Jt,It,Ft,kt,Te,Xt,ie):R.isDataTexture?T.texSubImage2D(T.TEXTURE_2D,Et,pe,Ee,It,Ft,Te,Xt,ie.data):R.isCompressedTexture?T.compressedTexSubImage2D(T.TEXTURE_2D,Et,pe,Ee,ie.width,ie.height,Te,ie.data):T.texSubImage2D(T.TEXTURE_2D,Et,pe,Ee,It,Ft,Te,Xt,ie);T.pixelStorei(T.UNPACK_ROW_LENGTH,_e),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,$t),T.pixelStorei(T.UNPACK_SKIP_PIXELS,ke),T.pixelStorei(T.UNPACK_SKIP_ROWS,tn),T.pixelStorei(T.UNPACK_SKIP_IMAGES,si),Et===0&&X.generateMipmaps&&T.generateMipmap(Le),lt.unbindTexture()},this.copyTextureToTexture3D=function(R,X,it=null,nt=null,Y=0){return Ls('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(R,X,it,nt,Y)},this.initRenderTarget=function(R){pt.get(R).__webglFramebuffer===void 0&&bt.setupRenderTarget(R)},this.initTexture=function(R){R.isCubeTexture?bt.setTextureCube(R,0):R.isData3DTexture?bt.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?bt.setTexture2DArray(R,0):bt.setTexture2D(R,0),lt.unbindTexture()},this.resetState=function(){N=0,B=0,V=null,lt.reset(),Pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return jn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Se._getDrawingBufferColorSpace(t),e.unpackColorSpace=Se._getUnpackColorSpace()}}/*!
3849
+ }`;class qw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new bd(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,s=new vi({vertexShader:Xw,fragmentShader:Yw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new pn(new Ir(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Qw extends Cs{constructor(t,e){super();const s=this;let r=null,a=1,l=null,h="local-floor",u=1,d=null,p=null,m=null,_=null,E=null,S=null;const w=new qw,v={},g=e.getContextAttributes();let I=null,C=null;const M=[],k=[],N=new be;let B=null;const V=new In;V.viewport=new He;const R=new In;R.viewport=new He;const D=[V,R],U=new Q0;let tt=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(et){let ut=M[et];return ut===void 0&&(ut=new Ec,M[et]=ut),ut.getTargetRaySpace()},this.getControllerGrip=function(et){let ut=M[et];return ut===void 0&&(ut=new Ec,M[et]=ut),ut.getGripSpace()},this.getHand=function(et){let ut=M[et];return ut===void 0&&(ut=new Ec,M[et]=ut),ut.getHandSpace()};function H(et){const ut=k.indexOf(et.inputSource);if(ut===-1)return;const _t=M[ut];_t!==void 0&&(_t.update(et.inputSource,et.frame,d||l),_t.dispatchEvent({type:et.type,data:et.inputSource}))}function q(){r.removeEventListener("select",H),r.removeEventListener("selectstart",H),r.removeEventListener("selectend",H),r.removeEventListener("squeeze",H),r.removeEventListener("squeezestart",H),r.removeEventListener("squeezeend",H),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",j);for(let et=0;et<M.length;et++){const ut=k[et];ut!==null&&(k[et]=null,M[et].disconnect(ut))}tt=null,F=null,w.reset();for(const et in v)delete v[et];t.setRenderTarget(I),E=null,_=null,m=null,r=null,C=null,Qt.stop(),s.isPresenting=!1,t.setPixelRatio(B),t.setSize(N.width,N.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(et){a=et,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(et){h=et,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(et){d=et},this.getBaseLayer=function(){return _!==null?_:E},this.getBinding=function(){return m},this.getFrame=function(){return S},this.getSession=function(){return r},this.setSession=async function(et){if(r=et,r!==null){if(I=t.getRenderTarget(),r.addEventListener("select",H),r.addEventListener("selectstart",H),r.addEventListener("selectend",H),r.addEventListener("squeeze",H),r.addEventListener("squeezestart",H),r.addEventListener("squeezeend",H),r.addEventListener("end",q),r.addEventListener("inputsourceschange",j),g.xrCompatible!==!0&&await e.makeXRCompatible(),B=t.getPixelRatio(),t.getSize(N),typeof XRWebGLBinding<"u"&&(m=new XRWebGLBinding(r,e)),m!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let _t=null,Nt=null,Zt=null;g.depth&&(Zt=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,_t=g.stencil?Er:yr,Nt=g.stencil?vr:ns);const jt={colorFormat:e.RGBA8,depthFormat:Zt,scaleFactor:a};_=m.createProjectionLayer(jt),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),C=new Ii(_.textureWidth,_.textureHeight,{format:zn,type:hi,depthTexture:new Xu(_.textureWidth,_.textureHeight,Nt,void 0,void 0,void 0,void 0,void 0,void 0,_t),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const _t={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,_t),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),C=new Ii(E.framebufferWidth,E.framebufferHeight,{format:zn,type:hi,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:E.ignoreDepthValues===!1,resolveStencilBuffer:E.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(u),d=null,l=await r.requestReferenceSpace(h),Qt.setContext(r),Qt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return w.getDepthTexture()};function j(et){for(let ut=0;ut<et.removed.length;ut++){const _t=et.removed[ut],Nt=k.indexOf(_t);Nt>=0&&(k[Nt]=null,M[Nt].disconnect(_t))}for(let ut=0;ut<et.added.length;ut++){const _t=et.added[ut];let Nt=k.indexOf(_t);if(Nt===-1){for(let jt=0;jt<M.length;jt++)if(jt>=k.length){k.push(_t),Nt=jt;break}else if(k[jt]===null){k[jt]=_t,Nt=jt;break}if(Nt===-1)break}const Zt=M[Nt];Zt&&Zt.connect(_t)}}const ct=new Q,W=new Q;function Et(et,ut,_t){ct.setFromMatrixPosition(ut.matrixWorld),W.setFromMatrixPosition(_t.matrixWorld);const Nt=ct.distanceTo(W),Zt=ut.projectionMatrix.elements,jt=_t.projectionMatrix.elements,Re=Zt[14]/(Zt[10]-1),ft=Zt[14]/(Zt[10]+1),T=(Zt[9]+1)/Zt[5],Z=(Zt[9]-1)/Zt[5],$=(Zt[8]-1)/Zt[0],ht=(jt[8]+1)/jt[0],rt=Re*$,Tt=Re*ht,pt=Nt/(-$+ht),At=pt*-$;if(ut.matrixWorld.decompose(et.position,et.quaternion,et.scale),et.translateX(At),et.translateZ(pt),et.matrixWorld.compose(et.position,et.quaternion,et.scale),et.matrixWorldInverse.copy(et.matrixWorld).invert(),Zt[10]===-1)et.projectionMatrix.copy(ut.projectionMatrix),et.projectionMatrixInverse.copy(ut.projectionMatrixInverse);else{const ne=Re+pt,de=ft+pt,O=rt-At,b=Tt+(Nt-At),J=T*ft/de*ne,ot=Z*ft/de*ne;et.projectionMatrix.makePerspective(O,b,J,ot,ne,de),et.projectionMatrixInverse.copy(et.projectionMatrix).invert()}}function lt(et,ut){ut===null?et.matrixWorld.copy(et.matrix):et.matrixWorld.multiplyMatrices(ut.matrixWorld,et.matrix),et.matrixWorldInverse.copy(et.matrixWorld).invert()}this.updateCamera=function(et){if(r===null)return;let ut=et.near,_t=et.far;w.texture!==null&&(w.depthNear>0&&(ut=w.depthNear),w.depthFar>0&&(_t=w.depthFar)),U.near=R.near=V.near=ut,U.far=R.far=V.far=_t,(tt!==U.near||F!==U.far)&&(r.updateRenderState({depthNear:U.near,depthFar:U.far}),tt=U.near,F=U.far),U.layers.mask=et.layers.mask|6,V.layers.mask=U.layers.mask&3,R.layers.mask=U.layers.mask&5;const Nt=et.parent,Zt=U.cameras;lt(U,Nt);for(let jt=0;jt<Zt.length;jt++)lt(Zt[jt],Nt);Zt.length===2?Et(U,V,R):U.projectionMatrix.copy(V.projectionMatrix),Mt(et,U,Nt)};function Mt(et,ut,_t){_t===null?et.matrix.copy(ut.matrixWorld):(et.matrix.copy(_t.matrixWorld),et.matrix.invert(),et.matrix.multiply(ut.matrixWorld)),et.matrix.decompose(et.position,et.quaternion,et.scale),et.updateMatrixWorld(!0),et.projectionMatrix.copy(ut.projectionMatrix),et.projectionMatrixInverse.copy(ut.projectionMatrixInverse),et.isPerspectiveCamera&&(et.fov=wr*2*Math.atan(1/et.projectionMatrix.elements[5]),et.zoom=1)}this.getCamera=function(){return U},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(et){u=et,_!==null&&(_.fixedFoveation=et),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=et)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(U)},this.getCameraTexture=function(et){return v[et]};let Ot=null;function oe(et,ut){if(p=ut.getViewerPose(d||l),S=ut,p!==null){const _t=p.views;E!==null&&(t.setRenderTargetFramebuffer(C,E.framebuffer),t.setRenderTarget(C));let Nt=!1;_t.length!==U.cameras.length&&(U.cameras.length=0,Nt=!0);for(let ft=0;ft<_t.length;ft++){const T=_t[ft];let Z=null;if(E!==null)Z=E.getViewport(T);else{const ht=m.getViewSubImage(_,T);Z=ht.viewport,ft===0&&(t.setRenderTargetTextures(C,ht.colorTexture,ht.depthStencilTexture),t.setRenderTarget(C))}let $=D[ft];$===void 0&&($=new In,$.layers.enable(ft),$.viewport=new He,D[ft]=$),$.matrix.fromArray(T.transform.matrix),$.matrix.decompose($.position,$.quaternion,$.scale),$.projectionMatrix.fromArray(T.projectionMatrix),$.projectionMatrixInverse.copy($.projectionMatrix).invert(),$.viewport.set(Z.x,Z.y,Z.width,Z.height),ft===0&&(U.matrix.copy($.matrix),U.matrix.decompose(U.position,U.quaternion,U.scale)),Nt===!0&&U.cameras.push($)}const Zt=r.enabledFeatures;if(Zt&&Zt.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const ft=m.getDepthInformation(_t[0]);ft&&ft.isValid&&ft.texture&&w.init(ft,r.renderState)}if(Zt&&Zt.includes("camera-access")&&(t.state.unbindTexture(),m))for(let ft=0;ft<_t.length;ft++){const T=_t[ft].camera;if(T){let Z=v[T];Z||(Z=new bd,v[T]=Z);const $=m.getCameraImage(T);Z.sourceTexture=$}}}for(let _t=0;_t<M.length;_t++){const Nt=k[_t],Zt=M[_t];Nt!==null&&Zt!==void 0&&Zt.update(Nt,ut,d||l)}Ot&&Ot(et,ut),ut.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:ut}),S=null}const Qt=new Ju;Qt.setAnimationLoop(oe),this.setAnimationLoop=function(et){Ot=et},this.dispose=function(){}}}const fs=new Jn,jw=new Oe;function Jw(n,t){function e(v,g){v.matrixAutoUpdate===!0&&v.updateMatrix(),g.value.copy(v.matrix)}function s(v,g){g.color.getRGB(v.fogColor.value,Nu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,I,C,M){g.isMeshBasicMaterial||g.isMeshLambertMaterial?a(v,g):g.isMeshToonMaterial?(a(v,g),m(v,g)):g.isMeshPhongMaterial?(a(v,g),p(v,g)):g.isMeshStandardMaterial?(a(v,g),_(v,g),g.isMeshPhysicalMaterial&&E(v,g,M)):g.isMeshMatcapMaterial?(a(v,g),S(v,g)):g.isMeshDepthMaterial?a(v,g):g.isMeshDistanceMaterial?(a(v,g),w(v,g)):g.isMeshNormalMaterial?a(v,g):g.isLineBasicMaterial?(l(v,g),g.isLineDashedMaterial&&h(v,g)):g.isPointsMaterial?u(v,g,I,C):g.isSpriteMaterial?d(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function a(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,e(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,g.side===fn&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===fn&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,e(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,e(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const I=t.get(g),C=I.envMap,M=I.envMapRotation;C&&(v.envMap.value=C,fs.copy(M),fs.x*=-1,fs.y*=-1,fs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(fs.y*=-1,fs.z*=-1),v.envMapRotation.value.setFromMatrix4(jw.makeRotationFromEuler(fs)),v.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,v.lightMapTransform)),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,v.aoMapTransform))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform))}function h(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function u(v,g,I,C){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*I,v.scale.value=C*.5,g.map&&(v.map.value=g.map,e(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function d(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function p(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}function m(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}function _(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,v.roughnessMapTransform)),g.envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function E(v,g,I){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fn&&v.clearcoatNormalScale.value.negate())),g.dispersion>0&&(v.dispersion.value=g.dispersion),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=I.texture,v.transmissionSamplerSize.value.set(I.width,I.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,v.specularIntensityMapTransform))}function S(v,g){g.matcap&&(v.matcap.value=g.matcap)}function w(v,g){const I=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(I.matrixWorld),v.nearDistance.value=I.shadow.camera.near,v.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function Kw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(I,C){const M=C.program;s.uniformBlockBinding(I,M)}function d(I,C){let M=r[I.id];M===void 0&&(S(I),M=p(I),r[I.id]=M,I.addEventListener("dispose",v));const k=C.program;s.updateUBOMapping(I,k);const N=t.render.frame;a[I.id]!==N&&(_(I),a[I.id]=N)}function p(I){const C=m();I.__bindingPointIndex=C;const M=n.createBuffer(),k=I.__size,N=I.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,k,N),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,M),M}function m(){for(let I=0;I<h;I++)if(l.indexOf(I)===-1)return l.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(I){const C=r[I.id],M=I.uniforms,k=I.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let N=0,B=M.length;N<B;N++){const V=Array.isArray(M[N])?M[N]:[M[N]];for(let R=0,D=V.length;R<D;R++){const U=V[R];if(E(U,N,R,k)===!0){const tt=U.__offset,F=Array.isArray(U.value)?U.value:[U.value];let H=0;for(let q=0;q<F.length;q++){const j=F[q],ct=w(j);typeof j=="number"||typeof j=="boolean"?(U.__data[0]=j,n.bufferSubData(n.UNIFORM_BUFFER,tt+H,U.__data)):j.isMatrix3?(U.__data[0]=j.elements[0],U.__data[1]=j.elements[1],U.__data[2]=j.elements[2],U.__data[3]=0,U.__data[4]=j.elements[3],U.__data[5]=j.elements[4],U.__data[6]=j.elements[5],U.__data[7]=0,U.__data[8]=j.elements[6],U.__data[9]=j.elements[7],U.__data[10]=j.elements[8],U.__data[11]=0):(j.toArray(U.__data,H),H+=ct.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,tt,U.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(I,C,M,k){const N=I.value,B=C+"_"+M;if(k[B]===void 0)return typeof N=="number"||typeof N=="boolean"?k[B]=N:k[B]=N.clone(),!0;{const V=k[B];if(typeof N=="number"||typeof N=="boolean"){if(V!==N)return k[B]=N,!0}else if(V.equals(N)===!1)return V.copy(N),!0}return!1}function S(I){const C=I.uniforms;let M=0;const k=16;for(let B=0,V=C.length;B<V;B++){const R=Array.isArray(C[B])?C[B]:[C[B]];for(let D=0,U=R.length;D<U;D++){const tt=R[D],F=Array.isArray(tt.value)?tt.value:[tt.value];for(let H=0,q=F.length;H<q;H++){const j=F[H],ct=w(j),W=M%k,Et=W%ct.boundary,lt=W+Et;M+=Et,lt!==0&&k-lt<ct.storage&&(M+=k-lt),tt.__data=new Float32Array(ct.storage/Float32Array.BYTES_PER_ELEMENT),tt.__offset=M,M+=ct.storage}}}const N=M%k;return N>0&&(M+=k-N),I.__size=M,I.__cache={},this}function w(I){const C={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(C.boundary=4,C.storage=4):I.isVector2?(C.boundary=8,C.storage=8):I.isVector3||I.isColor?(C.boundary=16,C.storage=12):I.isVector4?(C.boundary=16,C.storage=16):I.isMatrix3?(C.boundary=48,C.storage=48):I.isMatrix4?(C.boundary=64,C.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),C}function v(I){const C=I.target;C.removeEventListener("dispose",v);const M=l.indexOf(C.__bindingPointIndex);l.splice(M,1),n.deleteBuffer(r[C.id]),delete r[C.id],delete a[C.id]}function g(){for(const I in r)n.deleteBuffer(r[I]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class $w{constructor(t={}){const{canvas:e=a0(),context:s=null,depth:r=!0,stencil:a=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:_=!1}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=l;const S=new Uint32Array(4),w=new Int32Array(4);let v=null,g=null;const I=[],C=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Pi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const M=this;let k=!1;this._outputColorSpace=Rn;let N=0,B=0,V=null,R=-1,D=null;const U=new He,tt=new He;let F=null;const H=new Ce(0);let q=0,j=e.width,ct=e.height,W=1,Et=null,lt=null;const Mt=new He(0,0,j,ct),Ot=new He(0,0,j,ct);let oe=!1;const Qt=new Sc;let et=!1,ut=!1;const _t=new Oe,Nt=new Q,Zt=new He,jt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Re=!1;function ft(){return V===null?W:1}let T=s;function Z(P,X){return e.getContext(P,X)}try{const P={alpha:!0,depth:r,stencil:a,antialias:h,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${il}`),e.addEventListener("webglcontextlost",Ct,!1),e.addEventListener("webglcontextrestored",Ut,!1),e.addEventListener("webglcontextcreationerror",vt,!1),T===null){const X="webgl2";if(T=Z(X,P),T===null)throw Z(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(P){throw console.error("THREE.WebGLRenderer: "+P.message),P}let $,ht,rt,Tt,pt,At,ne,de,O,b,J,ot,gt,at,Ht,bt,Bt,Vt,wt,Lt,ie,Gt,Pt,ce;function G(){$=new cx(T),$.init(),Gt=new Zw(T,$),ht=new nx(T,$,t,Gt),rt=new Gw(T,$),ht.reversedDepthBuffer&&_&&rt.buffers.depth.setReversed(!0),Tt=new dx(T),pt=new Rw,At=new Ww(T,$,rt,pt,ht,Gt,Tt),ne=new sx(M),de=new lx(M),O=new K0(T),Pt=new tx(T,O),b=new hx(T,O,Tt,Pt),J=new px(T,b,O,Tt),wt=new fx(T,ht,At),bt=new ix(pt),ot=new Pw(M,ne,de,$,ht,Pt,bt),gt=new Jw(M,pt),at=new Iw,Ht=new Bw($),Vt=new $E(M,ne,de,rt,J,E,u),Bt=new Hw(M,J,ht),ce=new Kw(T,Tt,ht,rt),Lt=new ex(T,$,Tt),ie=new ux(T,$,Tt),Tt.programs=ot.programs,M.capabilities=ht,M.extensions=$,M.properties=pt,M.renderLists=at,M.shadowMap=Bt,M.state=rt,M.info=Tt}G();const St=new Qw(M,T);this.xr=St,this.getContext=function(){return T},this.getContextAttributes=function(){return T.getContextAttributes()},this.forceContextLoss=function(){const P=$.get("WEBGL_lose_context");P&&P.loseContext()},this.forceContextRestore=function(){const P=$.get("WEBGL_lose_context");P&&P.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(P){P!==void 0&&(W=P,this.setSize(j,ct,!1))},this.getSize=function(P){return P.set(j,ct)},this.setSize=function(P,X,it=!0){if(St.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}j=P,ct=X,e.width=Math.floor(P*W),e.height=Math.floor(X*W),it===!0&&(e.style.width=P+"px",e.style.height=X+"px"),this.setViewport(0,0,P,X)},this.getDrawingBufferSize=function(P){return P.set(j*W,ct*W).floor()},this.setDrawingBufferSize=function(P,X,it){j=P,ct=X,W=it,e.width=Math.floor(P*it),e.height=Math.floor(X*it),this.setViewport(0,0,P,X)},this.getCurrentViewport=function(P){return P.copy(U)},this.getViewport=function(P){return P.copy(Mt)},this.setViewport=function(P,X,it,nt){P.isVector4?Mt.set(P.x,P.y,P.z,P.w):Mt.set(P,X,it,nt),rt.viewport(U.copy(Mt).multiplyScalar(W).round())},this.getScissor=function(P){return P.copy(Ot)},this.setScissor=function(P,X,it,nt){P.isVector4?Ot.set(P.x,P.y,P.z,P.w):Ot.set(P,X,it,nt),rt.scissor(tt.copy(Ot).multiplyScalar(W).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(P){rt.setScissorTest(oe=P)},this.setOpaqueSort=function(P){Et=P},this.setTransparentSort=function(P){lt=P},this.getClearColor=function(P){return P.copy(Vt.getClearColor())},this.setClearColor=function(){Vt.setClearColor(...arguments)},this.getClearAlpha=function(){return Vt.getClearAlpha()},this.setClearAlpha=function(){Vt.setClearAlpha(...arguments)},this.clear=function(P=!0,X=!0,it=!0){let nt=0;if(P){let Y=!1;if(V!==null){const xt=V.texture.format;Y=xt===Sl||xt===wl||xt===xl}if(Y){const xt=V.texture.type,It=xt===hi||xt===ns||xt===gr||xt===vr||xt===yl||xt===El,Ft=Vt.getClearColor(),kt=Vt.getClearAlpha(),te=Ft.r,ee=Ft.g,qt=Ft.b;It?(S[0]=te,S[1]=ee,S[2]=qt,S[3]=kt,T.clearBufferuiv(T.COLOR,0,S)):(w[0]=te,w[1]=ee,w[2]=qt,w[3]=kt,T.clearBufferiv(T.COLOR,0,w))}else nt|=T.COLOR_BUFFER_BIT}X&&(nt|=T.DEPTH_BUFFER_BIT),it&&(nt|=T.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),T.clear(nt)},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",Ct,!1),e.removeEventListener("webglcontextrestored",Ut,!1),e.removeEventListener("webglcontextcreationerror",vt,!1),Vt.dispose(),at.dispose(),Ht.dispose(),pt.dispose(),ne.dispose(),de.dispose(),J.dispose(),Pt.dispose(),ce.dispose(),ot.dispose(),St.dispose(),St.removeEventListener("sessionstart",On),St.removeEventListener("sessionend",Ba),wi.stop()};function Ct(P){P.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),k=!0}function Ut(){console.log("THREE.WebGLRenderer: Context Restored."),k=!1;const P=Tt.autoReset,X=Bt.enabled,it=Bt.autoUpdate,nt=Bt.needsUpdate,Y=Bt.type;G(),Tt.autoReset=P,Bt.enabled=X,Bt.autoUpdate=it,Bt.needsUpdate=nt,Bt.type=Y}function vt(P){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",P.statusMessage)}function dt(P){const X=P.target;X.removeEventListener("dispose",dt),zt(X)}function zt(P){le(P),pt.remove(P)}function le(P){const X=pt.get(P).programs;X!==void 0&&(X.forEach(function(it){ot.releaseProgram(it)}),P.isShaderMaterial&&ot.releaseShaderCache(P))}this.renderBufferDirect=function(P,X,it,nt,Y,xt){X===null&&(X=jt);const It=Y.isMesh&&Y.matrixWorld.determinant()<0,Ft=Fa(P,X,it,nt,Y);rt.setMaterial(nt,It);let kt=it.index,te=1;if(nt.wireframe===!0){if(kt=b.getWireframeAttribute(it),kt===void 0)return;te=2}const ee=it.drawRange,qt=it.attributes.position;let pe=ee.start*te,Ee=(ee.start+ee.count)*te;xt!==null&&(pe=Math.max(pe,xt.start*te),Ee=Math.min(Ee,(xt.start+xt.count)*te)),kt!==null?(pe=Math.max(pe,0),Ee=Math.min(Ee,kt.count)):qt!=null&&(pe=Math.max(pe,0),Ee=Math.min(Ee,qt.count));const Jt=Ee-pe;if(Jt<0||Jt===1/0)return;Pt.setup(Y,nt,Ft,it,kt);let se,Te=Lt;if(kt!==null&&(se=O.get(kt),Te=ie,Te.setIndex(se)),Y.isMesh)nt.wireframe===!0?(rt.setLineWidth(nt.wireframeLinewidth*ft()),Te.setMode(T.LINES)):Te.setMode(T.TRIANGLES);else if(Y.isLine){let Xt=nt.linewidth;Xt===void 0&&(Xt=1),rt.setLineWidth(Xt*ft()),Y.isLineSegments?Te.setMode(T.LINES):Y.isLineLoop?Te.setMode(T.LINE_LOOP):Te.setMode(T.LINE_STRIP)}else Y.isPoints?Te.setMode(T.POINTS):Y.isSprite&&Te.setMode(T.TRIANGLES);if(Y.isBatchedMesh)if(Y._multiDrawInstances!==null)Ls("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Te.renderMultiDrawInstances(Y._multiDrawStarts,Y._multiDrawCounts,Y._multiDrawCount,Y._multiDrawInstances);else if($.get("WEBGL_multi_draw"))Te.renderMultiDraw(Y._multiDrawStarts,Y._multiDrawCounts,Y._multiDrawCount);else{const Xt=Y._multiDrawStarts,Le=Y._multiDrawCounts,_e=Y._multiDrawCount,$t=kt?O.get(kt).bytesPerElement:1,ke=pt.get(nt).currentProgram.getUniforms();for(let tn=0;tn<_e;tn++)ke.setValue(T,"_gl_DrawID",tn),Te.render(Xt[tn]/$t,Le[tn])}else if(Y.isInstancedMesh)Te.renderInstances(pe,Jt,Y.count);else if(it.isInstancedBufferGeometry){const Xt=it._maxInstanceCount!==void 0?it._maxInstanceCount:1/0,Le=Math.min(it.instanceCount,Xt);Te.renderInstances(pe,Jt,Le)}else Te.render(pe,Jt)};function De(P,X,it){P.transparent===!0&&P.side===ci&&P.forceSinglePass===!1?(P.side=fn,P.needsUpdate=!0,vs(P,X,it),P.side=Ai,P.needsUpdate=!0,vs(P,X,it),P.side=ci):vs(P,X,it)}this.compile=function(P,X,it=null){it===null&&(it=P),g=Ht.get(it),g.init(X),C.push(g),it.traverseVisible(function(Y){Y.isLight&&Y.layers.test(X.layers)&&(g.pushLight(Y),Y.castShadow&&g.pushShadow(Y))}),P!==it&&P.traverseVisible(function(Y){Y.isLight&&Y.layers.test(X.layers)&&(g.pushLight(Y),Y.castShadow&&g.pushShadow(Y))}),g.setupLights();const nt=new Set;return P.traverse(function(Y){if(!(Y.isMesh||Y.isPoints||Y.isLine||Y.isSprite))return;const xt=Y.material;if(xt)if(Array.isArray(xt))for(let It=0;It<xt.length;It++){const Ft=xt[It];De(Ft,it,Y),nt.add(Ft)}else De(xt,it,Y),nt.add(xt)}),g=C.pop(),nt},this.compileAsync=function(P,X,it=null){const nt=this.compile(P,X,it);return new Promise(Y=>{function xt(){if(nt.forEach(function(It){pt.get(It).currentProgram.isReady()&&nt.delete(It)}),nt.size===0){Y(P);return}setTimeout(xt,10)}$.get("KHR_parallel_shader_compile")!==null?xt():setTimeout(xt,10)})};let Me=null;function bn(P){Me&&Me(P)}function On(){wi.stop()}function Ba(){wi.start()}const wi=new Ju;wi.setAnimationLoop(bn),typeof self<"u"&&wi.setContext(self),this.setAnimationLoop=function(P){Me=P,St.setAnimationLoop(P),P===null?wi.stop():wi.start()},St.addEventListener("sessionstart",On),St.addEventListener("sessionend",Ba),this.render=function(P,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(k===!0)return;if(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),St.enabled===!0&&St.isPresenting===!0&&(St.cameraAutoUpdate===!0&&St.updateCamera(X),X=St.getCamera()),P.isScene===!0&&P.onBeforeRender(M,P,X,V),g=Ht.get(P,C.length),g.init(X),C.push(g),_t.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Qt.setFromProjectionMatrix(_t,jn,X.reversedDepth),ut=this.localClippingEnabled,et=bt.init(this.clippingPlanes,ut),v=at.get(P,I.length),v.init(),I.push(v),St.enabled===!0&&St.isPresenting===!0){const xt=M.xr.getDepthSensingMesh();xt!==null&&io(xt,X,-1/0,M.sortObjects)}io(P,X,0,M.sortObjects),v.finish(),M.sortObjects===!0&&v.sort(Et,lt),Re=St.enabled===!1||St.isPresenting===!1||St.hasDepthSensing()===!1,Re&&Vt.addToRenderList(v,P),this.info.render.frame++,et===!0&&bt.beginShadows();const it=g.state.shadowsArray;Bt.render(it,P,X),et===!0&&bt.endShadows(),this.info.autoReset===!0&&this.info.reset();const nt=v.opaque,Y=v.transmissive;if(g.setupLights(),X.isArrayCamera){const xt=X.cameras;if(Y.length>0)for(let It=0,Ft=xt.length;It<Ft;It++){const kt=xt[It];Wt(nt,Y,P,kt)}Re&&Vt.render(P);for(let It=0,Ft=xt.length;It<Ft;It++){const kt=xt[It];An(v,P,kt,kt.viewport)}}else Y.length>0&&Wt(nt,Y,P,X),Re&&Vt.render(P),An(v,P,X);V!==null&&B===0&&(At.updateMultisampleRenderTarget(V),At.updateRenderTargetMipmap(V)),P.isScene===!0&&P.onAfterRender(M,P,X),Pt.resetDefaultState(),R=-1,D=null,C.pop(),C.length>0?(g=C[C.length-1],et===!0&&bt.setGlobalState(M.clippingPlanes,g.state.camera)):g=null,I.pop(),I.length>0?v=I[I.length-1]:v=null};function io(P,X,it,nt){if(P.visible===!1)return;if(P.layers.test(X.layers)){if(P.isGroup)it=P.renderOrder;else if(P.isLOD)P.autoUpdate===!0&&P.update(X);else if(P.isLight)g.pushLight(P),P.castShadow&&g.pushShadow(P);else if(P.isSprite){if(!P.frustumCulled||Qt.intersectsSprite(P)){nt&&Zt.setFromMatrixPosition(P.matrixWorld).applyMatrix4(_t);const It=J.update(P),Ft=P.material;Ft.visible&&v.push(P,It,Ft,it,Zt.z,null)}}else if((P.isMesh||P.isLine||P.isPoints)&&(!P.frustumCulled||Qt.intersectsObject(P))){const It=J.update(P),Ft=P.material;if(nt&&(P.boundingSphere!==void 0?(P.boundingSphere===null&&P.computeBoundingSphere(),Zt.copy(P.boundingSphere.center)):(It.boundingSphere===null&&It.computeBoundingSphere(),Zt.copy(It.boundingSphere.center)),Zt.applyMatrix4(P.matrixWorld).applyMatrix4(_t)),Array.isArray(Ft)){const kt=It.groups;for(let te=0,ee=kt.length;te<ee;te++){const qt=kt[te],pe=Ft[qt.materialIndex];pe&&pe.visible&&v.push(P,It,pe,it,Zt.z,qt)}}else Ft.visible&&v.push(P,It,Ft,it,Zt.z,null)}}const xt=P.children;for(let It=0,Ft=xt.length;It<Ft;It++)io(xt[It],X,it,nt)}function An(P,X,it,nt){const Y=P.opaque,xt=P.transmissive,It=P.transparent;g.setupLightsView(it),et===!0&&bt.setGlobalState(M.clippingPlanes,it),nt&&rt.viewport(U.copy(nt)),Y.length>0&&_s(Y,X,it),xt.length>0&&_s(xt,X,it),It.length>0&&_s(It,X,it),rt.buffers.depth.setTest(!0),rt.buffers.depth.setMask(!0),rt.buffers.color.setMask(!0),rt.setPolygonOffset(!1)}function Wt(P,X,it,nt){if((it.isScene===!0?it.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[nt.id]===void 0&&(g.state.transmissionRenderTarget[nt.id]=new Ii(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?_r:hi,minFilter:Ri,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Se.workingColorSpace}));const xt=g.state.transmissionRenderTarget[nt.id],It=nt.viewport||U;xt.setSize(It.z*M.transmissionResolutionScale,It.w*M.transmissionResolutionScale);const Ft=M.getRenderTarget(),kt=M.getActiveCubeFace(),te=M.getActiveMipmapLevel();M.setRenderTarget(xt),M.getClearColor(H),q=M.getClearAlpha(),q<1&&M.setClearColor(16777215,.5),M.clear(),Re&&Vt.render(it);const ee=M.toneMapping;M.toneMapping=Pi;const qt=nt.viewport;if(nt.viewport!==void 0&&(nt.viewport=void 0),g.setupLightsView(nt),et===!0&&bt.setGlobalState(M.clippingPlanes,nt),_s(P,it,nt),At.updateMultisampleRenderTarget(xt),At.updateRenderTargetMipmap(xt),$.has("WEBGL_multisampled_render_to_texture")===!1){let pe=!1;for(let Ee=0,Jt=X.length;Ee<Jt;Ee++){const se=X[Ee],Te=se.object,Xt=se.geometry,Le=se.material,_e=se.group;if(Le.side===ci&&Te.layers.test(nt.layers)){const $t=Le.side;Le.side=fn,Le.needsUpdate=!0,so(Te,it,nt,Xt,Le,_e),Le.side=$t,Le.needsUpdate=!0,pe=!0}}pe===!0&&(At.updateMultisampleRenderTarget(xt),At.updateRenderTargetMipmap(xt))}M.setRenderTarget(Ft,kt,te),M.setClearColor(H,q),qt!==void 0&&(nt.viewport=qt),M.toneMapping=ee}function _s(P,X,it){const nt=X.isScene===!0?X.overrideMaterial:null;for(let Y=0,xt=P.length;Y<xt;Y++){const It=P[Y],Ft=It.object,kt=It.geometry,te=It.group;let ee=It.material;ee.allowOverride===!0&&nt!==null&&(ee=nt),Ft.layers.test(it.layers)&&so(Ft,X,it,kt,ee,te)}}function so(P,X,it,nt,Y,xt){P.onBeforeRender(M,X,it,nt,Y,xt),P.modelViewMatrix.multiplyMatrices(it.matrixWorldInverse,P.matrixWorld),P.normalMatrix.getNormalMatrix(P.modelViewMatrix),Y.onBeforeRender(M,X,it,nt,P,xt),Y.transparent===!0&&Y.side===ci&&Y.forceSinglePass===!1?(Y.side=fn,Y.needsUpdate=!0,M.renderBufferDirect(it,X,nt,Y,P,xt),Y.side=Ai,Y.needsUpdate=!0,M.renderBufferDirect(it,X,nt,Y,P,xt),Y.side=ci):M.renderBufferDirect(it,X,nt,Y,P,xt),P.onAfterRender(M,X,it,nt,Y,xt)}function vs(P,X,it){X.isScene!==!0&&(X=jt);const nt=pt.get(P),Y=g.state.lights,xt=g.state.shadowsArray,It=Y.state.version,Ft=ot.getParameters(P,Y.state,xt,X,it),kt=ot.getProgramCacheKey(Ft);let te=nt.programs;nt.environment=P.isMeshStandardMaterial?X.environment:null,nt.fog=X.fog,nt.envMap=(P.isMeshStandardMaterial?de:ne).get(P.envMap||nt.environment),nt.envMapRotation=nt.environment!==null&&P.envMap===null?X.environmentRotation:P.envMapRotation,te===void 0&&(P.addEventListener("dispose",dt),te=new Map,nt.programs=te);let ee=te.get(kt);if(ee!==void 0){if(nt.currentProgram===ee&&nt.lightsStateVersion===It)return lr(P,Ft),ee}else Ft.uniforms=ot.getUniforms(P),P.onBeforeCompile(Ft,M),ee=ot.acquireProgram(Ft,kt),te.set(kt,ee),nt.uniforms=Ft.uniforms;const qt=nt.uniforms;return(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(qt.clippingPlanes=bt.uniform),lr(P,Ft),nt.needsLights=za(P),nt.lightsStateVersion=It,nt.needsLights&&(qt.ambientLightColor.value=Y.state.ambient,qt.lightProbe.value=Y.state.probe,qt.directionalLights.value=Y.state.directional,qt.directionalLightShadows.value=Y.state.directionalShadow,qt.spotLights.value=Y.state.spot,qt.spotLightShadows.value=Y.state.spotShadow,qt.rectAreaLights.value=Y.state.rectArea,qt.ltc_1.value=Y.state.rectAreaLTC1,qt.ltc_2.value=Y.state.rectAreaLTC2,qt.pointLights.value=Y.state.point,qt.pointLightShadows.value=Y.state.pointShadow,qt.hemisphereLights.value=Y.state.hemi,qt.directionalShadowMap.value=Y.state.directionalShadowMap,qt.directionalShadowMatrix.value=Y.state.directionalShadowMatrix,qt.spotShadowMap.value=Y.state.spotShadowMap,qt.spotLightMatrix.value=Y.state.spotLightMatrix,qt.spotLightMap.value=Y.state.spotLightMap,qt.pointShadowMap.value=Y.state.pointShadowMap,qt.pointShadowMatrix.value=Y.state.pointShadowMatrix),nt.currentProgram=ee,nt.uniformsList=null,ee}function ro(P){if(P.uniformsList===null){const X=P.currentProgram.getUniforms();P.uniformsList=Ko.seqWithValue(X.seq,P.uniforms)}return P.uniformsList}function lr(P,X){const it=pt.get(P);it.outputColorSpace=X.outputColorSpace,it.batching=X.batching,it.batchingColor=X.batchingColor,it.instancing=X.instancing,it.instancingColor=X.instancingColor,it.instancingMorph=X.instancingMorph,it.skinning=X.skinning,it.morphTargets=X.morphTargets,it.morphNormals=X.morphNormals,it.morphColors=X.morphColors,it.morphTargetsCount=X.morphTargetsCount,it.numClippingPlanes=X.numClippingPlanes,it.numIntersection=X.numClipIntersection,it.vertexAlphas=X.vertexAlphas,it.vertexTangents=X.vertexTangents,it.toneMapping=X.toneMapping}function Fa(P,X,it,nt,Y){X.isScene!==!0&&(X=jt),At.resetTextureUnits();const xt=X.fog,It=nt.isMeshStandardMaterial?X.environment:null,Ft=V===null?M.outputColorSpace:V.isXRRenderTarget===!0?V.texture.colorSpace:is,kt=(nt.isMeshStandardMaterial?de:ne).get(nt.envMap||It),te=nt.vertexColors===!0&&!!it.attributes.color&&it.attributes.color.itemSize===4,ee=!!it.attributes.tangent&&(!!nt.normalMap||nt.anisotropy>0),qt=!!it.morphAttributes.position,pe=!!it.morphAttributes.normal,Ee=!!it.morphAttributes.color;let Jt=Pi;nt.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(Jt=M.toneMapping);const se=it.morphAttributes.position||it.morphAttributes.normal||it.morphAttributes.color,Te=se!==void 0?se.length:0,Xt=pt.get(nt),Le=g.state.lights;if(et===!0&&(ut===!0||P!==D)){const Fe=P===D&&nt.id===R;bt.setState(nt,P,Fe)}let _e=!1;nt.version===Xt.__version?(Xt.needsLights&&Xt.lightsStateVersion!==Le.state.version||Xt.outputColorSpace!==Ft||Y.isBatchedMesh&&Xt.batching===!1||!Y.isBatchedMesh&&Xt.batching===!0||Y.isBatchedMesh&&Xt.batchingColor===!0&&Y.colorTexture===null||Y.isBatchedMesh&&Xt.batchingColor===!1&&Y.colorTexture!==null||Y.isInstancedMesh&&Xt.instancing===!1||!Y.isInstancedMesh&&Xt.instancing===!0||Y.isSkinnedMesh&&Xt.skinning===!1||!Y.isSkinnedMesh&&Xt.skinning===!0||Y.isInstancedMesh&&Xt.instancingColor===!0&&Y.instanceColor===null||Y.isInstancedMesh&&Xt.instancingColor===!1&&Y.instanceColor!==null||Y.isInstancedMesh&&Xt.instancingMorph===!0&&Y.morphTexture===null||Y.isInstancedMesh&&Xt.instancingMorph===!1&&Y.morphTexture!==null||Xt.envMap!==kt||nt.fog===!0&&Xt.fog!==xt||Xt.numClippingPlanes!==void 0&&(Xt.numClippingPlanes!==bt.numPlanes||Xt.numIntersection!==bt.numIntersection)||Xt.vertexAlphas!==te||Xt.vertexTangents!==ee||Xt.morphTargets!==qt||Xt.morphNormals!==pe||Xt.morphColors!==Ee||Xt.toneMapping!==Jt||Xt.morphTargetsCount!==Te)&&(_e=!0):(_e=!0,Xt.__version=nt.version);let $t=Xt.currentProgram;_e===!0&&($t=vs(nt,X,Y));let ke=!1,tn=!1,si=!1;const ve=$t.getUniforms(),_n=Xt.uniforms;if(rt.useProgram($t.program)&&(ke=!0,tn=!0,si=!0),nt.id!==R&&(R=nt.id,tn=!0),ke||D!==P){rt.buffers.depth.getReversed()&&P.reversedDepth!==!0&&(P._reversedDepth=!0,P.updateProjectionMatrix()),ve.setValue(T,"projectionMatrix",P.projectionMatrix),ve.setValue(T,"viewMatrix",P.matrixWorldInverse);const ye=ve.map.cameraPosition;ye!==void 0&&ye.setValue(T,Nt.setFromMatrixPosition(P.matrixWorld)),ht.logarithmicDepthBuffer&&ve.setValue(T,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),(nt.isMeshPhongMaterial||nt.isMeshToonMaterial||nt.isMeshLambertMaterial||nt.isMeshBasicMaterial||nt.isMeshStandardMaterial||nt.isShaderMaterial)&&ve.setValue(T,"isOrthographic",P.isOrthographicCamera===!0),D!==P&&(D=P,tn=!0,si=!0)}if(Y.isSkinnedMesh){ve.setOptional(T,Y,"bindMatrix"),ve.setOptional(T,Y,"bindMatrixInverse");const Fe=Y.skeleton;Fe&&(Fe.boneTexture===null&&Fe.computeBoneTexture(),ve.setValue(T,"boneTexture",Fe.boneTexture,At))}Y.isBatchedMesh&&(ve.setOptional(T,Y,"batchingTexture"),ve.setValue(T,"batchingTexture",Y._matricesTexture,At),ve.setOptional(T,Y,"batchingIdTexture"),ve.setValue(T,"batchingIdTexture",Y._indirectTexture,At),ve.setOptional(T,Y,"batchingColorTexture"),Y._colorsTexture!==null&&ve.setValue(T,"batchingColorTexture",Y._colorsTexture,At));const en=it.morphAttributes;if((en.position!==void 0||en.normal!==void 0||en.color!==void 0)&&wt.update(Y,it,$t),(tn||Xt.receiveShadow!==Y.receiveShadow)&&(Xt.receiveShadow=Y.receiveShadow,ve.setValue(T,"receiveShadow",Y.receiveShadow)),nt.isMeshGouraudMaterial&&nt.envMap!==null&&(_n.envMap.value=kt,_n.flipEnvMap.value=kt.isCubeTexture&&kt.isRenderTargetTexture===!1?-1:1),nt.isMeshStandardMaterial&&nt.envMap===null&&X.environment!==null&&(_n.envMapIntensity.value=X.environmentIntensity),tn&&(ve.setValue(T,"toneMappingExposure",M.toneMappingExposure),Xt.needsLights&&Ji(_n,si),xt&&nt.fog===!0&&gt.refreshFogUniforms(_n,xt),gt.refreshMaterialUniforms(_n,nt,W,ct,g.state.transmissionRenderTarget[P.id]),Ko.upload(T,ro(Xt),_n,At)),nt.isShaderMaterial&&nt.uniformsNeedUpdate===!0&&(Ko.upload(T,ro(Xt),_n,At),nt.uniformsNeedUpdate=!1),nt.isSpriteMaterial&&ve.setValue(T,"center",Y.center),ve.setValue(T,"modelViewMatrix",Y.modelViewMatrix),ve.setValue(T,"normalMatrix",Y.normalMatrix),ve.setValue(T,"modelMatrix",Y.matrixWorld),nt.isShaderMaterial||nt.isRawShaderMaterial){const Fe=nt.uniformsGroups;for(let ye=0,Yn=Fe.length;ye<Yn;ye++){const Cn=Fe[ye];ce.update(Cn,$t),ce.bind(Cn,$t)}}return $t}function Ji(P,X){P.ambientLightColor.needsUpdate=X,P.lightProbe.needsUpdate=X,P.directionalLights.needsUpdate=X,P.directionalLightShadows.needsUpdate=X,P.pointLights.needsUpdate=X,P.pointLightShadows.needsUpdate=X,P.spotLights.needsUpdate=X,P.spotLightShadows.needsUpdate=X,P.rectAreaLights.needsUpdate=X,P.hemisphereLights.needsUpdate=X}function za(P){return P.isMeshLambertMaterial||P.isMeshToonMaterial||P.isMeshPhongMaterial||P.isMeshStandardMaterial||P.isShadowMaterial||P.isShaderMaterial&&P.lights===!0}this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return V},this.setRenderTargetTextures=function(P,X,it){const nt=pt.get(P);nt.__autoAllocateDepthBuffer=P.resolveDepthBuffer===!1,nt.__autoAllocateDepthBuffer===!1&&(nt.__useRenderToTexture=!1),pt.get(P.texture).__webglTexture=X,pt.get(P.depthTexture).__webglTexture=nt.__autoAllocateDepthBuffer?void 0:it,nt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(P,X){const it=pt.get(P);it.__webglFramebuffer=X,it.__useDefaultFramebuffer=X===void 0};const ph=T.createFramebuffer();this.setRenderTarget=function(P,X=0,it=0){V=P,N=X,B=it;let nt=!0,Y=null,xt=!1,It=!1;if(P){const kt=pt.get(P);if(kt.__useDefaultFramebuffer!==void 0)rt.bindFramebuffer(T.FRAMEBUFFER,null),nt=!1;else if(kt.__webglFramebuffer===void 0)At.setupRenderTarget(P);else if(kt.__hasExternalTextures)At.rebindTextures(P,pt.get(P.texture).__webglTexture,pt.get(P.depthTexture).__webglTexture);else if(P.depthBuffer){const qt=P.depthTexture;if(kt.__boundDepthTexture!==qt){if(qt!==null&&pt.has(qt)&&(P.width!==qt.image.width||P.height!==qt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");At.setupDepthRenderbuffer(P)}}const te=P.texture;(te.isData3DTexture||te.isDataArrayTexture||te.isCompressedArrayTexture)&&(It=!0);const ee=pt.get(P).__webglFramebuffer;P.isWebGLCubeRenderTarget?(Array.isArray(ee[X])?Y=ee[X][it]:Y=ee[X],xt=!0):P.samples>0&&At.useMultisampledRTT(P)===!1?Y=pt.get(P).__webglMultisampledFramebuffer:Array.isArray(ee)?Y=ee[it]:Y=ee,U.copy(P.viewport),tt.copy(P.scissor),F=P.scissorTest}else U.copy(Mt).multiplyScalar(W).floor(),tt.copy(Ot).multiplyScalar(W).floor(),F=oe;if(it!==0&&(Y=ph),rt.bindFramebuffer(T.FRAMEBUFFER,Y)&&nt&&rt.drawBuffers(P,Y),rt.viewport(U),rt.scissor(tt),rt.setScissorTest(F),xt){const kt=pt.get(P.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+X,kt.__webglTexture,it)}else if(It){const kt=X;for(let te=0;te<P.textures.length;te++){const ee=pt.get(P.textures[te]);T.framebufferTextureLayer(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0+te,ee.__webglTexture,it,kt)}}else if(P!==null&&it!==0){const kt=pt.get(P.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,kt.__webglTexture,it)}R=-1},this.readRenderTargetPixels=function(P,X,it,nt,Y,xt,It,Ft=0){if(!(P&&P.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let kt=pt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&It!==void 0&&(kt=kt[It]),kt){rt.bindFramebuffer(T.FRAMEBUFFER,kt);try{const te=P.textures[Ft],ee=te.format,qt=te.type;if(!ht.textureFormatReadable(ee)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ht.textureTypeReadable(qt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=P.width-nt&&it>=0&&it<=P.height-Y&&(P.textures.length>1&&T.readBuffer(T.COLOR_ATTACHMENT0+Ft),T.readPixels(X,it,nt,Y,Gt.convert(ee),Gt.convert(qt),xt))}finally{const te=V!==null?pt.get(V).__webglFramebuffer:null;rt.bindFramebuffer(T.FRAMEBUFFER,te)}}},this.readRenderTargetPixelsAsync=async function(P,X,it,nt,Y,xt,It,Ft=0){if(!(P&&P.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let kt=pt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&It!==void 0&&(kt=kt[It]),kt)if(X>=0&&X<=P.width-nt&&it>=0&&it<=P.height-Y){rt.bindFramebuffer(T.FRAMEBUFFER,kt);const te=P.textures[Ft],ee=te.format,qt=te.type;if(!ht.textureFormatReadable(ee))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ht.textureTypeReadable(qt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const pe=T.createBuffer();T.bindBuffer(T.PIXEL_PACK_BUFFER,pe),T.bufferData(T.PIXEL_PACK_BUFFER,xt.byteLength,T.STREAM_READ),P.textures.length>1&&T.readBuffer(T.COLOR_ATTACHMENT0+Ft),T.readPixels(X,it,nt,Y,Gt.convert(ee),Gt.convert(qt),0);const Ee=V!==null?pt.get(V).__webglFramebuffer:null;rt.bindFramebuffer(T.FRAMEBUFFER,Ee);const Jt=T.fenceSync(T.SYNC_GPU_COMMANDS_COMPLETE,0);return T.flush(),await l0(T,Jt,4),T.bindBuffer(T.PIXEL_PACK_BUFFER,pe),T.getBufferSubData(T.PIXEL_PACK_BUFFER,0,xt),T.deleteBuffer(pe),T.deleteSync(Jt),xt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(P,X=null,it=0){const nt=Math.pow(2,-it),Y=Math.floor(P.image.width*nt),xt=Math.floor(P.image.height*nt),It=X!==null?X.x:0,Ft=X!==null?X.y:0;At.setTexture2D(P,0),T.copyTexSubImage2D(T.TEXTURE_2D,it,0,0,It,Ft,Y,xt),rt.unbindTexture()};const mh=T.createFramebuffer(),gh=T.createFramebuffer();this.copyTextureToTexture=function(P,X,it=null,nt=null,Y=0,xt=null){xt===null&&(Y!==0?(Ls("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),xt=Y,Y=0):xt=0);let It,Ft,kt,te,ee,qt,pe,Ee,Jt;const se=P.isCompressedTexture?P.mipmaps[xt]:P.image;if(it!==null)It=it.max.x-it.min.x,Ft=it.max.y-it.min.y,kt=it.isBox3?it.max.z-it.min.z:1,te=it.min.x,ee=it.min.y,qt=it.isBox3?it.min.z:0;else{const en=Math.pow(2,-Y);It=Math.floor(se.width*en),Ft=Math.floor(se.height*en),P.isDataArrayTexture?kt=se.depth:P.isData3DTexture?kt=Math.floor(se.depth*en):kt=1,te=0,ee=0,qt=0}nt!==null?(pe=nt.x,Ee=nt.y,Jt=nt.z):(pe=0,Ee=0,Jt=0);const Te=Gt.convert(X.format),Xt=Gt.convert(X.type);let Le;X.isData3DTexture?(At.setTexture3D(X,0),Le=T.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(At.setTexture2DArray(X,0),Le=T.TEXTURE_2D_ARRAY):(At.setTexture2D(X,0),Le=T.TEXTURE_2D),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,X.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,X.unpackAlignment);const _e=T.getParameter(T.UNPACK_ROW_LENGTH),$t=T.getParameter(T.UNPACK_IMAGE_HEIGHT),ke=T.getParameter(T.UNPACK_SKIP_PIXELS),tn=T.getParameter(T.UNPACK_SKIP_ROWS),si=T.getParameter(T.UNPACK_SKIP_IMAGES);T.pixelStorei(T.UNPACK_ROW_LENGTH,se.width),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,se.height),T.pixelStorei(T.UNPACK_SKIP_PIXELS,te),T.pixelStorei(T.UNPACK_SKIP_ROWS,ee),T.pixelStorei(T.UNPACK_SKIP_IMAGES,qt);const ve=P.isDataArrayTexture||P.isData3DTexture,_n=X.isDataArrayTexture||X.isData3DTexture;if(P.isDepthTexture){const en=pt.get(P),Fe=pt.get(X),ye=pt.get(en.__renderTarget),Yn=pt.get(Fe.__renderTarget);rt.bindFramebuffer(T.READ_FRAMEBUFFER,ye.__webglFramebuffer),rt.bindFramebuffer(T.DRAW_FRAMEBUFFER,Yn.__webglFramebuffer);for(let Cn=0;Cn<kt;Cn++)ve&&(T.framebufferTextureLayer(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,pt.get(P).__webglTexture,Y,qt+Cn),T.framebufferTextureLayer(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,pt.get(X).__webglTexture,xt,Jt+Cn)),T.blitFramebuffer(te,ee,It,Ft,pe,Ee,It,Ft,T.DEPTH_BUFFER_BIT,T.NEAREST);rt.bindFramebuffer(T.READ_FRAMEBUFFER,null),rt.bindFramebuffer(T.DRAW_FRAMEBUFFER,null)}else if(Y!==0||P.isRenderTargetTexture||pt.has(P)){const en=pt.get(P),Fe=pt.get(X);rt.bindFramebuffer(T.READ_FRAMEBUFFER,mh),rt.bindFramebuffer(T.DRAW_FRAMEBUFFER,gh);for(let ye=0;ye<kt;ye++)ve?T.framebufferTextureLayer(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,en.__webglTexture,Y,qt+ye):T.framebufferTexture2D(T.READ_FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,en.__webglTexture,Y),_n?T.framebufferTextureLayer(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,Fe.__webglTexture,xt,Jt+ye):T.framebufferTexture2D(T.DRAW_FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,Fe.__webglTexture,xt),Y!==0?T.blitFramebuffer(te,ee,It,Ft,pe,Ee,It,Ft,T.COLOR_BUFFER_BIT,T.NEAREST):_n?T.copyTexSubImage3D(Le,xt,pe,Ee,Jt+ye,te,ee,It,Ft):T.copyTexSubImage2D(Le,xt,pe,Ee,te,ee,It,Ft);rt.bindFramebuffer(T.READ_FRAMEBUFFER,null),rt.bindFramebuffer(T.DRAW_FRAMEBUFFER,null)}else _n?P.isDataTexture||P.isData3DTexture?T.texSubImage3D(Le,xt,pe,Ee,Jt,It,Ft,kt,Te,Xt,se.data):X.isCompressedArrayTexture?T.compressedTexSubImage3D(Le,xt,pe,Ee,Jt,It,Ft,kt,Te,se.data):T.texSubImage3D(Le,xt,pe,Ee,Jt,It,Ft,kt,Te,Xt,se):P.isDataTexture?T.texSubImage2D(T.TEXTURE_2D,xt,pe,Ee,It,Ft,Te,Xt,se.data):P.isCompressedTexture?T.compressedTexSubImage2D(T.TEXTURE_2D,xt,pe,Ee,se.width,se.height,Te,se.data):T.texSubImage2D(T.TEXTURE_2D,xt,pe,Ee,It,Ft,Te,Xt,se);T.pixelStorei(T.UNPACK_ROW_LENGTH,_e),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,$t),T.pixelStorei(T.UNPACK_SKIP_PIXELS,ke),T.pixelStorei(T.UNPACK_SKIP_ROWS,tn),T.pixelStorei(T.UNPACK_SKIP_IMAGES,si),xt===0&&X.generateMipmaps&&T.generateMipmap(Le),rt.unbindTexture()},this.copyTextureToTexture3D=function(P,X,it=null,nt=null,Y=0){return Ls('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(P,X,it,nt,Y)},this.initRenderTarget=function(P){pt.get(P).__webglFramebuffer===void 0&&At.setupRenderTarget(P)},this.initTexture=function(P){P.isCubeTexture?At.setTextureCube(P,0):P.isData3DTexture?At.setTexture3D(P,0):P.isDataArrayTexture||P.isCompressedArrayTexture?At.setTexture2DArray(P,0):At.setTexture2D(P,0),rt.unbindTexture()},this.resetState=function(){N=0,B=0,V=null,rt.reset(),Pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return jn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Se._getDrawingBufferColorSpace(t),e.unpackColorSpace=Se._getUnpackColorSpace()}}/*!
3850
3850
  * Photo Sphere Viewer 5.14.0
3851
3851
  * @copyright 2014-2015 Jérémy Heleine
3852
3852
  * @copyright 2015-2025 Damien "Mistic" Sorel
@@ -3948,4 +3948,4 @@ void main() {
3948
3948
  * @preserve
3949
3949
  * gcoord 1.0.7, geographic coordinate library
3950
3950
  * Copyright (c) 2025 Jiulong Hu <me@hujiulong.com>
3951
- */const{sin:Tn,cos:AM,sqrt:fh,abs:Ca,PI:un}=Math,Kp=6378245,$p=.006693421622965823;function tm(n,t){return n>=72.004&&n<=137.8347&&t>=.8293&&t<=55.8271}function CM(n,t){let e=-100+2*n+3*t+.2*t*t+.1*n*t+.2*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(t*un)+40*Tn(t/3*un))*2/3,e+=(160*Tn(t/12*un)+320*Tn(t*un/30))*2/3,e}function PM(n,t){let e=300+n+2*t+.1*n*n+.1*n*t+.1*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(n*un)+40*Tn(n/3*un))*2/3,e+=(150*Tn(n/12*un)+300*Tn(n/30*un))*2/3,e}function RM(n,t){let e=PM(n-105,t-35),s=CM(n-105,t-35);const r=t/180*un;let a=Tn(r);a=1-$p*a*a;const l=fh(a);return e=e*180/(Kp/l*AM(r)*un),s=s*180/(Kp*(1-$p)/(a*l)*un),[e,s]}function qi(n){const[t,e]=n;if(!tm(t,e))return[t,e];const s=RM(t,e);return[t+s[0],e+s[1]]}function sr(n){const[t,e]=n;if(!tm(t,e))return[t,e];let[s,r]=[t,e],a=qi([s,r]),l=a[0]-t,h=a[1]-e;for(;Ca(l)>1e-6||Ca(h)>1e-6;)s-=l,r-=h,a=qi([s,r]),l=a[0]-t,h=a[1]-e;return[s,r]}const{sin:Pa,cos:Ra,atan2:em,sqrt:nm,PI:LM}=Math,La=LM*3e3/180;function rr(n){const[t,e]=n,s=t-.0065,r=e-.006,a=nm(s*s+r*r)-2e-5*Pa(r*La),l=em(r,s)-3e-6*Ra(s*La),h=a*Ra(l),u=a*Pa(l);return[h,u]}function or(n){const[t,e]=n,s=t,r=e,a=nm(s*s+r*r)+2e-5*Pa(r*La),l=em(r,s)+3e-6*Ra(s*La),h=a*Ra(l)+.0065,u=a*Pa(l)+.006;return[h,u]}const im=180/Math.PI,sm=Math.PI/180,Ia=6378137,Qi=20037508342789244e-9;function Da(n){return[n[0]*im/Ia,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/Ia)))*im]}function ka(n){const t=Math.abs(n[0])<=180?n[0]:n[0]-(n[0]<0?-1:1)*360,e=[Ia*t*sm,Ia*Math.log(Math.tan(Math.PI*.25+.5*n[1]*sm))];return e[0]>Qi&&(e[0]=Qi),e[0]<-Qi&&(e[0]=-Qi),e[1]>Qi&&(e[1]=Qi),e[1]<-Qi&&(e[1]=-Qi),e}const{abs:Ua}=Math,rm=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],om=[75,60,45,30,15,0],IM=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],DM=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]];function am(n,t,e){const s=Ua(t)/e[9];let r=e[0]+e[1]*Ua(n),a=e[2]+e[3]*s+e[4]*Math.pow(s,2)+e[5]*Math.pow(s,3)+e[6]*Math.pow(s,4)+e[7]*Math.pow(s,5)+e[8]*Math.pow(s,6);return r*=n<0?-1:1,a*=t<0?-1:1,[r,a]}function Oa(n){const[t,e]=n;let s=[];for(let r=0;r<om.length;r++)if(Ua(e)>om[r]){s=DM[r];break}return am(t,e,s)}function Na(n){const[t,e]=n;let s=[];for(let r=0;r<rm.length;r++)if(Ua(e)>=rm[r]){s=IM[r];break}return am(t,e,s)}function ji(n,t){if(!n)throw new Error(t)}function lm(n){return!!n&&Object.prototype.toString.call(n)==="[object Array]"}function cm(n){return!isNaN(Number(n))&&n!==null&&!lm(n)}function Un(...n){const t=n.length-1;return function(...e){let s=t,r=n[t].apply(null,e);for(;s--;)r=n[s].call(null,r);return r}}function hm(n,t,e=!1){if(n===null)return;let s,r,a,l,h,u,d=0,p=0,m,_;const{type:E}=n,S=E==="FeatureCollection",w=E==="Feature",v=S?n.features.length:1;for(let g=0;g<v;g++){m=S?n.features[g].geometry:w?n.geometry:n,_=m?m.type==="GeometryCollection":!1,u=_?m.geometries.length:1;for(let I=0;I<u;I++){let C=0,M=0;if(l=_?m.geometries[I]:m,l===null)continue;const k=l.type;switch(d=e&&(k==="Polygon"||k==="MultiPolygon")?1:0,k){case null:break;case"Point":if(h=l.coordinates,t(h,p,g,C,M)===!1)return!1;p++,C++;break;case"LineString":case"MultiPoint":for(h=l.coordinates,s=0;s<h.length;s++){if(t(h[s],p,g,C,M)===!1)return!1;p++,k==="MultiPoint"&&C++}k==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(h=l.coordinates,s=0;s<h.length;s++){for(r=0;r<h[s].length-d;r++){if(t(h[s][r],p,g,C,M)===!1)return!1;p++}k==="MultiLineString"&&C++,k==="Polygon"&&M++}k==="Polygon"&&C++;break;case"MultiPolygon":for(h=l.coordinates,s=0;s<h.length;s++){for(M=0,r=0;r<h[s].length;r++){for(a=0;a<h[s][r].length-d;a++){if(t(h[s][r][a],p,g,C,M)===!1)return!1;p++}M++}C++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)if(hm(l.geometries[s],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}var Be;(function(n){n.WGS84="WGS84",n.WGS1984="WGS84",n.EPSG4326="WGS84",n.GCJ02="GCJ02",n.AMap="GCJ02",n.BD09="BD09",n.BD09LL="BD09",n.Baidu="BD09",n.BMap="BD09",n.BD09MC="BD09MC",n.BD09Meter="BD09MC",n.EPSG3857="EPSG3857",n.EPSG900913="EPSG3857",n.EPSG102100="EPSG3857",n.WebMercator="EPSG3857",n.WM="EPSG3857"})(Be||(Be={}));const kM={to:{[Be.GCJ02]:qi,[Be.BD09]:Un(or,qi),[Be.BD09MC]:Un(Oa,or,qi),[Be.EPSG3857]:ka}},UM={to:{[Be.WGS84]:sr,[Be.BD09]:or,[Be.BD09MC]:Un(Oa,or),[Be.EPSG3857]:Un(ka,sr)}},OM={to:{[Be.WGS84]:Un(sr,rr),[Be.GCJ02]:rr,[Be.EPSG3857]:Un(ka,sr,rr),[Be.BD09MC]:Oa}},NM={to:{[Be.WGS84]:Da,[Be.GCJ02]:Un(qi,Da),[Be.BD09]:Un(or,qi,Da),[Be.BD09MC]:Un(Oa,or,qi,Da)}},BM={to:{[Be.WGS84]:Un(sr,rr,Na),[Be.GCJ02]:Un(rr,Na),[Be.EPSG3857]:Un(ka,sr,rr,Na),[Be.BD09]:Na}};var FM={WGS84:kM,GCJ02:UM,BD09:OM,EPSG3857:NM,BD09MC:BM};function zM(n,t,e){if(ji(!!n,"The args[0] input coordinate is required"),ji(!!t,"The args[1] original coordinate system is required"),ji(!!e,"The args[2] target coordinate system is required"),t===e)return n;const s=FM[t];ji(!!s,`Invalid original coordinate system: ${t}`);const r=s.to[e];ji(!!r,`Invalid target coordinate system: ${e}`);const a=typeof n;if(ji(a==="string"||a==="object",`Invalid input coordinate type: ${a}`),a==="string")try{n=JSON.parse(n)}catch{throw new Error(`Invalid input coordinate: ${n}`)}let l=!1;lm(n)&&(ji(n.length>=2,`Invalid input coordinate: ${n}`),ji(cm(n[0])&&cm(n[1]),`Invalid input coordinate: ${n}`),n=n.map(Number),l=!0);const h=r;return l?h(n):(hm(n,u=>{[u[0],u[1]]=h(u)}),n)}const um=Object.assign(Object.assign({},Be),{CRSTypes:Be,transform:zM});class ar{id="";coordinateId=0;coordinate=new yt.Coordinate;trackPoints=new Map;trackMarkers=new Map;relativePosition;projectId;createTime;color;type;panoramaSize;realseeSetting;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static async parsedModel(t,e,s){const{coordinateId:r,relativePosition:a,trackList:l,markerList:h,...u}=t,d=yt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(yt.RelativeMap.isValid(a)){const S=yt.RelativeMap.toParse(a);E=new yt.Coordinate({parent:E,type:yt.CoordinateType.Data,relativeMap:S})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await k_(l?.[0]?.img,s);d.panoramaSize=E;const S=new Map;for(const w of l){const v=gs.parsedModel({...w,patrolId:p,color:_},m,E,s);v.id&&S.set(v.id,new gs(v))}d.trackPoints=S}if(h?.length&&e){const E=new Map;for(const S of h){const w=no.parsedModel({...S,patrolId:p},e);w.id&&E.set(w.id,new no(w))}d.trackMarkers=E}return d}hasPoint(t){return this?.trackPoints?.has(t)}getPoint(t){return this?.trackPoints?.get(t)}getNearPoint(t){const e=Array.from(this?.trackPoints?.values()),s=e[0],r=e[e.length-1];return t<=(s.rawIndex??0)?s:t>=(r.rawIndex??0)?r:e.find(a=>(a.rawIndex??0)>=t)}hasMarker(t){return this?.trackMarkers?.has(t)}getMarker(t){return this?.trackMarkers?.get(t)}getPointMarkers(t){return Array.from(this?.trackMarkers?.values()).filter(e=>e.pointId===t)}projection(t,e,s){const{coordinate:r,trackPoints:a,trackMarkers:l}=this||{};if(!r||!a?.size)return;const h=r.getDestRelativeMap(t),u=r.getDestRelativeMap(e);if(!h||!u)return;const d=Array.from(l?.values()),p={srcToDstRelativeMap:h,srcCoordinate:r,dstCoordinate:t},m={srcToDstRelativeMap:u,srcCoordinate:r,dstCoordinate:e},{pointLax:_=0,trackCRSType:E}=s||{},S=new Map;let w;for(const g of a.values()){const I=g.projection(p,m);if(!I)continue;if(I.index=S.size,r.modelType===yt.CoordinateModelType.GeoModel){const{point:M}=I;if(E&&M){const[k,N]=um.transform([M.lon,M.lat],um.WGS84,E);I.point=new yt.Point({...M,lon:k,lat:N})}}if(_<=0){S.set(I.id,I);continue}if(d.find(M=>M.pointId===I.id)){S.set(I.id,I),w=I;continue}if(!S.size){S.set(I.id,I),w=I;continue}I.position&&w?.position&&yt.Point.dist(I.position,w.position)>=_&&(S.set(I.id,I),w=I)}const v=new ar(this);return v.trackPoints=S,v.coordinate=t,v.realseeSetting=s,v}getPathMarkers(t){const{pointType:e=Aa.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===Aa.NUMBER?l=this.getPointsByNumber(a,s):e===Aa.DISTANCE&&(l=this.getPointsByDistance(a,r)),this.createPathMarkers(a,l)}getPointsByDistance(t,e){if(!t.position||e<=0)return[];const{x:s,y:r}=t.position;return Array.from(this.trackPoints.values()).filter(a=>!a.position||!t.position||Math.abs(a.position.x-s)>e||Math.abs(a.position.y-r)>e?!1:yt.Point.dist(a.position,t.position)<=e)}getPointsByNumber(t,e){const s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}createPathMarkers(t,e){const{pathPin:s,pathRedPin:r}=this.realseeSetting||{},a=t.position;if(!a)return[];const l=[];for(const h of e){const u=h.position;if(!u)continue;const{d,yaw:p,pitch:m}=gs.toSphericalCoord(a,u);if(d===0)continue;const _=Math.min(120/(d/2e3),120),E=this.getPointMarkers(h.id).length>0;l.push({id:h.id,image:E?r:s,position:new yt.Position({yaw:p,pitch:m}),data:{...h,markerType:dh.pin},size:{width:_,height:_/2},hoverScale:{amount:1},opacity:.8,anchor:"center center"})}return l}getViolationMarkers(t){if(!t)return[];const e=this.getPointMarkers(t.id);return this.createViolationMarkers(e)}createViolationMarkers(t){return t.map((e,s)=>({id:e.id,image:e.markerIcon,position:e.perspective||new yt.Position({yaw:yt.Point.toDegrees(10)*s,pitch:0}),data:{...e,markerType:e.markerType},size:{width:50,height:50},hoverScale:{amount:1},opacity:.8,anchor:"bottom center"}))}getPreloadPoints(t){if(!t)return[];const{preloadStep:e=5}=this.realseeSetting||{},s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}}const{cloneDeep:dm,deepMergeProps:HM,getDiffProps:VM,delay:fm}=yt.utils;function GM(n,t,e,s,r){const a=y.ref(),l=y.ref(!1),h=y.ref(new Set),u=y.ref(new Set),d=y.ref(dm(Hh)),p=y.computed(()=>d.value),m=y.ref(),_=y.computed(()=>{const{currentRecord:dt}=y.unref(t)||{};return Array.from(dt?.trackPoints?.values()||[])});y.watch(()=>dm(n.value?.viewer),E,{immediate:!0,deep:!0});function E(dt,T){const Z=VM(dt,T);w(Z)}function S(){return p.value}function w(dt){dt&&HM(d.value,dt)}function v(){e.value?.addEventListener(Yt.ReadyEvent.type,I),e.value?.addEventListener(Yt.ClickEvent.type,C),e.value?.addEventListener(Yt.SizeUpdatedEvent.type,M),e.value?.addEventListener(Yt.PositionUpdatedEvent.type,k),e.value?.addEventListener(Yt.ZoomUpdatedEvent.type,N),e.value?.addEventListener(Yt.PanoramaLoadedEvent.type,B),e.value?.addEventListener(Yt.PanoramaErrorEvent.type,V),e.value?.container?.addEventListener("mousedown",P),e.value?.container?.addEventListener("touchstart",P),e.value?.container?.addEventListener("mouseup",O),e.value?.container?.addEventListener("touchend",O),e.value?.container?.addEventListener("mouseover",et),e.value?.container?.addEventListener("mouseout",z)}function g(){}function I(dt){r("ready",dt)}function C(dt){r("click",dt)}function M(dt){r("size-updated",dt)}function k(dt){r("position-updated",dt)}function N(dt){r("zoom-updated",dt)}function B(dt){r("panorama-loaded",dt)}function V(dt){r("panorama-error",dt)}function D(dt){r("panorama-complete",dt)}function P(dt){r("mousedown",dt)}function O(dt){r("mouseup",dt)}function et(dt){Mt(!0)}function z(dt){Mt(!1)}async function H(dt,T){if(l.value){a.value={currentPoint:dt,options:T};return}try{l.value=!0;const{maxRetries:Z,retryDelay:$}=n_;for(let ht=0;ht<Z;ht++)try{await q(dt,T),await j(dt.panorama);break}catch(lt){const Tt=$*Math.pow(1.5,ht);console.warn(`${Tt}ms 后开始第${ht+2}次重试:`,lt),await fm(Tt)}}finally{l.value=!1,W(),ct(),D(a.value)}}async function q(dt,T){const{loadingPh:Z=!1}=p.value,{panorama:$,placeholderImg:ht}=dt;ht&&!Z?(await e.value?.setPanorama(ht,T),await e.value?.setPanorama($,{showLoader:!1})):await e.value?.setPanorama($,T)}async function j(dt){if(yt.utils.isObject(dt)){const T=dt.tileUrl(Math.floor(dt.cols/2),0);if(T){const Z=await fetch(T);if(Z.ok)return await Z.blob()}}}async function ct(){if(await fm(10),a.value){const{currentPoint:dt,options:T}=a.value;a.value=void 0,H(dt,T)}}async function W(){const{currentPoint:dt,currentRecord:T}=y.unref(t)||{};if(!dt||!T)return;const Z=T.getPreloadPoints(dt);for(const $ of Z){const{panorama:ht,placeholderImg:lt}=$;if(!(!ht||h.value.has($.id)))try{const Tt=yt.utils.isObject(ht)?[ht.baseUrl,ht.tileUrl(Math.floor(ht.cols/2),0)]:[ht,lt].filter(Boolean);u.value.add($.id),await Promise.all(Tt.map(pt=>fetch(pt).then(bt=>{if(!bt.ok)throw new Error(`HTTP ${bt.status}`);return bt}))),h.value.add($.id)}catch{}finally{u.value.delete($.id)}}}function St(){at()}function at(){const{handleViolationMarkerFn:dt,handlePathMarkerFn:T}=y.unref(n)?.marker||{},{currentPoint:Z,currentRecord:$,currentMarker:ht}=y.unref(t)||{};if(Z&&$){const lt=$?.getPathMarkers(Z)?.map(bt=>T?.(bt)||bt),Tt=$?.getViolationMarkers(Z)?.map(bt=>dt?.(bt)||bt),pt=[...lt,...Tt];if(y.unref(s)?.setMarkers(pt),ht){const bt=Tt.find(re=>re.data.id===ht.id);if(!bt)return;y.unref(s)?.gotoMarker(bt.id,100)}}}function Mt(dt){w({mouseover:dt})}function Ot(dt){w({mousedown:dt})}function oe(){return y.unref(d)?.mouseover??!1}function Qt(){return y.unref(d)?.mousedown??!1}function tt(dt){w({moveDirection:dt})}function ut(dt){m.value=dt}async function _t(){const{currentPoint:dt}=y.unref(t)||{};if(dt){const T=Nt(dt);m.value=void 0,await H(dt,T)}}function Nt(dt){const{defaultTransition:T}=p.value,Z={showLoader:!1,transition:T},$=jt(dt);return{...Z,...m.value,...$?{position:$}:{}}}function Zt(dt){return Math.max(50,Math.min(1e3,dt-100))}function jt(dt,T){const{viewMode:Z,moveDirection:$=1,moveThresh:ht=0}=p.value;if(!dt||Z===ir.Auto||$===Yi.Stationary)return;const lt=e.value?.getPosition()?.yaw??0,Tt=T??ht;if(Z===ir.FollowView){const pt=dt.point.yaw??0;return Math.abs(pt-lt)>=Tt?{yaw:pt,pitch:0}:void 0}if(Z===ir.FollowRoad){const{index:pt=0,point:bt}=dt,re=_.value[pt+$]?.point;if(!bt||!re)return;const de=gs?.toSphericalCoord(bt,re);if(!de)return;const U=de.yaw??0;if(Math.abs(U-lt)>=Tt)return{yaw:U,pitch:0}}}return{getProps:p,viewerAction:{getState:S,setState:w,isMouseover:oe,isMousedown:Qt,setMousedown:Ot,setMouseover:Mt,setPanoramaPath:H,setViewerStatus:ut,setMoveDirection:tt,updateMarkers:at,preloadPanorama:W,loadMarkers:St,updateViewer:_t,getPanoramaOptions:Nt,getTransitionSpeed:Zt,getMovePosition:jt},handleViewerEvents:v,handleViewerUnEvents:g}}const{cloneDeep:pm,deepMergeProps:WM,getDiffProps:ZM}=yt.utils;function XM(n,t,e,s,r){const a=y.ref(pm(Gh)),l=y.computed(()=>a.value);y.watch(()=>pm(n.value?.marker),h,{immediate:!0,deep:!0});function h(E,S){const w=ZM(E,S);u(w)}function u(E){E&&WM(a.value,E)}function d(){y.unref(s)?.addEventListener(xp.SelectMarkerEvent.type,m)}function p(){}async function m(E){const{id:S,data:w}=E.marker.config,{onPointChange:v,onMarkerChange:g}=l.value;w.markerType==dh.pin?(await v?.(E),y.unref(t)?.selectPoint(w),r("select-point",w)):(await g?.(E),y.unref(s)?.gotoMarker(S,500),y.unref(t)?.selectMarker(w),r("select-marker",w))}return{getProps:l,markerAction:{},handleMarkerEvents:d,handleMarkerUnEvents:p}}const YM={class:"vsleem-viewer"},mm=Pn(y.defineComponent({name:"Viewer",__name:"Viewer",emits:["register","ready","click","mousedown","mouseup","size-updated","zoom-updated","position-updated","panorama-loaded","panorama-error","panorama-complete","select-point","select-marker"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(""),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(h))),p=y.computed(()=>y.unref(y.unref(u))),{getProps:m,handleViewerEvents:_,viewerAction:E}=GM(d,p,r,a,s),{handleMarkerEvents:S,markerAction:w}=XM(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(k),y.onBeforeUnmount(C);function v(N){N&&(g(),_(),S())}function g(){const{currentPoint:N}=p.value;if(y.unref(r)||!N)return;const B=I(),V=new GS(B),D=V.getPlugin(jp);r.value=Object.assign(V,E),a.value=Object.assign(D,w)}function I(){const{currentPoint:N}=p.value,{rotate:B}=d.value?.searchInfo||{},V=B??E.getMovePosition(N,0);V&&E.setState({defaultYaw:V.yaw,defaultPitch:V.pitch});let D;yt.utils.isObject(N?.panorama)&&(D=eM);const{viewMode:P,moveThresh:O,moveDirection:et,mousedown:z,mouseover:H,loadingPh:q,...j}=m.value;return{...j,container:l.value,panorama:N?.panorama,adapter:D,plugins:[[jp,[]]]}}function C(){r.value?.destroy()}function M(N,B){h.value=N,u.value=B}function k(){s("register",r,a,M)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(N,B)=>(y.openBlock(),y.createElementBlock("div",YM,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-a7047295"]]);function qM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getMap:a}}function QM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getPlaybar:a}}function jM(n,t){return yt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:yt.RequestMethod.GET,params:n},t)}function JM(n,t){const{setReferPoint:e,setRealseeState:s}=t,r=y.reactive(new Map),a=y.ref(),l=y.ref(),h=y.ref(),u=y.reactive(new Map),d=y.ref(!1),p=y.ref(!1),m=y.ref(),_=y.ref(),E=y.ref(),S=y.ref(),w=y.computed(()=>l.value?.findCsById(m.value)),v=y.computed(()=>w.value?.findParentSpace()),g=y.computed(()=>yt.Coordinate.getCommonCoordinate(Array.from(u.values(),T=>T.coordinate))),I=y.computed(()=>u.get(_.value??"")),C=y.computed(()=>V.value.get(_.value??"")),M=y.computed(()=>I.value?.getPoint(E.value??"")),k=y.computed(()=>C.value?.getPoint(E.value??"")),N=y.computed(()=>C.value?.getMarker(S.value??"")),B=y.computed(()=>C.value?.getPointMarkers(k.value?.id??"")||[]),V=y.computed(()=>{const T=new Map;if(!w.value||!g.value)return T;for(const Z of u.values()){const $=Z.projection(w.value,g.value,n.value.realseeSetting);$&&T.set($.id,$)}return T}),D=y.computed(()=>{const T=new Map;if(!V.value.size)return T;for(const Z of V.value.values()){const{trackMarkers:$}=Z;for(const ht of $.values()){const lt=Z.getPoint(ht.pointId);if(lt){const Tt=T.get(lt)??[];Tt.push(ht),Tt.length===1&&T.set(lt,Tt)}}}return T});async function P(T){const{projectId:Z,patrolId:$}=T||{},ht=$?Array.isArray($)?$:[$]:[];try{if(!Z||!ht.length)throw new yt.AppError(ze.StoreMissParams,"缺少必要的查询参数");if(d.value=!0,Z!=l.value?.projectId){const[re,de]=await Promise.all([yt.DataSource.getProjectDetail(Z),yt.DataSource.getCoordinateTree(Z)]);if(!re)throw new yt.AppError(ze.StoreNoProjectDetail,`未查询到项目ID为 ${Z} 的项目详情`);const{tileLayers:U=[]}=n.value.map||{};if(U.length){const b=U[U.length-1]||{},J=yt.utils.getMapProvider(b?.url),rt=J?.CRSTypes?.[re.mapArea??0];rt&&rt!==yt.CRSTypes.WGS84&&(re.CRSType=rt,re.mapType=J.name,s({realseeSetting:{trackCRSType:rt}}))}if(a.value=re,!de)throw new yt.AppError(ze.StoreNoCSTree,`未查询到项目ID为 ${Z} 的坐标系树`);l.value=de}const[lt,...Tt]=ht,pt=await O(lt);if(!pt)return;const bt=pt.coordinate.findChildModel([yt.CoordinateModelType.CADModel,yt.CoordinateModelType.GeoModel]);if(bt?.modelType===yt.CoordinateModelType.CADModel&&!bt?.modelValue)throw new yt.AppError(ze.StroeNoModelValue,`没有找到当前坐标系${bt?.id||""}的modelKey字段值`);h.value=bt?.getMappedCsTree(),u.clear(),u.set(pt.id,pt),z({modelCsId:bt?.id,...T}),Qt(Tt)}catch(lt){console.error(lt),n.value.fetchError?.(lt)}finally{d.value=!1}}async function O(T){try{let Z=r.get(T);if(Z||(Z=await jM({...n.value.fetchParams,id:T}),Z&&r.set(T,Z)),!Z)throw new yt.AppError(ze.StoreNoRecord,`未查询到ID为 ${T} 的巡检记录`);Z=await n.value.handleResponseFn?.(Z)||Z;const $=_t();Z.color=Z.color||$;const{appSetting:ht}=n.value,lt=await ar.parsedModel(Z,l.value,ht);if(!lt?.trackPoints?.size||!lt.coordinate)throw new yt.AppError(ze.StoreInvRecord,`ID为 ${T} 是无效的巡检记录`);let Tt;if(d.value?Tt=l.value?.findCsById(lt.coordinateId):h.value&&(Tt=h.value.findCsById(lt.coordinateId)),!Tt)throw new yt.AppError(ze.StoreRecordOutCSTree,`ID为 ${T} 的巡检记录不在映射坐标系树内`);if(Tt?.modelType===yt.CoordinateModelType.GeoModel){const bt=l.value?.findClosestModel(yt.CoordinateModelType.GeoModel);if(bt&&!bt.relativeMap?.refPoint){const re=Array.from(lt.trackPoints.values()),de=new yt.GeoPoint(re[0].point),U=new yt.RelativeMap({refPoint:de});bt.setOptions({relativeMap:U})}}const pt=new ar(lt);return n.value.fetchSuccess?.(pt,l.value),pt}catch(Z){console.error(Z),n.value.fetchError?.(Z)}}function et(T=!1){p.value=T}function z(T){const{patrolId:Z,pointId:$,modelCsId:ht,pointIndex:lt}=T,Tt=Z?Array.isArray(Z)?Z:[Z]:[];ht&&(m.value=ht);let pt=u.get(C.value?.id??"")||u.get(Tt[0]);if(pt){const bt=Array.from(pt.trackPoints.values()),re=pt.trackPoints.get(k.value?.id??"")||pt.trackPoints.get($??"")||bt.find(de=>de.rawIndex===lt)||bt[0];_.value=pt.id,E.value=re?.id}}function H(T){const{id:Z}=T;if(h.value?.findCsById(Z)?.type===yt.CoordinateType.Model)m.value=Z;else throw new yt.AppError(ze.StoreNoCSByID,`ID为 ${Z} 的模型坐标系不在映射坐标系树内`)}function q(T){const Z=Ot(T.id??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${T.id} 的巡检记录`);const $=Array.from(Z.trackPoints.values());_.value=Z.id,E.value=$[0]?.id}function j(T){const{patrolId:Z,id:$=""}=T,ht=Ot(Z??"");if(!ht)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${Z} 的巡检记录`);if(!ht?.hasPoint($))throw new yt.AppError(ze.StoreSelectNoPoint,`未找到ID为 ${$} 的轨迹点`);_.value=ht.id,E.value=$}function ct(T){if(T){const{patrolId:Z,id:$=""}=T,ht=Ot(Z??"");if(!ht)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${Z} 的巡检记录`);if(!ht?.hasMarker($))throw new yt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${$} 的问题标记`);S.value=$}else S.value=void 0}function W(T){const Z=u.get(T.patrolId);if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);Z.trackMarkers.set(T.id,T)}function St(T){const Z=u.get(T.patrolId??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);Z.trackMarkers.delete(T.id??"")}function at(T){const Z=u.get(T.patrolId??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);const $=Z.trackMarkers.get(T.id??"");if(!$)throw new yt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${T.id} 的问题标记`);Object.assign($,T)}function Mt(T){return V.value.has(T)}function Ot(T){return V.value.get(T)}async function oe(T){if(!u.has(T)){const Z=await O(T);if(Z){const $=new ar(Z);return u.set($.id,$),$}}}async function Qt(T){if(T.length)for(const Z of T)await oe(Z)}function tt(T){if(C.value?.id===T)throw new yt.AppError(ze.StoreSelectedMarker,`ID为 ${T} 的巡检记录正在被使用,无法删除`);return u.delete(T)}async function ut(T){const Z=u.get(T.id??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${T.id} 的巡检记录`);Object.assign(Z,T)}function _t(){const T=d.value?[]:Array.from(u.values()).map($=>$.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find($=>!T.includes($?.toUpperCase?.()))}function Nt(){return w.value?.findClosestModel(yt.CoordinateModelType.BIMModel)}function Zt(T){let Z=1/0,$;if(T.position){for(const ht of V.value.values())if(ht.trackPoints?.size)for(const lt of ht.trackPoints.values()){if(!lt.position)continue;const Tt=yt.Point.dist(T.position,lt.position);if(Tt===0){Z=Tt,$=lt;break}Tt<Z&&(Z=Tt,$=lt)}if($)return $}}function jt(T){if(!w.value||!g.value||!T)return;const Z=l.value?.findCsById(T.coordinate.id);if(!Z)return;const $=Z?.getDestRelativeMap(w.value),ht=Z?.getDestRelativeMap(g.value);if(!$||!ht)return;const lt={srcToDstRelativeMap:$,srcCoordinate:Z,dstCoordinate:w.value},Tt={srcToDstRelativeMap:ht,srcCoordinate:Z,dstCoordinate:g.value};return T.projection(lt,Tt)}function Re(){return dt.value}const dt=y.computed(()=>({ready:p.value,reloading:d.value,rawDataSource:u,currentProject:a.value,coordinateTree:l.value,mappedCoordinateTree:h.value,dataSource:V.value,comCoordinate:g.value,currentModel:w.value,currentSpace:v.value,currentRawRecord:I.value,currentRecord:C.value,currentRawPoint:M.value,currentPoint:k.value,currentMarker:N.value,currentPointMarkers:B.value,groupedMarkers:D.value,reload:P,fetchRecord:O,selectModel:H,selectRecord:q,selectPoint:j,selectMarker:ct,setReferPoint:e,addMarker:W,removeMarker:St,updateMarker:at,hasRecord:Mt,getRecord:Ot,addRecord:oe,batchAddRecords:Qt,removeRecord:tt,updateRecord:ut,findClosestBIMModel:Nt,findClosestPoint:Zt,normalizeToModelPoint:jt}));return{storeRef:dt,getStore:Re,setReady:et}}function KM(n,t){const e=y.ref(),s=y.ref(),r=y.ref(!1);function a(u,d,p){y.unref(r)||(e.value=u,s.value=d,y.unref(n)&&y.unref(t)&&p(n,t),r.value=!0)}function l(){return y.unref(y.unref(e))}function h(){return y.unref(y.unref(s))}return{register:a,getViewer:l,getMarker:h}}const{cloneDeep:gm,deepMergeProps:$M,getDiffProps:tT,delay:eT}=yt.utils;function _m(n,t){const e=y.ref(gm(Wh)),s=y.computed(()=>e.value);y.watch(()=>gm(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>M(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=JM(s,{setReferPoint:N,setRealseeState:I}),{register:h,getViewer:u,getMarker:d}=KM(s,r),{register:p,getMap:m}=qM(s,r),{register:_,getPlaybar:E}=QM(s,r);y.onMounted(S),y.onBeforeUnmount(w);async function S(){const{appSetting:B,immediate:V}=y.unref(s);B&&yt.http.setRequestGlobalConfig(B),V&&(await M(!0),await eT(0),C())}function w(){t?.("destroy")}function v(B,V){const D=tT(B,V);I(D)}function g(){return s.value}function I(B){B&&$M(e.value,B)}function C(){l(!0),t?.("ready")}async function M(B){const{searchInfo:V}=s.value;B&&V&&(await r.value?.reload(V),t?.("reload"))}function k(){const B=yt.utils.cloneDeep(s.value),V=a();if(V){const{currentModel:z,currentRecord:H,currentPoint:q}=V,{projectId:j=0,id:ct=""}=H||{},W=q?.id,St=z?.id;B.searchInfo={projectId:j,patrolId:ct,pointId:W,modelCsId:St}}const D=u();if(D){const z=yt.utils.cloneDeep(s.value.viewer),H=D.getPosition(),q=D.getZoomLevel(),{yaw:j,pitch:ct}=H||{};B.viewer={...z,defaultZoomLvl:q,defaultYaw:j,defaultPitch:ct}}d()&&(B.marker=yt.utils.cloneDeep(s.value.marker));const O=m();if(O){const{size:z,radarAngle:H,...q}=O.getState()||{};B.map={...q}}const et=E();if(et){const{showPlay:z,showSpeed:H,...q}=et.getState()||{};B.playbar={...q,showPlay:!1,showSpeed:!1}}return B}async function N(B,V){const D=a();if(D){const P=u();if(!P)return;const{viewMode:O}=P?.getState()||{};if(O!==ir.Auto)throw new yt.AppError(ze.ViewModeNoAuto,"视图预览不是自由模式");const et=D.normalizeToModelPoint(B);if(!et?.point)return;const z=D.findClosestPoint(et);if(!z?.point)return;const{zoom:H=0}=V,{yaw:q=0,pitch:j=0}=V.position||{},W={yaw:et.point.yaw-z.point.yaw+q,pitch:j};D?.selectPoint?.(z),P.setViewerStatus({position:W,zoom:H}),D.currentPoint?.id===z.id&&P.updateViewer()}}return{getProps:s,storeRef:r,registerViewer:h,registerMap:p,registerPlaybar:_,getStore:a,getViewer:u,getMarker:d,getPlaybar:E,getMap:m,getOptions:k,getState:g,setState:I}}function nT(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentMarker:M,currentPointMarkers:k}=n.value||{};return{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentPointMarkers:k,currentMarker:M}});y.watch(()=>n.value?.currentModel?.id,h,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,u,{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,d,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m,{immediate:!0});function h(E){E&&r("change-model",n.value?.currentModel)}function u(E){E&&r("change-record",n.value?.currentRecord)}function d(E,S){E&&(p(E,S),r("change-point",n.value?.currentPoint))}function p(E,S){_(S),t()?.updateViewer?.()}function m(E){if(E){const{currentRecord:S,currentRawPoint:w,selectPoint:v}=n.value;if(S?.id===w?.patrolId){const g=S?.getNearPoint(w?.rawIndex||0);g&&v?.(g)}}}function _(E){const S=t(),{moveDirection:w}=S?.getState()||{};if(w!==Yi.Stationary){const v=n.value?.currentPoint,g=n.value.currentRecord?.getPoint(E??""),I=(v?.index??0)-(g?.index??0)>=0?Yi.Forward:Yi.Backward;S?.setMoveDirection(I)}}return{getShow:a,getBindValue:l}}function iT(n,t){const{getMap:e,getViewer:s}=n;function r(){t("map-ready")}function a(){t("map-resize")}function l(_){t("map-collapse",_)}function h(){t("map-dragger")}function u(_){t("map-angle-updated",_)}function d(_,E){p(),t("map-select-point",_,E)}function p(){const{rotation:_}=e()?.getState?.()||{},E=_?void 0:Yi.Stationary;s()?.setMoveDirection(E)}return{mapEvents:{ready:r,resize:a,collapse:l,dragger:h,angleUpdated:u,selectPoint:d}}}function sT(n,t){const{getViewer:e,getPlaybar:s,setState:r}=n;function a(){t("playbar-ready")}function l(M){E(),t("playbar-slider",M)}function h(M){S(),t("playbar-backward",M)}function u(M){v(!1),t("playbar-pause",M)}function d(M){v(!0),t("playbar-play",M)}function p(M){w(),t("playbar-forward",M)}function m(M){g(M),t("playbar-speed",M)}function _(M){t("playbar-select-point",M)}function E(){const{rotation:M}=s()?.getState()||{};I(M?.slider)}function S(){const{rotation:M}=s()?.getState()||{};I(M?.backward)}function w(){const{rotation:M}=s()?.getState()||{};I(M?.forward)}function v(M){const{rotation:k}=s()?.getState()||{};I(k?.play),e()?.setState({loadingPh:M})}function g(M){const N={speed:e()?.getTransitionSpeed(M)};r({playbar:{speed:M}}),e()?.setState({defaultTransition:N})}function I(M){const k=M?void 0:Yi.Stationary;e()?.setMoveDirection(k)}return{playbarEvents:{ready:a,backward:h,pause:u,play:d,forward:p,slider:l,speed:m,selectPoint:_}}}const{delay:rT}=yt.utils;function oT(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(z){I(z),t("viewer-ready")}function h(z){t("viewer-click",z)}function u(z){M(z),t("viewer-size-updated",z)}function d(z){k(z),t("viewer-zoom-updated",z)}function p(z){N(z),t("viewer-position-updated",z,O(z))}function m(z){B(),t("viewer-panorama-loaded",z)}function _(z){t("viewer-panorama-error",z)}function E(z){V(z),t("viewer-panorama-complete")}function S(z){C(),t("viewer-mousedown",z)}function w(z){t("viewer-mouseup",z)}function v(z){t("viewer-select-point",z)}function g(z){t("viewer-select-marker",z)}function I(z){const H=z.currentTarget;D(H),P(H)}function C(z){e()?.setCollapse(!0)}function M(z){const H=z.currentTarget;e()?.setRadarHFov(H.state?.hFov??90),e()?.setCollapse(!0),P(H)}function k(z){const{state:H}=z.currentTarget;e()?.setRadarHFov(H?.hFov??90)}function N(z){e()?.setRadarYaw(z.position.yaw??0)}function B(){r()?.loadMarkers()}function V(z){z||s()?.playNext()}function D(z){const{state:H,config:q}=z,{defaultYaw:j=0,defaultPitch:ct=0}=q;a.value={yaw:j,pitch:ct},e()?.setRadarYaw(j),e()?.setRadarHFov(H?.hFov??90)}async function P(z){await rT(200);const H=z.state.size;if(H){const{style:q,offsetTop:j=0}=e()?.getState?.()||{},ct=parseInt(q?.top)||20,{width:W=0,height:St=0}=H,at=Math.min(W,St)-ct-j;e()?.setState({maxSize:at})}}function O(z){const{yaw:H,pitch:q}=z.position,{yaw:j,pitch:ct}=y.unref(a);return a.value=z.position,{yaw:H-j,pitch:q-ct}}return{viewerEvents:{ready:l,click:h,mousedown:S,mouseup:w,sizeUpdated:u,zoomUpdated:d,positionUpdated:p,panoramaLoaded:m,panoramaError:_,panoramaComplete:E,selectPoint:v,selectMarker:g}}}const aT={class:"vsleem-realsee"},vm=Pn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>nl},viewer:{},marker:{},playbar:{default:()=>_o},map:{default:()=>go},immediate:{type:Boolean,default:!0},fetchParams:{},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-record","change-point","map-ready","map-resize","map-collapse","map-dragger","map-angle-updated","map-select-point","viewer-ready","viewer-click","viewer-mousedown","viewer-mouseup","viewer-size-updated","viewer-zoom-updated","viewer-position-updated","viewer-panorama-loaded","viewer-panorama-error","viewer-panorama-complete","viewer-select-point","viewer-select-marker","playbar-ready","playbar-backward","playbar-pause","playbar-play","playbar-forward","playbar-speed","playbar-slider","playbar-select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,{registerViewer:a,registerMap:l,registerPlaybar:h,getProps:u,...d}=_m(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:S,getBindValue:w}=nT(p,m,_,E,r),{viewerEvents:v}=oT(d,r),{mapEvents:g}=iT(d,r),{playbarEvents:I}=sT(d,r);return t(d),(C,M)=>(y.openBlock(),y.createElementBlock("div",aT,[y.createVNode(mm,y.mergeProps({onRegister:y.unref(a)},y.toHandlers(y.unref(v))),null,16,["onRegister"]),y.unref(u).map&&y.unref(S)?(y.openBlock(),y.createBlock(Yh,y.mergeProps({key:0,onRegister:y.unref(l)},y.toHandlers(y.unref(g))),{extra:y.withCtx(k=>[y.renderSlot(C.$slots,"mapExtra",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),left:y.withCtx(k=>[y.renderSlot(C.$slots,"mapLeft",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),right:y.withCtx(k=>[y.renderSlot(C.$slots,"mapRight",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),default:y.withCtx(k=>[y.renderSlot(C.$slots,"mapDefault",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.unref(u).playbar&&y.unref(S)?(y.openBlock(),y.createBlock(Qh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(I))),{slider:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarSlider",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),box:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarBox",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),caption:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarCaption",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),button:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarButton",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),default:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarDefault",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.renderSlot(C.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0)]))}}),[["__scopeId","data-v-06733ad1"]]);Ae.APP_SETTING=zh,Ae.DirectionMoveEnum=Yi,Ae.MAP_CONFIG=go,Ae.MAP_GEO_OPTIONS=Vh,Ae.MARKER_CONFIG=Gh,Ae.Map=Yh,Ae.PLAYBAR_CONFIG=_o,Ae.Playbar=Qh,Ae.REALSEE_CONFIG=Wh,Ae.REALSEE_SETTING=nl,Ae.Realsee=vm,Ae.RealseeErrorCode=ze,Ae.RealseePlugin=vm,Ae.TILE_LAYERS=el,Ae.TRACK_COLOR_LIST=Fh,Ae.TrackMarker=no,Ae.TrackPoint=gs,Ae.TrackRecord=ar,Ae.TrackRecordTypeEnum=Jp,Ae.VIEWER_CONFIG=Hh,Ae.ViewModeEnum=ir,Ae.Viewer=mm,Ae.useRealsee=_m,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})}));
3951
+ */const{sin:Tn,cos:AM,sqrt:fh,abs:Ca,PI:un}=Math,Kp=6378245,$p=.006693421622965823;function tm(n,t){return n>=72.004&&n<=137.8347&&t>=.8293&&t<=55.8271}function CM(n,t){let e=-100+2*n+3*t+.2*t*t+.1*n*t+.2*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(t*un)+40*Tn(t/3*un))*2/3,e+=(160*Tn(t/12*un)+320*Tn(t*un/30))*2/3,e}function PM(n,t){let e=300+n+2*t+.1*n*n+.1*n*t+.1*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(n*un)+40*Tn(n/3*un))*2/3,e+=(150*Tn(n/12*un)+300*Tn(n/30*un))*2/3,e}function RM(n,t){let e=PM(n-105,t-35),s=CM(n-105,t-35);const r=t/180*un;let a=Tn(r);a=1-$p*a*a;const l=fh(a);return e=e*180/(Kp/l*AM(r)*un),s=s*180/(Kp*(1-$p)/(a*l)*un),[e,s]}function qi(n){const[t,e]=n;if(!tm(t,e))return[t,e];const s=RM(t,e);return[t+s[0],e+s[1]]}function sr(n){const[t,e]=n;if(!tm(t,e))return[t,e];let[s,r]=[t,e],a=qi([s,r]),l=a[0]-t,h=a[1]-e;for(;Ca(l)>1e-6||Ca(h)>1e-6;)s-=l,r-=h,a=qi([s,r]),l=a[0]-t,h=a[1]-e;return[s,r]}const{sin:Pa,cos:Ra,atan2:em,sqrt:nm,PI:LM}=Math,La=LM*3e3/180;function rr(n){const[t,e]=n,s=t-.0065,r=e-.006,a=nm(s*s+r*r)-2e-5*Pa(r*La),l=em(r,s)-3e-6*Ra(s*La),h=a*Ra(l),u=a*Pa(l);return[h,u]}function or(n){const[t,e]=n,s=t,r=e,a=nm(s*s+r*r)+2e-5*Pa(r*La),l=em(r,s)+3e-6*Ra(s*La),h=a*Ra(l)+.0065,u=a*Pa(l)+.006;return[h,u]}const im=180/Math.PI,sm=Math.PI/180,Ia=6378137,Qi=20037508342789244e-9;function Da(n){return[n[0]*im/Ia,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/Ia)))*im]}function ka(n){const t=Math.abs(n[0])<=180?n[0]:n[0]-(n[0]<0?-1:1)*360,e=[Ia*t*sm,Ia*Math.log(Math.tan(Math.PI*.25+.5*n[1]*sm))];return e[0]>Qi&&(e[0]=Qi),e[0]<-Qi&&(e[0]=-Qi),e[1]>Qi&&(e[1]=Qi),e[1]<-Qi&&(e[1]=-Qi),e}const{abs:Ua}=Math,rm=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],om=[75,60,45,30,15,0],IM=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],DM=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]];function am(n,t,e){const s=Ua(t)/e[9];let r=e[0]+e[1]*Ua(n),a=e[2]+e[3]*s+e[4]*Math.pow(s,2)+e[5]*Math.pow(s,3)+e[6]*Math.pow(s,4)+e[7]*Math.pow(s,5)+e[8]*Math.pow(s,6);return r*=n<0?-1:1,a*=t<0?-1:1,[r,a]}function Oa(n){const[t,e]=n;let s=[];for(let r=0;r<om.length;r++)if(Ua(e)>om[r]){s=DM[r];break}return am(t,e,s)}function Na(n){const[t,e]=n;let s=[];for(let r=0;r<rm.length;r++)if(Ua(e)>=rm[r]){s=IM[r];break}return am(t,e,s)}function ji(n,t){if(!n)throw new Error(t)}function lm(n){return!!n&&Object.prototype.toString.call(n)==="[object Array]"}function cm(n){return!isNaN(Number(n))&&n!==null&&!lm(n)}function Un(...n){const t=n.length-1;return function(...e){let s=t,r=n[t].apply(null,e);for(;s--;)r=n[s].call(null,r);return r}}function hm(n,t,e=!1){if(n===null)return;let s,r,a,l,h,u,d=0,p=0,m,_;const{type:E}=n,S=E==="FeatureCollection",w=E==="Feature",v=S?n.features.length:1;for(let g=0;g<v;g++){m=S?n.features[g].geometry:w?n.geometry:n,_=m?m.type==="GeometryCollection":!1,u=_?m.geometries.length:1;for(let I=0;I<u;I++){let C=0,M=0;if(l=_?m.geometries[I]:m,l===null)continue;const k=l.type;switch(d=e&&(k==="Polygon"||k==="MultiPolygon")?1:0,k){case null:break;case"Point":if(h=l.coordinates,t(h,p,g,C,M)===!1)return!1;p++,C++;break;case"LineString":case"MultiPoint":for(h=l.coordinates,s=0;s<h.length;s++){if(t(h[s],p,g,C,M)===!1)return!1;p++,k==="MultiPoint"&&C++}k==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(h=l.coordinates,s=0;s<h.length;s++){for(r=0;r<h[s].length-d;r++){if(t(h[s][r],p,g,C,M)===!1)return!1;p++}k==="MultiLineString"&&C++,k==="Polygon"&&M++}k==="Polygon"&&C++;break;case"MultiPolygon":for(h=l.coordinates,s=0;s<h.length;s++){for(M=0,r=0;r<h[s].length;r++){for(a=0;a<h[s][r].length-d;a++){if(t(h[s][r][a],p,g,C,M)===!1)return!1;p++}M++}C++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)if(hm(l.geometries[s],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}var Be;(function(n){n.WGS84="WGS84",n.WGS1984="WGS84",n.EPSG4326="WGS84",n.GCJ02="GCJ02",n.AMap="GCJ02",n.BD09="BD09",n.BD09LL="BD09",n.Baidu="BD09",n.BMap="BD09",n.BD09MC="BD09MC",n.BD09Meter="BD09MC",n.EPSG3857="EPSG3857",n.EPSG900913="EPSG3857",n.EPSG102100="EPSG3857",n.WebMercator="EPSG3857",n.WM="EPSG3857"})(Be||(Be={}));const kM={to:{[Be.GCJ02]:qi,[Be.BD09]:Un(or,qi),[Be.BD09MC]:Un(Oa,or,qi),[Be.EPSG3857]:ka}},UM={to:{[Be.WGS84]:sr,[Be.BD09]:or,[Be.BD09MC]:Un(Oa,or),[Be.EPSG3857]:Un(ka,sr)}},OM={to:{[Be.WGS84]:Un(sr,rr),[Be.GCJ02]:rr,[Be.EPSG3857]:Un(ka,sr,rr),[Be.BD09MC]:Oa}},NM={to:{[Be.WGS84]:Da,[Be.GCJ02]:Un(qi,Da),[Be.BD09]:Un(or,qi,Da),[Be.BD09MC]:Un(Oa,or,qi,Da)}},BM={to:{[Be.WGS84]:Un(sr,rr,Na),[Be.GCJ02]:Un(rr,Na),[Be.EPSG3857]:Un(ka,sr,rr,Na),[Be.BD09]:Na}};var FM={WGS84:kM,GCJ02:UM,BD09:OM,EPSG3857:NM,BD09MC:BM};function zM(n,t,e){if(ji(!!n,"The args[0] input coordinate is required"),ji(!!t,"The args[1] original coordinate system is required"),ji(!!e,"The args[2] target coordinate system is required"),t===e)return n;const s=FM[t];ji(!!s,`Invalid original coordinate system: ${t}`);const r=s.to[e];ji(!!r,`Invalid target coordinate system: ${e}`);const a=typeof n;if(ji(a==="string"||a==="object",`Invalid input coordinate type: ${a}`),a==="string")try{n=JSON.parse(n)}catch{throw new Error(`Invalid input coordinate: ${n}`)}let l=!1;lm(n)&&(ji(n.length>=2,`Invalid input coordinate: ${n}`),ji(cm(n[0])&&cm(n[1]),`Invalid input coordinate: ${n}`),n=n.map(Number),l=!0);const h=r;return l?h(n):(hm(n,u=>{[u[0],u[1]]=h(u)}),n)}const um=Object.assign(Object.assign({},Be),{CRSTypes:Be,transform:zM});class ar{id="";coordinateId=0;coordinate=new yt.Coordinate;trackPoints=new Map;trackMarkers=new Map;relativePosition;projectId;createTime;color;type;panoramaSize;realseeSetting;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static async parsedModel(t,e,s){const{coordinateId:r,relativePosition:a,trackList:l,markerList:h,...u}=t,d=yt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(yt.RelativeMap.isValid(a)){const S=yt.RelativeMap.toParse(a);E=new yt.Coordinate({parent:E,type:yt.CoordinateType.Data,relativeMap:S})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await k_(l?.[0]?.img,s);d.panoramaSize=E;const S=new Map;for(const w of l){const v=gs.parsedModel({...w,patrolId:p,color:_},m,E,s);v.id&&S.set(v.id,new gs(v))}d.trackPoints=S}if(h?.length&&e){const E=new Map;for(const S of h){const w=no.parsedModel({...S,patrolId:p},e);w.id&&E.set(w.id,new no(w))}d.trackMarkers=E}return d}hasPoint(t){return this?.trackPoints?.has(t)}getPoint(t){return this?.trackPoints?.get(t)}getNearPoint(t){const e=Array.from(this?.trackPoints?.values()),s=e[0],r=e[e.length-1];return t<=(s.rawIndex??0)?s:t>=(r.rawIndex??0)?r:e.find(a=>(a.rawIndex??0)>=t)}hasMarker(t){return this?.trackMarkers?.has(t)}getMarker(t){return this?.trackMarkers?.get(t)}getPointMarkers(t){return Array.from(this?.trackMarkers?.values()).filter(e=>e.pointId===t)}projection(t,e,s){const{coordinate:r,trackPoints:a,trackMarkers:l}=this||{};if(!r||!a?.size)return;const h=r.getDestRelativeMap(t),u=r.getDestRelativeMap(e);if(!h||!u)return;const d=Array.from(l?.values()),p={srcToDstRelativeMap:h,srcCoordinate:r,dstCoordinate:t},m={srcToDstRelativeMap:u,srcCoordinate:r,dstCoordinate:e},{pointLax:_=0,trackCRSType:E}=s||{},S=new Map;let w;for(const g of a.values()){const I=g.projection(p,m);if(!I)continue;if(I.index=S.size,r.modelType===yt.CoordinateModelType.GeoModel){const{point:M}=I;if(E&&M){const[k,N]=um.transform([M.lon,M.lat],um.WGS84,E);I.point=new yt.Point({...M,lon:k,lat:N})}}if(_<=0){S.set(I.id,I);continue}if(d.find(M=>M.pointId===I.id)){S.set(I.id,I),w=I;continue}if(!S.size){S.set(I.id,I),w=I;continue}I.position&&w?.position&&yt.Point.dist(I.position,w.position)>=_&&(S.set(I.id,I),w=I)}const v=new ar(this);return v.trackPoints=S,v.coordinate=t,v.realseeSetting=s,v}getPathMarkers(t){const{pointType:e=Aa.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===Aa.NUMBER?l=this.getPointsByNumber(a,s):e===Aa.DISTANCE&&(l=this.getPointsByDistance(a,r)),this.createPathMarkers(a,l)}getPointsByDistance(t,e){if(!t.position||e<=0)return[];const{x:s,y:r}=t.position;return Array.from(this.trackPoints.values()).filter(a=>!a.position||!t.position||Math.abs(a.position.x-s)>e||Math.abs(a.position.y-r)>e?!1:yt.Point.dist(a.position,t.position)<=e)}getPointsByNumber(t,e){const s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}createPathMarkers(t,e){const{pathPin:s,pathRedPin:r}=this.realseeSetting||{},a=t.position;if(!a)return[];const l=[];for(const h of e){const u=h.position;if(!u)continue;const{d,yaw:p,pitch:m}=gs.toSphericalCoord(a,u);if(d===0)continue;const _=Math.min(120/(d/2e3),120),E=this.getPointMarkers(h.id).length>0;l.push({id:h.id,image:E?r:s,position:new yt.Position({yaw:p,pitch:m}),data:{...h,markerType:dh.pin},size:{width:_,height:_/2},hoverScale:{amount:1},opacity:.8,anchor:"center center"})}return l}getViolationMarkers(t){if(!t)return[];const e=this.getPointMarkers(t.id);return this.createViolationMarkers(e)}createViolationMarkers(t){return t.map((e,s)=>({id:e.id,image:e.markerIcon,position:e.perspective||new yt.Position({yaw:yt.Point.toDegrees(10)*s,pitch:0}),data:{...e,markerType:e.markerType},size:{width:50,height:50},hoverScale:{amount:1},opacity:.8,anchor:"bottom center"}))}getPreloadPoints(t){if(!t)return[];const{preloadStep:e=5}=this.realseeSetting||{},s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}}const{cloneDeep:dm,deepMergeProps:HM,getDiffProps:VM,delay:fm}=yt.utils;function GM(n,t,e,s,r){const a=y.ref(),l=y.ref(!1),h=new Map,u=new Map,d=y.ref(dm(Hh)),p=y.computed(()=>d.value),m=y.ref(),_=y.computed(()=>{const{currentRecord:ft}=y.unref(t)||{};return Array.from(ft?.trackPoints?.values()||[])});y.watch(()=>dm(n.value?.viewer),E,{immediate:!0,deep:!0});function E(ft,T){const Z=VM(ft,T);w(Z)}function S(){return p.value}function w(ft){ft&&HM(d.value,ft)}function v(){e.value?.addEventListener(Yt.ReadyEvent.type,I),e.value?.addEventListener(Yt.ClickEvent.type,C),e.value?.addEventListener(Yt.SizeUpdatedEvent.type,M),e.value?.addEventListener(Yt.PositionUpdatedEvent.type,k),e.value?.addEventListener(Yt.ZoomUpdatedEvent.type,N),e.value?.addEventListener(Yt.PanoramaLoadedEvent.type,B),e.value?.addEventListener(Yt.PanoramaErrorEvent.type,V),e.value?.container?.addEventListener("mousedown",D),e.value?.container?.addEventListener("touchstart",D),e.value?.container?.addEventListener("mouseup",U),e.value?.container?.addEventListener("touchend",U),e.value?.container?.addEventListener("mouseover",tt),e.value?.container?.addEventListener("mouseout",F)}function g(){}function I(ft){r("ready",ft)}function C(ft){r("click",ft)}function M(ft){r("size-updated",ft)}function k(ft){r("position-updated",ft)}function N(ft){r("zoom-updated",ft)}function B(ft){r("panorama-loaded",ft)}function V(ft){r("panorama-error",ft)}function R(ft){r("panorama-complete",ft)}function D(ft){r("mousedown",ft)}function U(ft){r("mouseup",ft)}function tt(ft){Mt(!0)}function F(ft){Mt(!1)}async function H(ft,T){if(l.value){a.value={currentPoint:ft,options:T};return}try{l.value=!0;const{maxRetries:Z,retryDelay:$}=n_;for(let ht=0;ht<Z;ht++)try{await q(ft,T),await j(ft.panorama);break}catch(rt){const Tt=$*Math.pow(1.5,ht);console.warn(`${Tt}ms 后开始第${ht+2}次重试:`,rt),await fm(Tt)}}finally{l.value=!1,W(),ct(),R(a.value)}}async function q(ft,T){const{loadingPh:Z=!1}=p.value,{panorama:$,placeholderImg:ht}=ft;ht&&!Z?(await e.value?.setPanorama(ht,T),await e.value?.setPanorama($,{showLoader:!1})):await e.value?.setPanorama($,T)}async function j(ft){if(yt.utils.isObject(ft)){const T=ft.tileUrl(Math.floor(ft.cols/2),0);if(T){const Z=await fetch(T);if(Z.ok)return await Z.blob()}}}async function ct(){if(await fm(10),a.value){const{currentPoint:ft,options:T}=a.value;a.value=void 0,H(ft,T)}}async function W(){const{loadingPh:ft=!1}=p.value,{currentPoint:T,currentRecord:Z}=t.value||{};if(!T||!Z)return;const $=Z.getPreloadPoints(T);for(const ht of $){const{panorama:rt,placeholderImg:Tt}=ht;if(!rt||h.has(ht.id))continue;const pt=yt.utils.isObject(rt)?[rt.baseUrl,rt.tileUrl(Math.floor(rt.cols/2),0)]:ft?[rt]:[rt,Tt].filter(Boolean);u.set(ht.id,ht.id),Promise.all(pt.map(At=>fetch(At).then(ne=>{if(!ne.ok)throw new Error(`HTTP ${ne.status}`);return ne}))).then(()=>{h.set(ht.id,ht.id)}).catch(()=>{}).finally(()=>{u.delete(ht.id)})}}function Et(){lt()}function lt(){const{handleViolationMarkerFn:ft,handlePathMarkerFn:T}=y.unref(n)?.marker||{},{currentPoint:Z,currentRecord:$,currentMarker:ht}=y.unref(t)||{};if(Z&&$){const rt=$?.getPathMarkers(Z)?.map(At=>T?.(At)||At),Tt=$?.getViolationMarkers(Z)?.map(At=>ft?.(At)||At),pt=[...rt,...Tt];if(y.unref(s)?.setMarkers(pt),ht){const At=Tt.find(ne=>ne.data.id===ht.id);if(!At)return;y.unref(s)?.gotoMarker(At.id,100)}}}function Mt(ft){w({mouseover:ft})}function Ot(ft){w({mousedown:ft})}function oe(){return y.unref(d)?.mouseover??!1}function Qt(){return y.unref(d)?.mousedown??!1}function et(ft){w({moveDirection:ft})}function ut(ft){m.value=ft}async function _t(){const{currentPoint:ft}=y.unref(t)||{};if(ft){const T=Nt(ft);m.value=void 0,await H(ft,T)}}function Nt(ft){const{defaultTransition:T}=p.value,Z={showLoader:!1,transition:T},$=jt(ft);return{...Z,...m.value,...$?{position:$}:{}}}function Zt(ft){return Math.max(50,Math.min(1e3,ft-100))}function jt(ft,T){const{viewMode:Z,moveDirection:$=1,moveThresh:ht=0}=p.value;if(!ft||Z===ir.Auto||$===Yi.Stationary)return;const rt=e.value?.getPosition()?.yaw??0,Tt=T??ht;if(Z===ir.FollowView){const pt=ft.point.yaw??0;return Math.abs(pt-rt)>=Tt?{yaw:pt,pitch:0}:void 0}if(Z===ir.FollowRoad){const{index:pt=0,point:At}=ft,ne=_.value[pt+$]?.point;if(!At||!ne)return;const de=gs?.toSphericalCoord(At,ne);if(!de)return;const O=de.yaw??0;if(Math.abs(O-rt)>=Tt)return{yaw:O,pitch:0}}}return{getProps:p,viewerAction:{getState:S,setState:w,isMouseover:oe,isMousedown:Qt,setMousedown:Ot,setMouseover:Mt,setPanoramaPath:H,setViewerStatus:ut,setMoveDirection:et,updateMarkers:lt,preloadPanorama:W,loadMarkers:Et,updateViewer:_t,getPanoramaOptions:Nt,getTransitionSpeed:Zt,getMovePosition:jt},handleViewerEvents:v,handleViewerUnEvents:g}}const{cloneDeep:pm,deepMergeProps:WM,getDiffProps:ZM}=yt.utils;function XM(n,t,e,s,r){const a=y.ref(pm(Gh)),l=y.computed(()=>a.value);y.watch(()=>pm(n.value?.marker),h,{immediate:!0,deep:!0});function h(E,S){const w=ZM(E,S);u(w)}function u(E){E&&WM(a.value,E)}function d(){y.unref(s)?.addEventListener(xp.SelectMarkerEvent.type,m)}function p(){}async function m(E){const{id:S,data:w}=E.marker.config,{onPointChange:v,onMarkerChange:g}=l.value;w.markerType==dh.pin?(await v?.(E),y.unref(t)?.selectPoint(w),r("select-point",w)):(await g?.(E),y.unref(s)?.gotoMarker(S,500),y.unref(t)?.selectMarker(w),r("select-marker",w))}return{getProps:l,markerAction:{},handleMarkerEvents:d,handleMarkerUnEvents:p}}const YM={class:"vsleem-viewer"},mm=Pn(y.defineComponent({name:"Viewer",__name:"Viewer",emits:["register","ready","click","mousedown","mouseup","size-updated","zoom-updated","position-updated","panorama-loaded","panorama-error","panorama-complete","select-point","select-marker"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(""),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(h))),p=y.computed(()=>y.unref(y.unref(u))),{getProps:m,handleViewerEvents:_,viewerAction:E}=GM(d,p,r,a,s),{handleMarkerEvents:S,markerAction:w}=XM(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(k),y.onBeforeUnmount(C);function v(N){N&&(g(),_(),S())}function g(){const{currentPoint:N}=p.value;if(y.unref(r)||!N)return;const B=I(),V=new GS(B),R=V.getPlugin(jp);r.value=Object.assign(V,E),a.value=Object.assign(R,w)}function I(){const{currentPoint:N}=p.value,{rotate:B}=d.value?.searchInfo||{},V=B??E.getMovePosition(N,0);V&&E.setState({defaultYaw:V.yaw,defaultPitch:V.pitch});let R;yt.utils.isObject(N?.panorama)&&(R=eM);const{viewMode:D,moveThresh:U,moveDirection:tt,mousedown:F,mouseover:H,loadingPh:q,...j}=m.value;return{...j,container:l.value,panorama:N?.panorama,adapter:R,plugins:[[jp,[]]]}}function C(){r.value?.destroy()}function M(N,B){h.value=N,u.value=B}function k(){s("register",r,a,M)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(N,B)=>(y.openBlock(),y.createElementBlock("div",YM,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-a7047295"]]);function qM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getMap:a}}function QM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getPlaybar:a}}function jM(n,t){return yt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:yt.RequestMethod.GET,params:n},t)}function JM(n,t){const{setReferPoint:e,setRealseeState:s}=t,r=y.reactive(new Map),a=y.ref(),l=y.ref(),h=y.ref(),u=y.reactive(new Map),d=y.ref(!1),p=y.ref(!1),m=y.ref(),_=y.ref(),E=y.ref(),S=y.ref(),w=y.computed(()=>l.value?.findCsById(m.value)),v=y.computed(()=>w.value?.findParentSpace()),g=y.computed(()=>yt.Coordinate.getCommonCoordinate(Array.from(u.values(),T=>T.coordinate))),I=y.computed(()=>u.get(_.value??"")),C=y.computed(()=>V.value.get(_.value??"")),M=y.computed(()=>I.value?.getPoint(E.value??"")),k=y.computed(()=>C.value?.getPoint(E.value??"")),N=y.computed(()=>C.value?.getMarker(S.value??"")),B=y.computed(()=>C.value?.getPointMarkers(k.value?.id??"")||[]),V=y.computed(()=>{const T=new Map;if(!w.value||!g.value)return T;for(const Z of u.values()){const $=Z.projection(w.value,g.value,n.value.realseeSetting);$&&T.set($.id,$)}return T}),R=y.computed(()=>{const T=new Map;if(!V.value.size)return T;for(const Z of V.value.values()){const{trackMarkers:$}=Z;for(const ht of $.values()){const rt=Z.getPoint(ht.pointId);if(rt){const Tt=T.get(rt)??[];Tt.push(ht),Tt.length===1&&T.set(rt,Tt)}}}return T});async function D(T){const{projectId:Z,patrolId:$}=T||{},ht=$?Array.isArray($)?$:[$]:[];try{if(!Z||!ht.length)throw new yt.AppError(ze.StoreMissParams,"缺少必要的查询参数");if(d.value=!0,Z!=l.value?.projectId){const[ne,de]=await Promise.all([yt.DataSource.getProjectDetail(Z),yt.DataSource.getCoordinateTree(Z)]);if(!ne)throw new yt.AppError(ze.StoreNoProjectDetail,`未查询到项目ID为 ${Z} 的项目详情`);const{tileLayers:O=[]}=n.value.map||{};if(O.length){const b=O[O.length-1]||{},J=yt.utils.getMapProvider(b?.url),ot=J?.CRSTypes?.[ne.mapArea??0];ot&&ot!==yt.CRSTypes.WGS84&&(ne.CRSType=ot,ne.mapType=J.name,s({realseeSetting:{trackCRSType:ot}}))}if(a.value=ne,!de)throw new yt.AppError(ze.StoreNoCSTree,`未查询到项目ID为 ${Z} 的坐标系树`);l.value=de}const[rt,...Tt]=ht,pt=await U(rt);if(!pt)return;const At=pt.coordinate.findChildModel([yt.CoordinateModelType.CADModel,yt.CoordinateModelType.GeoModel]);if(At?.modelType===yt.CoordinateModelType.CADModel&&!At?.modelValue)throw new yt.AppError(ze.StroeNoModelValue,`没有找到当前坐标系${At?.id||""}的modelKey字段值`);h.value=At?.getMappedCsTree(),u.clear(),u.set(pt.id,pt),F({modelCsId:At?.id,...T}),Qt(Tt)}catch(rt){console.error(rt),n.value.fetchError?.(rt)}finally{d.value=!1}}async function U(T){try{let Z=r.get(T);if(Z||(Z=await jM({...n.value.fetchParams,id:T}),Z&&r.set(T,Z)),!Z)throw new yt.AppError(ze.StoreNoRecord,`未查询到ID为 ${T} 的巡检记录`);Z=await n.value.handleResponseFn?.(Z)||Z;const $=_t();Z.color=Z.color||$;const{appSetting:ht}=n.value,rt=await ar.parsedModel(Z,l.value,ht);if(!rt?.trackPoints?.size||!rt.coordinate)throw new yt.AppError(ze.StoreInvRecord,`ID为 ${T} 是无效的巡检记录`);let Tt;if(d.value?Tt=l.value?.findCsById(rt.coordinateId):h.value&&(Tt=h.value.findCsById(rt.coordinateId)),!Tt)throw new yt.AppError(ze.StoreRecordOutCSTree,`ID为 ${T} 的巡检记录不在映射坐标系树内`);if(Tt?.modelType===yt.CoordinateModelType.GeoModel){const At=l.value?.findClosestModel(yt.CoordinateModelType.GeoModel);if(At&&!At.relativeMap?.refPoint){const ne=Array.from(rt.trackPoints.values()),de=new yt.GeoPoint(ne[0].point),O=new yt.RelativeMap({refPoint:de});At.setOptions({relativeMap:O})}}const pt=new ar(rt);return n.value.fetchSuccess?.(pt,l.value),pt}catch(Z){console.error(Z),n.value.fetchError?.(Z)}}function tt(T=!1){p.value=T}function F(T){const{patrolId:Z,pointId:$,modelCsId:ht,pointIndex:rt}=T,Tt=Z?Array.isArray(Z)?Z:[Z]:[];ht&&(m.value=ht);let pt=u.get(C.value?.id??"")||u.get(Tt[0]);if(pt){const At=Array.from(pt.trackPoints.values()),ne=pt.trackPoints.get(k.value?.id??"")||pt.trackPoints.get($??"")||At.find(de=>de.rawIndex===rt)||At[0];_.value=pt.id,E.value=ne?.id}}function H(T){const{id:Z}=T;if(h.value?.findCsById(Z)?.type===yt.CoordinateType.Model)m.value=Z;else throw new yt.AppError(ze.StoreNoCSByID,`ID为 ${Z} 的模型坐标系不在映射坐标系树内`)}function q(T){const Z=Ot(T.id??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${T.id} 的巡检记录`);const $=Array.from(Z.trackPoints.values());_.value=Z.id,E.value=$[0]?.id}function j(T){const{patrolId:Z,id:$=""}=T,ht=Ot(Z??"");if(!ht)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${Z} 的巡检记录`);if(!ht?.hasPoint($))throw new yt.AppError(ze.StoreSelectNoPoint,`未找到ID为 ${$} 的轨迹点`);_.value=ht.id,E.value=$}function ct(T){if(T){const{patrolId:Z,id:$=""}=T,ht=Ot(Z??"");if(!ht)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${Z} 的巡检记录`);if(!ht?.hasMarker($))throw new yt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${$} 的问题标记`);S.value=$}else S.value=void 0}function W(T){const Z=u.get(T.patrolId);if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);Z.trackMarkers.set(T.id,T)}function Et(T){const Z=u.get(T.patrolId??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);Z.trackMarkers.delete(T.id??"")}function lt(T){const Z=u.get(T.patrolId??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${T.patrolId} 的巡检记录`);const $=Z.trackMarkers.get(T.id??"");if(!$)throw new yt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${T.id} 的问题标记`);Object.assign($,T)}function Mt(T){return V.value.has(T)}function Ot(T){return V.value.get(T)}async function oe(T){if(!u.has(T)){const Z=await U(T);if(Z){const $=new ar(Z);return u.set($.id,$),$}}}async function Qt(T){if(T.length)for(const Z of T)await oe(Z)}function et(T){if(C.value?.id===T)throw new yt.AppError(ze.StoreSelectedMarker,`ID为 ${T} 的巡检记录正在被使用,无法删除`);return u.delete(T)}async function ut(T){const Z=u.get(T.id??"");if(!Z)throw new yt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${T.id} 的巡检记录`);Object.assign(Z,T)}function _t(){const T=d.value?[]:Array.from(u.values()).map($=>$.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find($=>!T.includes($?.toUpperCase?.()))}function Nt(){return w.value?.findClosestModel(yt.CoordinateModelType.BIMModel)}function Zt(T){let Z=1/0,$;if(T.position){for(const ht of V.value.values())if(ht.trackPoints?.size)for(const rt of ht.trackPoints.values()){if(!rt.position)continue;const Tt=yt.Point.dist(T.position,rt.position);if(Tt===0){Z=Tt,$=rt;break}Tt<Z&&(Z=Tt,$=rt)}if($)return $}}function jt(T){if(!w.value||!g.value||!T)return;const Z=l.value?.findCsById(T.coordinate.id);if(!Z)return;const $=Z?.getDestRelativeMap(w.value),ht=Z?.getDestRelativeMap(g.value);if(!$||!ht)return;const rt={srcToDstRelativeMap:$,srcCoordinate:Z,dstCoordinate:w.value},Tt={srcToDstRelativeMap:ht,srcCoordinate:Z,dstCoordinate:g.value};return T.projection(rt,Tt)}function Re(){return ft.value}const ft=y.computed(()=>({ready:p.value,reloading:d.value,rawDataSource:u,currentProject:a.value,coordinateTree:l.value,mappedCoordinateTree:h.value,dataSource:V.value,comCoordinate:g.value,currentModel:w.value,currentSpace:v.value,currentRawRecord:I.value,currentRecord:C.value,currentRawPoint:M.value,currentPoint:k.value,currentMarker:N.value,currentPointMarkers:B.value,groupedMarkers:R.value,reload:D,fetchRecord:U,selectModel:H,selectRecord:q,selectPoint:j,selectMarker:ct,setReferPoint:e,addMarker:W,removeMarker:Et,updateMarker:lt,hasRecord:Mt,getRecord:Ot,addRecord:oe,batchAddRecords:Qt,removeRecord:et,updateRecord:ut,findClosestBIMModel:Nt,findClosestPoint:Zt,normalizeToModelPoint:jt}));return{storeRef:ft,getStore:Re,setReady:tt}}function KM(n,t){const e=y.ref(),s=y.ref(),r=y.ref(!1);function a(u,d,p){y.unref(r)||(e.value=u,s.value=d,y.unref(n)&&y.unref(t)&&p(n,t),r.value=!0)}function l(){return y.unref(y.unref(e))}function h(){return y.unref(y.unref(s))}return{register:a,getViewer:l,getMarker:h}}const{cloneDeep:gm,deepMergeProps:$M,getDiffProps:tT,delay:eT}=yt.utils;function _m(n,t){const e=y.ref(gm(Wh)),s=y.computed(()=>e.value);y.watch(()=>gm(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>M(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=JM(s,{setReferPoint:N,setRealseeState:I}),{register:h,getViewer:u,getMarker:d}=KM(s,r),{register:p,getMap:m}=qM(s,r),{register:_,getPlaybar:E}=QM(s,r);y.onMounted(S),y.onBeforeUnmount(w);async function S(){const{appSetting:B,immediate:V}=y.unref(s);B&&yt.http.setRequestGlobalConfig(B),V&&(await M(!0),await eT(0),C())}function w(){t?.("destroy")}function v(B,V){const R=tT(B,V);I(R)}function g(){return s.value}function I(B){B&&$M(e.value,B)}function C(){l(!0),t?.("ready")}async function M(B){const{searchInfo:V}=s.value;B&&V&&(await r.value?.reload(V),t?.("reload"))}function k(){const B=yt.utils.cloneDeep(s.value),V=a();if(V){const{currentModel:F,currentRecord:H,currentPoint:q}=V,{projectId:j=0,id:ct=""}=H||{},W=q?.id,Et=F?.id;B.searchInfo={projectId:j,patrolId:ct,pointId:W,modelCsId:Et}}const R=u();if(R){const F=yt.utils.cloneDeep(s.value.viewer),H=R.getPosition(),q=R.getZoomLevel(),{yaw:j,pitch:ct}=H||{};B.viewer={...F,defaultZoomLvl:q,defaultYaw:j,defaultPitch:ct}}d()&&(B.marker=yt.utils.cloneDeep(s.value.marker));const U=m();if(U){const{size:F,radarAngle:H,...q}=U.getState()||{};B.map={...q}}const tt=E();if(tt){const{showPlay:F,showSpeed:H,...q}=tt.getState()||{};B.playbar={...q,showPlay:!1,showSpeed:!1}}return B}async function N(B,V){const R=a();if(R){const D=u();if(!D)return;const{viewMode:U}=D?.getState()||{};if(U!==ir.Auto)throw new yt.AppError(ze.ViewModeNoAuto,"视图预览不是自由模式");const tt=R.normalizeToModelPoint(B);if(!tt?.point)return;const F=R.findClosestPoint(tt);if(!F?.point)return;const{zoom:H=0}=V,{yaw:q=0,pitch:j=0}=V.position||{},W={yaw:tt.point.yaw-F.point.yaw+q,pitch:j};R?.selectPoint?.(F),D.setViewerStatus({position:W,zoom:H}),R.currentPoint?.id===F.id&&D.updateViewer()}}return{getProps:s,storeRef:r,registerViewer:h,registerMap:p,registerPlaybar:_,getStore:a,getViewer:u,getMarker:d,getPlaybar:E,getMap:m,getOptions:k,getState:g,setState:I}}function nT(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentMarker:M,currentPointMarkers:k}=n.value||{};return{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentPointMarkers:k,currentMarker:M}});y.watch(()=>n.value?.currentModel?.id,h,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,u,{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,d,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m,{immediate:!0});function h(E){E&&r("change-model",n.value?.currentModel)}function u(E){E&&r("change-record",n.value?.currentRecord)}function d(E,S){E&&(p(E,S),r("change-point",n.value?.currentPoint))}function p(E,S){_(S),t()?.updateViewer?.()}function m(E){if(E){const{currentRecord:S,currentRawPoint:w,selectPoint:v}=n.value;if(S?.id===w?.patrolId){const g=S?.getNearPoint(w?.rawIndex||0);g&&v?.(g)}}}function _(E){const S=t(),{moveDirection:w}=S?.getState()||{};if(w!==Yi.Stationary){const v=n.value?.currentPoint,g=n.value.currentRecord?.getPoint(E??""),I=(v?.index??0)-(g?.index??0)>=0?Yi.Forward:Yi.Backward;S?.setMoveDirection(I)}}return{getShow:a,getBindValue:l}}function iT(n,t){const{getMap:e,getViewer:s}=n;function r(){t("map-ready")}function a(){t("map-resize")}function l(_){t("map-collapse",_)}function h(){t("map-dragger")}function u(_){t("map-angle-updated",_)}function d(_,E){p(),t("map-select-point",_,E)}function p(){const{rotation:_}=e()?.getState?.()||{},E=_?void 0:Yi.Stationary;s()?.setMoveDirection(E)}return{mapEvents:{ready:r,resize:a,collapse:l,dragger:h,angleUpdated:u,selectPoint:d}}}function sT(n,t){const{getViewer:e,getPlaybar:s,setState:r}=n;function a(){t("playbar-ready")}function l(M){E(),t("playbar-slider",M)}function h(M){S(),t("playbar-backward",M)}function u(M){v(!1),t("playbar-pause",M)}function d(M){v(!0),t("playbar-play",M)}function p(M){w(),t("playbar-forward",M)}function m(M){g(M),t("playbar-speed",M)}function _(M){t("playbar-select-point",M)}function E(){const{rotation:M}=s()?.getState()||{};I(M?.slider)}function S(){const{rotation:M}=s()?.getState()||{};I(M?.backward)}function w(){const{rotation:M}=s()?.getState()||{};I(M?.forward)}function v(M){const{rotation:k}=s()?.getState()||{};I(k?.play),e()?.setState({loadingPh:M})}function g(M){const N={speed:e()?.getTransitionSpeed(M)};r({playbar:{speed:M}}),e()?.setState({defaultTransition:N})}function I(M){const k=M?void 0:Yi.Stationary;e()?.setMoveDirection(k)}return{playbarEvents:{ready:a,backward:h,pause:u,play:d,forward:p,slider:l,speed:m,selectPoint:_}}}const{delay:rT}=yt.utils;function oT(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(F){I(F),t("viewer-ready")}function h(F){t("viewer-click",F)}function u(F){M(F),t("viewer-size-updated",F)}function d(F){k(F),t("viewer-zoom-updated",F)}function p(F){N(F),t("viewer-position-updated",F,U(F))}function m(F){B(),t("viewer-panorama-loaded",F)}function _(F){t("viewer-panorama-error",F)}function E(F){V(F),t("viewer-panorama-complete")}function S(F){C(),t("viewer-mousedown",F)}function w(F){t("viewer-mouseup",F)}function v(F){t("viewer-select-point",F)}function g(F){t("viewer-select-marker",F)}function I(F){const H=F.currentTarget;R(H),D(H)}function C(F){e()?.setCollapse(!0)}function M(F){const H=F.currentTarget;e()?.setRadarHFov(H.state?.hFov??90),e()?.setCollapse(!0),D(H)}function k(F){const{state:H}=F.currentTarget;e()?.setRadarHFov(H?.hFov??90)}function N(F){e()?.setRadarYaw(F.position.yaw??0)}function B(){r()?.loadMarkers()}function V(F){F||s()?.playNext()}function R(F){const{state:H,config:q}=F,{defaultYaw:j=0,defaultPitch:ct=0}=q;a.value={yaw:j,pitch:ct},e()?.setRadarYaw(j),e()?.setRadarHFov(H?.hFov??90)}async function D(F){await rT(200);const H=F.state.size;if(H){const{style:q,offsetTop:j=0}=e()?.getState?.()||{},ct=parseInt(q?.top)||20,{width:W=0,height:Et=0}=H,lt=Math.min(W,Et)-ct-j;e()?.setState({maxSize:lt})}}function U(F){const{yaw:H,pitch:q}=F.position,{yaw:j,pitch:ct}=y.unref(a);return a.value=F.position,{yaw:H-j,pitch:q-ct}}return{viewerEvents:{ready:l,click:h,mousedown:S,mouseup:w,sizeUpdated:u,zoomUpdated:d,positionUpdated:p,panoramaLoaded:m,panoramaError:_,panoramaComplete:E,selectPoint:v,selectMarker:g}}}const aT={class:"vsleem-realsee"},vm=Pn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>nl},viewer:{},marker:{},playbar:{default:()=>_o},map:{default:()=>go},immediate:{type:Boolean,default:!0},fetchParams:{},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-record","change-point","map-ready","map-resize","map-collapse","map-dragger","map-angle-updated","map-select-point","viewer-ready","viewer-click","viewer-mousedown","viewer-mouseup","viewer-size-updated","viewer-zoom-updated","viewer-position-updated","viewer-panorama-loaded","viewer-panorama-error","viewer-panorama-complete","viewer-select-point","viewer-select-marker","playbar-ready","playbar-backward","playbar-pause","playbar-play","playbar-forward","playbar-speed","playbar-slider","playbar-select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,{registerViewer:a,registerMap:l,registerPlaybar:h,getProps:u,...d}=_m(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:S,getBindValue:w}=nT(p,m,_,E,r),{viewerEvents:v}=oT(d,r),{mapEvents:g}=iT(d,r),{playbarEvents:I}=sT(d,r);return t(d),(C,M)=>(y.openBlock(),y.createElementBlock("div",aT,[y.createVNode(mm,y.mergeProps({onRegister:y.unref(a)},y.toHandlers(y.unref(v))),null,16,["onRegister"]),y.unref(u).map&&y.unref(S)?(y.openBlock(),y.createBlock(Yh,y.mergeProps({key:0,onRegister:y.unref(l)},y.toHandlers(y.unref(g))),{extra:y.withCtx(k=>[y.renderSlot(C.$slots,"mapExtra",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),left:y.withCtx(k=>[y.renderSlot(C.$slots,"mapLeft",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),right:y.withCtx(k=>[y.renderSlot(C.$slots,"mapRight",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),default:y.withCtx(k=>[y.renderSlot(C.$slots,"mapDefault",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.unref(u).playbar&&y.unref(S)?(y.openBlock(),y.createBlock(Qh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(I))),{slider:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarSlider",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),box:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarBox",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),caption:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarCaption",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),button:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarButton",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),default:y.withCtx(k=>[y.renderSlot(C.$slots,"playbarDefault",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.renderSlot(C.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0)]))}}),[["__scopeId","data-v-06733ad1"]]);Ae.APP_SETTING=zh,Ae.DirectionMoveEnum=Yi,Ae.MAP_CONFIG=go,Ae.MAP_GEO_OPTIONS=Vh,Ae.MARKER_CONFIG=Gh,Ae.Map=Yh,Ae.PLAYBAR_CONFIG=_o,Ae.Playbar=Qh,Ae.REALSEE_CONFIG=Wh,Ae.REALSEE_SETTING=nl,Ae.Realsee=vm,Ae.RealseeErrorCode=ze,Ae.RealseePlugin=vm,Ae.TILE_LAYERS=el,Ae.TRACK_COLOR_LIST=Fh,Ae.TrackMarker=no,Ae.TrackPoint=gs,Ae.TrackRecord=ar,Ae.TrackRecordTypeEnum=Jp,Ae.VIEWER_CONFIG=Hh,Ae.ViewModeEnum=ir,Ae.Viewer=mm,Ae.useRealsee=_m,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})}));