@arcgis/core 4.31.0-next.20240713 → 4.31.0-next.20240716

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.
Files changed (43) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/956cfaab50468b1de65a.js +1 -0
  3. package/assets/esri/core/workers/chunks/{d60b9ab97c56b1a3f0c2.js → dfee89697ffa6921fbee.js} +9 -9
  4. package/assets/esri/themes/base/widgets/_Tooltip.scss +9 -3
  5. package/assets/esri/themes/dark/main.css +1 -1
  6. package/assets/esri/themes/light/main.css +1 -1
  7. package/assets/esri/themes/light/view.css +1 -1
  8. package/chunks/Clipper-D_zmIu84.js +1 -1
  9. package/chunks/Densificator-DB2izaQs.js +1 -1
  10. package/chunks/OperatorDifference.js +5 -0
  11. package/chunks/OperatorRelationsBase-C_y-7Mq7.js +5 -0
  12. package/chunks/OperatorSimplify.js +1 -1
  13. package/chunks/Polyline.js +1 -1
  14. package/chunks/RelationalOperations-wfnLPxD3.js +5 -0
  15. package/geometry/operators/gx/operatorCut.js +1 -1
  16. package/geometry/operators/gx/operatorDensify.js +1 -1
  17. package/geometry/operators/gx/operatorIntersection.js +1 -1
  18. package/geometry/operators/gx/operatorUnion.js +1 -1
  19. package/geometry/operators/operatorContains.js +5 -0
  20. package/geometry/operators/operatorCrosses.js +5 -0
  21. package/geometry/operators/operatorDifference.js +5 -0
  22. package/geometry/operators/operatorDisjoint.js +1 -1
  23. package/geometry/operators/operatorEquals.js +5 -0
  24. package/geometry/operators/operatorIntersects.js +5 -0
  25. package/geometry/operators/operatorOverlaps.js +5 -0
  26. package/geometry/operators/operatorRelate.js +5 -0
  27. package/geometry/operators/operatorTouches.js +5 -0
  28. package/geometry/operators/operatorUnion.js +1 -1
  29. package/geometry/operators/operatorWithin.js +5 -0
  30. package/interfaces.d.ts +14 -1
  31. package/layers/support/SubtypeSublayer.js +1 -1
  32. package/package.json +2 -2
  33. package/support/revision.js +1 -1
  34. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  35. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +5 -5
  36. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +1 -1
  37. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +1 -1
  38. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +5 -5
  39. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  40. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  41. package/views/interactive/tooltip/Tooltip.js +1 -1
  42. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  43. package/assets/esri/core/workers/chunks/543f9db420c99d429637.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7e3,3069],{39516:(e,t,i)=>{async function r(e,t){const{WhereClause:r}=await Promise.all([i.e(835),i.e(4800)]).then(i.bind(i,50835));return r.create(e,t)}function n(e,t){return"1=1"===e?t??e:"1=1"===t?e??t:null!=e&&""!==e?null!=t&&""!==t?`(${e}) AND (${t})`:e:t}i.d(t,{G:()=>r,m:()=>n})},3330:(e,t,i)=>{i.d(t,{GB:()=>n,Qo:()=>o,Y4:()=>s});var r=i(96285);class n{}function s(e){return e instanceof r.bo?e===n.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return s(e)?n.instance:e}n.instance=new r.oh("Etc/UTC")},13069:(e,t,i)=>{i.d(t,{lk:()=>n,vD:()=>o,yS:()=>s});const r="randomUUID"in crypto;function n(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}},70328:(e,t,i)=>{i.d(t,{BI:()=>f,Ej:()=>d,Hq:()=>u,Ie:()=>h,Jt:()=>m,Ne:()=>p,RF:()=>l,aI:()=>b,fA:()=>s,hZ:()=>c,iT:()=>a,is:()=>g,qv:()=>v,vI:()=>y,v_:()=>w,vt:()=>n,w1:()=>o});var r=i(5443);function n(e=w){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function s(e,t,i,r,s,o,l=n()){return l[0]=e,l[1]=t,l[2]=i,l[3]=r,l[4]=s,l[5]=o,l}function o(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new r.A(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t,i=0,r=t.length/3){let n=e[0],s=e[1],o=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<r;e++)n=Math.min(n,t[i+3*e]),s=Math.min(s,t[i+3*e+1]),o=Math.min(o,t[i+3*e+2]),l=Math.max(l,t[i+3*e]),a=Math.max(a,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=n,e[1]=s,e[2]=o,e[3]=l,e[4]=a,e[5]=u}function d(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function p(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function y(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function c(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function h(e){return e?c(e,v):n(v)}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function f(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=r,e[4]=n,e[5]=Number.POSITIVE_INFINITY,e}function g(e){return 6===e.length}function b(e,t,i){if(null==e||null==t)return e===t;if(!g(e)||!g(t))return!1;if(i){for(let r=0;r<e.length;r++)if(!i(e[r],t[r]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}i(19419);const v=[1/0,1/0,1/0,-1/0,-1/0,-1/0],w=[0,0,0,0,0,0];n()},70048:(e,t,i)=>{i.r(t),i.d(t,{default:()=>be});var r=i(90237),n=i(69540),s=i(5503),o=i(49186),l=i(81583),a=i(92071),u=i(74887),d=i(36708),p=i(39516),y=i(84952),c=i(10107),h=(i(44208),i(53966)),m=(i(87811),i(36005)),f=i(40608),g=i(4146),b=i(52136),v=i(18768),w=i(63074),_=i(69208),F=i(47685),T=i(87796),I=i(16131),M=i(8303),S=i(54310),x=i(25036),A=i(82935),O=i(60694),Z=i(10873),E=i(15426),j=i(17036),N=i(30524),V=i(13874),C=i(86162),$=(i(94409),i(65345),i(42980),i(39290),i(92438)),L=i(96576),D=i(93618),R=(i(65494),i(4902)),P=i(4718),U=i(92474),q=i(93637),G=i(43937),B=i(90360),k=i(4206),J=i(29005),z=i(81457),H=i(39383),X=i(61956),Y=i(30291),Q=i(59868);const K={key:"type",base:$.A,errorContext:"renderer",typeMap:{simple:L.A,"unique-value":D.A,"class-breaks":C.A}},W=(0,j.p)(),ee=(0,B.C)({types:K});let te=0;function ie(e){const t=e.json.write;return"object"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function re(e){switch(e){case"point":case"multipoint":return Q.UK.clone();case"polyline":return Q.A7.clone();case"polygon":case"multipatch":return Q.Cx.clone();default:return null}}function ne(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function se(e,t){let i=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":i="point";break;case"esriGeometryPolyline":i="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":i="polygon";break;default:t.type,i=null}const r={},n=ne(e,t);if(null!=n){const{defaultValues:e}=n;for(const t in e)r[t]=e[t]}return r[t.subtypeField]=e,new J.A({name:"New Feature",drawingTool:i,prototype:{attributes:r}})}let oe=class extends((0,a.P)((0,n.O)((0,R.sA)(U.A)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${te++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return(0,N.yp)(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,i){const{fields:r,parent:n}=this;let s;if(r){s=[];let e=0;r.forEach((({name:t,alias:i,editable:r,visible:o})=>{if(!o)return;const l=n?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let u=!1;i!==l.alias&&(a.alias=i,u=!0),r!==l.editable&&(a.editable=r,u=!0),s.push(a),u&&e++})),0===e&&s.length===r.length&&(s=null)}else s=(0,P.o8)(e);s?.length&&(0,q.sM)(i,s,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:i}=this,r=e?.fields;if(!e||!r?.length)return null;const{subtypes:n,subtypeField:s}=e,o=n?.find((e=>e.code===i)),l=o?.defaultValues,a=o?.domains,u=[];for(const e of r){const r=e.clone(),{name:n}=r,o=t?.find((e=>e.name===n));if(r.visible=!t||!!o,o){const{alias:e,editable:t}=o;e&&(r.alias=e),!1===t&&(r.editable=!1)}const d=l?.[n]??null;r.defaultValue=n===s?i:d;const p=a?.[n]??null;r.domain=n===s?null:p?"inherited"===p.type?r.domain:p.clone():null,u.push(r)}return u}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||h.A.getLogger(this).error(ue("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,N.yp)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new L.A({symbol:re(e)})}(e.geometryType):null}readRendererFromService(e,t,i){if("Table"===t.type)return null;const r=t.drawingInfo?.renderer,n=ee(r,t,i);let s;const{subtypeCode:o}=this;if(null!=o&&function(e,t){return!(!t||"unique-value"!==e?.type||null==e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(o)));e&&(s=new L.A({symbol:e.symbol}))}else"simple"!==n?.type||n.visualVariables?.length||(s=n);return s}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;if(!r)return;const n=r.visualVariables?.some((e=>"rotationInfo"!==e.type));return n?void 0:ee(r,t,i)||void 0}get spatialReference(){return this.parent?.spatialReference}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[se(this.subtypeCode,t)]}readTitleFromService(e,t){const i=ne(this.subtypeCode,t);return null!=i?i.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:i}=this;if(!i)throw ue("addAttachment");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return i.addAttachment(e,t)}async updateAttachment(e,t,i){const{parent:r}=this;if(!r)throw ue("updateAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return r.updateAttachment(e,t,i)}async deleteAttachments(e,t){const{parent:i}=this;if(!i)throw ue("deleteAttachments");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new o.A("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return i.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw ue("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:i,fields:r,title:n}=this;if(i){const{displayField:e,editFieldsInfo:s,objectIdField:o}=i;t={displayField:e,editFieldsInfo:s,fields:r,objectIdField:o,title:n}}return(0,Y.tn)(t,e)}createQuery(){if(!this.parent)throw ue("createQuery");const e=(0,E.VZ)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,p.m)(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}async queryAttachments(e,t){const i=await this.load();if(!i.parent)throw ue("queryAttachments");const r=e.clone();return r.where=ae(r.where,i.parent.subtypeField,i.subtypeCode),i.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const i=await this.load();if(!i.parent)throw ue("queryFeatureCount");return i.parent.queryFeatureCount(le(i.parent,i,e),t)}async queryFeatures(e,t){const i=await this.load();if(!i.parent)throw ue("queryFeatures");return i.parent.queryFeatures(le(i.parent,i,e),t)}async queryObjectIds(e,t){const i=await this.load();if(!i.parent)throw ue("queryObjectIds");return i.parent.queryObjectIds(le(i.parent,i,e),t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"capabilities",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"effectiveCapabilities",null),(0,r._)([(0,c.MZ)({json:{write:{ignoreOrigin:!0}}})],oe.prototype,"charts",void 0),(0,r._)([(0,c.MZ)({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],oe.prototype,"editingEnabled",void 0),(0,r._)([(0,c.MZ)({type:Boolean,readOnly:!0})],oe.prototype,"effectiveEditingEnabled",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"elevationInfo",null),(0,r._)([(0,c.MZ)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],oe.prototype,"fieldOverrides",void 0),(0,r._)([(0,G.K)("fieldOverrides")],oe.prototype,"writeFieldOverrides",null),(0,r._)([(0,c.MZ)({...W.fields,readOnly:!0,json:{read:!1}})],oe.prototype,"fields",null),(0,r._)([(0,c.MZ)(W.fieldsIndex)],oe.prototype,"fieldsIndex",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"floorInfo",null),(0,r._)([(0,c.MZ)({type:k.A,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],oe.prototype,"formTemplate",void 0),(0,r._)([(0,c.MZ)({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],oe.prototype,"id",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"geometryType",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"type",void 0),(0,r._)([(0,c.MZ)(ie((0,P.o8)(Z.kF)))],oe.prototype,"labelsVisible",void 0),(0,r._)([(0,c.MZ)({type:[z.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:H.w},write:{ignoreOrigin:!0}}})],oe.prototype,"labelingInfo",void 0),(0,r._)([(0,c.MZ)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],oe.prototype,"layerType",void 0),(0,r._)([(0,c.MZ)(ie((0,P.o8)(Z.fV)))],oe.prototype,"legendEnabled",void 0),(0,r._)([(0,c.MZ)({type:["show","hide"]})],oe.prototype,"listMode",void 0),(0,r._)([(0,c.MZ)((()=>{const e=(0,P.o8)(Z.hn);return e.json.origins.service.read=!1,ie(e)})())],oe.prototype,"minScale",void 0),(0,r._)([(0,c.MZ)((()=>{const e=(0,P.o8)(Z.hG);return e.json.origins.service.read=!1,ie(e)})())],oe.prototype,"maxScale",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],oe.prototype,"effectiveScaleRange",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"objectIdField",null),(0,r._)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"opacity",void 0),(0,r._)([(0,c.MZ)({clonable:!1})],oe.prototype,"parent",void 0),(0,r._)([(0,c.MZ)(ie((0,P.o8)(Z.M6)))],oe.prototype,"popupEnabled",void 0),(0,r._)([(0,c.MZ)({type:V.A,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],oe.prototype,"popupTemplate",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],oe.prototype,"defaultPopupTemplate",null),(0,r._)([(0,c.MZ)({types:K,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],oe.prototype,"renderer",null),(0,r._)([(0,m.w)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],oe.prototype,"readRendererFromService",null),(0,r._)([(0,m.w)("renderer",["layerDefinition.drawingInfo.renderer"])],oe.prototype,"readRenderer",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"spatialReference",null),(0,r._)([(0,c.MZ)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],oe.prototype,"subtypeCode",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"subtypeField",null),(0,r._)([(0,c.MZ)({type:[J.A],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],oe.prototype,"templates",void 0),(0,r._)([(0,m.w)("service","templates",["geometryType","subtypeField","subtypes","type"])],oe.prototype,"readTemplatesFromService",null),(0,r._)([(0,c.MZ)({type:String,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"title",void 0),(0,r._)([(0,m.w)("service","title",["subtypes"])],oe.prototype,"readTitleFromService",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],oe.prototype,"url",null),(0,r._)([(0,c.MZ)({readOnly:!0})],oe.prototype,"userHasUpdateItemPrivileges",null),(0,r._)([(0,c.MZ)({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],oe.prototype,"visible",void 0),oe=(0,r._)([(0,f.$)("esri.layers.support.SubtypeSublayer")],oe);const le=(e,t,i)=>{if(!i)return t.createQuery();const r=X.A.from(i);return r.where=ae(r.where,e.subtypeField,t.subtypeCode),r},ae=(e,t,i)=>{const r=new RegExp(`${t}\\s*=\\s*\\d+`),n=`${t}=${i}`,s=e??"";return r.test(s)?s.replace(r,n):(0,p.m)(n,s)},ue=e=>new o.A(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),de=oe;var pe=i(96184),ye=i(91908),ce=i(92935);const he="SubtypeGroupLayer";function me(e,t){return new o.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const fe=(0,j.p)();let ge=class extends((0,T.j)((0,F.w6)((0,w.dM)((0,A.e)((0,x.j)((0,S.J)((0,v.b)((0,I.q)((0,M.A)((0,a.P)((0,_.d)((0,b.p)((0,n.O)(g.A)))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(s.A.ofType(de)),this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=(0,u.sg)((async(e,t,r)=>{const{save:n,saveAs:s}=await i.e(5740).then(i.bind(i,33359));switch(e){case ce.X.SAVE:return n(this,t);case ce.X.SAVE_AS:return s(this,r,t)}})),this.addHandles((0,d.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),d.OH))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.QP).then((async()=>{if(!this.url)throw new o.A("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new o.A("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,E.VA)(this,"load",e)));return this.addResolvingPromise(i),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,E.C$)(this)}get parsedUrl(){const e=(0,y.An)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,y.fj)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,O.yG)(this.url,t):t}async addAttachment(e,t){return(0,E.Xl)(this,e,t,he)}async updateAttachment(e,t,i){return(0,E.bt)(this,e,t,i,he)}async applyEdits(e,t){return(0,E.ct)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.qr)(Promise.all([i.e(893),i.e(3622),i.e(2593),i.e(9062)]).then(i.bind(i,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,E.VZ)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,p.m)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return(0,E.mm)(this,e,t,he)}async fetchRecomputedExtents(e){return(0,E.WP)(this,e,he)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),i=e.attributes[t.name];return this.findSublayerForSubtypeCode(i)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return(0,l.g)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,E.lV)(this,e,t,he)}async queryFeatures(e,t){const i=await this.load(),r=X.A.from(e)??i.createQuery(),n=r.outFields??[];n.includes(this.subtypeField)||(n.push(this.subtypeField),r.outFields=n);const s=await i.source.queryFeatures(r,t);if(s?.features)for(const e of s.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return s}async queryObjectIds(e,t){return(0,E.sg)(this,e,t,he)}async queryFeatureCount(e,t){return(0,E.Ye)(this,e,t,he)}async queryExtent(e,t){return(0,E.B5)(this,e,t,he)}async queryRelatedFeatures(e,t){return(0,E.hM)(this,e,t,he)}async queryRelatedFeaturesCount(e,t){return(0,E.S2)(this,e,t,he)}async save(e){return this._debouncedSaveOperations(ce.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ce.X.SAVE_AS,t,e)}write(e,t){const{origin:i,layerContainerType:r,messages:n}=t;if(this.isTable){if("web-scene"===i||"web-map"===i&&"tables"!==r)return n?.push(me(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===i&&"tables"===r)return n?.push(me(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(n?.push(new o.A("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,ye.D)(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new o.A("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,N.sv)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,E.jp)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};(0,r._)([(0,c.MZ)({readOnly:!0})],ge.prototype,"createQueryVersion",null),(0,r._)([(0,c.MZ)({readOnly:!0})],ge.prototype,"editingEnabled",null),(0,r._)([(0,c.MZ)({readOnly:!0})],ge.prototype,"effectiveEditingEnabled",null),(0,r._)([(0,c.MZ)({...fe.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ge.prototype,"fields",void 0),(0,r._)([(0,c.MZ)(fe.fieldsIndex)],ge.prototype,"fieldsIndex",void 0),(0,r._)([(0,c.MZ)(Z.id)],ge.prototype,"id",void 0),(0,r._)([(0,c.MZ)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],ge.prototype,"listMode",void 0),(0,r._)([(0,c.MZ)({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],ge.prototype,"operationalLayerType",void 0),(0,r._)([(0,c.MZ)(fe.outFields)],ge.prototype,"outFields",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],ge.prototype,"parsedUrl",null),(0,r._)([(0,c.MZ)({clonable:!1})],ge.prototype,"source",null),(0,r._)([(0,c.MZ)({type:s.A.ofType(de),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,i)=>{const r=e.map((({code:e})=>{const r=new de({subtypeCode:e});return r.read(t,i),r}));return new(s.A.ofType(de))(r)}}}},name:"layers",write:{ignoreOrigin:!0}}})],ge.prototype,"sublayers",void 0),(0,r._)([(0,c.MZ)({type:pe.A})],ge.prototype,"timeInfo",void 0),(0,r._)([(0,c.MZ)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],ge.prototype,"title",void 0),(0,r._)([(0,m.w)("service","title",["name"])],ge.prototype,"readTitleFromService",null),(0,r._)([(0,c.MZ)({json:{read:!1}})],ge.prototype,"type",void 0),ge=(0,r._)([(0,f.$)("esri.layers.SubtypeGroupLayer")],ge);const be=ge},82935:(e,t,i)=>{i.d(t,{B:()=>c,e:()=>h});var r=i(90237),n=i(10107),s=(i(44208),i(53966),i(87811),i(36005)),o=i(40608),l=i(89317),a=i(30524),u=i(96184),d=i(73133),p=i(79677),y=i(10184);const c={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:l.K}}},h=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const i=t.timeInfo.exportOptions;if(!i)return null;const r=i.timeOffset,n=d.j.fromJSON(i.timeOffsetUnits);return r&&n?new y.A({value:r,unit:n}):null}set timeInfo(e){(0,a.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,r._)([(0,n.MZ)({type:p.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,r._)([(0,n.MZ)({type:y.A})],t.prototype,"timeOffset",void 0),(0,r._)([(0,s.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,r._)([(0,n.MZ)({value:null,type:u.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,r._)([(0,n.MZ)(c)],t.prototype,"useViewTime",void 0),t=(0,r._)([(0,o.$)("esri.layers.mixins.TemporalLayer")],t),t}},20437:(e,t,i)=>{i.d(t,{A:()=>f});var r,n=i(90237),s=i(66552),o=i(25482),l=i(10107),a=i(56507),u=(i(87811),i(44208),i(93223)),d=i(36005),p=i(40608),y=i(72088),c=i(98453);const h=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=r=class extends o.oY{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?.value??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?h.fromJSON(i.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,l.MZ)({type:String,json:{write:!0}})],m.prototype,"alias",void 0),(0,n._)([(0,l.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),(0,n._)([(0,l.MZ)()],m.prototype,"description",void 0),(0,n._)([(0,d.w)("description")],m.prototype,"readDescription",null),(0,n._)([(0,l.MZ)({types:y.gK,json:{read:{reader:y.rS},write:!0}})],m.prototype,"domain",void 0),(0,n._)([(0,l.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),(0,n._)([(0,l.MZ)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),(0,n._)([(0,l.MZ)({type:String,json:{write:!0}})],m.prototype,"name",void 0),(0,n._)([(0,l.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),(0,n._)([(0,u.e)(c.m)],m.prototype,"type",void 0),(0,n._)([(0,l.MZ)()],m.prototype,"valueType",void 0),(0,n._)([(0,d.w)("valueType",["description"])],m.prototype,"readValueType",null),(0,n._)([(0,l.MZ)({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=r=(0,n._)([(0,p.$)("esri.layers.support.Field")],m);const f=m},95466:(e,t,i)=>{i.d(t,{A:()=>y});var r=i(49186),n=i(25482),s=i(53966),o=i(91869),l=i(3330),a=i(30524),u=i(56400),d=i(96285);const p=new Map;class y{static fromJSON(e){return new y(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new y(e.fields??[],f(e))}static fromLayerJSON(e){return new y(e.fields??[],f(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const i=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const n=c(t);this._fieldsMap.set(t,e),this._fieldsMap.set(n,e),this._normalizedFieldsMap.set(r,e),i.push(`${n}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(c(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").error(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):m.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?l.GB.instance:t===u.n$?d.mQ.utcInstance:(0,o.tE)(p,t,(()=>d.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,n.Wj)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function c(e){return e.trim().toLowerCase()}function h(e){return(0,a.rS)(e)?.toLowerCase()??""}const m=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function f(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:n}=e,s=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.ZS)(e.dateFieldsTimeReference):null,a=n?function(e){return"timeZone"in e}(n)?n.timeZone??l:n.dateFieldsTimeReference?(0,u.ZS)(n.dateFieldsTimeReference):l??u.n$:null,d=r?function(e){return"timeZone"in e}(r)?r.timeZone??l:r.timeReference?(0,u.ZS)(r.timeReference):l:null,p=new Map([[c(n?.creationDateField??""),a],[c(n?.editDateField??""),a],[c(s),d],[c(o),d]]);for(const{name:r,type:n}of e.fields)if(m.has(n))t.set(r,u.L5);else if("date"!==n&&"esriFieldTypeDate"!==n)t.set(r,null);else if(i)t.set(r,u.L5);else{const e=p.get(c(r??""))??l;t.set(r,e)}return t}},96184:(e,t,i)=>{i.d(t,{A:()=>m});var r=i(90237),n=i(69540),s=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),a=i(40608),u=i(43937),d=i(79677),p=i(10184),y=i(56400);function c(e,t){return p.A.fromJSON({value:e,unit:t})}let h=class extends((0,n.O)(s.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?d.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?c(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?c(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,r._)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],h.prototype,"cumulative",void 0),(0,r._)([(0,o.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"endField",void 0),(0,r._)([(0,o.MZ)({type:d.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"fullTimeExtent",void 0),(0,r._)([(0,l.w)("fullTimeExtent",["timeExtent"])],h.prototype,"readFullTimeExtent",null),(0,r._)([(0,u.K)("fullTimeExtent")],h.prototype,"writeFullTimeExtent",null),(0,r._)([(0,o.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"hasLiveData",void 0),(0,r._)([(0,o.MZ)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"interval",void 0),(0,r._)([(0,l.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],h.prototype,"readInterval",null),(0,r._)([(0,u.K)("interval")],h.prototype,"writeInterval",null),(0,r._)([(0,o.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],h.prototype,"startField",void 0),(0,r._)([(0,o.MZ)((0,y.P6)("timeReference",!0))],h.prototype,"timeZone",void 0),(0,r._)([(0,o.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],h.prototype,"trackIdField",void 0),(0,r._)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],h.prototype,"useTime",void 0),(0,r._)([(0,o.MZ)({type:[Date],json:{read:!1}})],h.prototype,"stops",void 0),h=(0,r._)([(0,a.$)("esri.layers.support.TimeInfo")],h);const m=h},72088:(e,t,i)=>{i.d(t,{rS:()=>I,gK:()=>T}),i(44208);var r,n=i(90237),s=i(4718),o=i(10107),l=(i(53966),i(93223)),a=i(40608),u=i(25482);i(87811);let d=r=class extends u.oY{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,o.MZ)({type:[String,Number],json:{write:!0}})],d.prototype,"code",void 0),d=r=(0,n._)([(0,a.$)("esri.layers.support.CodedValue")],d);const p=new(i(66552).J)({inherited:"inherited",codedValue:"coded-value",range:"range"});let y=class extends u.oY{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,n._)([(0,l.e)(p)],y.prototype,"type",void 0),y=(0,n._)([(0,a.$)("esri.layers.support.Domain")],y);const c=y;var h;let m=h=class extends c{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some((e=>(String(e.code)===i&&(t=e.name),!!t)))}return t}clone(){return new h({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,n._)([(0,o.MZ)({type:[d],json:{write:!0}})],m.prototype,"codedValues",void 0),(0,n._)([(0,l.e)({codedValue:"coded-value"})],m.prototype,"type",void 0),m=h=(0,n._)([(0,a.$)("esri.layers.support.CodedValueDomain")],m);const f=m;var g;i(49186);let b=g=class extends c{constructor(e){super(e),this.type="inherited"}clone(){return new g}};(0,n._)([(0,l.e)({inherited:"inherited"})],b.prototype,"type",void 0),b=g=(0,n._)([(0,a.$)("esri.layers.support.InheritedDomain")],b);const v=b;var w;let _=w=class extends c{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],_.prototype,"maxValue",void 0),(0,n._)([(0,o.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],_.prototype,"minValue",void 0),(0,n._)([(0,l.e)({range:"range"})],_.prototype,"type",void 0),_=w=(0,n._)([(0,a.$)("esri.layers.support.RangeDomain")],_);const F=_,T={key:"type",base:c,typeMap:{range:_,"coded-value":f,inherited:v}};function I(e){if(!e?.type)return null;switch(e.type){case"range":return F.fromJSON(e);case"codedValue":return f.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},17036:(e,t,i)=>{i.d(t,{p:()=>a});var r=i(44208),n=i(53966),s=i(20437),o=i(95466),l=i(30524);function a(){return{fields:{type:[s.A],value:null,set:function(e){if(e&&(0,r.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");n.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const i=this.fieldsIndex?.has(t);i||n.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},98453:(e,t,i)=>{i.d(t,{m:()=>r});const r=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},32730:(e,t,i)=>{i.d(t,{BI:()=>f,D3:()=>h,XJ:()=>m,lc:()=>c,mX:()=>b,rU:()=>g,tH:()=>T});var r=i(799);const n="__begin__",s="__end__",o=new RegExp(n,"ig"),l=new RegExp(s,"ig"),a=new RegExp("^"+n,"i"),u=new RegExp(s+"$","i"),d='"',p=d+" + ",y=" + "+d;function c(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function m(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=c(e.labelExpression),t.type="conventional"),t}function f(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return b(t.expression);case"arcade":return t.expression}return null}function g(e){const t=m(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(v);return t?.[1].trim()||null}(t.expression);case"arcade":return T(t.expression)}return null}function b(e){let t;return e?(t=(0,r.HC)(e,(e=>n+'$feature["'+e+'"]'+s)),t=a.test(t)?t.replace(a,""):d+t,t=u.test(t)?t.replace(u,""):t+d,t=t.replaceAll(o,p).replaceAll(l,y)):t='""',t}const v=/^\s*\{([^}]+)\}\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,_=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,F=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function T(e){if(!e)return null;let t=w.exec(e)||_.exec(e);return t?t[1]||t[3]:(t=F.exec(e),t?t[2]:null)}},73133:(e,t,i)=>{i.d(t,{j:()=>r});const r=(0,i(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},10184:(e,t,i)=>{i.d(t,{A:()=>y});var r=i(90237),n=i(69540),s=i(25482),o=i(88930),l=i(10107),a=(i(44208),i(53966),i(87811),i(93223)),u=i(40608),d=i(73133);let p=class extends((0,n.O)(s.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r._)([(0,a.e)(d.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,r._)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,r._)([(0,u.$)("esri.time.TimeInterval")],p);const y=p},92935:(e,t,i)=>{var r;i.d(t,{X:()=>r}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(r||(r={}))}}]);
@@ -221,7 +221,7 @@ return fallOffFunction(vv, vn, 0.1);
221
221
  vec2 uvOffset = uv + rf * blurSize;
222
222
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
223
223
  }
224
- fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},76412:(e,t,r)=>{r.d(t,{c:()=>p,d:()=>_,f:()=>b,g:()=>T,h:()=>x,k:()=>w,o:()=>P}),r(44208),r(53966);var i=r(34727),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(34304),d=r(88582),u=r(71351),h=r(44280),f=r(32114);const m=p();function p(){return(0,l.vt)()}const v=s.e,g=s.e;function _(e,t){return(0,s.c)(t,e)}function x(e){return e[3]}function T(e){return e}function b(e,t,r,i){return(0,l.fA)(e,t,r,i)}function y(e,t,r){if(null==t)return!1;if(!E(e,t,A))return!1;let{t0:i,t1:n}=A;if((i<0||n<i&&n>0)&&(i=n),i<0)return!1;if(r){const{origin:e,direction:n}=t;r[0]=e[0]+n[0]*i,r[1]=e[1]+n[1]*i,r[2]=e[2]+n[2]*i}return!0}const A={t0:0,t1:0};function E(e,t,r){const{origin:i,direction:n}=t,o=S;o[0]=i[0]-e[0],o[1]=i[1]-e[1],o[2]=i[2]-e[2];const a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];if(0===a)return!1;const s=2*(n[0]*o[0]+n[1]*o[1]+n[2]*o[2]),l=s*s-4*a*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*a),r.t1=(-s+c)/(2*a),!0}const S=(0,a.vt)();function w(e,t){return y(e,t,null)}function M(e,t,r){const i=f.rq.get(),a=f.Rc.get();(0,o.b)(i,t.origin,t.direction);const s=x(e);(0,o.b)(r,i,t.origin),(0,o.j)(r,r,1/(0,o.l)(r)*s);const l=O(e,t.origin),c=(0,h.g7)(t.origin,r);return(0,n.$0)(a,c+l,i),(0,o.h)(r,r,a),r}function C(e,t,r){const i=(0,o.f)(f.rq.get(),t,e),n=(0,o.j)(f.rq.get(),i,e[3]/(0,o.l)(i));return(0,o.g)(r,n,e)}function O(e,t){const r=(0,o.f)(f.rq.get(),t,e),n=(0,o.l)(r),a=x(e),s=a+Math.abs(a-n);return(0,i.XM)(a/s)}const I=(0,a.vt)();function R(e,t,r,n){const a=(0,o.f)(I,t,e);switch(r){case d._.X:{const e=(0,i.jU)(a,I)[2];return(0,o.s)(n,-Math.sin(e),Math.cos(e),0)}case d._.Y:{const e=(0,i.jU)(a,I),t=e[1],r=e[2],s=Math.sin(t);return(0,o.s)(n,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d._.Z:return(0,o.n)(n,a);default:return}}function N(e,t){const r=(0,o.f)(L,t,e);return(0,o.l)(r)-e[3]}function P(e,t){const r=(0,o.a)(e,t),i=x(e);return r<=i*i}const L=(0,a.vt)(),H=p();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:m,altitudeAt:N,angleToSilhouette:O,axisAt:R,cameraFrustumCoverage:function(e,t,r,i){const n=x(e),o=n*n,a=t+.5*Math.PI,s=r*r+o-2*Math.cos(a)*r*n,l=Math.sqrt(s),c=s-o;if(c<=0)return.5;const d=Math.sqrt(c),u=Math.acos(d/l)-Math.asin(n/(l/Math.sin(a)));return Math.min(1,(u+.5*i)/i)},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return y(e,t,r)?r:((0,u.oC)(t,e,r),C(e,r,r))},closestPointOnSilhouette:M,containsPoint:P,copy:_,create:p,distanceToSilhouette:function(e,t){const r=(0,o.f)(f.rq.get(),t,e),i=(0,o.q)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:g,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,l.fA)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:b,getCenter:T,getExtent:function(e,t){return t},getRadius:x,intersectLine:function(e,t,r){const i=(0,u.Cr)(t,r);if(!E(e,i,A))return[];const{origin:n,direction:s}=i,{t0:l,t1:d}=A,h=t=>{const r=(0,a.vt)();return(0,o.r)(r,n,s,t),C(e,r,r)};return Math.abs(l-d)<(0,c.FD)()?[h(l)]:[h(l),h(d)]},intersectRay:y,intersectRayClosestSilhouette:function(e,t,r){if(y(e,t,r))return r;const i=M(e,t,f.rq.get());return(0,o.g)(r,t.origin,(0,o.j)(f.rq.get(),t.direction,(0,o.p)(t.origin,i)/(0,o.l)(t.direction))),r},intersectsRay:w,projectPoint:C,setAltitudeAt:function(e,t,r,i){const n=N(e,t),a=R(e,t,d._.Z,L),s=(0,o.j)(L,a,r-n);return(0,o.g)(i,t,s)},setExtent:function(e,t,r){return e!==r&&_(e,r),r},tmpSphere:H,union:function(e,t,r=(0,l.vt)()){const i=(0,o.p)(e,t),n=e[3],a=t[3];return i+a<n?((0,s.c)(r,e),r):i+n<a?((0,s.c)(r,t),r):((0,o.o)(r,e,t,(i+a-n)/(2*i)),r[3]=(i+n+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let a=0,s=0;if((0,i.cy)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354:(e,t,r)=>{function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,i=3,n=i){if(e.length/i!==Math.ceil(t.length/n))return e;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[4],d=r[5],u=r[6],h=r[8],f=r[9],m=r[10],p=r[12],v=r[13],g=r[14];let _=0,x=0;for(let r=0;r<o;r++){const r=t[_],o=t[_+1],T=t[_+2];e[x]=a*r+c*o+h*T+p,e[x+1]=s*r+d*o+f*T+v,e[x+2]=l*r+u*o+m*T+g,_+=n,x+=i}return e}function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,i=3,n=i){if(e.length/i!==Math.ceil(t.length/n))return;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],f=r[7],m=r[8];let p=0,v=0;for(let r=0;r<o;r++){const r=t[p],o=t[p+1],g=t[p+2];e[v]=a*r+c*o+h*g,e[v+1]=s*r+d*o+f*g,e[v+2]=l*r+u*o+m*g,p+=n,v+=i}}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i=3,n=i){const o=e.length/i;if(o!==Math.ceil(t.length/n))return e;let a=0,s=0;for(let l=0;l<o;l++)e[s]=t[a]+r[0],e[s+1]=t[a+1]+r[1],e[s+2]=t[a+2]+r[2],a+=n,s+=i;return e}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,a=0;for(let s=0;s<n;s++){const n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}r.d(t,{a:()=>n,b:()=>c,c:()=>o,d:()=>i,e:()=>d,f:()=>l,n:()=>u,s:()=>s,t:()=>a}),r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:l,scaleView:s,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:a,transformMat3View:o,transformMat4:n,transformMat4View:i,translate:c},Symbol.toStringTag,{value:"Module"}))},51737:(e,t,r)=>{function i(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=3,i=r){const n=t.length/i;let o=0,a=0;for(let s=0;s<n;++s)e[o]=t[a],e[o+1]=t[a+1],e[o+2]=t[a+2],o+=r,a+=i}function o(e,t,r,i,n){const o=e.typedBuffer,a=e.typedBufferStride,s=n?.count??e.count;let l=(n?.dstIndex??0)*a;for(let e=0;e<s;++e)o[l]=t,o[l+1]=r,o[l+2]=i,l+=a}r.d(t,{a:()=>i,c:()=>n,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:n,copyView:i,fill:o},Symbol.toStringTag,{value:"Module"}))},65686:(e,t,r)=>{r.d(t,{a:()=>n,b:()=>l,n:()=>a,s:()=>s,t:()=>o}),r(44208);var i=r(53966);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,i=4,n=i){if(e.length/i!=t.length/n)return;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],f=r[7],m=r[8];let p=0,v=0;for(let r=0;r<o;r++){const r=t[p],o=t[p+1],g=t[p+2],_=t[p+3];e[v]=a*r+c*o+h*g,e[v+1]=s*r+d*o+f*g,e[v+2]=l*r+u*o+m*g,e[v+3]=_,p+=n,v+=i}}function a(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,i=4){const n=Math.min(e.length/i,t.count),o=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<n;t++)e[l]=r*o[s],e[l+1]=r*o[s+1],e[l+2]=r*o[s+2],e[l+3]=r*o[s+3],s+=a,l+=i}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:l,scaleView:s,transformMat3:o,transformMat3View:n,transformMat4:function(e,t,r,n=4,o=n){if(e.length/n!=t.length/o)return void i.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const a=e.length/n,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],f=r[6],m=r[7],p=r[8],v=r[9],g=r[10],_=r[11],x=r[12],T=r[13],b=r[14],y=r[15];let A=0,E=0;for(let r=0;r<a;r++){const r=t[A],i=t[A+1],a=t[A+2],S=t[A+3];e[E]=s*r+u*i+p*a+x*S,e[E+1]=l*r+h*i+v*a+T*S,e[E+2]=c*r+f*i+g*a+b*S,e[E+3]=d*r+m*i+_*a+y*S,A+=o,E+=n}},transformMat4View:function(e,t,r){if(e.count!==t.count)return;const i=e.count,n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],f=r[9],m=r[10],p=r[11],v=r[12],g=r[13],_=r[14],x=r[15],T=e.typedBuffer,b=e.typedBufferStride,y=t.typedBuffer,A=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*b,r=e*A,i=y[r],E=y[r+1],S=y[r+2],w=y[r+3];T[t]=n*i+l*E+h*S+v*w,T[t+1]=o*i+c*E+f*S+g*w,T[t+2]=a*i+d*E+m*S+_*w,T[t+3]=s*i+u*E+p*S+x*w}}},Symbol.toStringTag,{value:"Module"}))},78358:(e,t,r)=>{function i(e,t){n(e.typedBuffer,t,e.typedBufferStride)}function n(e,t,r=4){const i=t.typedBuffer,n=t.typedBufferStride,o=t.count;let a=0,s=0;for(let t=0;t<o;++t)e[a]=i[s],e[a+1]=i[s+1],e[a+2]=i[s+2],e[a+3]=i[s+3],a+=r,s+=n}function o(e,t,r,i,n,o){const a=e.typedBuffer,s=e.typedBufferStride,l=o?.count??e.count;let c=(o?.dstIndex??0)*s;for(let e=0;e<l;++e)a[c]=t,a[c+1]=r,a[c+2]=i,a[c+3]=n,c+=s}r.d(t,{a:()=>n,c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:n,copyView:i,fill:o},Symbol.toStringTag,{value:"Module"}))},4341:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),l=parseInt(o,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,o.c)(r.origin,e),(0,o.f)(r.vector,t,e),r}function d(e,t){const r=(0,o.f)(s.rq.get(),t,e.origin),n=(0,o.m)(e.vector,r),a=(0,o.m)(e.vector,e.vector),l=(0,i.qE)(n/a,0,1),c=(0,o.f)(s.rq.get(),(0,o.j)(s.rq.get(),e.vector,l),r);return(0,o.m)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,n,a){const{vector:l,origin:c}=e,d=(0,o.f)(s.rq.get(),t,c),u=(0,o.m)(l,d)/(0,o.q)(l);return(0,o.j)(a,l,(0,i.qE)(u,r,n)),(0,o.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new n.I((()=>l()))},71351:(e,t,r)=>{r.d(t,{Cr:()=>d,LV:()=>c,kb:()=>u,oC:()=>h,vt:()=>s}),r(4576);var i=r(4341),n=r(38954),o=r(51850),a=r(32114);function s(e){return e?l((0,o.o8)(e.origin),(0,o.o8)(e.direction)):l((0,o.vt)(),(0,o.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=f.get();return r.origin=e,r.direction=t,r}function d(e,t,r=s()){return(0,n.c)(r.origin,e),(0,n.f)(r.direction,t,e),r}function u(e,t){const r=(0,n.b)(a.rq.get(),(0,n.n)(a.rq.get(),e.direction),(0,n.f)(a.rq.get(),t,e.origin));return(0,n.m)(r,r)}function h(e,t,r){const i=(0,n.m)(e.direction,(0,n.f)(r,t,e.origin));return(0,n.g)(r,e.origin,(0,n.j)(r,e.direction,i)),r}const f=new i.I((()=>s()));(0,o.vt)()},21015:(e,t,r)=>{r.d(t,{R:()=>l});var i=r(78888),n=r(60999),o=r(49186),a=r(74887),s=r(84952);class l{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,i.A)(t,{responseType:c[e]})).data;const s=await(0,n.Ke)(this._streamDataRequester.request(t,e,r));if(!0===s.ok)return s.value;throw(0,a.QP)(s.error),new o.A("",`Request for resource failed: ${s.error}`)}}const c={image:"image",binary:"array-buffer",json:"json","image+type":void 0}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return"number"==typeof(r=e)?(0,n.tM)(r):(0,i.mg)(r)?new Uint16Array(r):r;case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}var r}},51530:(e,t,r)=>{r.d(t,{KB:()=>s,Xi:()=>o,pn:()=>l,x3:()=>a});var i=r(44208),n=r(89192);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=n.JS.KTX2_ENCODING}}function a(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function l(e,t){if(t===n.JS.KTX2_ENCODING)return new o(e);const r=new Blob([e],{type:t}),a=URL.createObjectURL(r),s=new Image;if((0,i.A)("esri-iPhone"))return new Promise(((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(a),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=a}));try{s.src=a,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),s}},55268:(e,t,r)=>{r.d(t,{fetch:()=>wr});var i=r(61473),n=r(34727),o=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),f=r(11868),m=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(84498),y=r(51530),A=r(88340);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:A.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:A.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class w{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var M=r(78888),C=r(60999),O=r(86805),I=r(49186),R=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}var P=r(74887),L=r(46140),H=r(97146);async function D(e,t){const{data:r}=await(0,M.A)(e,{responseType:"image",...t});return r}var B=r(46610),F=r(89192),z=r(34275);function V(e){if(e.length<z.y9)return Array.from(e);if((0,z.cy)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(3694),U=r(620);class W{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,U.vA)(e.length>=1),(0,U.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,U.vA)(o.length%this._numIndexPerPrimitive==0),(0,U.vA)(o.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let s=n*o[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(s);const l=(0,u.fA)(i[s],i[s+1],i[s+2]),c=(0,u.o8)(l);for(let t=0;t<a;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*o[r+e],j.push(s);let t=i[s];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=i[s+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=i[s+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}this.bbMin=l,this.bbMax=c;const h=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]);let f=this.radius*this.radius;for(let e=0;e<j.length;++e){s=j.at(e);const t=i[s]-h[0],r=i[s+1]-h[1],n=i[s+2]-h[2],o=t*t+r*r+n*n;if(o<=f)continue;const a=Math.sqrt(o),l=.5*(a-this.radius);this.radius=this.radius+l,f=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=n*c}this.center=h,j.clear()}getChildren(){if(this._children||(0,d.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:a}=this.position;for(let s=0;s<t;++s){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[s];let c=o*a[l],d=n[c],u=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=o*a[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[s]=t,++i[t]}let s=0;for(let e=0;e<8;++e)i[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new W(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new G.A({deallocator:null});var q=r(69720),k=r(96672),$=r(4341),Y=r(11964);function X(e,t,r){return(0,d.f)(Z,t,e),(0,d.f)(J,r,e),.5*(0,d.l)((0,d.b)(Z,Z,J))}r(32114),new $.I(Y.vt),new $.I((()=>{return e?{p0:(0,u.o8)(e.p0),p1:(0,u.o8)(e.p1),p2:(0,u.o8)(e.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var e}));const Z=(0,u.vt)(),J=(0,u.vt)(),K=(0,u.vt)(),Q=(0,u.vt)(),ee=(0,u.vt)(),te=(0,u.vt)();var re=r(24326);class ie{constructor(e){this.channel=e,this.id=(0,re.c)()}}var ne=r(46540);r(28449),(0,u.vt)(),new Float32Array(6);class oe extends q.J{constructor(e,t,r=null,i=k.X.Mesh,n=null,o=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=n,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,H.Dg)(r.indices)}),e===ne.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new oe(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===k.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===k.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.h)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,d.s)(t,0,0,0),(0,d.s)(te,0,0,0);let o=0,a=0;for(let e=0;e<n.length-2;e+=3){const s=n[e]*r,l=n[e+1]*r,c=n[e+2]*r;(0,d.s)(K,i[s],i[s+1],i[s+2]),(0,d.s)(Q,i[l],i[l+1],i[l+2]),(0,d.s)(ee,i[c],i[c+1],i[c+2]);const u=X(K,Q,ee);u?((0,d.g)(K,K,Q),(0,d.g)(K,K,ee),(0,d.j)(K,K,1/3*u),(0,d.g)(t,t,K),o+=u):((0,d.g)(te,te,K),(0,d.g)(te,te,Q),(0,d.g)(te,te,ee),a+=3)}return!(0===a&&0===o||(0!==o?((0,d.j)(t,t,1/o),0):0===a||((0,d.j)(t,te,1/a),0)))}(this.attributes.get(ne.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(ne.r.POSITION);return function(e,t,r){if(!e)return!1;(0,d.s)(r,0,0,0),(0,d.s)(te,0,0,0);let i=0,n=0;const{size:o,data:a,indices:s}=e,l=s.length-1,c=l+(t?2:0);for(let e=0;e<c;e+=2){const t=e<l?e+1:0,c=s[e<l?e:l]*o,u=s[t]*o;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],Q[0]=a[u],Q[1]=a[u+1],Q[2]=a[u+2],(0,d.j)(K,(0,d.g)(K,K,Q),.5);const h=(0,d.F)(K,Q);h>0?((0,d.g)(r,r,(0,d.j)(K,K,h)),i+=h):0===i&&((0,d.g)(te,te,K),n++)}return 0!==i?((0,d.j)(r,r,1/i),!0):0!==n&&((0,d.j)(r,te,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,d.s)(t,0,0,0);let o=-1,a=0;for(let e=0;e<n.length;e++){const s=n[e]*r;o!==s&&(t[0]+=i[s],t[1]+=i[s+1],t[2]+=i[s+2],a++),o=s}return a>1&&(0,d.j)(t,t,1/a),a>0}(this.attributes.get(ne.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(ne.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===k.X.Mesh?3:1;(0,U.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,H.tM)(e.indices.length/t);return new W(r,t,e)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}addHighlight(){const e=new ie(F.Mg.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(44208),se=r(65529),le=r(97768),ce=r(84952),de=r(56058),ue=r(2741);let he;var fe,me;(me=fe||(fe={}))[me.ETC1_RGB=0]="ETC1_RGB",me[me.ETC2_RGBA=1]="ETC2_RGBA",me[me.BC1_RGB=2]="BC1_RGB",me[me.BC3_RGBA=3]="BC3_RGBA",me[me.BC4_R=4]="BC4_R",me[me.BC5_RG=5]="BC5_RG",me[me.BC7_M6_RGB=6]="BC7_M6_RGB",me[me.BC7_M5_RGBA=7]="BC7_M5_RGBA",me[me.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",me[me.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",me[me.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",me[me.ATC_RGB=11]="ATC_RGB",me[me.ATC_RGBA=12]="ATC_RGBA",me[me.FXT1_RGB=17]="FXT1_RGB",me[me.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",me[me.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",me[me.ETC2_EAC_R11=20]="ETC2_EAC_R11",me[me.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",me[me.RGBA32=13]="RGBA32",me[me.RGB565=14]="RGB565",me[me.BGR565=15]="BGR565",me[me.RGBA4444=16]="RGBA4444";var pe=r(63907),ve=r(21231),ge=r(42293);let _e=null,xe=null;async function Te(){return null==xe&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,ue.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=he,_e=await xe),xe}function be(e,t,r,i,n){const o=(0,ge.IB)(t?pe.CQ.COMPRESSED_RGBA8_ETC2_EAC:pe.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Ee(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[fe.ETC2_RGBA,pe.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[fe.ETC1_RGB,pe.CQ.COMPRESSED_RGB8_ETC2]:c?i?[fe.BC3_RGBA,pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[fe.BC1_RGB,pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[fe.RGBA32,pe.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);return t.internalFormat=u,t.hasMipmap=f.length>1,t.samplingMode=t.hasMipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.width=n,t.height=o,new ve.g(e,t,{type:"compressed",levels:f})}const Se=()=>R.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function we(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Me=we("DXT1"),Ce=we("DXT3"),Oe=we("DXT5");function Ie(e,t,r){if(e instanceof ImageData)return Ie(Re(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function Re(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var Ne,Pe,Le=r(67171);class He extends q.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=k.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.A,this._parameters={...Be,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Le.R;return t.wrapMode=this._parameters.wrap??pe.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return t.encoding===F.JS.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===F.JS.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),i=ye(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ve.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,z.mg)(t)?this._loadFromPixelData(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<Ne.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Se().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Me:n=8,o=pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=pe.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:n=16,o=pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new ve.g(e,t,n)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const i=new _e.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const n=Ee(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const i=new _e.BasisFile(new Uint8Array(r));if(!ye(i))return null;i.startTranscoding();const n=Ee(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?pe.Ab.LUMINANCE:3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ve.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,de.Sx)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.xt)(l)},a=()=>{t.readyState>=Ne.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},s=e=>{o(),n(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,P.u7)(r,(()=>s((0,P.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?Re(e):e;let i=e.width,n=e.height;do{i=Math.ceil(i/2),n=Math.ceil(n/2),r=i*n}while(r>1048576||null!=t&&(i>t||n>t));return Ie(e,i,n)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return Ie(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=De(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,n.width=i.width,n.height=i.height,this._glTexture=new ve.g(e,n,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,le.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Ne||(Ne={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Be={wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Fe=r(24151),ze=r(1843),Ve=r(49255),Ge=r(96336),Ue=r(62602),We=r(59469),je=r(35093),qe=r(25634),ke=r(14903),$e=r(14327),Ye=r(90644);const Xe=(0,Ye.p3)(pe.dn.SRC_ALPHA,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA,pe.dn.ONE_MINUS_SRC_ALPHA),Ze=(0,Ye.p3)(pe.dn.ONE,pe.dn.ZERO,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA);function Je(e){switch(e){case $e.y.NONE:return Xe;case $e.y.ColorAlpha:return Ze;case $e.y.FrontFace:case $e.y.COUNT:return null}}const Ke={factor:-1,units:-2};function Qe(e){return e?Ke:null}function et(e,t=pe.MT.LESS){return e===$e.y.NONE||e===$e.y.FrontFace?t:pe.MT.LEQUAL}function tt(e){return e===$e.y.ColorAlpha?{buffers:[pe.Nm.COLOR_ATTACHMENT0,pe.Nm.COLOR_ATTACHMENT1]}:null}class rt{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const it=(0,h.vt)();function nt(e,t,r,i,n,o){if(!e.visible)return;const a=(0,d.z)(gt,i,r),s=(e,t,r)=>{o(e,r,t,!1)},l=new rt(!1,t.options.normalRequired);if(e.boundingInfo){(0,U.vA)(e.type===k.X.Mesh);const i=t.tolerance;at(e.boundingInfo,r,a,i,n,l,s)}else{const t=e.attributes.get(ne.r.POSITION),i=t.indices;!function(e,t,r,i,n,o,a,s,l,c){const u=t,h=_t,f=Math.abs(u[0]),m=Math.abs(u[1]),p=Math.abs(u[2]),v=f>=m?f>=p?0:2:m>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],y=u[T]/u[g],A=1/u[g],E=lt,S=ct,w=dt,{normalRequired:M}=l;for(let t=r;t<i;++t){const r=3*t,i=a*n[r];(0,d.s)(h[0],o[i+0],o[i+1],o[i+2]);const l=a*n[r+1];(0,d.s)(h[1],o[l+0],o[l+1],o[l+2]);const u=a*n[r+2];(0,d.s)(h[2],o[u+0],o[u+1],o[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.z)(E,h[0],e),(0,d.z)(S,h[1],e),(0,d.z)(w,h[2],e);const f=E[x]-b*E[g],m=E[T]-y*E[g],p=S[x]-b*S[g],v=S[T]-y*S[g],_=w[x]-b*w[g],C=w[T]-y*w[g],O=_*v-C*p,I=f*C-m*_,R=p*m-v*f;if((O<0||I<0||R<0)&&(O>0||I>0||R>0))continue;const N=O+I+R;if(0===N)continue;const P=O*(A*E[g])+I*(A*S[g])+R*(A*w[g]);if(P*Math.sign(N)<0)continue;const L=P/N;L>=0&&c(L,t,M?ht(h):null)}}(r,a,0,i.length/3,i,t.data,t.stride,n,l,s)}}const ot=(0,u.vt)();function at(e,t,r,i,n,o,a){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,ot);if((0,h.Ne)(it,e.bbMin),(0,h.vI)(it,e.bbMax),null!=n&&n.applyToAabb(it),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(it,t,s,i)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>pt){const s=e.getChildren();if(void 0!==s){for(const e of s)at(e,t,r,i,n,o,a);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],f=e[2],m=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],_=o[i+1],x=o[i+2];const T=a*n[r+1];let b=o[T],y=o[T+1],A=o[T+2];const E=a*n[r+2];let S=o[E],w=o[E+1],M=o[E+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,y,A]=l.applyToVertex(b,y,A,e),[S,w,M]=l.applyToVertex(S,w,M,e));const C=b-c,O=y-_,I=A-x,R=S-c,N=w-_,P=M-x,L=p*P-N*v,H=v*R-P*m,D=m*N-R*p,B=C*L+O*H+I*D;if(Math.abs(B)<=vt)continue;const F=u-c,z=h-_,V=f-x,G=F*L+z*H+V*D;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const U=z*I-O*V,W=V*C-I*F,j=F*O-C*z,q=m*U+p*W+v*j;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const k=(R*U+N*W+P*j)/B;k>=0&&d(k,t,g?ut(C,O,I,R,N,P,st):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,n,o,a)}}const st=(0,u.vt)();const lt=(0,u.vt)(),ct=(0,u.vt)(),dt=(0,u.vt)();function ut(e,t,r,i,n,o,a){return(0,d.s)(ft,e,t,r),(0,d.s)(mt,i,n,o),(0,d.b)(a,ft,mt),(0,d.n)(a,a),a}function ht(e){return(0,d.z)(ft,e[1],e[0]),(0,d.z)(mt,e[2],e[0]),(0,d.b)(st,ft,mt),(0,d.n)(st,st),st}const ft=(0,u.vt)(),mt=(0,u.vt)(),pt=1e3,vt=1e-7,gt=(0,u.vt)(),_t=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var xt,Tt;(Tt=xt||(xt={}))[Tt.INTEGRATED_MESH=0]="INTEGRATED_MESH",Tt[Tt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Tt[Tt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Tt[Tt.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",Tt[Tt.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",Tt[Tt.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",Tt[Tt.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",Tt[Tt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Tt[Tt.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",Tt[Tt.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",Tt[Tt.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",Tt[Tt.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",Tt[Tt.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",Tt[Tt.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",Tt[Tt.HUD_MATERIAL=14]="HUD_MATERIAL",Tt[Tt.LABEL_MATERIAL=15]="LABEL_MATERIAL",Tt[Tt.LINE_CALLOUTS=16]="LINE_CALLOUTS",Tt[Tt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Tt[Tt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Tt[Tt.DRAPED_WATER=19]="DRAPED_WATER",Tt[Tt.VOXEL=20]="VOXEL",Tt[Tt.MAX_SLOTS=21]="MAX_SLOTS";var bt=r(76412),yt=r(57005);const At=new class{constructor(e=0){this.offset=e,this.sphere=(0,bt.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,n=(0,d.s)(Et,e,t,r),o=(0,d.h)(n,n,i),a=this.offset/(0,d.l)(o);(0,d.r)(o,o,o,a);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,o,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.r)(e,e,e,r);const i=this.offset/(0,d.l)(t);(0,d.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,bt.g)(e)),r=this.offset/t;return(0,d.r)((0,bt.g)(this.sphere),(0,bt.g)(e),(0,bt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,bt.c)(),this._tmpObb=new yt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,d.l)(e)}applyToVertex(e,t,r){const i=(0,d.s)(Et,e,t,r),n=(0,d.s)(St,e,t,r+this.componentLocalOriginLength),o=this._totalOffset/(0,d.l)(n);return(0,d.r)(this._tmpVertex,i,n,o),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),f=Math.abs(s),m=.5*(1+Math.sign(r*o))*Math.min(l,u),p=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(n*s))*Math.min(d,f),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,f),T=Math.sqrt(m*m+p*p+v*v),b=Math.sign(l+r),y=Math.sign(c+i),A=Math.sign(d+n),E=Math.sign(u+o),S=Math.sign(h+a),w=Math.sign(f+s),M=this._totalOffset;if(T<M)return e[0]-=(1-b)*M,e[1]-=(1-y)*M,e[2]-=(1-A)*M,e[3]+=E*M,e[4]+=S*M,e[5]+=w*M,e;const C=M/Math.sqrt(g*g+_*_+x*x),O=M/T,I=O-C,R=-I;return e[0]+=r*(b*R+O),e[1]+=i*(y*R+O),e[2]+=n*(A*R+O),e[3]+=o*(E*I+C),e[4]+=a*(S*I+C),e[5]+=s*(w*I+C),e}applyToMbs(e){const t=(0,d.l)((0,bt.g)(e)),r=this._totalOffset/t;return(0,d.r)((0,bt.g)(this._tmpMbs),(0,bt.g)(e),(0,bt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,yt.gm)(e,this._totalOffset,this._totalOffset,Fe.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const i=(0,d.s)(Et,e,t,r),n=(0,d.g)(St,i,this.localOrigin),o=this.offset/(0,d.l)(n);return(0,d.r)(this.tmpVertex,i,n,o),this.tmpVertex}applyToAabb(e){const t=wt,r=Mt,i=Ct;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(!(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Et=(0,u.vt)(),St=(0,u.vt)(),wt=(0,u.vt)(),Mt=(0,u.vt)(),Ct=(0,u.vt)();function Ot(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function It(e,t,r,i){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function Rt(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function Nt(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function Pt(e,t,r,i,n,o){switch(e){case ne.r.POSITION:{(0,U.vA)(3===t.size);const i=n.getField(e,m.xs);(0,U.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,n=1){if(!t)return void It(e,r,i,n);const{data:o,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,d=a.length,u=t[0],h=t[1],f=t[2],m=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],y=t[14];i*=c;let A=0,E=0,S=0;const w=(0,s.tZ)(t)?e=>{A=o[e]+T,E=o[e+1]+b,S=o[e+2]+y}:e=>{const t=o[e],r=o[e+1],i=o[e+2];A=u*t+m*r+g*i+T,E=h*t+p*r+_*i+b,S=f*t+v*r+x*i+y};if(1===n)for(let e=0;e<d;++e)w(3*a[e]),l[i]=A,l[i+1]=E,l[i+2]=S,i+=c;else for(let e=0;e<d;++e){w(3*a[e]);for(let e=0;e<n;++e)l[i]=A,l[i+1]=E,l[i+2]=S,i+=c}}(t,r,i,o);break}case ne.r.NORMAL:{(0,U.vA)(3===t.size);const r=n.getField(e,m.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,n=1){if(!t)return void It(e,r,i,n);const{data:o,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;i*=d;let E=0,S=0,w=0;const M=(0,s.tZ)(l)?e=>{E=o[e],S=o[e+1],w=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];E=h*t+p*r+_*i,S=f*t+v*r+x*i,w=m*t+g*r+T*i};if(1===n)if(b)for(let e=0;e<u;++e){M(3*a[e]);const t=E*E+S*S+w*w;if(t<A&&t>y){const e=1/Math.sqrt(t);c[i]=E*e,c[i+1]=S*e,c[i+2]=w*e}else c[i]=E,c[i+1]=S,c[i+2]=w;i+=d}else for(let e=0;e<u;++e)M(3*a[e]),c[i]=E,c[i+1]=S,c[i+2]=w,i+=d;else for(let e=0;e<u;++e){if(M(3*a[e]),b){const e=E*E+S*S+w*w;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,w*=t}}for(let e=0;e<n;++e)c[i]=E,c[i+1]=S,c[i+2]=w,i+=d}}(t,i,r,o);break}case ne.r.NORMALCOMPRESSED:{(0,U.vA)(2===t.size);const r=n.getField(e,m.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ot(t,r,o);break}case ne.r.UV0:{(0,U.vA)(2===t.size);const r=n.getField(e,m.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ot(t,r,o);break}case ne.r.COLOR:case ne.r.SYMBOLCOLOR:{const r=n.getField(e,m.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==o.length||4!==t)if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}else{s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*n;for(let r=1;r<d;++r)e[i]=a,i+=t}}(t,t.size,r,o);break}case ne.r.COLORFEATUREATTRIBUTE:{const r=n.getField(e,m.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,o);break}case ne.r.TANGENT:{(0,U.vA)(4===t.size);const i=n.getField(e,m.Eq);(0,U.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,n=1){if(!t)return void Rt(e,r,i,n);const{data:o,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;if(i*=d,1===n)for(let e=0;e<u;++e){const t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3];let u=h*r+p*n+_*s,E=f*r+v*n+x*s,S=m*r+g*n+T*s;if(b){const e=u*u+E*E+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}c[i]=u,c[i+1]=E,c[i+2]=S,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],u=o[t+3];let E=h*r+p*s+_*l,S=f*r+v*s+x*l,w=m*r+g*s+T*l;if(b){const e=E*E+S*S+w*w;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,w*=t}}for(let e=0;e<n;++e)c[i]=E,c[i+1]=S,c[i+2]=w,c[i+3]=u,i+=d}}(t,r,i,o);break}case ne.r.PROFILERIGHT:case ne.r.PROFILEUP:case ne.r.PROFILEVERTEXANDNORMAL:case ne.r.FEATUREVALUE:{(0,U.vA)(4===t.size);const r=n.getField(e,m.Eq);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Rt(t,r,o)}}}class Lt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(ne.r.POSITION).indices.length}write(e,t,r,i,n){!function(e,t,r,i,n,o){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Pt(a,t,r,i,n,o);else if(a===ne.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(ne.r.POSITION)?.indices;if(t){const r=t.length,i=n.getField(a,m.XP);Nt(e.objectAndLayerIdColor,i,r,o)}}}}(r,this.vertexBufferLayout,e,t,i,n)}}var Ht=r(13752),Dt=r(91829),Bt=r(53466),Ft=r(72824),zt=r(97220),Vt=r(84867),Gt=r(39341),Ut=r(34886);pe.MT.LESS,pe.MT.ALWAYS;const Wt={mask:255},jt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.ZERO}},qt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.REPLACE}};pe.MT.EQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP,pe.MT.NOTEQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP;const kt=[1,1,.5],$t=[0,.6,.2],Yt=[0,1,.2];var Xt=r(28491);class Zt extends Ft.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(kt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=F.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Ge.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Dt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=F.it.Less,this.textureAlphaMode=F.sf.Blend,this.textureAlphaCutoff=je.Q,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ke.m$.Occlude,this.isDecoration=!1}}Ft.gy;class Jt extends Vt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?Bt.q.Default:Bt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Jt.shader)}_initializeProgram(e,t){return new Ut.B(e.rctx,t.get().build(this.configuration),Gt.D)}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,writeDepth:a,hasOccludees:s,enableOffset:l}=this.configuration,c=e===$e.y.NONE,d=e===$e.y.FrontFace;return(0,Ye.Ey)({blending:r===Ve.V.Color&&i?Je(e):null,culling:Qt(this.configuration)?(0,Ye.Xt)(n):null,depthTest:{func:et(e,Kt(o))},depthWrite:(c||d)&&a?Ye.kn:null,drawBuffers:r===Ve.V.Depth?{buffers:[pe.Hr.NONE]}:tt(e),colorWrite:Ye.wE,stencilWrite:s?Wt:null,stencilTest:s?t?qt:jt:null,polygonOffset:c||d?null:Qe(l)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Kt(e){return e===F.it.Lequal?pe.MT.LEQUAL:pe.MT.LESS}function Qt(e){return e.cullFace!==F.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Jt.shader=new zt.$(Xt.D,(()=>r.e(5141).then(r.bind(r,5141))));var er=r(90237),tr=r(99769),rr=r(82991),ir=r(46263);class nr extends rr.nW{}(0,er._)([(0,tr.W)({constValue:!0})],nr.prototype,"hasSliceHighlight",void 0),(0,er._)([(0,tr.W)({constValue:!1})],nr.prototype,"hasSliceInVertexProgram",void 0),(0,er._)([(0,tr.W)({constValue:ir.c.Pass})],nr.prototype,"pbrTextureBindType",void 0);class or extends nr{constructor(){super(...arguments),this.output=Ve.V.Color,this.alphaDiscardMode=F.sf.Opaque,this.doubleSidedMode=Ue.W.None,this.pbrMode=We.A9.Disabled,this.cullFace=F.s2.None,this.transparencyPassType=$e.y.NONE,this.normalType=Ge.W.Attribute,this.textureCoordinateType=Bt.q.None,this.customDepthTest=F.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.discardInvisibleFragments=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,er._)([(0,tr.W)({count:Ve.V.COUNT})],or.prototype,"output",void 0),(0,er._)([(0,tr.W)({count:F.sf.COUNT})],or.prototype,"alphaDiscardMode",void 0),(0,er._)([(0,tr.W)({count:Ue.W.COUNT})],or.prototype,"doubleSidedMode",void 0),(0,er._)([(0,tr.W)({count:We.A9.COUNT})],or.prototype,"pbrMode",void 0),(0,er._)([(0,tr.W)({count:F.s2.COUNT})],or.prototype,"cullFace",void 0),(0,er._)([(0,tr.W)({count:$e.y.COUNT})],or.prototype,"transparencyPassType",void 0),(0,er._)([(0,tr.W)({count:Ge.W.COUNT})],or.prototype,"normalType",void 0),(0,er._)([(0,tr.W)({count:Bt.q.COUNT})],or.prototype,"textureCoordinateType",void 0),(0,er._)([(0,tr.W)({count:F.it.COUNT})],or.prototype,"customDepthTest",void 0),(0,er._)([(0,tr.W)()],or.prototype,"spherical",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVertexColors",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSymbolColors",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVerticalOffset",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSlicePlane",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSliceHighlight",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasColorTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasMetallicRoughnessTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasEmissionTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOcclusionTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasNormalTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasScreenSizePerspective",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVertexTangents",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOccludees",void 0),(0,er._)([(0,tr.W)()],or.prototype,"multipassEnabled",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasModelTransformation",void 0),(0,er._)([(0,tr.W)()],or.prototype,"offsetBackfaces",void 0),(0,er._)([(0,tr.W)()],or.prototype,"vvSize",void 0),(0,er._)([(0,tr.W)()],or.prototype,"vvColor",void 0),(0,er._)([(0,tr.W)()],or.prototype,"receiveShadows",void 0),(0,er._)([(0,tr.W)()],or.prototype,"receiveAmbientOcclusion",void 0),(0,er._)([(0,tr.W)()],or.prototype,"textureAlphaPremultiplied",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instanced",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instancedColor",void 0),(0,er._)([(0,tr.W)()],or.prototype,"objectAndLayerIdColorInstanced",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instancedDoublePrecision",void 0),(0,er._)([(0,tr.W)()],or.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,er._)([(0,tr.W)()],or.prototype,"writeDepth",void 0),(0,er._)([(0,tr.W)()],or.prototype,"transparent",void 0),(0,er._)([(0,tr.W)()],or.prototype,"discardInvisibleFragments",void 0),(0,er._)([(0,tr.W)()],or.prototype,"enableOffset",void 0),(0,er._)([(0,tr.W)()],or.prototype,"cullAboveGround",void 0),(0,er._)([(0,tr.W)()],or.prototype,"snowCover",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasColorTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasEmissionTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasNormalTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOcclusionTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,er._)([(0,tr.W)({constValue:!1})],or.prototype,"occlusionPass",void 0),(0,er._)([(0,tr.W)({constValue:!0})],or.prototype,"hasVvInstancing",void 0),(0,er._)([(0,tr.W)({constValue:!1})],or.prototype,"useCustomDTRExponentForWater",void 0),(0,er._)([(0,tr.W)({constValue:!1})],or.prototype,"supportsTextureAtlas",void 0),(0,er._)([(0,tr.W)({constValue:!0})],or.prototype,"useFillLights",void 0);var ar=r(57323);class sr extends Jt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ge.W.Attribute,t.doubleSidedMode=Ue.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,sr.shader)}}sr.shader=new zt.$(ar.R,(()=>r.e(9933).then(r.bind(r,39933))));class lr extends ke.im{constructor(e){super(e,dr),this._configuration=new or,this.supportsEdges=!0,this.produces=new Map([[xt.OPAQUE_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&!this.parameters.transparent],[xt.TRANSPARENT_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,ze.BP)().vec3f(ne.r.POSITION);return e.normalType===Ge.W.Compressed?t.vec2i16(ne.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ne.r.NORMAL),e.hasVertexTangents&&t.vec4f(ne.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ne.r.UV0),e.hasVertexColors&&t.vec4u8(ne.r.COLOR),e.hasSymbolColors&&t.vec4u8(ne.r.SYMBOLCOLOR),(0,ae.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ne.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ve.V.Shadow&&e!==Ve.V.ShadowExcludeHighlight&&e!==Ve.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<je.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:n}=e,o=t||n||i,a="replace"===e.colorMixMode,s=e.opacity>=je.Q;if(r&&o)return a||s;const l=e.externalColor&&e.externalColor[3]>=je.Q;return r?a?l:s:o?a||s:a?l:s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?F.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===Ve.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.W.WindingOrder:Ue.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?We.A9.Schematic:We.A9.Normal:We.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(vr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case Fe.RT.Global:o=(0,d.n)(mr,vr);break;case Fe.RT.Local:o=(0,d.c)(mr,fr)}let a=0;const s=(0,d.f)(gr,vr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(o,c)),a+=(0,Ht.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(o,o,a),(0,d.t)(pr,o,r.transform.inverseRotation),i=(0,d.f)(ur,i,pr),n=(0,d.f)(hr,n,pr)}var a;nt(e,r,i,n,null!=(a=r.verticalOffset)?(At.offset=a,At):null,o)}createGLMaterial(e){return new cr(e)}createBufferWriter(){return new Lt(this._vertexBufferLayout)}}class cr extends qe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===Ve.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?sr:Jt,e)}}class dr extends Zt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const ur=(0,u.vt)(),hr=(0,u.vt)(),fr=(0,u.fA)(0,0,1),mr=(0,u.vt)(),pr=(0,u.vt)(),vr=(0,u.vt)(),gr=(0,u.vt)(),_r=()=>R.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function xr(e){throw new I.A("",`Request for object resource failed: ${e}`)}function Tr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(_r().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(_r().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(_r().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(_r().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else _r().warn("Indexed geometries must specify faces"),i=!1;break}default:_r().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(_r().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(_r().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function br(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function yr(e){switch(e){case"mask":return F.sf.Mask;case"maskAndTransparency":return F.sf.MaskBlend;case"none":return F.sf.Opaque;default:return F.sf.Blend}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Er=new L.R(1,2,"wosr");var Sr=r(61765);async function wr(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,C.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,P.QP)(i.error),xr(i.error.details.url)}(e,r,t);const i=await(0,C.Ke)((0,M.A)(e,t));if(!0===i.ok)return i.value.data;(0,P.QP)(i.error),xr(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){_r().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},preMultiplyAlpha:yr(l)!==F.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):D(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:n+(0,O.iL)(r)}}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new N,a=e.resource,s=L.R.parse(a.version||"1.0","wosr");Er.validate(s);const l=a.model.name,c=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let f=0;const m=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!Tr(a))continue;const s=Ar(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[ne.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,H.tM)(_);p.push([e,new B.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!m.has(x)){const{image:e,parameters:t}=T,r=new He(e,t);i.push(r),m.set(x,r)}const b=m.get(x),y=b?b.id:void 0,A=s.material;let E=o.get(A,x);if(null==E){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,n=T?yr(T.alphaChannelUsage):void 0,a={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:n,textureAlphaCutoff:.33,textureId:y,initTextureTransparent:!0,doubleSided:!0,cullFace:F.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),E=new lr(a),o.set(A,x,E)}n.push(E);const S=new oe(E,p);f+=p.find((e=>e[0]===ne.r.POSITION))?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:br(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let A;if(t.cache)A=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(4399).then(r.bind(r,4399));A=await e(new T.R(t.streamDataRequester),a.url,t,t.usePBR)}const S=A.model.meta?.ESRI_proxyEllipsoid,I=A.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===A.meta.ESRI_webstyle;I&&!A.customMeta.esriTreeRendering&&(A.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const n of i.parts){const i=n.attributes.normal;if(null==i)return;const o=n.attributes.position,a=o.count,c=(0,u.vt)(),h=(0,u.vt)(),f=(0,u.vt)(),p=new Uint8Array(4*a),v=new Float64Array(3*a),g=(0,s.B8)((0,l.vt)(),n.transform);let _=0,x=0;for(let s=0;s<a;s++){o.getVec(s,h),i.getVec(s,c),(0,d.h)(h,h,n.transform),(0,d.f)(f,h,t.center),(0,d.D)(f,f,t.radius);const a=f[2],l=(0,d.l)(f),u=Math.min(.45+.55*l*l,1);(0,d.D)(f,f,t.radius),null!==g&&(0,d.h)(f,f,g),(0,d.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(f,f,c,a>-1?.2:Math.min(-4*a-3.8,1)),v[_]=f[0],v[_+1]=f[1],v[_+2]=f[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}n.attributes.normal=new m.xs(v),n.attributes.color=new m.XP(p)}}}(A,S));const R=!!t.usePBR,z=A.meta.isEsriSymbolResource?{usePBR:R,isSchematic:!1,treeRendering:I,mrrFactors:[...Yt]}:{usePBR:R,isSchematic:!1,treeRendering:!1,mrrFactors:[...kt]},V={...t.materialParameters,treeRendering:I},{engineResources:G,referenceBoundingBox:U}=function(e,t,r,i){const a=e.model,s=new Array,l=new Map,T=new Map,A=a.lods.length,S=(0,h.Ie)();return a.lods.forEach(((e,M)=>{const C=!0===i.skipHighLods&&(A>1&&0===M||A>3&&1===M)||!1===i.skipHighLods&&null!=i.singleLodIndex&&M!==i.singleLodIndex;if(C&&0!==M)return;const O=new w(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=C?new lr({}):function(e,t,r,i,n,o,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,f=null!=t.attributes.normal;if(null==l)return null;const m=function(e){switch(e){case"BLEND":return F.sf.Blend;case"MASK":return F.sf.Mask;case"OPAQUE":case null:case void 0:return F.sf.Opaque}}(l.alphaMode);if(!o.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new He((0,y.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&r,encoding:(0,y.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,m!==F.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/Sr.T),p=l.color[1]**(1/Sr.T),v=l.color[2]**(1/Sr.T),g=l.emissiveFactor[0]**(1/Sr.T),_=l.emissiveFactor[1]**(1/Sr.T),x=l.emissiveFactor[2]**(1/Sr.T),T=null!=l.textureColor&&h?a.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:n,emissiveFactor:o,occlusionTexture:a}){return null==e&&null==t&&null==n&&(null==o||(0,d.e)(o,u.uY))&&null==a&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),A=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;o.set(s,new lr({...i,transparent:m===F.sf.Blend,customDepthTest:F.it.Lequal,textureAlphaMode:m,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?F.s2.None:F.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:f?Ge.W.Attribute:Ge.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...$t]:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:E(l.colorTextureTransform),normalTextureTransformMatrix:E(l.normalTextureTransform),scale:[A[0],A[1]],occlusionTextureTransformMatrix:E(l.occlusionTextureTransform),emissiveTextureTransformMatrix:E(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(l.metallicRoughnessTextureTransform),...n}))}const p=o.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(a,e,O,t,r,l,T),{geometry:s,vertexCount:A}=function(e,t){const r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),a=(0,f.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(a,s,e.transform,3,l);const c=[[ne.r.POSITION,new B.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,f.oe)(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,o.Ge)(Mr,e.transform),(0,p.t)(t,a,Mr,3,s),(0,n.or)(Mr)&&(0,p.n)(t,t),c.push([ne.r.NORMAL,new B.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,f.oe)(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,o.z0)(Mr,e.transform),(0,v.t)(t,a,Mr,4,s),(0,n.or)(Mr)&&(0,p.n)(t,t,4),c.push([ne.r.TANGENT,new B.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,f.oe)(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,g.a)(t,n,2,o),c.push([ne.r.UV0,new B.n(t,i,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof m.Eq?(0,v.b)(t,d,255):d instanceof m.XP?(0,x.a)(t,d):d instanceof m.Uz&&(0,v.b)(t,d,1/256):(t.fill(255),d instanceof m.xs?(0,p.f)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof m.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.f)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([ne.r.COLOR,new B.n(t,i,4,!0)])}return{geometry:new oe(t,c),vertexCount:r}}(e,null!=i?i:new lr({})),w=s.boundingInfo;null!=w&&0===M&&((0,h.iT)(S,w.bbMin),(0,h.iT)(S,w.bbMax)),null!=i&&(O.stageResources.geometries.push(s),O.numberOfVertices+=A)})),C||s.push(O)})),{engineResources:s,referenceBoundingBox:S}}(A,z,V,t.skipHighLods&&null==a.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:a.specifiedLodIndex});return{lods:G,referenceBoundingBox:U,isEsriSymbolResource:A.meta.isEsriSymbolResource,isWosr:!1}}const Mr=(0,a.vt)()},66104:(e,t,r)=>{var i,n;r.d(t,{k5:()=>i}),r(34727),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},42583:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(66104),n=r(2597);function o(e){e.vertex.code.add(n.H`
224
+ fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},76412:(e,t,r)=>{r.d(t,{c:()=>p,d:()=>_,f:()=>b,g:()=>T,h:()=>x,k:()=>w,o:()=>P}),r(44208),r(53966);var i=r(34727),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(34304),d=r(88582),u=r(71351),h=r(44280),f=r(32114);const m=p();function p(){return(0,l.vt)()}const v=s.e,g=s.e;function _(e,t){return(0,s.c)(t,e)}function x(e){return e[3]}function T(e){return e}function b(e,t,r,i){return(0,l.fA)(e,t,r,i)}function y(e,t,r){if(null==t)return!1;if(!E(e,t,A))return!1;let{t0:i,t1:n}=A;if((i<0||n<i&&n>0)&&(i=n),i<0)return!1;if(r){const{origin:e,direction:n}=t;r[0]=e[0]+n[0]*i,r[1]=e[1]+n[1]*i,r[2]=e[2]+n[2]*i}return!0}const A={t0:0,t1:0};function E(e,t,r){const{origin:i,direction:n}=t,o=S;o[0]=i[0]-e[0],o[1]=i[1]-e[1],o[2]=i[2]-e[2];const a=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];if(0===a)return!1;const s=2*(n[0]*o[0]+n[1]*o[1]+n[2]*o[2]),l=s*s-4*a*(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*a),r.t1=(-s+c)/(2*a),!0}const S=(0,a.vt)();function w(e,t){return y(e,t,null)}function M(e,t,r){const i=f.rq.get(),a=f.Rc.get();(0,o.b)(i,t.origin,t.direction);const s=x(e);(0,o.b)(r,i,t.origin),(0,o.j)(r,r,1/(0,o.l)(r)*s);const l=O(e,t.origin),c=(0,h.g7)(t.origin,r);return(0,n.$0)(a,c+l,i),(0,o.h)(r,r,a),r}function C(e,t,r){const i=(0,o.f)(f.rq.get(),t,e),n=(0,o.j)(f.rq.get(),i,e[3]/(0,o.l)(i));return(0,o.g)(r,n,e)}function O(e,t){const r=(0,o.f)(f.rq.get(),t,e),n=(0,o.l)(r),a=x(e),s=a+Math.abs(a-n);return(0,i.XM)(a/s)}const I=(0,a.vt)();function R(e,t,r,n){const a=(0,o.f)(I,t,e);switch(r){case d._.X:{const e=(0,i.jU)(a,I)[2];return(0,o.s)(n,-Math.sin(e),Math.cos(e),0)}case d._.Y:{const e=(0,i.jU)(a,I),t=e[1],r=e[2],s=Math.sin(t);return(0,o.s)(n,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d._.Z:return(0,o.n)(n,a);default:return}}function N(e,t){const r=(0,o.f)(L,t,e);return(0,o.l)(r)-e[3]}function P(e,t){const r=(0,o.a)(e,t),i=x(e);return r<=i*i}const L=(0,a.vt)(),H=p();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:m,altitudeAt:N,angleToSilhouette:O,axisAt:R,cameraFrustumCoverage:function(e,t,r,i){const n=x(e),o=n*n,a=t+.5*Math.PI,s=r*r+o-2*Math.cos(a)*r*n,l=Math.sqrt(s),c=s-o;if(c<=0)return.5;const d=Math.sqrt(c),u=Math.acos(d/l)-Math.asin(n/(l/Math.sin(a)));return Math.min(1,(u+.5*i)/i)},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return y(e,t,r)?r:((0,u.oC)(t,e,r),C(e,r,r))},closestPointOnSilhouette:M,containsPoint:P,copy:_,create:p,distanceToSilhouette:function(e,t){const r=(0,o.f)(f.rq.get(),t,e),i=(0,o.q)(r),n=e[3]*e[3];return Math.sqrt(Math.abs(i-n))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:g,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,l.fA)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:b,getCenter:T,getExtent:function(e,t){return t},getRadius:x,intersectLine:function(e,t,r){const i=(0,u.Cr)(t,r);if(!E(e,i,A))return[];const{origin:n,direction:s}=i,{t0:l,t1:d}=A,h=t=>{const r=(0,a.vt)();return(0,o.r)(r,n,s,t),C(e,r,r)};return Math.abs(l-d)<(0,c.FD)()?[h(l)]:[h(l),h(d)]},intersectRay:y,intersectRayClosestSilhouette:function(e,t,r){if(y(e,t,r))return r;const i=M(e,t,f.rq.get());return(0,o.g)(r,t.origin,(0,o.j)(f.rq.get(),t.direction,(0,o.p)(t.origin,i)/(0,o.l)(t.direction))),r},intersectsRay:w,projectPoint:C,setAltitudeAt:function(e,t,r,i){const n=N(e,t),a=R(e,t,d._.Z,L),s=(0,o.j)(L,a,r-n);return(0,o.g)(i,t,s)},setExtent:function(e,t,r){return e!==r&&_(e,r),r},tmpSphere:H,union:function(e,t,r=(0,l.vt)()){const i=(0,o.p)(e,t),n=e[3],a=t[3];return i+a<n?((0,s.c)(r,e),r):i+n<a?((0,s.c)(r,t),r):((0,o.o)(r,e,t,(i+a-n)/(2*i)),r[3]=(i+n+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let a=0,s=0;if((0,i.cy)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354:(e,t,r)=>{function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,i=3,n=i){if(e.length/i!==Math.ceil(t.length/n))return e;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[4],d=r[5],u=r[6],h=r[8],f=r[9],m=r[10],p=r[12],v=r[13],g=r[14];let _=0,x=0;for(let r=0;r<o;r++){const r=t[_],o=t[_+1],T=t[_+2];e[x]=a*r+c*o+h*T+p,e[x+1]=s*r+d*o+f*T+v,e[x+2]=l*r+u*o+m*T+g,_+=n,x+=i}return e}function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,i=3,n=i){if(e.length/i!==Math.ceil(t.length/n))return;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],f=r[7],m=r[8];let p=0,v=0;for(let r=0;r<o;r++){const r=t[p],o=t[p+1],g=t[p+2];e[v]=a*r+c*o+h*g,e[v+1]=s*r+d*o+f*g,e[v+2]=l*r+u*o+m*g,p+=n,v+=i}}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i=3,n=i){const o=e.length/i;if(o!==Math.ceil(t.length/n))return e;let a=0,s=0;for(let l=0;l<o;l++)e[s]=t[a]+r[0],e[s+1]=t[a+1]+r[1],e[s+2]=t[a+2]+r[2],a+=n,s+=i;return e}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,a=0;for(let s=0;s<n;s++){const n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}r.d(t,{a:()=>n,b:()=>c,c:()=>o,d:()=>i,e:()=>d,f:()=>l,n:()=>u,s:()=>s,t:()=>a}),r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:l,scaleView:s,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:a,transformMat3View:o,transformMat4:n,transformMat4View:i,translate:c},Symbol.toStringTag,{value:"Module"}))},51737:(e,t,r)=>{function i(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=3,i=r){const n=t.length/i;let o=0,a=0;for(let s=0;s<n;++s)e[o]=t[a],e[o+1]=t[a+1],e[o+2]=t[a+2],o+=r,a+=i}function o(e,t,r,i,n){const o=e.typedBuffer,a=e.typedBufferStride,s=n?.count??e.count;let l=(n?.dstIndex??0)*a;for(let e=0;e<s;++e)o[l]=t,o[l+1]=r,o[l+2]=i,l+=a}r.d(t,{a:()=>i,c:()=>n,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:n,copyView:i,fill:o},Symbol.toStringTag,{value:"Module"}))},65686:(e,t,r)=>{r.d(t,{a:()=>n,b:()=>l,n:()=>a,s:()=>s,t:()=>o}),r(44208);var i=r(53966);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,i=4,n=i){if(e.length/i!=t.length/n)return;const o=e.length/i,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],f=r[7],m=r[8];let p=0,v=0;for(let r=0;r<o;r++){const r=t[p],o=t[p+1],g=t[p+2],_=t[p+3];e[v]=a*r+c*o+h*g,e[v+1]=s*r+d*o+f*g,e[v+2]=l*r+u*o+m*g,e[v+3]=_,p+=n,v+=i}}function a(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,o=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*n,r=e*a,s=o[r],l=o[r+1],c=o[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,i=4){const n=Math.min(e.length/i,t.count),o=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<n;t++)e[l]=r*o[s],e[l+1]=r*o[s+1],e[l+2]=r*o[s+2],e[l+3]=r*o[s+3],s+=a,l+=i}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:l,scaleView:s,transformMat3:o,transformMat3View:n,transformMat4:function(e,t,r,n=4,o=n){if(e.length/n!=t.length/o)return void i.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const a=e.length/n,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],f=r[6],m=r[7],p=r[8],v=r[9],g=r[10],_=r[11],x=r[12],T=r[13],b=r[14],y=r[15];let A=0,E=0;for(let r=0;r<a;r++){const r=t[A],i=t[A+1],a=t[A+2],S=t[A+3];e[E]=s*r+u*i+p*a+x*S,e[E+1]=l*r+h*i+v*a+T*S,e[E+2]=c*r+f*i+g*a+b*S,e[E+3]=d*r+m*i+_*a+y*S,A+=o,E+=n}},transformMat4View:function(e,t,r){if(e.count!==t.count)return;const i=e.count,n=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],f=r[9],m=r[10],p=r[11],v=r[12],g=r[13],_=r[14],x=r[15],T=e.typedBuffer,b=e.typedBufferStride,y=t.typedBuffer,A=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*b,r=e*A,i=y[r],E=y[r+1],S=y[r+2],w=y[r+3];T[t]=n*i+l*E+h*S+v*w,T[t+1]=o*i+c*E+f*S+g*w,T[t+2]=a*i+d*E+m*S+_*w,T[t+3]=s*i+u*E+p*S+x*w}}},Symbol.toStringTag,{value:"Module"}))},78358:(e,t,r)=>{function i(e,t){n(e.typedBuffer,t,e.typedBufferStride)}function n(e,t,r=4){const i=t.typedBuffer,n=t.typedBufferStride,o=t.count;let a=0,s=0;for(let t=0;t<o;++t)e[a]=i[s],e[a+1]=i[s+1],e[a+2]=i[s+2],e[a+3]=i[s+3],a+=r,s+=n}function o(e,t,r,i,n,o){const a=e.typedBuffer,s=e.typedBufferStride,l=o?.count??e.count;let c=(o?.dstIndex??0)*s;for(let e=0;e<l;++e)a[c]=t,a[c+1]=r,a[c+2]=i,a[c+3]=n,c+=s}r.d(t,{a:()=>n,c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:n,copyView:i,fill:o},Symbol.toStringTag,{value:"Module"}))},4341:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),l=parseInt(o,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function n(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,o.c)(r.origin,e),(0,o.f)(r.vector,t,e),r}function d(e,t){const r=(0,o.f)(s.rq.get(),t,e.origin),n=(0,o.m)(e.vector,r),a=(0,o.m)(e.vector,e.vector),l=(0,i.qE)(n/a,0,1),c=(0,o.f)(s.rq.get(),(0,o.j)(s.rq.get(),e.vector,l),r);return(0,o.m)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,n,a){const{vector:l,origin:c}=e,d=(0,o.f)(s.rq.get(),t,c),u=(0,o.m)(l,d)/(0,o.q)(l);return(0,o.j)(a,l,(0,i.qE)(u,r,n)),(0,o.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new n.I((()=>l()))},71351:(e,t,r)=>{r.d(t,{Cr:()=>d,LV:()=>c,kb:()=>u,oC:()=>h,vt:()=>s}),r(4576);var i=r(4341),n=r(38954),o=r(51850),a=r(32114);function s(e){return e?l((0,o.o8)(e.origin),(0,o.o8)(e.direction)):l((0,o.vt)(),(0,o.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=f.get();return r.origin=e,r.direction=t,r}function d(e,t,r=s()){return(0,n.c)(r.origin,e),(0,n.f)(r.direction,t,e),r}function u(e,t){const r=(0,n.b)(a.rq.get(),(0,n.n)(a.rq.get(),e.direction),(0,n.f)(a.rq.get(),t,e.origin));return(0,n.m)(r,r)}function h(e,t,r){const i=(0,n.m)(e.direction,(0,n.f)(r,t,e.origin));return(0,n.g)(r,e.origin,(0,n.j)(r,e.direction,i)),r}const f=new i.I((()=>s()));(0,o.vt)()},21015:(e,t,r)=>{r.d(t,{R:()=>l});var i=r(78888),n=r(60999),o=r(49186),a=r(74887),s=r(84952);class l{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,i.A)(t,{responseType:c[e]})).data;const s=await(0,n.Ke)(this._streamDataRequester.request(t,e,r));if(!0===s.ok)return s.value;throw(0,a.QP)(s.error),new o.A("",`Request for resource failed: ${s.error}`)}}const c={image:"image",binary:"array-buffer",json:"json","image+type":void 0}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return"number"==typeof(r=e)?(0,n.tM)(r):(0,i.mg)(r)?new Uint16Array(r):r;case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}var r}},51530:(e,t,r)=>{r.d(t,{KB:()=>s,Xi:()=>o,pn:()=>l,x3:()=>a});var i=r(44208),n=r(89192);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=n.JS.KTX2_ENCODING}}function a(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function l(e,t){if(t===n.JS.KTX2_ENCODING)return new o(e);const r=new Blob([e],{type:t}),a=URL.createObjectURL(r),s=new Image;if((0,i.A)("esri-iPhone"))return new Promise(((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(a),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=a}));try{s.src=a,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),s}},55268:(e,t,r)=>{r.d(t,{fetch:()=>wr});var i=r(61473),n=r(34727),o=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),f=r(11868),m=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(84498),y=r(51530),A=r(88340);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:A.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:A.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class w{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var M=r(78888),C=r(60999),O=r(86805),I=r(49186),R=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}var P=r(74887),L=r(46140),H=r(97146);async function D(e,t){const{data:r}=await(0,M.A)(e,{responseType:"image",...t});return r}var B=r(46610),F=r(89192),z=r(34275);function V(e){if(e.length<z.y9)return Array.from(e);if((0,z.cy)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(3694),U=r(620);class W{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,U.vA)(e.length>=1),(0,U.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,U.vA)(o.length%this._numIndexPerPrimitive==0),(0,U.vA)(o.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let s=n*o[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(s);const l=(0,u.fA)(i[s],i[s+1],i[s+2]),c=(0,u.o8)(l);for(let t=0;t<a;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*o[r+e],j.push(s);let t=i[s];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=i[s+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=i[s+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}this.bbMin=l,this.bbMax=c;const h=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]);let f=this.radius*this.radius;for(let e=0;e<j.length;++e){s=j.at(e);const t=i[s]-h[0],r=i[s+1]-h[1],n=i[s+2]-h[2],o=t*t+r*r+n*n;if(o<=f)continue;const a=Math.sqrt(o),l=.5*(a-this.radius);this.radius=this.radius+l,f=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=n*c}this.center=h,j.clear()}getChildren(){if(this._children||(0,d.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:a}=this.position;for(let s=0;s<t;++s){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[s];let c=o*a[l],d=n[c],u=n[c+1],h=n[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=o*a[l+e];const t=n[c],r=n[c+1],i=n[c+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[s]=t,++i[t]}let s=0;for(let e=0;e<8;++e)i[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new W(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new G.A({deallocator:null});var q=r(69720),k=r(96672),$=r(4341),Y=r(11964);function X(e,t,r){return(0,d.f)(Z,t,e),(0,d.f)(J,r,e),.5*(0,d.l)((0,d.b)(Z,Z,J))}r(32114),new $.I(Y.vt),new $.I((()=>{return e?{p0:(0,u.o8)(e.p0),p1:(0,u.o8)(e.p1),p2:(0,u.o8)(e.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var e}));const Z=(0,u.vt)(),J=(0,u.vt)(),K=(0,u.vt)(),Q=(0,u.vt)(),ee=(0,u.vt)(),te=(0,u.vt)();var re=r(24326);class ie{constructor(e){this.channel=e,this.id=(0,re.c)()}}var ne=r(46540);r(28449),(0,u.vt)(),new Float32Array(6);class oe extends q.J{constructor(e,t,r=null,i=k.X.Mesh,n=null,o=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=n,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,H.Dg)(r.indices)}),e===ne.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new oe(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===k.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===k.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.h)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,d.s)(t,0,0,0),(0,d.s)(te,0,0,0);let o=0,a=0;for(let e=0;e<n.length-2;e+=3){const s=n[e]*r,l=n[e+1]*r,c=n[e+2]*r;(0,d.s)(K,i[s],i[s+1],i[s+2]),(0,d.s)(Q,i[l],i[l+1],i[l+2]),(0,d.s)(ee,i[c],i[c+1],i[c+2]);const u=X(K,Q,ee);u?((0,d.g)(K,K,Q),(0,d.g)(K,K,ee),(0,d.j)(K,K,1/3*u),(0,d.g)(t,t,K),o+=u):((0,d.g)(te,te,K),(0,d.g)(te,te,Q),(0,d.g)(te,te,ee),a+=3)}return!(0===a&&0===o||(0!==o?((0,d.j)(t,t,1/o),0):0===a||((0,d.j)(t,te,1/a),0)))}(this.attributes.get(ne.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(ne.r.POSITION);return function(e,t,r){if(!e)return!1;(0,d.s)(r,0,0,0),(0,d.s)(te,0,0,0);let i=0,n=0;const{size:o,data:a,indices:s}=e,l=s.length-1,c=l+(t?2:0);for(let e=0;e<c;e+=2){const t=e<l?e+1:0,c=s[e<l?e:l]*o,u=s[t]*o;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],Q[0]=a[u],Q[1]=a[u+1],Q[2]=a[u+2],(0,d.j)(K,(0,d.g)(K,K,Q),.5);const h=(0,d.F)(K,Q);h>0?((0,d.g)(r,r,(0,d.j)(K,K,h)),i+=h):0===i&&((0,d.g)(te,te,K),n++)}return 0!==i?((0,d.j)(r,r,1/i),!0):0!==n&&((0,d.j)(r,te,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,d.s)(t,0,0,0);let o=-1,a=0;for(let e=0;e<n.length;e++){const s=n[e]*r;o!==s&&(t[0]+=i[s],t[1]+=i[s+1],t[2]+=i[s+2],a++),o=s}return a>1&&(0,d.j)(t,t,1/a),a>0}(this.attributes.get(ne.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(ne.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===k.X.Mesh?3:1;(0,U.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,H.tM)(e.indices.length/t);return new W(r,t,e)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}addHighlight(){const e=new ie(F.Mg.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(44208),se=r(65529),le=r(97768),ce=r(84952),de=r(56058),ue=r(2741);let he;var fe,me;(me=fe||(fe={}))[me.ETC1_RGB=0]="ETC1_RGB",me[me.ETC2_RGBA=1]="ETC2_RGBA",me[me.BC1_RGB=2]="BC1_RGB",me[me.BC3_RGBA=3]="BC3_RGBA",me[me.BC4_R=4]="BC4_R",me[me.BC5_RG=5]="BC5_RG",me[me.BC7_M6_RGB=6]="BC7_M6_RGB",me[me.BC7_M5_RGBA=7]="BC7_M5_RGBA",me[me.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",me[me.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",me[me.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",me[me.ATC_RGB=11]="ATC_RGB",me[me.ATC_RGBA=12]="ATC_RGBA",me[me.FXT1_RGB=17]="FXT1_RGB",me[me.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",me[me.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",me[me.ETC2_EAC_R11=20]="ETC2_EAC_R11",me[me.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",me[me.RGBA32=13]="RGBA32",me[me.RGB565=14]="RGB565",me[me.BGR565=15]="BGR565",me[me.RGBA4444=16]="RGBA4444";var pe=r(63907),ve=r(21231),ge=r(42293);let _e=null,xe=null;async function Te(){return null==xe&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,ue.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=he,_e=await xe),xe}function be(e,t,r,i,n){const o=(0,ge.IB)(t?pe.CQ.COMPRESSED_RGBA8_ETC2_EAC:pe.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Ee(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[fe.ETC2_RGBA,pe.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[fe.ETC1_RGB,pe.CQ.COMPRESSED_RGB8_ETC2]:c?i?[fe.BC3_RGBA,pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[fe.BC1_RGB,pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[fe.RGBA32,pe.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);return t.internalFormat=u,t.hasMipmap=f.length>1,t.samplingMode=t.hasMipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.width=n,t.height=o,new ve.g(e,t,{type:"compressed",levels:f})}const Se=()=>R.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function we(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Me=we("DXT1"),Ce=we("DXT3"),Oe=we("DXT5");function Ie(e,t,r){if(e instanceof ImageData)return Ie(Re(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function Re(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var Ne,Pe,Le=r(67171);class He extends q.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=k.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.A,this._parameters={...Be,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Le.R;return t.wrapMode=this._parameters.wrap??pe.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return t.encoding===F.JS.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===F.JS.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),i=ye(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ve.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,z.mg)(t)?this._loadFromPixelData(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<Ne.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Se().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Me:n=8,o=pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=pe.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:n=16,o=pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new ve.g(e,t,n)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const i=new _e.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const n=Ee(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const i=new _e.BasisFile(new Uint8Array(r));if(!ye(i))return null;i.startTranscoding();const n=Ee(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?pe.Ab.LUMINANCE:3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ve.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,de.Sx)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.xt)(l)},a=()=>{t.readyState>=Ne.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},s=e=>{o(),n(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,P.u7)(r,(()=>s((0,P.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?Re(e):e;let i=e.width,n=e.height;do{i=Math.ceil(i/2),n=Math.ceil(n/2),r=i*n}while(r>1048576||null!=t&&(i>t||n>t));return Ie(e,i,n)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return Ie(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=De(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,n.width=i.width,n.height=i.height,this._glTexture=new ve.g(e,n,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,le.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Ne||(Ne={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Be={wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Fe=r(24151),ze=r(1843),Ve=r(49255),Ge=r(96336),Ue=r(62602),We=r(59469),je=r(35093),qe=r(25634),ke=r(14903),$e=r(14327),Ye=r(90644);const Xe=(0,Ye.p3)(pe.dn.SRC_ALPHA,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA,pe.dn.ONE_MINUS_SRC_ALPHA),Ze=(0,Ye.p3)(pe.dn.ONE,pe.dn.ZERO,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA);function Je(e){switch(e){case $e.y.NONE:return Xe;case $e.y.ColorAlpha:return Ze;case $e.y.FrontFace:case $e.y.COUNT:return null}}const Ke={factor:-1,units:-2};function Qe(e){return e?Ke:null}function et(e,t=pe.MT.LESS){return e===$e.y.NONE||e===$e.y.FrontFace?t:pe.MT.LEQUAL}function tt(e){return e===$e.y.ColorAlpha?{buffers:[pe.Nm.COLOR_ATTACHMENT0,pe.Nm.COLOR_ATTACHMENT1]}:null}class rt{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const it=(0,h.vt)();function nt(e,t,r,i,n,o){if(!e.visible)return;const a=(0,d.z)(gt,i,r),s=(e,t,r)=>{o(e,r,t,!1)},l=new rt(!1,t.options.normalRequired);if(e.boundingInfo){(0,U.vA)(e.type===k.X.Mesh);const i=t.tolerance;at(e.boundingInfo,r,a,i,n,l,s)}else{const t=e.attributes.get(ne.r.POSITION),i=t.indices;!function(e,t,r,i,n,o,a,s,l,c){const u=t,h=_t,f=Math.abs(u[0]),m=Math.abs(u[1]),p=Math.abs(u[2]),v=f>=m?f>=p?0:2:m>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],y=u[T]/u[g],A=1/u[g],E=lt,S=ct,w=dt,{normalRequired:M}=l;for(let t=r;t<i;++t){const r=3*t,i=a*n[r];(0,d.s)(h[0],o[i+0],o[i+1],o[i+2]);const l=a*n[r+1];(0,d.s)(h[1],o[l+0],o[l+1],o[l+2]);const u=a*n[r+2];(0,d.s)(h[2],o[u+0],o[u+1],o[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.z)(E,h[0],e),(0,d.z)(S,h[1],e),(0,d.z)(w,h[2],e);const f=E[x]-b*E[g],m=E[T]-y*E[g],p=S[x]-b*S[g],v=S[T]-y*S[g],_=w[x]-b*w[g],C=w[T]-y*w[g],O=_*v-C*p,I=f*C-m*_,R=p*m-v*f;if((O<0||I<0||R<0)&&(O>0||I>0||R>0))continue;const N=O+I+R;if(0===N)continue;const P=O*(A*E[g])+I*(A*S[g])+R*(A*w[g]);if(P*Math.sign(N)<0)continue;const L=P/N;L>=0&&c(L,t,M?ht(h):null)}}(r,a,0,i.length/3,i,t.data,t.stride,n,l,s)}}const ot=(0,u.vt)();function at(e,t,r,i,n,o,a){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,ot);if((0,h.Ne)(it,e.bbMin),(0,h.vI)(it,e.bbMax),null!=n&&n.applyToAabb(it),function(e,t,r,i){return function(e,t,r,i,n){const o=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(o,a),l=Math.max(o,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(it,t,s,i)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>pt){const s=e.getChildren();if(void 0!==s){for(const e of s)at(e,t,r,i,n,o,a);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],f=e[2],m=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],_=o[i+1],x=o[i+2];const T=a*n[r+1];let b=o[T],y=o[T+1],A=o[T+2];const E=a*n[r+2];let S=o[E],w=o[E+1],M=o[E+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,y,A]=l.applyToVertex(b,y,A,e),[S,w,M]=l.applyToVertex(S,w,M,e));const C=b-c,O=y-_,I=A-x,R=S-c,N=w-_,P=M-x,L=p*P-N*v,H=v*R-P*m,D=m*N-R*p,B=C*L+O*H+I*D;if(Math.abs(B)<=vt)continue;const F=u-c,z=h-_,V=f-x,G=F*L+z*H+V*D;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const U=z*I-O*V,W=V*C-I*F,j=F*O-C*z,q=m*U+p*W+v*j;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const k=(R*U+N*W+P*j)/B;k>=0&&d(k,t,g?ut(C,O,I,R,N,P,st):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,n,o,a)}}const st=(0,u.vt)();const lt=(0,u.vt)(),ct=(0,u.vt)(),dt=(0,u.vt)();function ut(e,t,r,i,n,o,a){return(0,d.s)(ft,e,t,r),(0,d.s)(mt,i,n,o),(0,d.b)(a,ft,mt),(0,d.n)(a,a),a}function ht(e){return(0,d.z)(ft,e[1],e[0]),(0,d.z)(mt,e[2],e[0]),(0,d.b)(st,ft,mt),(0,d.n)(st,st),st}const ft=(0,u.vt)(),mt=(0,u.vt)(),pt=1e3,vt=1e-7,gt=(0,u.vt)(),_t=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var xt,Tt;(Tt=xt||(xt={}))[Tt.INTEGRATED_MESH=0]="INTEGRATED_MESH",Tt[Tt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Tt[Tt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Tt[Tt.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",Tt[Tt.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",Tt[Tt.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",Tt[Tt.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",Tt[Tt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Tt[Tt.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",Tt[Tt.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",Tt[Tt.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",Tt[Tt.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",Tt[Tt.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",Tt[Tt.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",Tt[Tt.HUD_MATERIAL=14]="HUD_MATERIAL",Tt[Tt.LABEL_MATERIAL=15]="LABEL_MATERIAL",Tt[Tt.LINE_CALLOUTS=16]="LINE_CALLOUTS",Tt[Tt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Tt[Tt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Tt[Tt.DRAPED_WATER=19]="DRAPED_WATER",Tt[Tt.VOXEL=20]="VOXEL",Tt[Tt.MAX_SLOTS=21]="MAX_SLOTS";var bt=r(76412),yt=r(57005);const At=new class{constructor(e=0){this.offset=e,this.sphere=(0,bt.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,n=(0,d.s)(Et,e,t,r),o=(0,d.h)(n,n,i),a=this.offset/(0,d.l)(o);(0,d.r)(o,o,o,a);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,o,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.r)(e,e,e,r);const i=this.offset/(0,d.l)(t);(0,d.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,bt.g)(e)),r=this.offset/t;return(0,d.r)((0,bt.g)(this.sphere),(0,bt.g)(e),(0,bt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,bt.c)(),this._tmpObb=new yt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,d.l)(e)}applyToVertex(e,t,r){const i=(0,d.s)(Et,e,t,r),n=(0,d.s)(St,e,t,r+this.componentLocalOriginLength),o=this._totalOffset/(0,d.l)(n);return(0,d.r)(this._tmpVertex,i,n,o),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),f=Math.abs(s),m=.5*(1+Math.sign(r*o))*Math.min(l,u),p=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(n*s))*Math.min(d,f),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,f),T=Math.sqrt(m*m+p*p+v*v),b=Math.sign(l+r),y=Math.sign(c+i),A=Math.sign(d+n),E=Math.sign(u+o),S=Math.sign(h+a),w=Math.sign(f+s),M=this._totalOffset;if(T<M)return e[0]-=(1-b)*M,e[1]-=(1-y)*M,e[2]-=(1-A)*M,e[3]+=E*M,e[4]+=S*M,e[5]+=w*M,e;const C=M/Math.sqrt(g*g+_*_+x*x),O=M/T,I=O-C,R=-I;return e[0]+=r*(b*R+O),e[1]+=i*(y*R+O),e[2]+=n*(A*R+O),e[3]+=o*(E*I+C),e[4]+=a*(S*I+C),e[5]+=s*(w*I+C),e}applyToMbs(e){const t=(0,d.l)((0,bt.g)(e)),r=this._totalOffset/t;return(0,d.r)((0,bt.g)(this._tmpMbs),(0,bt.g)(e),(0,bt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,yt.gm)(e,this._totalOffset,this._totalOffset,Fe.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const i=(0,d.s)(Et,e,t,r),n=(0,d.g)(St,i,this.localOrigin),o=this.offset/(0,d.l)(n);return(0,d.r)(this.tmpVertex,i,n,o),this.tmpVertex}applyToAabb(e){const t=wt,r=Mt,i=Ct;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(!(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Et=(0,u.vt)(),St=(0,u.vt)(),wt=(0,u.vt)(),Mt=(0,u.vt)(),Ct=(0,u.vt)();function Ot(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function It(e,t,r,i){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function Rt(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function Nt(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function Pt(e,t,r,i,n,o){switch(e){case ne.r.POSITION:{(0,U.vA)(3===t.size);const i=n.getField(e,m.xs);(0,U.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,n=1){if(!t)return void It(e,r,i,n);const{data:o,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,d=a.length,u=t[0],h=t[1],f=t[2],m=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],y=t[14];i*=c;let A=0,E=0,S=0;const w=(0,s.tZ)(t)?e=>{A=o[e]+T,E=o[e+1]+b,S=o[e+2]+y}:e=>{const t=o[e],r=o[e+1],i=o[e+2];A=u*t+m*r+g*i+T,E=h*t+p*r+_*i+b,S=f*t+v*r+x*i+y};if(1===n)for(let e=0;e<d;++e)w(3*a[e]),l[i]=A,l[i+1]=E,l[i+2]=S,i+=c;else for(let e=0;e<d;++e){w(3*a[e]);for(let e=0;e<n;++e)l[i]=A,l[i+1]=E,l[i+2]=S,i+=c}}(t,r,i,o);break}case ne.r.NORMAL:{(0,U.vA)(3===t.size);const r=n.getField(e,m.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,n=1){if(!t)return void It(e,r,i,n);const{data:o,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;i*=d;let E=0,S=0,w=0;const M=(0,s.tZ)(l)?e=>{E=o[e],S=o[e+1],w=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];E=h*t+p*r+_*i,S=f*t+v*r+x*i,w=m*t+g*r+T*i};if(1===n)if(b)for(let e=0;e<u;++e){M(3*a[e]);const t=E*E+S*S+w*w;if(t<A&&t>y){const e=1/Math.sqrt(t);c[i]=E*e,c[i+1]=S*e,c[i+2]=w*e}else c[i]=E,c[i+1]=S,c[i+2]=w;i+=d}else for(let e=0;e<u;++e)M(3*a[e]),c[i]=E,c[i+1]=S,c[i+2]=w,i+=d;else for(let e=0;e<u;++e){if(M(3*a[e]),b){const e=E*E+S*S+w*w;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,w*=t}}for(let e=0;e<n;++e)c[i]=E,c[i+1]=S,c[i+2]=w,i+=d}}(t,i,r,o);break}case ne.r.NORMALCOMPRESSED:{(0,U.vA)(2===t.size);const r=n.getField(e,m.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ot(t,r,o);break}case ne.r.UV0:{(0,U.vA)(2===t.size);const r=n.getField(e,m.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ot(t,r,o);break}case ne.r.COLOR:case ne.r.SYMBOLCOLOR:{const r=n.getField(e,m.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==o.length||4!==t)if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}else{s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*n;for(let r=1;r<d;++r)e[i]=a,i+=t}}(t,t.size,r,o);break}case ne.r.COLORFEATUREATTRIBUTE:{const r=n.getField(e,m.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,o);break}case ne.r.TANGENT:{(0,U.vA)(4===t.size);const i=n.getField(e,m.Eq);(0,U.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,n=1){if(!t)return void Rt(e,r,i,n);const{data:o,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],f=l[1],m=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;if(i*=d,1===n)for(let e=0;e<u;++e){const t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3];let u=h*r+p*n+_*s,E=f*r+v*n+x*s,S=m*r+g*n+T*s;if(b){const e=u*u+E*E+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}c[i]=u,c[i+1]=E,c[i+2]=S,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],u=o[t+3];let E=h*r+p*s+_*l,S=f*r+v*s+x*l,w=m*r+g*s+T*l;if(b){const e=E*E+S*S+w*w;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,w*=t}}for(let e=0;e<n;++e)c[i]=E,c[i+1]=S,c[i+2]=w,c[i+3]=u,i+=d}}(t,r,i,o);break}case ne.r.PROFILERIGHT:case ne.r.PROFILEUP:case ne.r.PROFILEVERTEXANDNORMAL:case ne.r.FEATUREVALUE:{(0,U.vA)(4===t.size);const r=n.getField(e,m.Eq);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Rt(t,r,o)}}}class Lt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(ne.r.POSITION).indices.length}write(e,t,r,i,n){!function(e,t,r,i,n,o){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Pt(a,t,r,i,n,o);else if(a===ne.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(ne.r.POSITION)?.indices;if(t){const r=t.length,i=n.getField(a,m.XP);Nt(e.objectAndLayerIdColor,i,r,o)}}}}(r,this.vertexBufferLayout,e,t,i,n)}}var Ht=r(13752),Dt=r(91829),Bt=r(53466),Ft=r(72824),zt=r(97220),Vt=r(84867),Gt=r(39341),Ut=r(34886);pe.MT.LESS,pe.MT.ALWAYS;const Wt={mask:255},jt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.ZERO}},qt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.REPLACE}};pe.MT.EQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP,pe.MT.NOTEQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP;const kt=[1,1,.5],$t=[0,.6,.2],Yt=[0,1,.2];var Xt=r(28491);class Zt extends Ft.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(kt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=F.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Ge.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Dt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=F.it.Less,this.textureAlphaMode=F.sf.Blend,this.textureAlphaCutoff=je.Q,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ke.m$.Occlude,this.isDecoration=!1}}Ft.gy;class Jt extends Vt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?Bt.q.Default:Bt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Jt.shader)}_initializeProgram(e,t){return new Ut.B(e.rctx,t.get().build(this.configuration),Gt.D)}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,writeDepth:a,hasOccludees:s,enableOffset:l}=this.configuration,c=e===$e.y.NONE,d=e===$e.y.FrontFace;return(0,Ye.Ey)({blending:r===Ve.V.Color&&i?Je(e):null,culling:Qt(this.configuration)?(0,Ye.Xt)(n):null,depthTest:{func:et(e,Kt(o))},depthWrite:(c||d)&&a?Ye.kn:null,drawBuffers:r===Ve.V.Depth?{buffers:[pe.Hr.NONE]}:tt(e),colorWrite:Ye.wE,stencilWrite:s?Wt:null,stencilTest:s?t?qt:jt:null,polygonOffset:c||d?null:Qe(l)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Kt(e){return e===F.it.Lequal?pe.MT.LEQUAL:pe.MT.LESS}function Qt(e){return e.cullFace!==F.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Jt.shader=new zt.$(Xt.D,(()=>r.e(5141).then(r.bind(r,5141))));var er=r(90237),tr=r(99769),rr=r(82991),ir=r(46263);class nr extends rr.nW{}(0,er._)([(0,tr.W)({constValue:!0})],nr.prototype,"hasSliceHighlight",void 0),(0,er._)([(0,tr.W)({constValue:!1})],nr.prototype,"hasSliceInVertexProgram",void 0),(0,er._)([(0,tr.W)({constValue:ir.c.Pass})],nr.prototype,"bindType",void 0);class or extends nr{constructor(){super(...arguments),this.output=Ve.V.Color,this.alphaDiscardMode=F.sf.Opaque,this.doubleSidedMode=Ue.W.None,this.pbrMode=We.A9.Disabled,this.cullFace=F.s2.None,this.transparencyPassType=$e.y.NONE,this.normalType=Ge.W.Attribute,this.textureCoordinateType=Bt.q.None,this.customDepthTest=F.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.discardInvisibleFragments=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,er._)([(0,tr.W)({count:Ve.V.COUNT})],or.prototype,"output",void 0),(0,er._)([(0,tr.W)({count:F.sf.COUNT})],or.prototype,"alphaDiscardMode",void 0),(0,er._)([(0,tr.W)({count:Ue.W.COUNT})],or.prototype,"doubleSidedMode",void 0),(0,er._)([(0,tr.W)({count:We.A9.COUNT})],or.prototype,"pbrMode",void 0),(0,er._)([(0,tr.W)({count:F.s2.COUNT})],or.prototype,"cullFace",void 0),(0,er._)([(0,tr.W)({count:$e.y.COUNT})],or.prototype,"transparencyPassType",void 0),(0,er._)([(0,tr.W)({count:Ge.W.COUNT})],or.prototype,"normalType",void 0),(0,er._)([(0,tr.W)({count:Bt.q.COUNT})],or.prototype,"textureCoordinateType",void 0),(0,er._)([(0,tr.W)({count:F.it.COUNT})],or.prototype,"customDepthTest",void 0),(0,er._)([(0,tr.W)()],or.prototype,"spherical",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVertexColors",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSymbolColors",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVerticalOffset",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSlicePlane",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasSliceHighlight",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasColorTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasMetallicRoughnessTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasEmissionTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOcclusionTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasNormalTexture",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasScreenSizePerspective",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasVertexTangents",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOccludees",void 0),(0,er._)([(0,tr.W)()],or.prototype,"multipassEnabled",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasModelTransformation",void 0),(0,er._)([(0,tr.W)()],or.prototype,"offsetBackfaces",void 0),(0,er._)([(0,tr.W)()],or.prototype,"vvSize",void 0),(0,er._)([(0,tr.W)()],or.prototype,"vvColor",void 0),(0,er._)([(0,tr.W)()],or.prototype,"receiveShadows",void 0),(0,er._)([(0,tr.W)()],or.prototype,"receiveAmbientOcclusion",void 0),(0,er._)([(0,tr.W)()],or.prototype,"textureAlphaPremultiplied",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instanced",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instancedColor",void 0),(0,er._)([(0,tr.W)()],or.prototype,"objectAndLayerIdColorInstanced",void 0),(0,er._)([(0,tr.W)()],or.prototype,"instancedDoublePrecision",void 0),(0,er._)([(0,tr.W)()],or.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,er._)([(0,tr.W)()],or.prototype,"writeDepth",void 0),(0,er._)([(0,tr.W)()],or.prototype,"transparent",void 0),(0,er._)([(0,tr.W)()],or.prototype,"discardInvisibleFragments",void 0),(0,er._)([(0,tr.W)()],or.prototype,"enableOffset",void 0),(0,er._)([(0,tr.W)()],or.prototype,"cullAboveGround",void 0),(0,er._)([(0,tr.W)()],or.prototype,"snowCover",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasColorTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasEmissionTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasNormalTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasOcclusionTextureTransform",void 0),(0,er._)([(0,tr.W)()],or.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,er._)([(0,tr.W)({constValue:!1})],or.prototype,"occlusionPass",void 0),(0,er._)([(0,tr.W)({constValue:!0})],or.prototype,"hasVvInstancing",void 0),(0,er._)([(0,tr.W)({constValue:!1})],or.prototype,"useCustomDTRExponentForWater",void 0),(0,er._)([(0,tr.W)({constValue:!0})],or.prototype,"useFillLights",void 0);var ar=r(57323);class sr extends Jt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ge.W.Attribute,t.doubleSidedMode=Ue.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,sr.shader)}}sr.shader=new zt.$(ar.R,(()=>r.e(9933).then(r.bind(r,39933))));class lr extends ke.im{constructor(e){super(e,dr),this._configuration=new or,this.supportsEdges=!0,this.produces=new Map([[xt.OPAQUE_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&!this.parameters.transparent],[xt.TRANSPARENT_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,ze.BP)().vec3f(ne.r.POSITION);return e.normalType===Ge.W.Compressed?t.vec2i16(ne.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ne.r.NORMAL),e.hasVertexTangents&&t.vec4f(ne.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ne.r.UV0),e.hasVertexColors&&t.vec4u8(ne.r.COLOR),e.hasSymbolColors&&t.vec4u8(ne.r.SYMBOLCOLOR),(0,ae.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ne.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ve.V.Shadow&&e!==Ve.V.ShadowExcludeHighlight&&e!==Ve.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<je.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:n}=e,o=t||n||i,a="replace"===e.colorMixMode,s=e.opacity>=je.Q;if(r&&o)return a||s;const l=e.externalColor&&e.externalColor[3]>=je.Q;return r?a?l:s:o?a||s:a?l:s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.discardInvisibleFragments=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?F.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===Ve.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.W.WindingOrder:Ue.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?We.A9.Schematic:We.A9.Normal:We.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(vr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case Fe.RT.Global:o=(0,d.n)(mr,vr);break;case Fe.RT.Local:o=(0,d.c)(mr,fr)}let a=0;const s=(0,d.f)(gr,vr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(o,c)),a+=(0,Ht.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(o,o,a),(0,d.t)(pr,o,r.transform.inverseRotation),i=(0,d.f)(ur,i,pr),n=(0,d.f)(hr,n,pr)}var a;nt(e,r,i,n,null!=(a=r.verticalOffset)?(At.offset=a,At):null,o)}createGLMaterial(e){return new cr(e)}createBufferWriter(){return new Lt(this._vertexBufferLayout)}}class cr extends qe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===Ve.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?sr:Jt,e)}}class dr extends Zt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const ur=(0,u.vt)(),hr=(0,u.vt)(),fr=(0,u.fA)(0,0,1),mr=(0,u.vt)(),pr=(0,u.vt)(),vr=(0,u.vt)(),gr=(0,u.vt)(),_r=()=>R.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function xr(e){throw new I.A("",`Request for object resource failed: ${e}`)}function Tr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(_r().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(_r().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(_r().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(_r().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else _r().warn("Indexed geometries must specify faces"),i=!1;break}default:_r().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(_r().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(_r().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function br(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function yr(e){switch(e){case"mask":return F.sf.Mask;case"maskAndTransparency":return F.sf.MaskBlend;case"none":return F.sf.Opaque;default:return F.sf.Blend}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Er=new L.R(1,2,"wosr");var Sr=r(61765);async function wr(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,C.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,P.QP)(i.error),xr(i.error.details.url)}(e,r,t);const i=await(0,C.Ke)((0,M.A)(e,t));if(!0===i.ok)return i.value.data;(0,P.QP)(i.error),xr(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){_r().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},preMultiplyAlpha:yr(l)!==F.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):D(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:n+(0,O.iL)(r)}}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new N,a=e.resource,s=L.R.parse(a.version||"1.0","wosr");Er.validate(s);const l=a.model.name,c=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let f=0;const m=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!Tr(a))continue;const s=Ar(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[ne.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,H.tM)(_);p.push([e,new B.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!m.has(x)){const{image:e,parameters:t}=T,r=new He(e,t);i.push(r),m.set(x,r)}const b=m.get(x),y=b?b.id:void 0,A=s.material;let E=o.get(A,x);if(null==E){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,n=T?yr(T.alphaChannelUsage):void 0,a={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:n,textureAlphaCutoff:.33,textureId:y,initTextureTransparent:!0,doubleSided:!0,cullFace:F.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),E=new lr(a),o.set(A,x,E)}n.push(E);const S=new oe(E,p);f+=p.find((e=>e[0]===ne.r.POSITION))?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:br(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let A;if(t.cache)A=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(4399).then(r.bind(r,4399));A=await e(new T.R(t.streamDataRequester),a.url,t,t.usePBR)}const S=A.model.meta?.ESRI_proxyEllipsoid,I=A.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===A.meta.ESRI_webstyle;I&&!A.customMeta.esriTreeRendering&&(A.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const n of i.parts){const i=n.attributes.normal;if(null==i)return;const o=n.attributes.position,a=o.count,c=(0,u.vt)(),h=(0,u.vt)(),f=(0,u.vt)(),p=new Uint8Array(4*a),v=new Float64Array(3*a),g=(0,s.B8)((0,l.vt)(),n.transform);let _=0,x=0;for(let s=0;s<a;s++){o.getVec(s,h),i.getVec(s,c),(0,d.h)(h,h,n.transform),(0,d.f)(f,h,t.center),(0,d.D)(f,f,t.radius);const a=f[2],l=(0,d.l)(f),u=Math.min(.45+.55*l*l,1);(0,d.D)(f,f,t.radius),null!==g&&(0,d.h)(f,f,g),(0,d.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(f,f,c,a>-1?.2:Math.min(-4*a-3.8,1)),v[_]=f[0],v[_+1]=f[1],v[_+2]=f[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}n.attributes.normal=new m.xs(v),n.attributes.color=new m.XP(p)}}}(A,S));const R=!!t.usePBR,z=A.meta.isEsriSymbolResource?{usePBR:R,isSchematic:!1,treeRendering:I,mrrFactors:[...Yt]}:{usePBR:R,isSchematic:!1,treeRendering:!1,mrrFactors:[...kt]},V={...t.materialParameters,treeRendering:I},{engineResources:G,referenceBoundingBox:U}=function(e,t,r,i){const a=e.model,s=new Array,l=new Map,T=new Map,A=a.lods.length,S=(0,h.Ie)();return a.lods.forEach(((e,M)=>{const C=!0===i.skipHighLods&&(A>1&&0===M||A>3&&1===M)||!1===i.skipHighLods&&null!=i.singleLodIndex&&M!==i.singleLodIndex;if(C&&0!==M)return;const O=new w(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=C?new lr({}):function(e,t,r,i,n,o,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,f=null!=t.attributes.normal;if(null==l)return null;const m=function(e){switch(e){case"BLEND":return F.sf.Blend;case"MASK":return F.sf.Mask;case"OPAQUE":case null:case void 0:return F.sf.Opaque}}(l.alphaMode);if(!o.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new He((0,y.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&r,encoding:(0,y.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,m!==F.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/Sr.T),p=l.color[1]**(1/Sr.T),v=l.color[2]**(1/Sr.T),g=l.emissiveFactor[0]**(1/Sr.T),_=l.emissiveFactor[1]**(1/Sr.T),x=l.emissiveFactor[2]**(1/Sr.T),T=null!=l.textureColor&&h?a.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:n,emissiveFactor:o,occlusionTexture:a}){return null==e&&null==t&&null==n&&(null==o||(0,d.e)(o,u.uY))&&null==a&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),A=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;o.set(s,new lr({...i,transparent:m===F.sf.Blend,customDepthTest:F.it.Lequal,textureAlphaMode:m,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?F.s2.None:F.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:f?Ge.W.Attribute:Ge.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...$t]:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:E(l.colorTextureTransform),normalTextureTransformMatrix:E(l.normalTextureTransform),scale:[A[0],A[1]],occlusionTextureTransformMatrix:E(l.occlusionTextureTransform),emissiveTextureTransformMatrix:E(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(l.metallicRoughnessTextureTransform),...n}))}const p=o.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(a,e,O,t,r,l,T),{geometry:s,vertexCount:A}=function(e,t){const r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),a=(0,f.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(a,s,e.transform,3,l);const c=[[ne.r.POSITION,new B.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,f.oe)(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,o.Ge)(Mr,e.transform),(0,p.t)(t,a,Mr,3,s),(0,n.or)(Mr)&&(0,p.n)(t,t),c.push([ne.r.NORMAL,new B.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,f.oe)(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,o.z0)(Mr,e.transform),(0,v.t)(t,a,Mr,4,s),(0,n.or)(Mr)&&(0,p.n)(t,t,4),c.push([ne.r.TANGENT,new B.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,f.oe)(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,g.a)(t,n,2,o),c.push([ne.r.UV0,new B.n(t,i,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof m.Eq?(0,v.b)(t,d,255):d instanceof m.XP?(0,x.a)(t,d):d instanceof m.Uz&&(0,v.b)(t,d,1/256):(t.fill(255),d instanceof m.xs?(0,p.f)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof m.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.f)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([ne.r.COLOR,new B.n(t,i,4,!0)])}return{geometry:new oe(t,c),vertexCount:r}}(e,null!=i?i:new lr({})),w=s.boundingInfo;null!=w&&0===M&&((0,h.iT)(S,w.bbMin),(0,h.iT)(S,w.bbMax)),null!=i&&(O.stageResources.geometries.push(s),O.numberOfVertices+=A)})),C||s.push(O)})),{engineResources:s,referenceBoundingBox:S}}(A,z,V,t.skipHighLods&&null==a.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:a.specifiedLodIndex});return{lods:G,referenceBoundingBox:U,isEsriSymbolResource:A.meta.isEsriSymbolResource,isWosr:!1}}const Mr=(0,a.vt)()},66104:(e,t,r)=>{var i,n;r.d(t,{k5:()=>i}),r(34727),(n=i||(i={}))[n.Multiply=1]="Multiply",n[n.Ignore=2]="Ignore",n[n.Replace=3]="Replace",n[n.Tint=4]="Tint"},42583:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(66104),n=r(2597);function o(e){e.vertex.code.add(n.H`
225
225
  vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
226
226
  float symbolAlpha = 0.0;
227
227
 
@@ -407,18 +407,18 @@ return transform_CameraRelativeFromModel + rotatedModelPosition;
407
407
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
408
408
  }`),e.fragment.code.add(d.H`vec3 positionWorld() {
409
409
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
410
- }`)}class p extends d.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class v extends d.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},99208:(e,t,r)=>{r.d(t,{r:()=>s});var i=r(21818),n=r(53466),o=r(2597);function a(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
410
+ }`)}class p extends d.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class v extends d.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),n=r(2597);function o(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
411
411
  vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
412
412
  vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
413
413
  float maxdUV = 0.125;
414
414
  vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
415
415
  vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
416
416
  return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
417
- }`)}function s(e,t){switch(e.include(n.U,t),t.textureCoordinateType){case n.q.Default:case n.q.Compressed:return void e.fragment.code.add(o.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
418
- return texture(tex, uv);
419
- }`);case n.q.Atlas:return e.include(a),void e.fragment.code.add(o.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
420
- return textureAtlasLookup(tex, uv, vuvRegion);
421
- }`);default:(0,i.Xb)(t.textureCoordinateType);case n.q.None:case n.q.COUNT:return}}},54154:(e,t,r)=>{r.d(t,{G:()=>f});var i=r(87317),n=r(91829),o=r(38954),a=r(51850),s=r(33079),l=r(2597);function c(e){e.vertex.code.add(l.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
417
+ }`)}function a(e,t){const{textureCoordinateType:r}=t;if(r===i.q.None||r===i.q.COUNT)return;e.include(i.U,t);const a=r===i.q.Atlas;a&&e.include(o),e.fragment.code.add(n.H`
418
+ vec4 textureLookup(sampler2D tex, vec2 uv) {
419
+ return ${a?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
420
+ }
421
+ `)}},54154:(e,t,r)=>{r.d(t,{G:()=>f});var i=r(87317),n=r(91829),o=r(38954),a=r(51850),s=r(33079),l=r(2597);function c(e){e.vertex.code.add(l.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
422
422
  return absCosAngle * absCosAngle * absCosAngle;
423
423
  }`),e.vertex.code.add(l.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
424
424
  return vec3(
@@ -555,7 +555,7 @@ T = T - normal * dot(normal, T);
555
555
  T *= inversesqrt(max(dot(T,T), 1.e-10));
556
556
  vec3 B = sign(det) * cross(normal, T);
557
557
  return mat3(T, B, normal);
558
- }`),t.textureCoordinateType!==o.q.None&&(e.include(a.r,t),r.uniforms.add(t.pbrTextureBindType===f.c.Pass?new h.N("normalTexture",(e=>e.textureNormal)):new u.o("normalTexture",(e=>e.textureNormal))),t.hasNormalTextureTransform&&(r.uniforms.add(new l.G("scale",(e=>e.scale??n.Un))),r.uniforms.add(new d.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??i.zK)))),r.code.add(c.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
558
+ }`),t.textureCoordinateType!==o.q.None&&(e.include(a.r,t),r.uniforms.add(t.bindType===f.c.Pass?new h.N("normalTexture",(e=>e.textureNormal)):new u.o("normalTexture",(e=>e.textureNormal))),t.hasNormalTextureTransform&&(r.uniforms.add(new l.G("scale",(e=>e.scale??n.Un))),r.uniforms.add(new d.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??i.zK)))),r.code.add(c.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
559
559
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(c.H`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
560
560
  normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
561
561
  0.0, 0.0, 0.0 );
@@ -791,7 +791,7 @@ float getBakedOcclusion() { return 1.0; }`);if(r===i.Schematic)return void n.cod
791
791
  vec3 emission = vec3(0.0);
792
792
  float occlusion = 1.0;
793
793
  void applyPBRFactors() {}
794
- float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:h,hasMetallicRoughnessTextureTransform:f,hasEmissionTexture:m,hasEmissiveTextureTransform:p,hasOcclusionTexture:v,hasOcclusionTextureTransform:g,pbrTextureBindType:_}=t;(h||m||v)&&e.include(o.r,t),n.code.add(l.H`vec3 mrr;
794
+ float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:h,hasMetallicRoughnessTextureTransform:f,hasEmissionTexture:m,hasEmissiveTextureTransform:p,hasOcclusionTexture:v,hasOcclusionTextureTransform:g,bindType:_}=t;(h||m||v)&&e.include(o.r,t),n.code.add(l.H`vec3 mrr;
795
795
  vec3 emission;
796
796
  float occlusion;`),h&&n.uniforms.add(_===u.c.Pass?new d.N("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new c.o("texMetallicRoughness",(e=>e.textureMetallicRoughness))),m&&n.uniforms.add(_===u.c.Pass?new d.N("texEmission",(e=>e.textureEmissive)):new c.o("texEmission",(e=>e.textureEmissive))),v&&n.uniforms.add(_===u.c.Pass?new d.N("texOcclusion",(e=>e.textureOcclusion)):new c.o("texOcclusion",(e=>e.textureOcclusion))),n.uniforms.add(_===u.c.Pass?new s.t("emissionFactor",(e=>e.emissiveFactor)):new a.W("emissionFactor",(e=>e.emissiveFactor)),_===u.c.Pass?new s.t("mrrFactors",(e=>e.mrrFactors)):new a.W("mrrFactors",(e=>e.mrrFactors))),n.code.add(l.H`
797
797
  ${(0,l.If)(h,l.H`void applyMetallicRoughness(vec2 uv) {
@@ -29,6 +29,7 @@
29
29
  z-index: 1;
30
30
  width: fit-content;
31
31
  overflow: visible;
32
+ will-change: transform;
32
33
 
33
34
  &-content {
34
35
  display: flex;
@@ -49,6 +50,7 @@
49
50
  line-height: 1.1em;
50
51
  color: $font-color;
51
52
  font-size: var(--font-size);
53
+ contain: content;
52
54
  backdrop-filter: blur(4px);
53
55
  view-transition-name: tooltip-content;
54
56
 
@@ -260,13 +262,17 @@
260
262
  --offset: 20px;
261
263
  --offset-start: calc(-100% - var(--offset));
262
264
 
263
- &.debug::after {
265
+ &--debug::after {
266
+ --size: 10px;
267
+
264
268
  position: absolute;
265
269
  top: 0;
266
270
  left: 0;
271
+ margin-top: calc(var(--size) * -0.5);
272
+ margin-left: calc(var(--size) * -0.5);
267
273
  background: red;
268
- width: 5px;
269
- height: 5px;
274
+ width: var(--size);
275
+ height: var(--size);
270
276
  content: "";
271
277
  }
272
278