@arcgis/core 4.22.1 → 4.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0146455a237a1d237525.js +1 -0
  3. package/assets/esri/core/workers/chunks/{3a4885bf1cfc82cf2b67.js → 26111da2277612ba0e38.js} +1 -1
  4. package/assets/esri/core/workers/chunks/360bb187a91c8cadcb8b.js +1 -0
  5. package/assets/esri/core/workers/chunks/{32efb77e3dabd2c11446.js → 3981c2e5b88c93d63793.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{fa9c5dd90d19d4061b40.js → 3ccb827134eb2ad54ff2.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{d431b35c274b76150724.js → 487713de9462be6b5202.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7b12bf4be88ca0e14683.js → 53c05fb7fed21c815ee9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{e7117121160907a593d4.js → 5f87aea9f42c40c51b6f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{762f45a7ecd40d564be2.js → 606b99f366517ca9d577.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{8b98fc7d115469e6ae5d.js → 88fd591d45e8b4542f82.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{2d97adeb48adeecd7607.js → 8cdaa07b09d5c2b1ccc5.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c535188091d83fd50d74.js → a4c58e301ded79fe827d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{04adf8c6c5e8ad67aa06.js → ab067b1b6a2af26decc5.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{a3b7217566347ab595d0.js → ac9f18daa7236446c9c8.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{ac9b25ce30f2cd569944.js → b6e150686198dec02a27.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{2174266668fa6f2df8cc.js → d06d4b76625afc309a55.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2f29fb12452d363a1b17.js → e07f78db820375e105c0.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{5a31dfbac9c7e15a4dc5.js → f1b3f84ddf34a13c9d8e.js} +1 -1
  20. package/config.js +1 -1
  21. package/package.json +1 -1
  22. package/rest/query/operations/query.js +1 -1
  23. package/support/revision.js +1 -1
  24. package/symbols/cim/CIMSymbolHelper.js +1 -1
  25. package/symbols/cim/cimAnalyzer.js +1 -1
  26. package/views/2d/engine/webgl/mesh/templates/WGLDynamicMeshTemplate.js +1 -1
  27. package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
  28. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  29. package/assets/esri/core/workers/chunks/22d1bead2fe51ab81bea.js +0 -1
  30. package/assets/esri/core/workers/chunks/25017204ffbd1bbac91f.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4599],{45091:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(80442),n=s(71143);const i=4294967296,o=(0,r.Z)("esri-text-decoder")?new TextDecoder("utf-8"):null,a=(0,r.Z)("safari")||(0,r.Z)("ios")?6:(0,r.Z)("ff")?12:32;class u{constructor(e,t,s=0,r=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this.init(e,t,s,r)}init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*i;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*i;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const n=this.getMessage(),i=e(n,t,s,r);return n.release(),i}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t.init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*n,n*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*n}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>a&&o){const r=e.subarray(t,s);return o.decode(r)}let r="",n="";for(let i=t;i<s;++i){const t=e[i];128&t?n+="%"+t.toString(16):(r+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(r+=decodeURIComponent(n)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}u.pool=new n.Z(u,null,(e=>{e._data=null,e._dataView=null}))},38581:(e,t,s)=>{s.d(t,{aX:()=>k});var r=s(68773),n=s(20102),i=s(92604),o=s(70586),a=s(17332),u=s(58901),l=s(73913),c=s(8744),h=s(40488),p=(s(66577),s(3172)),f=s(17452),d=s(33955);const g=i.Z.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function m(e){return"polyline"===e[0].type}function _(e,t,s){if(t){const t=function(e,t){if(!(e instanceof u.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g.error(e),new n.Z(e)}const s=(0,l.x3)(e),r=[];for(const e of s){const s=[];r.push(s),s.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const n=e[r][0],i=e[r][1],o=e[r+1][0],a=e[r+1][1],u=Math.sqrt((o-n)*(o-n)+(a-i)*(a-i)),l=(a-i)/u,c=(o-n)/u,h=u/t;if(h>1){for(let e=1;e<=h-1;e++){const r=e*t,o=c*r+n,a=l*r+i;s.push([o,a])}const e=(u+Math.floor(h-1)*t)/2,r=c*e+n,o=l*e+i;s.push([r,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:r,spatialReference:e.spatialReference}):new u.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.Sx)(t,!0)}return s&&(e=(0,l.Sy)(e,s)),e}function b(e,t,s){if(Array.isArray(e)){const r=e[0];if(r>t){const s=(0,l.XZ)(r,t);e[0]=r+s*(-2*t)}else if(r<s){const t=(0,l.XZ)(r,s);e[0]=r+t*(-2*s)}}else{const r=e.x;if(r>t){const s=(0,l.XZ)(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r<s){const t=(0,l.XZ)(r,s);e=e.clone().offset(t*(-2*s),0)}}return e}function x(e,t){let s=-1;for(let r=0;r<t.cutIndexes.length;r++){const n=t.cutIndexes[r],i=t.geometries[r],o=(0,l.x3)(i);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const r=t[e][0];s=r>s?r:s}s=Number(s.toFixed(9));const r=-360*(0,l.XZ)(s,180);for(let s=0;s<t.length;s++){const t=i.getPoint(e,s);i.setPoint(e,s,t.clone().offset(r,0))}return!0}}))}if(n===s){if(y(e))for(const t of(0,l.x3)(i))e[n]=e[n].addRing(t);else if(m(e))for(const t of(0,l.x3)(i))e[n]=e[n].addPath(t)}else s=n,e[n]=i}return e}async function k(e,t,s){var n;if(!Array.isArray(e))return k([e],t);const i=null!=(n=null==t?void 0:t.url)?n:r.Z.geometryServiceUrl;let g,y,m,w,S,I,T,F,q=0;const R=[],v=[];for(const t of e)if((0,o.Wi)(t))v.push(t);else if(g||(g=t.spatialReference,y=(0,c.C5)(g),m=g.isWebMercator,I=m?102100:4326,w=l.UZ[I].maxX,S=l.UZ[I].minX,T=l.UZ[I].plus180Line,F=l.UZ[I].minus180Line),y)if("mesh"===t.type)v.push(t);else if("point"===t.type)v.push(b(t.clone(),w,S));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,w,S))),v.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,y);v.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,s=(0,l.XZ)(e.xmin,S)*(2*w);let r=0===s?t.clone():(0,l.Sy)(t.clone(),s);e.offset(s,0),e.intersects(T)&&e.xmax!==w?(q=e.xmax>q?e.xmax:q,r=_(r,m),R.push(r),v.push("cut")):e.intersects(F)&&e.xmin!==S?(q=e.xmax*(2*w)>q?e.xmax*(2*w):q,r=_(r,m,360),R.push(r),v.push("cut")):v.push(r)}else v.push(t.clone());else v.push(t);let Z=(0,l.XZ)(q,w),C=-90;const N=Z,O=new u.Z;for(;Z>0;){const e=360*Z-180;O.addPath([[e,C],[e,-1*C]]),C*=-1,Z--}if(R.length>0&&N>0){const t=x(R,await async function(e,t,s,r){const n="string"==typeof e?(0,f.mN)(e):e,i=t[0].spatialReference,o={...r,query:{...n.query,f:"json",sr:JSON.stringify(i),target:JSON.stringify({geometryType:(0,d.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,p.default)(n.path+"/cut",o),{cutIndexes:u,geometries:l=[]}=a.data;return{cutIndexes:u,geometries:l.map((e=>{const t=(0,d.im)(e);return t.spatialReference=i,t}))}}(i,R,O,s)),r=[],n=[];for(let s=0;s<v.length;s++){const i=v[s];if("cut"!==i)n.push(i);else{const i=t.shift(),a=e[s];(0,o.pC)(a)&&"polygon"===a.type&&a.rings&&a.rings.length>1&&i.rings.length>=a.rings.length?(r.push(i),n.push("simplify")):n.push(m?(0,h.$)(i):i)}}if(!r.length)return n;const a=await async function(e,t,s){const r="string"==typeof e?(0,f.mN)(e):e,n=t[0].spatialReference,i=(0,d.Ji)(t[0]),o={...s,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify((a=t,{geometryType:(0,d.Ji)(a[0]),geometries:a.map((e=>e.toJSON()))}))}};var a;return function(e,t,s){const r=(0,d.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=s,t}))}((await(0,p.default)(r.path+"/simplify",o)).data,i,n)}(i,r,s),u=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?u.push(t):u.push(m?(0,h.$)(a.shift()):a.shift())}return u}const G=[];for(let e=0;e<v.length;e++){const t=v[e];if("cut"!==t)G.push(t);else{const e=R.shift();G.push(!0===m?(0,h.$)(e):e)}}return Promise.resolve(G)}},73913:(e,t,s)=>{s.d(t,{UZ:()=>o,x3:()=>l,XZ:()=>a,Sy:()=>u});var r=s(58901),n=s(82971),i=s(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator}),minus180Line:new r.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.Z({paths:[[[180,-180],[180,180]]],spatialReference:n.Z.WGS84}),minus180Line:new r.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:n.Z.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){const s=l(e);for(const e of s)for(const s of e)s[0]+=t;return e}function l(e){return(0,i.oU)(e)?e.rings:e.paths}},69285:(e,t,s)=>{s.d(t,{k:()=>o});var r=s(70586),n=s(67900),i=s(8744);function o(e,t,s){if((0,r.Wi)(t)||(0,r.Wi)(s)||s.vcsWkid||(0,i.fS)(t,s))return null;const o=(0,n._R)(t)/(0,n._R)(s);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const s of e.paths)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const s of e.rings)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const s of e.points)s.length>2&&(s[2]*=t)}(e,o);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},70272:(e,t,s)=>{s.d(t,{nd:()=>o,ZP:()=>n,S6:()=>i});var r=s(70586);class n{constructor(e=null,t={},s,r){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new n(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function i(e){return!((0,r.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)}class o extends n{}},44876:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new r;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e=[],t=[],s=!1){this.lengths=null!=e?e:[],this.coords=null!=t?t:[],this.hasIndeterminateRingOrder=s}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const r=this.lengths[s];for(let s=0;s<r;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=r}}clone(e){return e?(e.set(this.coords),new r(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new r(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},66677:(e,t,s)=>{s.d(t,{ld:()=>d,B5:()=>h,M8:()=>y,G:()=>x,Qc:()=>p,DR:()=>f,Nm:()=>m,XG:()=>_,a7:()=>g,wH:()=>b});var r=s(70586),n=s(17452),i=s(25929);const o={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},a=Object.values(o),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!u.test(e)}function p(e){const t=(0,n.mN)(e),s=t.path.match(u)||t.path.match(l);if(!s)return null;const[,r,i,a,c]=s,h=i.indexOf("/");return{title:d(-1!==h?i.slice(h+1):i),serverType:o[a.toLowerCase()],sublayer:null!=c&&""!==c?parseInt(c,10):null,url:{path:r}}}function f(e){const t=(0,n.mN)(e).path.match(c);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function d(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function g(e,t){const s=[];if(e){const t=p(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=d(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function y(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,n.Qj)((0,n.Hu)(e,t)):e}function _(e){let{url:t}=e;if(!t)return{url:t};t=(0,n.Hu)(t,e.logger);const s=(0,n.mN)(t),i=p(s.path);let o;if((0,r.pC)(i))null!=i.sublayer&&null==e.layer.layerId&&(o=i.sublayer),t=i.url.path;else if(e.nonStandardUrlAllowed){const e=f(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,o=e.sublayerId)}return{url:(0,n.Qj)(t),layerId:o}}function b(e,t,s,r,o){(0,i.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,n.v_)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),n=-1!==t.indexOf("/imageserver/wmsserver"),i=-1!==t.indexOf("/wmsserver");return s&&(r||n||i)}},77863:(e,t,s)=>{s.d(t,{K9:()=>v,O7:()=>h,G$:()=>I});var r=s(20102),n=s(70586),i=s(45091),o=s(5428),a=s(78760);const u=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function h(e){return e>=u.length?null:u[e]}function p(e){return e>=l.length?null:l[e]}function f(e){return e>=c.length?null:c[e]}function d(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function g(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addCoordinatePoint(r,e.getSInt64(),i++);break}default:e.skip()}return r}function y(e,t,s){const r=t.createGeometry(s),n=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addLength(r,e.getUInt32(),i++);break}case 3:{const s=e.getUInt32(),i=e.pos()+s;let o=0;for(t.allocateCoordinates(r);e.pos()<i;)t.addCoordinate(r,e.getSInt64(),o),o++,o===n&&(o=0);break}default:e.skip()}return r}function m(e){const t=new o.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=a.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function _(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function b(e){const t={type:h(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=h(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=p(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function x(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function k(e,t,s,r){const n=t.createFeature(s);let i=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[i++].name;n.attributes[t]=e.processMessage(_);break}case 2:n.geometry=e.processMessageWithArgs(y,t,s);break;case 4:n.centroid=e.processMessageWithArgs(g,t,s);break;default:e.skip()}return n}function w(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function I(e){const t={originPosition:f(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=f(e.getEnum());break;case 2:t.scale=e.processMessage(w);break;case 3:t.translate=e.processMessage(S);break;default:e.skip()}return t}function T(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function F(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function q(e,t){const s=t.createFeatureResult();s.geometryType=d(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(T);break;case 7:s.geometryType=d(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(F,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(I);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(b));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(k,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(x);break;default:e.skip()}return t.finishFeatureResult(s),s}function R(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(q,t);break;default:e.skip()}return(0,n.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function v(e,t){try{const s=2,r=new i.Z(new Uint8Array(e),new DataView(e)),n={};for(;r.next();)r.tag()===s?n.queryResult=r.processMessageWithArgs(R,t):r.skip();return n}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>u,J:()=>l});var r=s(67900),n=s(8744),i=s(70272),o=s(44876),a=s(5428);const u=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class l{constructor(e){this.options=e,this.geometryTypes=u,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new o.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,n.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,i.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new i.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new a.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new a.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>n});var r=s(77863);function n(e,t){const s=(0,r.K9)(e,t),n=s.queryResult.featureResult,i=s.queryResult.queryGeometry,o=s.queryResult.queryGeometryType;if(n&&n.features&&n.features.length&&n.objectIdFieldName){const e=n.objectIdFieldName;for(const t of n.features)t.attributes&&(t.objectId=t.attributes[e])}return n&&(n.queryGeometry=i,n.queryGeometryType=o),n}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>d,executeQueryForCount:()=>_,executeQueryForExtent:()=>b,executeQueryForIds:()=>m,executeQueryPBF:()=>g,executeQueryPBFBuffer:()=>y,queryToQueryStringParameters:()=>f,runQuery:()=>x});var r=s(3172),n=s(70586),i=s(17452),o=s(33955),a=s(38581),u=s(66677),l=s(45178),c=s(28694),h=s(99306);const p="Layer does not support extent calculation.";function f(e,t,s=!1){const r=e.geometry,i=e.toJSON(),a=i,u=e.outSpatialReference;let l,c;if((0,n.pC)(r)){if(l=r.spatialReference,c=r.spatialReference.wkid||JSON.stringify(r.spatialReference),a.geometryType=(0,o.Ji)(r),"extent"===r.type)a.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if("point"===r.type)a.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,a.geometry=JSON.stringify(e)}a.inSR=c}if(l||(l=u),i.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=i.groupByFieldsForStatistics.join(",")),i.objectIds&&(a.objectIds=i.objectIds.join(",")),i.orderByFields&&(a.orderByFields=i.orderByFields.join(",")),!i.outFields||!i.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete a.outFields:-1!==i.outFields.indexOf("*")?a.outFields="*":a.outFields=i.outFields.join(","),i.outSR?a.outSR=i.outSR.wkid||JSON.stringify(i.outSR):r&&(i.returnGeometry||i.returnCentroid)&&(a.outSR=a.inSR),i.returnGeometry&&delete i.returnGeometry,i.outStatistics&&(a.outStatistics=JSON.stringify(i.outStatistics)),i.pixelSize&&(a.pixelSize=JSON.stringify(i.pixelSize)),i.quantizationParameters&&(s&&(0,n.pC)(l)&&(0,n.pC)(e.quantizationParameters)&&(0,n.pC)(e.quantizationParameters.extent)&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete i.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(i.quantizationParameters)),i.parameterValues&&(a.parameterValues=JSON.stringify(i.parameterValues)),i.rangeValues&&(a.rangeValues=JSON.stringify(i.rangeValues)),i.dynamicDataSource&&(a.layer=JSON.stringify({source:i.dynamicDataSource}),delete i.dynamicDataSource),i.timeExtent){const e=i.timeExtent,{start:t,end:s}=e;null==t&&null==s||(a.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete i.timeExtent}return a}async function d(e,t,s,r){const i=(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await x(e,t,"json",r);return(0,c.p)(t,s,i.data),i}async function g(e,t,s,r){if((0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const i=await y(e,t,r),o=i;return o.data=(0,l.C)(i.data,s),o}function y(e,t,s){return x(e,t,"pbf",s)}function m(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):x(e,t,"json",s,{returnIdsOnly:!0})}function _(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):x(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function b(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):x(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(p);if(t.hasOwnProperty("count"))throw new Error(p);return e}))}function x(e,t,s,o={},l={}){const c="string"==typeof e?(0,i.mN)(e):e,p=t.geometry?[t.geometry]:[];return o.responseType="pbf"===s?"array-buffer":"json",(0,a.aX)(p,null,o).then((e=>{const a=e&&e[0];(0,n.pC)(a)&&((t=t.clone()).geometry=a);const p=(0,u.M8)(c.path),d=(0,h.A)({...c.query,f:s,...l,...f(t,l,p)});return(0,r.default)((0,i.v_)(c.path,"query"),{...o,query:{...d,...o.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>i});var r=s(70586),n=s(69285);function i(e,t,s){if(!s||!s.features||!s.hasZ)return;const i=(0,n.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(i))for(const e of s.features)i(e.geometry)}},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){t[s]=[];for(let e=0;e<n.length;e++)t[s][e]=r(n[e])}else"object"==typeof n?n.toJSON&&(t[s]=JSON.stringify(n)):t[s]=n}return t}s.d(t,{A:()=>r})}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4599],{45091:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(80442),n=s(71143);const i=4294967296,o=(0,r.Z)("esri-text-decoder")?new TextDecoder("utf-8"):null,a=(0,r.Z)("safari")||(0,r.Z)("ios")?6:(0,r.Z)("ff")?12:32;class u{constructor(e,t,s=0,r=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this.init(e,t,s,r)}init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*i;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*i;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const n=this.getMessage(),i=e(n,t,s,r);return n.release(),i}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t.init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*n,n*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*n}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>a&&o){const r=e.subarray(t,s);return o.decode(r)}let r="",n="";for(let i=t;i<s;++i){const t=e[i];128&t?n+="%"+t.toString(16):(r+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(r+=decodeURIComponent(n)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}u.pool=new n.Z(u,null,(e=>{e._data=null,e._dataView=null}))},38581:(e,t,s)=>{s.d(t,{aX:()=>k});var r=s(68773),n=s(20102),i=s(92604),o=s(70586),a=s(17332),u=s(58901),l=s(73913),c=s(8744),h=s(40488),p=(s(66577),s(3172)),f=s(17452),d=s(33955);const g=i.Z.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function m(e){return"polyline"===e[0].type}function _(e,t,s){if(t){const t=function(e,t){if(!(e instanceof u.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g.error(e),new n.Z(e)}const s=(0,l.x3)(e),r=[];for(const e of s){const s=[];r.push(s),s.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const n=e[r][0],i=e[r][1],o=e[r+1][0],a=e[r+1][1],u=Math.sqrt((o-n)*(o-n)+(a-i)*(a-i)),l=(a-i)/u,c=(o-n)/u,h=u/t;if(h>1){for(let e=1;e<=h-1;e++){const r=e*t,o=c*r+n,a=l*r+i;s.push([o,a])}const e=(u+Math.floor(h-1)*t)/2,r=c*e+n,o=l*e+i;s.push([r,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:r,spatialReference:e.spatialReference}):new u.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.Sx)(t,!0)}return s&&(e=(0,l.Sy)(e,s)),e}function b(e,t,s){if(Array.isArray(e)){const r=e[0];if(r>t){const s=(0,l.XZ)(r,t);e[0]=r+s*(-2*t)}else if(r<s){const t=(0,l.XZ)(r,s);e[0]=r+t*(-2*s)}}else{const r=e.x;if(r>t){const s=(0,l.XZ)(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r<s){const t=(0,l.XZ)(r,s);e=e.clone().offset(t*(-2*s),0)}}return e}function x(e,t){let s=-1;for(let r=0;r<t.cutIndexes.length;r++){const n=t.cutIndexes[r],i=t.geometries[r],o=(0,l.x3)(i);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const r=t[e][0];s=r>s?r:s}s=Number(s.toFixed(9));const r=-360*(0,l.XZ)(s,180);for(let s=0;s<t.length;s++){const t=i.getPoint(e,s);i.setPoint(e,s,t.clone().offset(r,0))}return!0}}))}if(n===s){if(y(e))for(const t of(0,l.x3)(i))e[n]=e[n].addRing(t);else if(m(e))for(const t of(0,l.x3)(i))e[n]=e[n].addPath(t)}else s=n,e[n]=i}return e}async function k(e,t,s){var n;if(!Array.isArray(e))return k([e],t);const i=null!=(n=null==t?void 0:t.url)?n:r.Z.geometryServiceUrl;let g,y,m,w,S,I,T,F,q=0;const R=[],v=[];for(const t of e)if((0,o.Wi)(t))v.push(t);else if(g||(g=t.spatialReference,y=(0,c.C5)(g),m=g.isWebMercator,I=m?102100:4326,w=l.UZ[I].maxX,S=l.UZ[I].minX,T=l.UZ[I].plus180Line,F=l.UZ[I].minus180Line),y)if("mesh"===t.type)v.push(t);else if("point"===t.type)v.push(b(t.clone(),w,S));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,w,S))),v.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,y);v.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,s=(0,l.XZ)(e.xmin,S)*(2*w);let r=0===s?t.clone():(0,l.Sy)(t.clone(),s);e.offset(s,0),e.intersects(T)&&e.xmax!==w?(q=e.xmax>q?e.xmax:q,r=_(r,m),R.push(r),v.push("cut")):e.intersects(F)&&e.xmin!==S?(q=e.xmax*(2*w)>q?e.xmax*(2*w):q,r=_(r,m,360),R.push(r),v.push("cut")):v.push(r)}else v.push(t.clone());else v.push(t);let Z=(0,l.XZ)(q,w),C=-90;const N=Z,O=new u.Z;for(;Z>0;){const e=360*Z-180;O.addPath([[e,C],[e,-1*C]]),C*=-1,Z--}if(R.length>0&&N>0){const t=x(R,await async function(e,t,s,r){const n="string"==typeof e?(0,f.mN)(e):e,i=t[0].spatialReference,o={...r,query:{...n.query,f:"json",sr:JSON.stringify(i),target:JSON.stringify({geometryType:(0,d.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,p.default)(n.path+"/cut",o),{cutIndexes:u,geometries:l=[]}=a.data;return{cutIndexes:u,geometries:l.map((e=>{const t=(0,d.im)(e);return t.spatialReference=i,t}))}}(i,R,O,s)),r=[],n=[];for(let s=0;s<v.length;s++){const i=v[s];if("cut"!==i)n.push(i);else{const i=t.shift(),a=e[s];(0,o.pC)(a)&&"polygon"===a.type&&a.rings&&a.rings.length>1&&i.rings.length>=a.rings.length?(r.push(i),n.push("simplify")):n.push(m?(0,h.$)(i):i)}}if(!r.length)return n;const a=await async function(e,t,s){const r="string"==typeof e?(0,f.mN)(e):e,n=t[0].spatialReference,i=(0,d.Ji)(t[0]),o={...s,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify((a=t,{geometryType:(0,d.Ji)(a[0]),geometries:a.map((e=>e.toJSON()))}))}};var a;return function(e,t,s){const r=(0,d.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=s,t}))}((await(0,p.default)(r.path+"/simplify",o)).data,i,n)}(i,r,s),u=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?u.push(t):u.push(m?(0,h.$)(a.shift()):a.shift())}return u}const G=[];for(let e=0;e<v.length;e++){const t=v[e];if("cut"!==t)G.push(t);else{const e=R.shift();G.push(!0===m?(0,h.$)(e):e)}}return Promise.resolve(G)}},73913:(e,t,s)=>{s.d(t,{UZ:()=>o,x3:()=>l,XZ:()=>a,Sy:()=>u});var r=s(58901),n=s(82971),i=s(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator}),minus180Line:new r.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.Z({paths:[[[180,-180],[180,180]]],spatialReference:n.Z.WGS84}),minus180Line:new r.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:n.Z.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){const s=l(e);for(const e of s)for(const s of e)s[0]+=t;return e}function l(e){return(0,i.oU)(e)?e.rings:e.paths}},69285:(e,t,s)=>{s.d(t,{k:()=>o});var r=s(70586),n=s(67900),i=s(8744);function o(e,t,s){if((0,r.Wi)(t)||(0,r.Wi)(s)||s.vcsWkid||(0,i.fS)(t,s))return null;const o=(0,n._R)(t)/(0,n._R)(s);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const s of e.paths)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const s of e.rings)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const s of e.points)s.length>2&&(s[2]*=t)}(e,o);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},70272:(e,t,s)=>{s.d(t,{nd:()=>o,ZP:()=>n,S6:()=>i});var r=s(70586);class n{constructor(e=null,t={},s,r){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new n(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function i(e){return!((0,r.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)}class o extends n{}},44876:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new r;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e=[],t=[],s=!1){this.lengths=null!=e?e:[],this.coords=null!=t?t:[],this.hasIndeterminateRingOrder=s}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const r=this.lengths[s];for(let s=0;s<r;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=r}}clone(e){return e?(e.set(this.coords),new r(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new r(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},66677:(e,t,s)=>{s.d(t,{ld:()=>d,B5:()=>h,M8:()=>y,G:()=>x,Qc:()=>p,DR:()=>f,Nm:()=>m,XG:()=>_,a7:()=>g,wH:()=>b});var r=s(70586),n=s(17452),i=s(25929);const o={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},a=Object.values(o),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!u.test(e)}function p(e){const t=(0,n.mN)(e),s=t.path.match(u)||t.path.match(l);if(!s)return null;const[,r,i,a,c]=s,h=i.indexOf("/");return{title:d(-1!==h?i.slice(h+1):i),serverType:o[a.toLowerCase()],sublayer:null!=c&&""!==c?parseInt(c,10):null,url:{path:r}}}function f(e){const t=(0,n.mN)(e).path.match(c);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function d(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function g(e,t){const s=[];if(e){const t=p(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=d(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function y(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,n.Qj)((0,n.Hu)(e,t)):e}function _(e){let{url:t}=e;if(!t)return{url:t};t=(0,n.Hu)(t,e.logger);const s=(0,n.mN)(t),i=p(s.path);let o;if((0,r.pC)(i))null!=i.sublayer&&null==e.layer.layerId&&(o=i.sublayer),t=i.url.path;else if(e.nonStandardUrlAllowed){const e=f(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,o=e.sublayerId)}return{url:(0,n.Qj)(t),layerId:o}}function b(e,t,s,r,o){(0,i.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,n.v_)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),n=-1!==t.indexOf("/imageserver/wmsserver"),i=-1!==t.indexOf("/wmsserver");return s&&(r||n||i)}},77863:(e,t,s)=>{s.d(t,{K9:()=>v,O7:()=>h,G$:()=>I});var r=s(20102),n=s(70586),i=s(45091),o=s(5428),a=s(78760);const u=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function h(e){return e>=u.length?null:u[e]}function p(e){return e>=l.length?null:l[e]}function f(e){return e>=c.length?null:c[e]}function d(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function g(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addCoordinatePoint(r,e.getSInt64(),i++);break}default:e.skip()}return r}function y(e,t,s){const r=t.createGeometry(s),n=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addLength(r,e.getUInt32(),i++);break}case 3:{const s=e.getUInt32(),i=e.pos()+s;let o=0;for(t.allocateCoordinates(r);e.pos()<i;)t.addCoordinate(r,e.getSInt64(),o),o++,o===n&&(o=0);break}default:e.skip()}return r}function m(e){const t=new o.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=a.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function _(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function b(e){const t={type:h(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=h(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=p(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function x(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function k(e,t,s,r){const n=t.createFeature(s);let i=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[i++].name;n.attributes[t]=e.processMessage(_);break}case 2:n.geometry=e.processMessageWithArgs(y,t,s);break;case 4:n.centroid=e.processMessageWithArgs(g,t,s);break;default:e.skip()}return n}function w(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function I(e){const t={originPosition:f(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=f(e.getEnum());break;case 2:t.scale=e.processMessage(w);break;case 3:t.translate=e.processMessage(S);break;default:e.skip()}return t}function T(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function F(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function q(e,t){const s=t.createFeatureResult();s.geometryType=d(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(T);break;case 7:s.geometryType=d(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(F,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(I);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(b));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(k,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(x);break;default:e.skip()}return t.finishFeatureResult(s),s}function R(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(q,t);break;default:e.skip()}return(0,n.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function v(e,t){try{const s=2,r=new i.Z(new Uint8Array(e),new DataView(e)),n={};for(;r.next();)r.tag()===s?n.queryResult=r.processMessageWithArgs(R,t):r.skip();return n}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>u,J:()=>l});var r=s(67900),n=s(8744),i=s(70272),o=s(44876),a=s(5428);const u=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class l{constructor(e){this.options=e,this.geometryTypes=u,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new o.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,n.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,i.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new i.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new a.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new a.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>n});var r=s(77863);function n(e,t){const s=(0,r.K9)(e,t),n=s.queryResult.featureResult,i=s.queryResult.queryGeometry,o=s.queryResult.queryGeometryType;if(n&&n.features&&n.features.length&&n.objectIdFieldName){const e=n.objectIdFieldName;for(const t of n.features)t.attributes&&(t.objectId=t.attributes[e])}return n&&(n.queryGeometry=i,n.queryGeometryType=o),n}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>d,executeQueryForCount:()=>_,executeQueryForExtent:()=>b,executeQueryForIds:()=>m,executeQueryPBF:()=>g,executeQueryPBFBuffer:()=>y,queryToQueryStringParameters:()=>f,runQuery:()=>x});var r=s(3172),n=s(70586),i=s(17452),o=s(33955),a=s(38581),u=s(66677),l=s(45178),c=s(28694),h=s(99306);const p="Layer does not support extent calculation.";function f(e,t,s=!1){const r=e.geometry,i=e.toJSON(),a=i,u=e.outSpatialReference;let l,c;if((0,n.pC)(r)){if(l=r.spatialReference,c=r.spatialReference.wkid||JSON.stringify(r.spatialReference),a.geometryType=(0,o.Ji)(r),s&&"extent"===r.type)a.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if(s&&"point"===r.type)a.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,a.geometry=JSON.stringify(e)}a.inSR=c}if(l||(l=u),i.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=i.groupByFieldsForStatistics.join(",")),i.objectIds&&(a.objectIds=i.objectIds.join(",")),i.orderByFields&&(a.orderByFields=i.orderByFields.join(",")),!i.outFields||!i.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete a.outFields:-1!==i.outFields.indexOf("*")?a.outFields="*":a.outFields=i.outFields.join(","),i.outSR?a.outSR=i.outSR.wkid||JSON.stringify(i.outSR):r&&(i.returnGeometry||i.returnCentroid)&&(a.outSR=a.inSR),i.returnGeometry&&delete i.returnGeometry,i.outStatistics&&(a.outStatistics=JSON.stringify(i.outStatistics)),i.pixelSize&&(a.pixelSize=JSON.stringify(i.pixelSize)),i.quantizationParameters&&(s&&(0,n.pC)(l)&&(0,n.pC)(e.quantizationParameters)&&(0,n.pC)(e.quantizationParameters.extent)&&l.equals(e.quantizationParameters.extent.spatialReference)&&delete i.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(i.quantizationParameters)),i.parameterValues&&(a.parameterValues=JSON.stringify(i.parameterValues)),i.rangeValues&&(a.rangeValues=JSON.stringify(i.rangeValues)),i.dynamicDataSource&&(a.layer=JSON.stringify({source:i.dynamicDataSource}),delete i.dynamicDataSource),i.timeExtent){const e=i.timeExtent,{start:t,end:s}=e;null==t&&null==s||(a.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete i.timeExtent}return a}async function d(e,t,s,r){const i=(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await x(e,t,"json",r);return(0,c.p)(t,s,i.data),i}async function g(e,t,s,r){if((0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const i=await y(e,t,r),o=i;return o.data=(0,l.C)(i.data,s),o}function y(e,t,s){return x(e,t,"pbf",s)}function m(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):x(e,t,"json",s,{returnIdsOnly:!0})}function _(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):x(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function b(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):x(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(p);if(t.hasOwnProperty("count"))throw new Error(p);return e}))}function x(e,t,s,o={},l={}){const c="string"==typeof e?(0,i.mN)(e):e,p=t.geometry?[t.geometry]:[];return o.responseType="pbf"===s?"array-buffer":"json",(0,a.aX)(p,null,o).then((e=>{const a=e&&e[0];(0,n.pC)(a)&&((t=t.clone()).geometry=a);const p=(0,u.M8)(c.path),d=(0,h.A)({...c.query,f:s,...l,...f(t,l,p)});return(0,r.default)((0,i.v_)(c.path,"query"),{...o,query:{...d,...o.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>i});var r=s(70586),n=s(69285);function i(e,t,s){if(!s||!s.features||!s.hasZ)return;const i=(0,n.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(i))for(const e of s.features)i(e.geometry)}},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){t[s]=[];for(let e=0;e<n.length;e++)t[s][e]=r(n[e])}else"object"==typeof n?n.toJSON&&(t[s]=JSON.stringify(n)):t[s]=n}return t}s.d(t,{A:()=>r})}}]);
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";var s;const r={apiKey:void 0,applicationUrl:null==(s=globalThis.location)?void 0:s.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.22.1";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";var s;const r={apiKey:void 0,applicationUrl:null==(s=globalThis.location)?void 0:s.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.22.2";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.22.1",
3
+ "version": "4.22.2",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../request.js";import{isSome as e}from"../../../core/maybe.js";import{join as r,urlToObject as n}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as o}from"../../../geometry/support/normalizeUtils.js";import{isHostedAgolService as s}from"../../../layers/support/arcgisLayerUrl.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{applyFeatureSetZUnitScaling as u}from"./queryZScale.js";import{mapParameters as l}from"../../../tasks/operations/urlUtils.js";const m="Layer does not support extent calculation.";function y(t,r,n=!1){const o=t.geometry,s=t.toJSON(),a=s,u=t.outSpatialReference;let l,m;if(e(o)){if(l=o.spatialReference,m=o.spatialReference.wkid||JSON.stringify(o.spatialReference),a.geometryType=i(o),"extent"===o.type)a.geometry=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`;else if("point"===o.type)a.geometry=`${o.x},${o.y}`;else{const t=o.toJSON();delete t.spatialReference,a.geometry=JSON.stringify(t)}a.inSR=m}if(l||(l=u),s.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=s.groupByFieldsForStatistics.join(",")),s.objectIds&&(a.objectIds=s.objectIds.join(",")),s.orderByFields&&(a.orderByFields=s.orderByFields.join(",")),!s.outFields||!s.returnDistinctValues&&(null!=r&&r.returnCountOnly||null!=r&&r.returnExtentOnly||null!=r&&r.returnIdsOnly)?delete a.outFields:-1!==s.outFields.indexOf("*")?a.outFields="*":a.outFields=s.outFields.join(","),s.outSR?a.outSR=s.outSR.wkid||JSON.stringify(s.outSR):o&&(s.returnGeometry||s.returnCentroid)&&(a.outSR=a.inSR),s.returnGeometry&&delete s.returnGeometry,s.outStatistics&&(a.outStatistics=JSON.stringify(s.outStatistics)),s.pixelSize&&(a.pixelSize=JSON.stringify(s.pixelSize)),s.quantizationParameters&&(n&&e(l)&&e(t.quantizationParameters)&&e(t.quantizationParameters.extent)&&l.equals(t.quantizationParameters.extent.spatialReference)&&delete s.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(s.quantizationParameters)),s.parameterValues&&(a.parameterValues=JSON.stringify(s.parameterValues)),s.rangeValues&&(a.rangeValues=JSON.stringify(s.rangeValues)),s.dynamicDataSource&&(a.layer=JSON.stringify({source:s.dynamicDataSource}),delete s.dynamicDataSource),s.timeExtent){const t=s.timeExtent,{start:e,end:r}=t;null==e&&null==r||(a.time=e===r?e:`${null==e?"null":e},${null==r?"null":r}`),delete s.timeExtent}return a}async function c(t,r,n,i){const o=e(r.timeExtent)&&r.timeExtent.isEmpty?{data:{features:[]}}:await g(t,r,"json",i);return u(r,n,o.data),o}async function p(t,r,n,i){if(e(r.timeExtent)&&r.timeExtent.isEmpty)return Promise.resolve({data:n.createFeatureResult()});const o=await f(t,r,i),s=o;return s.data=a(o.data,n),s}function f(t,e,r){return g(t,e,"pbf",r)}function d(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):g(t,r,"json",n,{returnIdsOnly:!0})}function x(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):g(t,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function S(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):g(t,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then((t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(m);if(e.hasOwnProperty("count"))throw new Error(m);return t}))}function g(i,a,u,m={},c={}){const p="string"==typeof i?n(i):i,f=a.geometry?[a.geometry]:[];return m.responseType="pbf"===u?"array-buffer":"json",o(f,null,m).then((n=>{const i=n&&n[0];e(i)&&((a=a.clone()).geometry=i);const o=s(p.path),f=l({...p.query,f:u,...c,...y(a,c,o)});return t(r(p.path,"query"),{...m,query:{...f,...m.query}})}))}export{c as executeQuery,x as executeQueryForCount,S as executeQueryForExtent,d as executeQueryForIds,p as executeQueryPBF,f as executeQueryPBFBuffer,y as queryToQueryStringParameters,g as runQuery};
5
+ import t from"../../../request.js";import{isSome as e}from"../../../core/maybe.js";import{join as r,urlToObject as n}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as o}from"../../../geometry/support/normalizeUtils.js";import{isHostedAgolService as s}from"../../../layers/support/arcgisLayerUrl.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{applyFeatureSetZUnitScaling as u}from"./queryZScale.js";import{mapParameters as l}from"../../../tasks/operations/urlUtils.js";const m="Layer does not support extent calculation.";function y(t,r,n=!1){const o=t.geometry,s=t.toJSON(),a=s,u=t.outSpatialReference;let l,m;if(e(o)){if(l=o.spatialReference,m=o.spatialReference.wkid||JSON.stringify(o.spatialReference),a.geometryType=i(o),n&&"extent"===o.type)a.geometry=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`;else if(n&&"point"===o.type)a.geometry=`${o.x},${o.y}`;else{const t=o.toJSON();delete t.spatialReference,a.geometry=JSON.stringify(t)}a.inSR=m}if(l||(l=u),s.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=s.groupByFieldsForStatistics.join(",")),s.objectIds&&(a.objectIds=s.objectIds.join(",")),s.orderByFields&&(a.orderByFields=s.orderByFields.join(",")),!s.outFields||!s.returnDistinctValues&&(null!=r&&r.returnCountOnly||null!=r&&r.returnExtentOnly||null!=r&&r.returnIdsOnly)?delete a.outFields:-1!==s.outFields.indexOf("*")?a.outFields="*":a.outFields=s.outFields.join(","),s.outSR?a.outSR=s.outSR.wkid||JSON.stringify(s.outSR):o&&(s.returnGeometry||s.returnCentroid)&&(a.outSR=a.inSR),s.returnGeometry&&delete s.returnGeometry,s.outStatistics&&(a.outStatistics=JSON.stringify(s.outStatistics)),s.pixelSize&&(a.pixelSize=JSON.stringify(s.pixelSize)),s.quantizationParameters&&(n&&e(l)&&e(t.quantizationParameters)&&e(t.quantizationParameters.extent)&&l.equals(t.quantizationParameters.extent.spatialReference)&&delete s.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(s.quantizationParameters)),s.parameterValues&&(a.parameterValues=JSON.stringify(s.parameterValues)),s.rangeValues&&(a.rangeValues=JSON.stringify(s.rangeValues)),s.dynamicDataSource&&(a.layer=JSON.stringify({source:s.dynamicDataSource}),delete s.dynamicDataSource),s.timeExtent){const t=s.timeExtent,{start:e,end:r}=t;null==e&&null==r||(a.time=e===r?e:`${null==e?"null":e},${null==r?"null":r}`),delete s.timeExtent}return a}async function c(t,r,n,i){const o=e(r.timeExtent)&&r.timeExtent.isEmpty?{data:{features:[]}}:await g(t,r,"json",i);return u(r,n,o.data),o}async function p(t,r,n,i){if(e(r.timeExtent)&&r.timeExtent.isEmpty)return Promise.resolve({data:n.createFeatureResult()});const o=await f(t,r,i),s=o;return s.data=a(o.data,n),s}function f(t,e,r){return g(t,e,"pbf",r)}function d(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):g(t,r,"json",n,{returnIdsOnly:!0})}function x(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):g(t,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function S(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):g(t,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then((t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(m);if(e.hasOwnProperty("count"))throw new Error(m);return t}))}function g(i,a,u,m={},c={}){const p="string"==typeof i?n(i):i,f=a.geometry?[a.geometry]:[];return m.responseType="pbf"===u?"array-buffer":"json",o(f,null,m).then((n=>{const i=n&&n[0];e(i)&&((a=a.clone()).geometry=i);const o=s(p.path),f=l({...p.query,f:u,...c,...y(a,c,o)});return t(r(p.path,"query"),{...m,query:{...f,...m.query}})}))}export{c as executeQuery,x as executeQueryForCount,S as executeQueryForExtent,d as executeQueryForIds,p as executeQueryPBF,f as executeQueryPBFBuffer,y as queryToQueryStringParameters,g as runQuery};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- const a="20211214",b="2f62aa11eb308d30278a805efbaca7231370b0d8";export{a as buildDate,b as commitHash};
5
+ const a="20211215",d="ad43611b413b1d0a625293a3ce87543dde5c1fa2";export{a as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{bidiText as t}from"../../core/BidiText.js";import{packFloatRGBA as r}from"../../core/floatRGBA.js";import{clone as o}from"../../core/lang.js";import a from"../../core/Logger.js";import{nextPowerOfTwo as i}from"../../core/mathUtils.js";import{isSome as s}from"../../core/maybe.js";import{pt2px as n,px2pt as l}from"../../core/screenUtils.js";import{create as c,expandPointInPlace as m}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as f}from"../../geometry/support/boundsUtils.js";import{Placement as y}from"./CIMPlacements.js";import{lineGapType2LineHeight as h,horizontalAlignment2HAlign as u,verticalAlignment2VAlign as p,EnvDrawHelper as S,Transformation as M,CanvasDrawHelper as d}from"./CIMSymbolDrawHelper.js";import{getValue as b}from"./utils.js";import{C_INFINITY as g}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{GLYPH_SIZE as C,MAGIC_LABEL_LINE_HEIGHT as I}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as k}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";const x=Math.PI,w=x/2,P=4,L=10,v=96/72,F=Math.PI/180,z=a.getLogger("esri.symbols.cim.CIMSymbolHelper");function D(e){if(!e||!e.type)return null;let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":t=O.fromSimpleMarker(e);break;case"picture-marker":t=O.fromPictureMarker(e);break;case"simple-line":t=O.fromSimpleLineSymbol(e);break;case"simple-fill":t=O.fromSimpleFillSymbol(e);break;case"picture-fill":t=O.fromPictureFillSymbol(e);break;case"text":t=O.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function T(e,t){switch(t.type){case"CIMSymbolReference":return T(e,t.symbol);case"CIMPointSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMLineSymbol":{const r={paths:[[[0,0],[0,1]]]};e.drawSymbol(t,r);break}case"CIMPolygonSymbol":{const r={rings:[[[0,0],[0,1],[0,0]]]};e.drawSymbol(t,r);break}case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new y;e.drawMarker(t,r);break}}return e.envelope()}function G(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function A(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(b(e.offsetX)),Math.abs(b(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude)}}function E(e){if(!e)return 0;let t=0;for(const r of e)t+=A(r);return t}class N{getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static SafeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}_vectorMarkerBounds(e,t,r,o){let a=!0;const i=c();if(t&&t.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(f(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}_getInflateSize(e,t,r,o,a){if($(t)){const i=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),s=E(t.effects);return s>0&&(i[0]-=s,i[1]-=s,i[2]+=s,i[3]+=s),i}return this._getTextInflatedSize(e,t,a)}_getLayersInflateSize(e,t,r,o,a){let i=!0;if(!t)return e;for(const n of t){if(!n)continue;let t=[0,0,0,0];switch(n.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n;let r=e.width;"Square"===e.capStyle||"Miter"===e.joinStyle?r/=1.4142135623730951:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r;break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=n;if("CIMVectorMarker"===n.type){const e=n;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o;const a=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=a,t[1]*=a,t[2]*=a,t[3]*=a}}else if("CIMPictureMarker"===n.type){const o=n,a=r.getResource(o.url);let i=1;s(a)&&a.height&&(i=a.width/a.height);const l=e.size/2,c=e.size*i*o.scaleX/2;t=[-c,-l,c,l]}else{const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1])),t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o}let i=b(e.rotation);if(e.rotateClockwise&&(i=-i),o&&(i-=o),i){const e=F*i,r=Math.cos(e),o=Math.sin(e),a=c([g,g,-g,-g]);m(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),m(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),m(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),m(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let l=b(e.offsetX),f=b(e.offsetY);if(o){const e=F*o,t=Math.cos(e),r=Math.sin(e),a=l*r+f*t;l=l*t-f*r,f=a}t[0]+=l,t[1]+=f,t[2]+=l,t[3]+=f;const y=G(e.markerPlacement);y>0&&(t[0]-=y,t[1]-=y,t[2]+=y,t[3]+=y);break}}const l=E(n.effects);l>0&&(t[0]-=l,t[1]-=l,t[2]+=l,t[3]+=l),i?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],i=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}_getTextInflatedSize(e,r,o){var a,i;const s=null!=(a=r.height)?a:L;if(e[0]=-s/2,e[1]=-s/2,e[2]=s/2,e[3]=s/2,!o)return e;const n=o.get(r);if(!n)return e;const{text:l,mosaicItem:c}=n;if(!c||0===c.glyphMosaicItems.length)return e;const m=h(r.lineGapType,null!=(i=r.lineGap)?i:0,s),f=t(l)[1],y=c.glyphMosaicItems,S=k(y,f,{scale:s/C,angle:b(r.angle),xOffset:b(r.offsetX),yOffset:b(r.offsetY),hAlign:u(r.horizontalAlignment),vAlign:p(r.verticalAlignment),maxLineWidth:512,lineHeight:I*Math.max(.25,Math.min(m||1,4)),decoration:r.font.decoration||"none",isCIM:!0}).boundsT;return e[0]=S.x-S.halfWidth,e[1]=-S.y-S.halfHeight,e[2]=S.x+S.halfWidth,e[3]=-S.y+S.halfHeight,e}}class O{static getEnvelope(e,t){const r=new S(t);if(Array.isArray(e)){let t;for(const o of e)t?t.union(T(r,o)):t=T(r,o);return t}return T(r,e)}static getTextureAnchor(e,t){const r=this.getEnvelope(e,t);if(!r)return[0,0,0];const o=(r.x+.5*r.width)*v,a=-(r.y+.5*r.height)*v,i=r.width*v+2,s=r.height*v+2;return[o/i,a/s,s]}static rasterize(e,t,r,o,a=!0){const i=r||this.getEnvelope(t,o);if(!i)return[null,0,0,0,0];const s=(i.x+.5*i.width)*v,n=(i.y+.5*i.height)*v;e.width=i.width*v,e.height=i.height*v,r||(e.width+=2,e.height+=2);const l=e.getContext("2d"),c=M.createScale(v,-v);c.translate(.5*e.width-s,.5*e.height+n);const m=new d(l,o,c);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};m.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new y;m.drawMarker(t,e);break}}const f=l.getImageData(0,0,e.width,e.height),h=new Uint8Array(f.data);if(a){let e;for(let t=0;t<h.length;t+=4)e=h[t+3]/255,h[t]=h[t]*e,h[t+1]=h[t+1]*e,h[t+2]=h[t+2]*e}return[h,e.width,e.height,-s/e.width,-n/e.height]}static fromTextSymbol(e){const{angle:r,color:o,font:a,haloColor:i,haloSize:s,horizontalAlignment:n,kerning:l,text:c,verticalAlignment:m,xoffset:f,yoffset:y}=e;let h,u,p,S,M;a&&(h=a.family,u=a.style,p=a.weight,S=a.size,M=a.decoration);let d=!1;if(c){d=t(c)[1]}return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:h||"Tahoma",fontStyleName:H(u,p),fontType:0,haloSize:s,height:S,hinting:1,horizontalAlignment:X(null!=n?n:"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:b(f),offsetY:b(y),strikethrough:"line-through"===M,underline:"underline"===M,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_(i)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:d?1:0,verticalAlignment:Y(null!=m?m:"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2},textString:c}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:i,yoffset:s,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const{cap:e,join:t,miterLimit:o,width:a}=r;l.push({type:"CIMSolidStroke",color:_(r.color),capStyle:V(e),joinStyle:B(t),miterLimit:o,width:a})}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle:0,y=o*(i||1),h=t*(n||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(s),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:t,style:r,outline:a}=e,s=[],n={type:"CIMPolygonSymbol",symbolLayers:s};let l=null;if(a){const{cap:e,join:t,style:r}=a;"solid"!==r&&"none"!==r&&"esriSLSSolid"!==r&&"esriSLSNull"!==r&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:W(r,e),lineDashEnding:"NoConstraint",scaleDash:!0}]),s.push({type:"CIMSolidStroke",color:_(a.color),capStyle:V(e),joinStyle:B(t),miterLimit:a.miterLimit,width:a.width,effects:l})}if(r&&"solid"!==r&&"none"!==r&&"esriSFSSolid"!==r&&"esriSFSNull"!==r){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:_(t),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let a=0;const n=i(Math.ceil(window.devicePixelRatio)),l=K(r)?8*n:10*n;switch(r){case"vertical":case"esriSFSVertical":a=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":a=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":a=45;break;case"cross":case"esriSFSCross":a=0}s.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:a,separation:l}),"cross"===r||"esriSFSCross"===r?s.push({type:"CIMHatchFill",lineSymbol:o(e),offsetX:0,offsetY:0,rotation:90,separation:l}):"diagonal-cross"!==r&&"esriSFSDiagonalCross"!==r||s.push({type:"CIMHatchFill",lineSymbol:o(e),offsetX:0,offsetY:0,rotation:45,separation:l})}else!r||"solid"!==r&&"esriSFSSolid"!==r||s.push({type:"CIMSolidFill",enable:!0,color:_(t)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:i,style:s,width:n}=e;let l=null;"solid"!==s&&"none"!==s&&"esriSLSSolid"!==s&&"esriSLSNull"!==s&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:W(s,t),lineDashEnding:"NoConstraint",scaleDash:!0}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=O.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return"none"!==s&&"esriSLSNull"!==s&&c.push({type:"CIMSolidStroke",color:_(r),capStyle:V(t),joinStyle:B(o),miterLimit:i,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:i}=e;let s=e.url;return"esriPMS"===e.type&&e.imageData&&(s=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,size:r,width:o,offsetX:b(a),offsetY:b(i),rotation:b(-t)}]}}static fromSimpleMarker(e,t,r){var o;const{style:a}=e,i=null!=(o=e.color)?o:r;if("path"===a){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:n(Math.round(l(r.width))),color:_(r.color)})}t.push({type:"CIMSolidFill",enable:!0,color:_(i),path:e.path});const[r,o]=J("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const[s,c]=J(a);let m;if(c&&s){const r=[];if("outline"in e&&e.outline){const t=e.outline;r.push({type:"CIMSolidStroke",enable:!0,width:n(Math.round(l(t.width))),color:_(t.color)})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style||r.push({type:"CIMSolidStroke",enable:!0,width:t,color:_(i)});r.push({type:"CIMSolidFill",enable:!0,color:_(i)});const o={type:"CIMPolygonSymbol",symbolLayers:r};m={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(e.size||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),frame:s,markerGraphics:[{type:"CIMMarkerGraphic",geometry:c,symbol:o}]}]}}return m}static fromCIMHatchFill(e){var t;const r=null!=(t=e.separation)?t:P,o=r/2,a=4;let i=this._getLineSymbolPeriod(e.lineSymbol)||a;for(;i<a;)i*=2;const s=i/2;return{type:"CIMVectorMarker",frame:{xmin:-s,xmax:s,ymin:-o,ymax:o},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-s,0],[s,0]]]},symbol:e.lineSymbol}],size:r}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers){const e=this._getEffectsRepeat(r.effects);if(e)return e;if(r){const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:z.error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={type:e.type,...e};let o,a,i,s;if(r.markerPlacement=null,r.anchorPoint=null,!0===t.shiftOddRows){a=t.stepX/2,i=t.stepY,s=2*t.stepY;o=[{x:-a,y:0},{x:a,y:0},{x:0,y:i},{x:0,y:-i}].map((e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})))}else a=t.stepX/2,i=t.stepY/2,s=t.stepY,o=[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMPointSymbol",symbolLayers:[r]}}];return{type:"CIMVectorMarker",frame:{xmin:-a,xmax:a,ymin:-i,ymax:i},markerGraphics:o,size:s}}static getFillColor(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getFillColor(t);if(null!=e)return e}break;case"CIMTextSymbol":return O.getFillColor(e.symbol);case"CIMSolidFill":return e.color}}static getStrokeColor(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getStrokeColor(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return O.getStrokeColor(e.symbol);case"CIMSolidStroke":return e.color}}static getStrokeWidth(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getStrokeWidth(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return O.getStrokeWidth(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}static getSize(e){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=0;if(e.symbolLayers)for(const r of e.symbolLayers){const e=O.getSize(r);e>t&&(t=e)}return t}case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":return e.width;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":return e.size}}static getMarkerScaleRatio(e){if(e&&"CIMVectorMarker"===e.type)if(!1!==e.scaleSymbolsProportionally&&e.frame){const t=e.frame.ymax-e.frame.ymin;return e.size/t}return 1}}class j{static rasterizeSimpleFill(e,t,r){"solid"!==t&&"none"!==t&&"esriSFSSolid"!==t&&"esriSFSNull"!==t||console.error("Unexpected: style does not require rasterization");const o=i(Math.ceil(r)),a=K(t)?8*o:16*o,s=2*o;e.width=a,e.height=a;const n=e.getContext("2d");n.strokeStyle="#FFFFFF",n.lineWidth=o,n.beginPath(),"vertical"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSVertical"!==t||(n.moveTo(a/2,-s),n.lineTo(a/2,a+s)),"horizontal"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSHorizontal"!==t||(n.moveTo(-s,a/2),n.lineTo(a+s,a/2)),"forward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSDiagonalCross"!==t&&"esriSFSForwardDiagonal"!==t||(n.moveTo(-s,-s),n.lineTo(a+s,a+s),n.moveTo(a-s,-s),n.lineTo(a+s,s),n.moveTo(-s,a-s),n.lineTo(s,a+s)),"backward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSBackwardDiagonal"!==t&&"esriSFSDiagonalCross"!==t||(n.moveTo(a+s,-s),n.lineTo(-s,a+s),n.moveTo(s,-s),n.lineTo(-s,s),n.moveTo(a+s,a-s),n.lineTo(a-s,a+s)),n.stroke();const l=n.getImageData(0,0,e.width,e.height),c=new Uint8Array(l.data);let m;for(let i=0;i<c.length;i+=4)m=c[i+3]/255,c[i]=c[i]*m,c[i+1]=c[i+1]*m,c[i+2]=c[i+2]*m;return[c,e.width,e.height]}static rasterizeSimpleLine(e,t){return this.rasterizeDash(e,t)}static rasterizeDash(e,t){const o="Butt"===t,a="Square"===t,i=!o&&!a;e.length%2==1&&(e=[...e,...e]);const s=15.5,n=2*s;let l=0;for(const r of e)l+=r;const c=Math.round(l*s),m=new Float32Array(c*n),f=.5*s;let y=0,h=0,u=.5,p=!0;for(const r of e){for(y=h,h+=r*s;u<=h;){let e=.5;for(;e<n;){const t=(e-.5)*c+u-.5,r=i?(e-s)*(e-s):Math.abs(e-s);m[t]=p?o?Math.max(Math.max(y+f-u,r),Math.max(u-h+f,r)):r:i?Math.min((u-y)*(u-y)+r,(u-h)*(u-h)+r):a?Math.min(Math.max(u-y,r),Math.max(h-u,r)):Math.min(Math.max(u-y+f,r),Math.max(h+f-u,r)),e++}u++}p=!p}const S=m.length,M=new Uint8Array(4*S);for(let d=0;d<S;++d){const e=(i?Math.sqrt(m[d]):m[d])/s;r(e,M,4*d)}return[M,c,n]}}class R{static findApplicableOverrides(e,t,r){if(t){if(e.primitiveName){let o=!1;for(const t of r)if(t.primitiveName===e.primitiveName){o=!0;break}if(!o)for(const a of t)a.primitiveName===e.primitiveName&&r.push(a)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const o of e.effects)R.findApplicableOverrides(o,t,r);if(e.symbolLayers)for(const o of e.symbolLayers)R.findApplicableOverrides(o,t,r);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const o of e.effects)R.findApplicableOverrides(o,t,r);if(e.markerPlacement&&R.findApplicableOverrides(e.markerPlacement,t,r),"CIMVectorMarker"===e.type){if(e.markerGraphics)for(const o of e.markerGraphics)R.findApplicableOverrides(o,t,r),R.findApplicableOverrides(o.symbol,t,r)}else"CIMCharacterMarker"===e.type?R.findApplicableOverrides(e.symbol,t,r):"CIMHatchFill"===e.type&&R.findApplicableOverrides(e.lineSymbol,t,r)}}}static applyOverrides(e,t,r,o){if(!t)return;const a=e=>e?e.charAt(0).toLowerCase()+e.substr(1):e;if(e.primitiveName)for(const i of t)if(i.primitiveName===e.primitiveName){const t=a(i.propertyName);if(o&&o.push({cim:e,nocapPropertyName:t,value:e[t]}),i.expression&&(i.value=R.toValue(i.propertyName,i.expression)),r){let t=!1;for(const o of r)o.primitiveName===e.primitiveName&&(t=!0);t||r.push(i)}e[t]=i.value}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const a of e.effects)R.applyOverrides(a,t,r,o);if(e.symbolLayers)for(const a of e.symbolLayers)R.applyOverrides(a,t,r,o);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const a of e.effects)R.applyOverrides(a,t,r,o);if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const a of e.markerGraphics)R.applyOverrides(a,t,r,o),R.applyOverrides(a.symbol,t,r,o)}}static restoreOverrides(e){for(const t of e)t.cim[t.nocapPropertyName]=t.value}static buildOverrideKey(e){let t="";for(const r of e)void 0!==r.value&&(t+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return t}static toValue(t,r){if("DashTemplate"===t)return r.split(" ").map((e=>Number(e)));if("Color"===t){const t=new e(r).toRgba();return t[3]*=255,t}return r}}const V=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},B=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},X=e=>{if(!e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},Y=e=>{if(!e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},_=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},H=(e,t)=>{const r=U(t),o=q(e);return r&&o?`${r}-${o}`:`${r}${o}`},U=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},W=(e,t)=>{const r="butt"===t;switch(e){case"dash":case"esriSLSDash":return r?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return r?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return r?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return r?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return r?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return r?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return r?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return r?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return r?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return r?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return z.error("Unexpected: style does not require rasterization"),[0,0];default:return z.error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function $(e){return void 0!==e.symbolLayers}const J=e=>{const t=100,r=50;let o,a;const i=e;if("circle"===i||"esriSMSCircle"===i){const e=.25;let t=Math.acos(1-e/r),i=Math.ceil(x/t/4);0===i&&(i=1),t=w/i,i*=4;const s=[];s.push([r,0]);for(let o=1;o<i;o++)s.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);s.push([r,0]),o={rings:[s]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===i||"esriSMSCross"===i){const e=0;o={rings:[[[e,r],[e,e],[r,e],[r,-e],[e,-e],[e,-r],[-e,-r],[-e,-e],[-r,-e],[-r,e],[-e,e],[-e,r],[e,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===i||"esriSMSDiamond"===i)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===i||"esriSMSSquare"===i)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===i||"esriSMSX"===i){const e=0;o={rings:[[[0,e],[r-e,r],[r,r-e],[e,0],[r,e-r],[r-e,-r],[0,-e],[e-r,-r],[-r,e-r],[-e,0],[-r,r-e],[e-r,r],[0,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("triangle"===i||"esriSMSTriangle"===i){const e=t*.5773502691896257,r=-e,i=2/3*t,s=i-t;o={rings:[[[r,s],[0,i],[e,s],[r,s]]]},a={xmin:r,ymin:s,xmax:e,ymax:i}}else"arrow"===i&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},K=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;export{N as CIMSimbolInflatedSizeHelper,O as CIMSymbolHelper,R as OverrideHelper,j as SymbolHelper,W as slsDashToTemplateArray,D as symbolToCIM};
5
+ import e from"../../Color.js";import{bidiText as t}from"../../core/BidiText.js";import{packFloatRGBA as r}from"../../core/floatRGBA.js";import{clone as o}from"../../core/lang.js";import a from"../../core/Logger.js";import{nextPowerOfTwo as i}from"../../core/mathUtils.js";import{isSome as s}from"../../core/maybe.js";import{pt2px as n,px2pt as l}from"../../core/screenUtils.js";import{create as c,expandPointInPlace as m}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as f}from"../../geometry/support/boundsUtils.js";import{Placement as y}from"./CIMPlacements.js";import{lineGapType2LineHeight as h,horizontalAlignment2HAlign as u,verticalAlignment2VAlign as p,EnvDrawHelper as S,Transformation as M,CanvasDrawHelper as d}from"./CIMSymbolDrawHelper.js";import{getValue as b}from"./utils.js";import{C_INFINITY as g}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{GLYPH_SIZE as C,MAGIC_LABEL_LINE_HEIGHT as I}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as k}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";const x=Math.PI,w=x/2,P=4,L=10,v=96/72,F=Math.PI/180,z=a.getLogger("esri.symbols.cim.CIMSymbolHelper");function D(e){if(!e||!e.type)return null;let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":t=O.fromSimpleMarker(e);break;case"picture-marker":t=O.fromPictureMarker(e);break;case"simple-line":t=O.fromSimpleLineSymbol(e);break;case"simple-fill":t=O.fromSimpleFillSymbol(e);break;case"picture-fill":t=O.fromPictureFillSymbol(e);break;case"text":t=O.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function T(e,t){switch(t.type){case"CIMSymbolReference":return T(e,t.symbol);case"CIMPointSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMLineSymbol":{const r={paths:[[[0,0],[0,1]]]};e.drawSymbol(t,r);break}case"CIMPolygonSymbol":{const r={rings:[[[0,0],[0,1],[0,0]]]};e.drawSymbol(t,r);break}case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new y;e.drawMarker(t,r);break}}return e.envelope()}function G(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function A(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(b(e.offsetX)),Math.abs(b(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude)}}function E(e){if(!e)return 0;let t=0;for(const r of e)t+=A(r);return t}class N{getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static SafeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}_vectorMarkerBounds(e,t,r,o){let a=!0;const i=c();if(t&&t.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(f(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}_getInflateSize(e,t,r,o,a){if($(t)){const i=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),s=E(t.effects);return s>0&&(i[0]-=s,i[1]-=s,i[2]+=s,i[3]+=s),i}return this._getTextInflatedSize(e,t,a)}_getLayersInflateSize(e,t,r,o,a){let i=!0;if(!t)return e;for(const n of t){if(!n)continue;let t=[0,0,0,0];switch(n.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n;let r=e.width;"Square"===e.capStyle||"Miter"===e.joinStyle?r/=1.4142135623730951:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r;break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=n;if("CIMVectorMarker"===n.type){const e=n;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o;const a=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=a,t[1]*=a,t[2]*=a,t[3]*=a}}else if("CIMPictureMarker"===n.type){const o=n,a=r.getResource(o.url);let i=1;s(a)&&a.height&&(i=a.width/a.height);const l=e.size/2,c=e.size*i*o.scaleX/2;t=[-c,-l,c,l]}else{const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1])),t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o}let i=b(e.rotation);if(e.rotateClockwise&&(i=-i),o&&(i-=o),i){const e=F*i,r=Math.cos(e),o=Math.sin(e),a=c([g,g,-g,-g]);m(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),m(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),m(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),m(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let l=b(e.offsetX),f=b(e.offsetY);if(o){const e=F*o,t=Math.cos(e),r=Math.sin(e),a=l*r+f*t;l=l*t-f*r,f=a}t[0]+=l,t[1]+=f,t[2]+=l,t[3]+=f;const y=G(e.markerPlacement);y>0&&(t[0]-=y,t[1]-=y,t[2]+=y,t[3]+=y);break}}const l=E(n.effects);l>0&&(t[0]-=l,t[1]-=l,t[2]+=l,t[3]+=l),i?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],i=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}_getTextInflatedSize(e,r,o){var a,i;const s=null!=(a=r.height)?a:L;if(e[0]=-s/2,e[1]=-s/2,e[2]=s/2,e[3]=s/2,!o)return e;const n=o.get(r);if(!n)return e;const{text:l,mosaicItem:c}=n;if(!c||0===c.glyphMosaicItems.length)return e;const m=h(r.lineGapType,null!=(i=r.lineGap)?i:0,s),f=t(l)[1],y=c.glyphMosaicItems,S=k(y,f,{scale:s/C,angle:b(r.angle),xOffset:b(r.offsetX),yOffset:b(r.offsetY),hAlign:u(r.horizontalAlignment),vAlign:p(r.verticalAlignment),maxLineWidth:512,lineHeight:I*Math.max(.25,Math.min(m||1,4)),decoration:r.font.decoration||"none",isCIM:!0}).boundsT;return e[0]=S.x-S.halfWidth,e[1]=-S.y-S.halfHeight,e[2]=S.x+S.halfWidth,e[3]=-S.y+S.halfHeight,e}}class O{static getEnvelope(e,t){const r=new S(t);if(Array.isArray(e)){let t;for(const o of e)t?t.union(T(r,o)):t=T(r,o);return t}return T(r,e)}static getTextureAnchor(e,t){const r=this.getEnvelope(e,t);if(!r)return[0,0,0];const o=(r.x+.5*r.width)*v,a=-(r.y+.5*r.height)*v,i=r.width*v+2,s=r.height*v+2;return[o/i,a/s,s]}static rasterize(e,t,r,o,a=!0){const i=r||this.getEnvelope(t,o);if(!i)return[null,0,0,0,0];const s=(i.x+.5*i.width)*v,n=(i.y+.5*i.height)*v;e.width=i.width*v,e.height=i.height*v,r||(e.width+=2,e.height+=2);const l=e.getContext("2d"),c=M.createScale(v,-v);c.translate(.5*e.width-s,.5*e.height+n);const m=new d(l,o,c);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};m.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new y;m.drawMarker(t,e);break}}const f=l.getImageData(0,0,e.width,e.height),h=new Uint8Array(f.data);if(a){let e;for(let t=0;t<h.length;t+=4)e=h[t+3]/255,h[t]=h[t]*e,h[t+1]=h[t+1]*e,h[t+2]=h[t+2]*e}return[h,e.width,e.height,-s/e.width,-n/e.height]}static fromTextSymbol(e){const{angle:r,color:o,font:a,haloColor:i,haloSize:s,horizontalAlignment:n,kerning:l,text:c,verticalAlignment:m,xoffset:f,yoffset:y}=e;let h,u,p,S,M;a&&(h=a.family,u=a.style,p=a.weight,S=a.size,M=a.decoration);let d=!1;if(c){d=t(c)[1]}return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:h||"Arial",fontStyleName:H(u,p),fontType:0,haloSize:s,height:S,hinting:1,horizontalAlignment:X(null!=n?n:"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:b(f),offsetY:b(y),strikethrough:"line-through"===M,underline:"underline"===M,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_(i)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:d?1:0,verticalAlignment:Y(null!=m?m:"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2},textString:c}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:i,yoffset:s,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const{cap:e,join:t,miterLimit:o,width:a}=r;l.push({type:"CIMSolidStroke",color:_(r.color),capStyle:V(e),joinStyle:B(t),miterLimit:o,width:a})}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle:0,y=o*(i||1),h=t*(n||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(s),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:t,style:r,outline:a}=e,s=[],n={type:"CIMPolygonSymbol",symbolLayers:s};let l=null;if(a){const{cap:e,join:t,style:r}=a;"solid"!==r&&"none"!==r&&"esriSLSSolid"!==r&&"esriSLSNull"!==r&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:W(r,e),lineDashEnding:"NoConstraint",scaleDash:!0}]),s.push({type:"CIMSolidStroke",color:_(a.color),capStyle:V(e),joinStyle:B(t),miterLimit:a.miterLimit,width:a.width,effects:l})}if(r&&"solid"!==r&&"none"!==r&&"esriSFSSolid"!==r&&"esriSFSNull"!==r){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:_(t),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let a=0;const n=i(Math.ceil(window.devicePixelRatio)),l=K(r)?8*n:10*n;switch(r){case"vertical":case"esriSFSVertical":a=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":a=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":a=45;break;case"cross":case"esriSFSCross":a=0}s.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:a,separation:l}),"cross"===r||"esriSFSCross"===r?s.push({type:"CIMHatchFill",lineSymbol:o(e),offsetX:0,offsetY:0,rotation:90,separation:l}):"diagonal-cross"!==r&&"esriSFSDiagonalCross"!==r||s.push({type:"CIMHatchFill",lineSymbol:o(e),offsetX:0,offsetY:0,rotation:45,separation:l})}else!r||"solid"!==r&&"esriSFSSolid"!==r||s.push({type:"CIMSolidFill",enable:!0,color:_(t)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:i,style:s,width:n}=e;let l=null;"solid"!==s&&"none"!==s&&"esriSLSSolid"!==s&&"esriSLSNull"!==s&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:W(s,t),lineDashEnding:"NoConstraint",scaleDash:!0}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=O.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return"none"!==s&&"esriSLSNull"!==s&&c.push({type:"CIMSolidStroke",color:_(r),capStyle:V(t),joinStyle:B(o),miterLimit:i,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:i}=e;let s=e.url;return"esriPMS"===e.type&&e.imageData&&(s=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,size:r,width:o,offsetX:b(a),offsetY:b(i),rotation:b(-t)}]}}static fromSimpleMarker(e,t,r){var o;const{style:a}=e,i=null!=(o=e.color)?o:r;if("path"===a){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:n(Math.round(l(r.width))),color:_(r.color)})}t.push({type:"CIMSolidFill",enable:!0,color:_(i),path:e.path});const[r,o]=J("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const[s,c]=J(a);let m;if(c&&s){const r=[];if("outline"in e&&e.outline){const t=e.outline;r.push({type:"CIMSolidStroke",enable:!0,width:n(Math.round(l(t.width))),color:_(t.color)})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style||r.push({type:"CIMSolidStroke",enable:!0,width:t,color:_(i)});r.push({type:"CIMSolidFill",enable:!0,color:_(i)});const o={type:"CIMPolygonSymbol",symbolLayers:r};m={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(e.size||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),frame:s,markerGraphics:[{type:"CIMMarkerGraphic",geometry:c,symbol:o}]}]}}return m}static fromCIMHatchFill(e){var t;const r=null!=(t=e.separation)?t:P,o=r/2,a=4;let i=this._getLineSymbolPeriod(e.lineSymbol)||a;for(;i<a;)i*=2;const s=i/2;return{type:"CIMVectorMarker",frame:{xmin:-s,xmax:s,ymin:-o,ymax:o},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-s,0],[s,0]]]},symbol:e.lineSymbol}],size:r}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers){const e=this._getEffectsRepeat(r.effects);if(e)return e;if(r){const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:z.error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={type:e.type,...e};let o,a,i,s;if(r.markerPlacement=null,r.anchorPoint=null,!0===t.shiftOddRows){a=t.stepX/2,i=t.stepY,s=2*t.stepY;o=[{x:-a,y:0},{x:a,y:0},{x:0,y:i},{x:0,y:-i}].map((e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})))}else a=t.stepX/2,i=t.stepY/2,s=t.stepY,o=[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMPointSymbol",symbolLayers:[r]}}];return{type:"CIMVectorMarker",frame:{xmin:-a,xmax:a,ymin:-i,ymax:i},markerGraphics:o,size:s}}static getFillColor(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getFillColor(t);if(null!=e)return e}break;case"CIMTextSymbol":return O.getFillColor(e.symbol);case"CIMSolidFill":return e.color}}static getStrokeColor(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getStrokeColor(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return O.getStrokeColor(e.symbol);case"CIMSolidStroke":return e.color}}static getStrokeWidth(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=O.getStrokeWidth(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return O.getStrokeWidth(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}static getSize(e){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=0;if(e.symbolLayers)for(const r of e.symbolLayers){const e=O.getSize(r);e>t&&(t=e)}return t}case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":return e.width;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":return e.size}}static getMarkerScaleRatio(e){if(e&&"CIMVectorMarker"===e.type)if(!1!==e.scaleSymbolsProportionally&&e.frame){const t=e.frame.ymax-e.frame.ymin;return e.size/t}return 1}}class j{static rasterizeSimpleFill(e,t,r){"solid"!==t&&"none"!==t&&"esriSFSSolid"!==t&&"esriSFSNull"!==t||console.error("Unexpected: style does not require rasterization");const o=i(Math.ceil(r)),a=K(t)?8*o:16*o,s=2*o;e.width=a,e.height=a;const n=e.getContext("2d");n.strokeStyle="#FFFFFF",n.lineWidth=o,n.beginPath(),"vertical"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSVertical"!==t||(n.moveTo(a/2,-s),n.lineTo(a/2,a+s)),"horizontal"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSHorizontal"!==t||(n.moveTo(-s,a/2),n.lineTo(a+s,a/2)),"forward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSDiagonalCross"!==t&&"esriSFSForwardDiagonal"!==t||(n.moveTo(-s,-s),n.lineTo(a+s,a+s),n.moveTo(a-s,-s),n.lineTo(a+s,s),n.moveTo(-s,a-s),n.lineTo(s,a+s)),"backward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSBackwardDiagonal"!==t&&"esriSFSDiagonalCross"!==t||(n.moveTo(a+s,-s),n.lineTo(-s,a+s),n.moveTo(s,-s),n.lineTo(-s,s),n.moveTo(a+s,a-s),n.lineTo(a-s,a+s)),n.stroke();const l=n.getImageData(0,0,e.width,e.height),c=new Uint8Array(l.data);let m;for(let i=0;i<c.length;i+=4)m=c[i+3]/255,c[i]=c[i]*m,c[i+1]=c[i+1]*m,c[i+2]=c[i+2]*m;return[c,e.width,e.height]}static rasterizeSimpleLine(e,t){return this.rasterizeDash(e,t)}static rasterizeDash(e,t){const o="Butt"===t,a="Square"===t,i=!o&&!a;e.length%2==1&&(e=[...e,...e]);const s=15.5,n=2*s;let l=0;for(const r of e)l+=r;const c=Math.round(l*s),m=new Float32Array(c*n),f=.5*s;let y=0,h=0,u=.5,p=!0;for(const r of e){for(y=h,h+=r*s;u<=h;){let e=.5;for(;e<n;){const t=(e-.5)*c+u-.5,r=i?(e-s)*(e-s):Math.abs(e-s);m[t]=p?o?Math.max(Math.max(y+f-u,r),Math.max(u-h+f,r)):r:i?Math.min((u-y)*(u-y)+r,(u-h)*(u-h)+r):a?Math.min(Math.max(u-y,r),Math.max(h-u,r)):Math.min(Math.max(u-y+f,r),Math.max(h+f-u,r)),e++}u++}p=!p}const S=m.length,M=new Uint8Array(4*S);for(let d=0;d<S;++d){const e=(i?Math.sqrt(m[d]):m[d])/s;r(e,M,4*d)}return[M,c,n]}}class R{static findApplicableOverrides(e,t,r){if(t){if(e.primitiveName){let o=!1;for(const t of r)if(t.primitiveName===e.primitiveName){o=!0;break}if(!o)for(const a of t)a.primitiveName===e.primitiveName&&r.push(a)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const o of e.effects)R.findApplicableOverrides(o,t,r);if(e.symbolLayers)for(const o of e.symbolLayers)R.findApplicableOverrides(o,t,r);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const o of e.effects)R.findApplicableOverrides(o,t,r);if(e.markerPlacement&&R.findApplicableOverrides(e.markerPlacement,t,r),"CIMVectorMarker"===e.type){if(e.markerGraphics)for(const o of e.markerGraphics)R.findApplicableOverrides(o,t,r),R.findApplicableOverrides(o.symbol,t,r)}else"CIMCharacterMarker"===e.type?R.findApplicableOverrides(e.symbol,t,r):"CIMHatchFill"===e.type&&R.findApplicableOverrides(e.lineSymbol,t,r)}}}static applyOverrides(e,t,r,o){if(!t)return;const a=e=>e?e.charAt(0).toLowerCase()+e.substr(1):e;if(e.primitiveName)for(const i of t)if(i.primitiveName===e.primitiveName){const t=a(i.propertyName);if(o&&o.push({cim:e,nocapPropertyName:t,value:e[t]}),i.expression&&(i.value=R.toValue(i.propertyName,i.expression)),r){let t=!1;for(const o of r)o.primitiveName===e.primitiveName&&(t=!0);t||r.push(i)}e[t]=i.value}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const a of e.effects)R.applyOverrides(a,t,r,o);if(e.symbolLayers)for(const a of e.symbolLayers)R.applyOverrides(a,t,r,o);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const a of e.effects)R.applyOverrides(a,t,r,o);if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const a of e.markerGraphics)R.applyOverrides(a,t,r,o),R.applyOverrides(a.symbol,t,r,o)}}static restoreOverrides(e){for(const t of e)t.cim[t.nocapPropertyName]=t.value}static buildOverrideKey(e){let t="";for(const r of e)void 0!==r.value&&(t+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return t}static toValue(t,r){if("DashTemplate"===t)return r.split(" ").map((e=>Number(e)));if("Color"===t){const t=new e(r).toRgba();return t[3]*=255,t}return r}}const V=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},B=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},X=e=>{if(!e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},Y=e=>{if(!e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},_=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},H=(e,t)=>{const r=U(t),o=q(e);return r&&o?`${r}-${o}`:`${r}${o}`},U=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},W=(e,t)=>{const r="butt"===t;switch(e){case"dash":case"esriSLSDash":return r?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return r?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return r?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return r?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return r?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return r?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return r?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return r?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return r?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return r?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return z.error("Unexpected: style does not require rasterization"),[0,0];default:return z.error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function $(e){return void 0!==e.symbolLayers}const J=e=>{const t=100,r=50;let o,a;const i=e;if("circle"===i||"esriSMSCircle"===i){const e=.25;let t=Math.acos(1-e/r),i=Math.ceil(x/t/4);0===i&&(i=1),t=w/i,i*=4;const s=[];s.push([r,0]);for(let o=1;o<i;o++)s.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);s.push([r,0]),o={rings:[s]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===i||"esriSMSCross"===i){const e=0;o={rings:[[[e,r],[e,e],[r,e],[r,-e],[e,-e],[e,-r],[-e,-r],[-e,-e],[-r,-e],[-r,e],[-e,e],[-e,r],[e,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===i||"esriSMSDiamond"===i)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===i||"esriSMSSquare"===i)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===i||"esriSMSX"===i){const e=0;o={rings:[[[0,e],[r-e,r],[r,r-e],[e,0],[r,e-r],[r-e,-r],[0,-e],[e-r,-r],[-r,e-r],[-e,0],[-r,r-e],[e-r,r],[0,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("triangle"===i||"esriSMSTriangle"===i){const e=t*.5773502691896257,r=-e,i=2/3*t,s=i-t;o={rings:[[[r,s],[0,i],[e,s],[r,s]]]},a={xmin:r,ymin:s,xmax:e,ymax:i}}else"arrow"===i&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},K=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;export{N as CIMSimbolInflatedSizeHelper,O as CIMSymbolHelper,R as OverrideHelper,j as SymbolHelper,W as slsDashToTemplateArray,D as symbolToCIM};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import t from"../../core/Logger.js";import{isSome as i}from"../../core/maybe.js";import{pt2px as o}from"../../core/screenUtils.js";import{numericHash as r}from"../../core/string.js";import{createRendererExpression as n,ArcadeExpression as a}from"../../support/arcadeOnDemand.js";import{CIMSymbolHelper as l,OverrideHelper as s}from"./CIMSymbolHelper.js";import{getExtent as c,getSDFMetrics as f}from"./SDFHelper.js";import{fromCIMColor as m,getValue as p,toKebabCase as u,_adjustTextCase as h,evaluateValueOrFunction as y}from"./utils.js";import{CIMEffectHelper as g}from"./effects/CIMEffectHelper.js";import d from"../../views/2d/arcade/callExpressionWithFeature.js";const S=t.getLogger("esri.symbols.cim.cimAnalyzer");function v(e){switch(e){case"Butt":return 0;case"Square":return 2;default:return 1}}function N(e){switch(e){case"Bevel":return 0;case"Miter":return 2;default:return 1}}function b(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function k(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function C(e){let t="",i="";if(e){const o=e.toLowerCase();-1!==o.indexOf("italic")?t="italic":-1!==o.indexOf("oblique")&&(t="oblique"),-1!==o.indexOf("bold")?i="bold":-1!==o.indexOf("light")&&(i="lighter")}return{style:t,weight:i}}function O(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function P(e,t,i,o){let r;e[t]?r=e[t]:(r={},e[t]=r),r[i]=o}function M(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}async function I(e,t,i,o,r){const a=null!=o?o:[];if(!e)return a;let l,s;const c={};if("CIMSymbolReference"!==e.type)return S.error("Expect cim type to be 'CIMSymbolReference'"),a;if(l=e.symbol,s=e.primitiveOverrides,s){const e=[];for(const i of s){const o=i.valueExpressionInfo;if(o&&t){const r=o.expression,a=n(r,t.spatialReference,t.fields).then((e=>{e&&P(c,i.primitiveName,i.propertyName,e)}));e.push(a)}else null!=i.value&&P(c,i.primitiveName,i.propertyName,i.value)}e.length>0&&await Promise.all(e)}const f=[];switch(K(l,i,f),f.length>0&&await Promise.all(f),l.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":L(l,s,c,t,a,i,r)}return a}function L(e,t,i,o,r,n,a){if(!e)return;const c=e.symbolLayers;if(!c)return;const f=e.effects;let m;const p=l.getSize(e);"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(m=1);let u=c.length;for(;u--;){const l=c[u];if(!l||!1===l.enable)continue;let h;f&&f.length&&(h=[...f]);const y=l.effects;y&&y.length&&(f?h.push(...y):h=[...y]);const g=[];switch(s.findApplicableOverrides(l,t,g),l.type){case"CIMSolidFill":w(l,h,i,g,o,r);break;case"CIMPictureFill":X(l,h,i,g,o,n,r);break;case"CIMHatchFill":z(l,h,i,g,o,r);break;case"CIMGradientFill":x(l,h,i,g,o,r);break;case"CIMSolidStroke":J(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMPictureStroke":H(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMGradientStroke":Y(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMCharacterMarker":if(R(l,h,i,g,o,r))break;break;case"CIMPictureMarker":if(R(l,h,i,g,o,r))break;"CIMLineSymbol"===e.type&&(m=M(l)),A(l,h,i,g,o,n,r,m,p);break;case"CIMVectorMarker":if(R(l,h,i,g,o,r))break;"CIMLineSymbol"===e.type&&(m=M(l)),$(l,h,i,g,o,r,n,m,p,a);break;default:S.error("Cannot analyze CIM layer",l.type)}}}function w(e,t,i,o,n,a){const l=e.primitiveName,s=m(e.color),[c,f]=V(o,l),p=r(JSON.stringify(e)+f).toString();a.push({type:"fill",templateHash:p,materialHash:c?()=>p:p,cim:e,materialOverrides:null,colorLocked:e.colorLocked,color:U(l,i,"Color",n,s,G),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t})}function X(e,t,o,n,a,l,s){const c=e.primitiveName,f=e.tintColor?m(e.tintColor):{r:255,g:255,b:255,a:1},[u,h]=V(n,c),y=r(JSON.stringify(e)+h).toString(),g=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString();let d=p(e.scaleX);if("width"in e){const t=e.width;let o=1;const r=l.getResource(e.url);i(r)&&(o=r.width/r.height),d/=o*(e.height/t)}s.push({type:"fill",templateHash:y,materialHash:u?()=>g:g,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,color:U(c,o,"TintColor",a,f,G),height:U(c,o,"Height",a,e.height),scaleX:U(c,o,"ScaleX",a,d),angle:U(c,o,"Rotation",a,p(e.rotation)),offsetX:U(c,o,"OffsetX",a,p(e.offsetX)),offsetY:U(c,o,"OffsetY",a,p(e.offsetY)),url:e.url})}function z(e,t,i,o,n,a){const l=["Rotation","OffsetX","OffsetY"],s=o.filter((t=>t.primitiveName!==e.primitiveName&&-1===l.indexOf(t.propertyName))),c=e.primitiveName,[f,m]=V(o,c),u=r(JSON.stringify(e)+m).toString(),h=r(`${e.separation}${JSON.stringify(e.lineSymbol)}`).toString();a.push({type:"fill",templateHash:u,materialHash:f?B(h,i,s,n):h,cim:e,materialOverrides:s,colorLocked:e.colorLocked,effects:t,color:{r:255,g:255,b:255,a:1},height:U(c,i,"Separation",n,e.separation),scaleX:1,angle:U(c,i,"Rotation",n,p(e.rotation)),offsetX:U(c,i,"OffsetX",n,p(e.offsetX)),offsetY:U(c,i,"OffsetY",n,p(e.offsetY))})}function x(e,t,i,o,n,a){const l=e.primitiveName,[s,c]=V(o,l),f=r(JSON.stringify(e)+c).toString();a.push({type:"fill",templateHash:f,materialHash:s?B(f,i,o,n):f,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1})}function J(e,t,i,o,n,a,l,s){const c=e.primitiveName,f=m(e.color),p=void 0!==e.width?e.width:4,u=v(e.capStyle),h=N(e.joinStyle),y=e.miterLimit,[g,d]=V(o,c),S=r(JSON.stringify(e)+d).toString();let b,k;if(t&&t.length>0){const i=t[t.length-1];if("CIMGeometricEffectDashes"===i.type&&"NoConstraint"===i.lineDashEnding){const i=(t=[...e.effects]).pop();b=i.dashTemplate,k=i.scaleDash}}a.push({type:"line",templateHash:S,materialHash:g?()=>S:S,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:U(c,i,"Color",n,f,G),width:U(c,i,"Width",n,p),cap:U(c,i,"CapStyle",n,u),join:U(c,i,"JoinStyle",n,h),miterLimit:U(c,i,"MiterLimit",n,y),referenceWidth:s,zOrder:E(e.name),dashTemplate:b,scaleDash:k})}function H(e,t,i,o,n,a,l,s){const c=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),f=e.primitiveName,p=m(e.tintColor),u=void 0!==e.width?e.width:4,h=v(e.capStyle),y=N(e.joinStyle),g=e.miterLimit,[d,S]=V(o,f),b=r(JSON.stringify(e)+S).toString();a.push({type:"line",templateHash:b,materialHash:d?()=>c:c,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:U(f,i,"TintColor",n,p,G),width:U(f,i,"Width",n,u),cap:U(f,i,"CapStyle",n,h),join:U(f,i,"JoinStyle",n,y),miterLimit:U(f,i,"MiterLimit",n,g),referenceWidth:s,zOrder:E(e.name),dashTemplate:null,scaleDash:!1,url:e.url})}function Y(e,t,i,o,n,a,l,s){const c=e.primitiveName,f=void 0!==e.width?e.width:4,m=v(e.capStyle),p=N(e.joinStyle),u=e.miterLimit,[h,y]=V(o,c),g=r(JSON.stringify(e)+y).toString();a.push({type:"line",templateHash:g,materialHash:h?B(g,i,o,n):g,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:U(c,i,"Width",n,f),cap:U(c,i,"CapStyle",n,m),join:U(c,i,"JoinStyle",n,p),miterLimit:U(c,i,"MiterLimit",n,u),referenceWidth:s,zOrder:E(e.name),dashTemplate:null,scaleDash:!1})}function R(e,t,i,o,n,a){const l=e.markerPlacement;if(!l||"CIMMarkerPlacementInsidePolygon"!==l.type)return!1;const s=l,c=["Rotation","OffsetX","OffsetY"],f=o.filter((t=>t.primitiveName!==e.primitiveName&&-1===c.indexOf(t.propertyName))),m="url"in e?e.url:null,[u,h]=V(o,s.primitiveName),y=r(JSON.stringify(e)+h).toString();let g=s.stepY,d=null,S=1;return l.shiftOddRows&&(g*=2,d=function(e){return e?2*e:0},S=.5),a.push({type:"fill",templateHash:y,materialHash:u?B(y,i,f,n):y,cim:e,materialOverrides:f,colorLocked:e.colorLocked,effects:t,color:{r:255,g:255,b:255,a:1},height:U(s.primitiveName,i,"StepY",n,g,d),scaleX:S,angle:U(s.primitiveName,i,"GridAngle",n,s.gridAngle),offsetX:U(s.primitiveName,i,"OffsetX",n,p(s.offsetX)),offsetY:U(s.primitiveName,i,"OffsetY",n,p(s.offsetY)),url:m}),!0}function A(e,t,o,n,a,l,s,c,f){var u;const h=e.primitiveName,y=p(e.size);let g=p(e.scaleX);const d=p(e.rotation),S=p(e.offsetX),v=p(e.offsetY),N=e.tintColor?m(e.tintColor):{r:255,g:255,b:255,a:1},b=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),[k,C]=V(n,h),O=r(JSON.stringify(e)+C).toString(),P=null!=(u=e.anchorPoint)?u:{x:0,y:0};if("width"in e){const t=e.width;let o=1;const r=l.getResource(e.url);i(r)&&(o=r.width/r.height),g/=o*(y/t)}s.push({type:"marker",templateHash:O,materialHash:k?()=>b:b,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:!1,alignment:c,size:U(h,o,"Size",a,y),scaleX:U(h,o,"ScaleX",a,g),rotation:U(h,o,"Rotation",a,d),offsetX:U(h,o,"OffsetX",a,S),offsetY:U(h,o,"OffsetY",a,v),color:U(h,o,"TintColor",a,N,G),anchorPoint:{x:P.x,y:-P.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:e.rotateClockwise,referenceSize:f,sizeRatio:1,markerPlacement:e.markerPlacement,url:e.url})}function $(e,t,i,o,r,n,a,l,s,c){const f=e.markerGraphics;if(!f)return;let m=0;if(e.scaleSymbolsProportionally){const t=e.frame;t&&(m=t.ymax-t.ymin)}for(const p of f)if(p){const f=p.symbol;if(!f)continue;switch(f.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":j(e,t,p,o,i,r,n,a,l,s,m,c);break;case"CIMTextSymbol":F(e,t,p,i,o,r,n,l,s,m)}}}function F(e,t,i,o,n,a,c,f,g,d){const S=[];s.findApplicableOverrides(i,n,S);const v=i.geometry;if(!("x"in v)||!("y"in v))return;const N=i.symbol,P=O(N),M=C(N.fontStyleName),I=u(N.fontFamilyName);N.font={family:I,decoration:P,...M};const L=e.frame,w=v.x-.5*(L.xmin+L.xmax),X=v.y-.5*(L.ymin+L.ymax),z=e.size/d,x=e.primitiveName,J=p(N.height)*z,H=p(N.angle),Y=(p(N.offsetX)+w)*z,R=(p(N.offsetY)+X)*z,A=m(l.getFillColor(N));let $=m(l.getStrokeColor(N)),F=l.getStrokeWidth(N);F||($=m(l.getFillColor(N.haloSymbol)),F=N.haloSize*z);const[j,W]=V(n,x),T=JSON.stringify(e.effects)+Number(e.colorLocked)+JSON.stringify(e.anchorPoint)+e.anchorPointUnits+JSON.stringify(e.markerPlacement),D=r(JSON.stringify(i)+T+W).toString(),E=r(JSON.stringify(N.font)).toString(),G=U(i.primitiveName,o,"TextString",a,i.textString,h,N.textCase),{fontStyleName:B}=N,q=I+(B?"-"+B.toLowerCase():"-regular");c.push({type:"text",templateHash:D,materialHash:j||"function"==typeof G||G.match(/\[([\w]+)\]/)?(e,t,i)=>E+"-"+y(G,e,t,i):E+"-"+r(G),cim:N,materialOverrides:null,colorLocked:e.colorLocked,effects:t,alignment:f,anchorPoint:{x:e.anchorPoint?e.anchorPoint.x:0,y:e.anchorPoint?e.anchorPoint.y:0},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,fontName:q,decoration:P,weight:U(x,o,"Weight",a,M.weight),style:U(x,o,"Size",a,M.style),size:U(x,o,"Size",a,J),angle:U(x,o,"Rotation",a,H),offsetX:U(x,o,"OffsetX",a,Y),offsetY:U(x,o,"OffsetY",a,R),horizontalAlignment:b(N.horizontalAlignment),verticalAlignment:k(N.verticalAlignment),text:G,color:A,outlineColor:$,outlineSize:F,referenceSize:g,sizeRatio:1,markerPlacement:e.markerPlacement})}function j(e,t,i,o,n,a,s,u,h,y,d,S){const v=i.symbol,N=v.symbolLayers;if(!N)return;if(S)return void T(e,t,i,n,o,a,s,u,h,y,d);let b=N.length;if(_(N))return void W(e,i,N,o,n,a,s,h,y,d);const k=g.applyEffects(v.effects,i.geometry);if(k)for(;b--;){const S=N[b];if(S&&!1!==S.enable)switch(S.type){case"CIMSolidFill":case"CIMSolidStroke":{var C;const u=g.applyEffects(S.effects,k),v=c(u);if(!v)continue;const[N,b,O]=f(v,e.frame,e.size,e.anchorPoint,"Relative"!==e.anchorPointUnits),P="CIMSolidFill"===S.type,M={type:"sdf",geom:u,asFill:P},I=e.primitiveName,L=null!=(C=p(e.size))?C:10,w=p(e.rotation),X=p(e.offsetX),z=p(e.offsetY),x=S.path,J=S.primitiveName,H=m(P?l.getFillColor(S):l.getStrokeColor(S)),Y=P?{r:0,g:0,b:0,a:0}:m(l.getStrokeColor(S)),R=l.getStrokeWidth(S);if(!P&&!R)break;let A=!1,$="";for(const e of o)e.primitiveName!==J&&e.primitiveName!==I||(void 0!==e.value?$+=`-${e.primitiveName}-${e.propertyName}-${JSON.stringify(e.value)}`:e.valueExpressionInfo&&(A=!0));const F=JSON.stringify({...e,markerGraphics:null}),j=r(JSON.stringify(M)+x).toString(),W={type:"marker",templateHash:r(JSON.stringify(i)+JSON.stringify(S)+F+$).toString(),materialHash:A?()=>j:j,cim:M,materialOverrides:null,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:h,anchorPoint:{x:b,y:O},isAbsoluteAnchorPoint:!1,size:U(e.primitiveName,n,"Size",a,L),rotation:U(e.primitiveName,n,"Rotation",a,w),offsetX:U(e.primitiveName,n,"OffsetX",a,X),offsetY:U(e.primitiveName,n,"OffsetY",a,z),scaleX:1,frameHeight:d,rotateClockwise:e.rotateClockwise,referenceSize:y,sizeRatio:N,color:U(J,n,"Color",a,H,G),outlineColor:U(J,n,"Color",a,Y,G),outlineWidth:U(J,n,"Width",a,R),markerPlacement:e.markerPlacement,path:x};s.push(W);break}default:T(e,t,i,n,o,a,s,u,h,y,d)}}}function W(e,t,i,o,n,a,s,u,h,y){const g=t.geometry,d=i[0],S=i[1],v=c(g);if(!v)return;const[N,b,k]=f(v,e.frame,e.size,e.anchorPoint,"Relative"!==e.anchorPointUnits),C={type:"sdf",geom:g,asFill:!0},O=e.primitiveName,P=p(e.size),M=p(e.rotation),I=p(e.offsetX),L=p(e.offsetY),w=S.path,X=S.primitiveName,z=d.primitiveName,x=m(l.getFillColor(S)),J=m(l.getStrokeColor(d)),H=l.getStrokeWidth(d);let Y=!1,R="";for(const r of o)r.primitiveName!==X&&r.primitiveName!==z&&r.primitiveName!==O||(void 0!==r.value?R+=`-${r.primitiveName}-${r.propertyName}-${JSON.stringify(r.value)}`:r.valueExpressionInfo&&(Y=!0));const A=JSON.stringify({...e,markerGraphics:null}),$=r(JSON.stringify(C)+w).toString(),F={type:"marker",templateHash:r(JSON.stringify(t)+JSON.stringify(S)+JSON.stringify(d)+A+R).toString(),materialHash:Y?()=>$:$,cim:C,materialOverrides:null,colorLocked:e.colorLocked,effects:e.effects,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:b,y:k},isAbsoluteAnchorPoint:!1,size:U(e.primitiveName,n,"Size",a,P),rotation:U(e.primitiveName,n,"Rotation",a,M),offsetX:U(e.primitiveName,n,"OffsetX",a,I),offsetY:U(e.primitiveName,n,"OffsetY",a,L),scaleX:1,frameHeight:y,rotateClockwise:e.rotateClockwise,referenceSize:h,sizeRatio:N,color:U(X,n,"Color",a,x,G),outlineColor:U(z,n,"Color",a,J,G),outlineWidth:U(z,n,"Width",a,H),markerPlacement:e.markerPlacement,path:w};s.push(F)}function T(e,t,i,n,a,s,c,f,m,u,h){const y=D(e,i);let g=[];const d=["Rotation","OffsetX","OffsetY"];g=a.filter((t=>t.primitiveName!==e.primitiveName||-1===d.indexOf(t.propertyName)));let S="";for(const o of a)void 0!==o.value&&(S+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`);const[v,N,b]=l.getTextureAnchor(y,f),k=e.primitiveName,C=p(e.rotation),O=p(e.offsetX),P=p(e.offsetY),M=r(JSON.stringify(y)+S).toString(),I={type:"marker",templateHash:M,materialHash:0===g.length?M:B(M,n,g,s),cim:y,materialOverrides:g,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:m,anchorPoint:{x:v,y:N},isAbsoluteAnchorPoint:!1,size:e.size,rotation:U(k,n,"Rotation",s,C),offsetX:U(k,n,"OffsetX",s,O),offsetY:U(k,n,"OffsetY",s,P),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:h,rotateClockwise:e.rotateClockwise,referenceSize:u,sizeRatio:b/o(e.size),markerPlacement:e.markerPlacement};c.push(I)}function D(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function E(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.substr(6),10);if(NaN!==t)return t}return 0}function G(t){if(!t||0===t.length)return null;const i=new e(t).toRgba();return{r:i[0],g:i[1],b:i[2],a:i[3]}}function U(e,t,i,o,r,n,l){const s=t[e];if(s){const e=s[i];if("string"==typeof e||"number"==typeof e||e instanceof Array)return n?n.call(null,e,l):e;if(null!=e&&e instanceof a)return(t,i,a)=>{let s=d(e,t,{$view:a},o.geometryType,i);return null!==s&&n&&(s=n.call(null,s,l)),null!==s?s:r}}return r}function B(e,t,i,o){for(const r of i){if(r.valueExpressionInfo){const e=t[r.primitiveName]&&t[r.primitiveName][r.propertyName];e instanceof a&&(r.fn=(t,i,r)=>d(e,t,{$view:r},o.geometryType,i))}}return(t,o,n)=>{for(const e of i)e.fn&&(e.value=e.fn(t,o,n));return r(e+s.buildOverrideKey(i)).toString()}}function q(e,t){if(!t||0===t.length)return e;const i=JSON.parse(JSON.stringify(e));return s.applyOverrides(i,t),i}function V(e,t){let i=!1,o="";for(const r of e)r.primitiveName===t&&(void 0!==r.value?o+=`-${r.primitiveName}-${r.propertyName}-${JSON.stringify(r.value)}`:r.valueExpressionInfo&&(i=!0));return[i,o]}function K(e,t,i){if(e&&t)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const o=e.symbolLayers;if(!o)return;for(const e of o)switch(e.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in e&&e.url&&i.push(t.fetchResource(e.url,null));break;case"CIMVectorMarker":{const o=e.markerGraphics;if(!o)continue;for(const e of o)if(e){const o=e.symbol;o&&K(o,t,i)}}}}}}const _=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&!e[0].effects&&!e[1].effects;export{q as analyzeCIMResource,I as analyzeCIMSymbol};
5
+ import e from"../../Color.js";import t from"../../core/Logger.js";import{isSome as i}from"../../core/maybe.js";import{pt2px as o}from"../../core/screenUtils.js";import{numericHash as r}from"../../core/string.js";import{createRendererExpression as n,ArcadeExpression as a}from"../../support/arcadeOnDemand.js";import{CIMSymbolHelper as l,OverrideHelper as s}from"./CIMSymbolHelper.js";import{getExtent as c,getSDFMetrics as f}from"./SDFHelper.js";import{fromCIMColor as m,getValue as p,toKebabCase as u,_adjustTextCase as h,evaluateValueOrFunction as y}from"./utils.js";import{CIMEffectHelper as g}from"./effects/CIMEffectHelper.js";import d from"../../views/2d/arcade/callExpressionWithFeature.js";const S=t.getLogger("esri.symbols.cim.cimAnalyzer");function v(e){switch(e){case"Butt":return 0;case"Square":return 2;default:return 1}}function N(e){switch(e){case"Bevel":return 0;case"Miter":return 2;default:return 1}}function b(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function k(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function C(e){let t="",i="";if(e){const o=e.toLowerCase();-1!==o.indexOf("italic")?t="italic":-1!==o.indexOf("oblique")&&(t="oblique"),-1!==o.indexOf("bold")?i="bold":-1!==o.indexOf("light")&&(i="lighter")}return{style:t,weight:i}}function O(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function P(e,t,i,o){let r;e[t]?r=e[t]:(r={},e[t]=r),r[i]=o}function M(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}async function I(e,t,i,o,r){const a=null!=o?o:[];if(!e)return a;let l,s;const c={};if("CIMSymbolReference"!==e.type)return S.error("Expect cim type to be 'CIMSymbolReference'"),a;if(l=e.symbol,s=e.primitiveOverrides,s){const e=[];for(const i of s){const o=i.valueExpressionInfo;if(o&&t){const r=o.expression,a=n(r,t.spatialReference,t.fields).then((e=>{e&&P(c,i.primitiveName,i.propertyName,e)}));e.push(a)}else null!=i.value&&P(c,i.primitiveName,i.propertyName,i.value)}e.length>0&&await Promise.all(e)}const f=[];switch(K(l,i,f),f.length>0&&await Promise.all(f),l.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":L(l,s,c,t,a,i,r)}return a}function L(e,t,i,o,r,n,a){if(!e)return;const c=e.symbolLayers;if(!c)return;const f=e.effects;let m;const p=l.getSize(e);"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(m=1);let u=c.length;for(;u--;){const l=c[u];if(!l||!1===l.enable)continue;let h;f&&f.length&&(h=[...f]);const y=l.effects;y&&y.length&&(f?h.push(...y):h=[...y]);const g=[];switch(s.findApplicableOverrides(l,t,g),l.type){case"CIMSolidFill":w(l,h,i,g,o,r);break;case"CIMPictureFill":X(l,h,i,g,o,n,r);break;case"CIMHatchFill":z(l,h,i,g,o,r);break;case"CIMGradientFill":x(l,h,i,g,o,r);break;case"CIMSolidStroke":J(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMPictureStroke":H(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMGradientStroke":Y(l,h,i,g,o,r,"CIMPolygonSymbol"===e.type,p);break;case"CIMCharacterMarker":if(R(l,h,i,g,o,r))break;break;case"CIMPictureMarker":if(R(l,h,i,g,o,r))break;"CIMLineSymbol"===e.type&&(m=M(l)),A(l,h,i,g,o,n,r,m,p);break;case"CIMVectorMarker":if(R(l,h,i,g,o,r))break;"CIMLineSymbol"===e.type&&(m=M(l)),$(l,h,i,g,o,r,n,m,p,a);break;default:S.error("Cannot analyze CIM layer",l.type)}}}function w(e,t,i,o,n,a){const l=e.primitiveName,s=m(e.color),[c,f]=V(o,l),p=r(JSON.stringify(e)+f).toString();a.push({type:"fill",templateHash:p,materialHash:c?()=>p:p,cim:e,materialOverrides:null,colorLocked:e.colorLocked,color:U(l,i,"Color",n,s,G),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t})}function X(e,t,o,n,a,l,s){const c=e.primitiveName,f=e.tintColor?m(e.tintColor):{r:255,g:255,b:255,a:1},[u,h]=V(n,c),y=r(JSON.stringify(e)+h).toString(),g=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString();let d=p(e.scaleX);if("width"in e){const t=e.width;let o=1;const r=l.getResource(e.url);i(r)&&(o=r.width/r.height),d/=o*(e.height/t)}s.push({type:"fill",templateHash:y,materialHash:u?()=>g:g,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,color:U(c,o,"TintColor",a,f,G),height:U(c,o,"Height",a,e.height),scaleX:U(c,o,"ScaleX",a,d),angle:U(c,o,"Rotation",a,p(e.rotation)),offsetX:U(c,o,"OffsetX",a,p(e.offsetX)),offsetY:U(c,o,"OffsetY",a,p(e.offsetY)),url:e.url})}function z(e,t,i,o,n,a){const l=["Rotation","OffsetX","OffsetY"],s=o.filter((t=>t.primitiveName!==e.primitiveName&&-1===l.indexOf(t.propertyName))),c=e.primitiveName,[f,m]=V(o,c),u=r(JSON.stringify(e)+m).toString(),h=r(`${e.separation}${JSON.stringify(e.lineSymbol)}`).toString();a.push({type:"fill",templateHash:u,materialHash:f?B(h,i,s,n):h,cim:e,materialOverrides:s,colorLocked:e.colorLocked,effects:t,color:{r:255,g:255,b:255,a:1},height:U(c,i,"Separation",n,e.separation),scaleX:1,angle:U(c,i,"Rotation",n,p(e.rotation)),offsetX:U(c,i,"OffsetX",n,p(e.offsetX)),offsetY:U(c,i,"OffsetY",n,p(e.offsetY))})}function x(e,t,i,o,n,a){const l=e.primitiveName,[s,c]=V(o,l),f=r(JSON.stringify(e)+c).toString();a.push({type:"fill",templateHash:f,materialHash:s?B(f,i,o,n):f,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1})}function J(e,t,i,o,n,a,l,s){const c=e.primitiveName,f=m(e.color),p=void 0!==e.width?e.width:4,u=v(e.capStyle),h=N(e.joinStyle),y=e.miterLimit,[g,d]=V(o,c),S=r(JSON.stringify(e)+d).toString();let b,k;if(t&&t.length>0){const i=t[t.length-1];if("CIMGeometricEffectDashes"===i.type&&"NoConstraint"===i.lineDashEnding){const i=(t=[...e.effects]).pop();b=i.dashTemplate,k=i.scaleDash}}a.push({type:"line",templateHash:S,materialHash:g?()=>S:S,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:U(c,i,"Color",n,f,G),width:U(c,i,"Width",n,p),cap:U(c,i,"CapStyle",n,u),join:U(c,i,"JoinStyle",n,h),miterLimit:U(c,i,"MiterLimit",n,y),referenceWidth:s,zOrder:E(e.name),dashTemplate:b,scaleDash:k})}function H(e,t,i,o,n,a,l,s){const c=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),f=e.primitiveName,p=m(e.tintColor),u=void 0!==e.width?e.width:4,h=v(e.capStyle),y=N(e.joinStyle),g=e.miterLimit,[d,S]=V(o,f),b=r(JSON.stringify(e)+S).toString();a.push({type:"line",templateHash:b,materialHash:d?()=>c:c,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:U(f,i,"TintColor",n,p,G),width:U(f,i,"Width",n,u),cap:U(f,i,"CapStyle",n,h),join:U(f,i,"JoinStyle",n,y),miterLimit:U(f,i,"MiterLimit",n,g),referenceWidth:s,zOrder:E(e.name),dashTemplate:null,scaleDash:!1,url:e.url})}function Y(e,t,i,o,n,a,l,s){const c=e.primitiveName,f=void 0!==e.width?e.width:4,m=v(e.capStyle),p=N(e.joinStyle),u=e.miterLimit,[h,y]=V(o,c),g=r(JSON.stringify(e)+y).toString();a.push({type:"line",templateHash:g,materialHash:h?B(g,i,o,n):g,cim:e,materialOverrides:null,isOutline:l,colorLocked:e.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:U(c,i,"Width",n,f),cap:U(c,i,"CapStyle",n,m),join:U(c,i,"JoinStyle",n,p),miterLimit:U(c,i,"MiterLimit",n,u),referenceWidth:s,zOrder:E(e.name),dashTemplate:null,scaleDash:!1})}function R(e,t,i,o,n,a){const l=e.markerPlacement;if(!l||"CIMMarkerPlacementInsidePolygon"!==l.type)return!1;const s=l,c=["Rotation","OffsetX","OffsetY"],f=o.filter((t=>t.primitiveName!==e.primitiveName&&-1===c.indexOf(t.propertyName))),m="url"in e?e.url:null,[u,h]=V(o,s.primitiveName),y=r(JSON.stringify(e)+h).toString();let g=s.stepY,d=null,S=1;return l.shiftOddRows&&(g*=2,d=function(e){return e?2*e:0},S=.5),a.push({type:"fill",templateHash:y,materialHash:u?B(y,i,f,n):y,cim:e,materialOverrides:f,colorLocked:e.colorLocked,effects:t,color:{r:255,g:255,b:255,a:1},height:U(s.primitiveName,i,"StepY",n,g,d),scaleX:S,angle:U(s.primitiveName,i,"GridAngle",n,s.gridAngle),offsetX:U(s.primitiveName,i,"OffsetX",n,p(s.offsetX)),offsetY:U(s.primitiveName,i,"OffsetY",n,p(s.offsetY)),url:m}),!0}function A(e,t,o,n,a,l,s,c,f){var u;const h=e.primitiveName,y=p(e.size);let g=p(e.scaleX);const d=p(e.rotation),S=p(e.offsetX),v=p(e.offsetY),N=e.tintColor?m(e.tintColor):{r:255,g:255,b:255,a:1},b=r(`${e.url}${JSON.stringify(e.colorSubstitutions)}`).toString(),[k,C]=V(n,h),O=r(JSON.stringify(e)+C).toString(),P=null!=(u=e.anchorPoint)?u:{x:0,y:0};if("width"in e){const t=e.width;let o=1;const r=l.getResource(e.url);i(r)&&(o=r.width/r.height),g/=o*(y/t)}s.push({type:"marker",templateHash:O,materialHash:k?()=>b:b,cim:e,materialOverrides:null,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:!1,alignment:c,size:U(h,o,"Size",a,y),scaleX:U(h,o,"ScaleX",a,g),rotation:U(h,o,"Rotation",a,d),offsetX:U(h,o,"OffsetX",a,S),offsetY:U(h,o,"OffsetY",a,v),color:U(h,o,"TintColor",a,N,G),anchorPoint:{x:P.x,y:-P.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:e.rotateClockwise,referenceSize:f,sizeRatio:1,markerPlacement:e.markerPlacement,url:e.url})}function $(e,t,i,o,r,n,a,l,s,c){const f=e.markerGraphics;if(!f)return;let m=0;if(e.scaleSymbolsProportionally){const t=e.frame;t&&(m=t.ymax-t.ymin)}for(const p of f)if(p){const f=p.symbol;if(!f)continue;switch(f.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":j(e,t,p,o,i,r,n,a,l,s,m,c);break;case"CIMTextSymbol":F(e,t,p,i,o,r,n,l,s,m)}}}function F(e,t,i,o,n,a,c,f,g,d){const S=[];s.findApplicableOverrides(i,n,S);const v=i.geometry;if(!("x"in v)||!("y"in v))return;const N=i.symbol,P=O(N),M=C(N.fontStyleName),I=u(N.fontFamilyName);N.font={family:I,decoration:P,...M};const L=e.frame,w=v.x-.5*(L.xmin+L.xmax),X=v.y-.5*(L.ymin+L.ymax),z=e.size/d,x=e.primitiveName,J=p(N.height)*z,H=p(N.angle),Y=(p(N.offsetX)+w)*z,R=(p(N.offsetY)+X)*z,A=m(l.getFillColor(N));let $=m(l.getStrokeColor(N)),F=l.getStrokeWidth(N);F||($=m(l.getFillColor(N.haloSymbol)),F=N.haloSize*z);const[j,W]=V(n,x),T=JSON.stringify(e.effects)+Number(e.colorLocked)+JSON.stringify(e.anchorPoint)+e.anchorPointUnits+JSON.stringify(e.markerPlacement),D=r(JSON.stringify(i)+T+W).toString(),E=U(i.primitiveName,o,"TextString",a,i.textString,h,N.textCase),{fontStyleName:G}=N,B=I+(G?"-"+G.toLowerCase():"-regular"),q=B;c.push({type:"text",templateHash:D,materialHash:j||"function"==typeof E||E.match(/\[(.*?)\]/)?(e,t,i)=>q+"-"+y(E,e,t,i):q+"-"+r(E),cim:N,materialOverrides:null,colorLocked:e.colorLocked,effects:t,alignment:f,anchorPoint:{x:e.anchorPoint?e.anchorPoint.x:0,y:e.anchorPoint?e.anchorPoint.y:0},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,fontName:B,decoration:P,weight:U(x,o,"Weight",a,M.weight),style:U(x,o,"Size",a,M.style),size:U(x,o,"Size",a,J),angle:U(x,o,"Rotation",a,H),offsetX:U(x,o,"OffsetX",a,Y),offsetY:U(x,o,"OffsetY",a,R),horizontalAlignment:b(N.horizontalAlignment),verticalAlignment:k(N.verticalAlignment),text:E,color:A,outlineColor:$,outlineSize:F,referenceSize:g,sizeRatio:1,markerPlacement:e.markerPlacement})}function j(e,t,i,o,n,a,s,u,h,y,d,S){const v=i.symbol,N=v.symbolLayers;if(!N)return;if(S)return void T(e,t,i,n,o,a,s,u,h,y,d);let b=N.length;if(_(N))return void W(e,i,N,o,n,a,s,h,y,d);const k=g.applyEffects(v.effects,i.geometry);if(k)for(;b--;){const S=N[b];if(S&&!1!==S.enable)switch(S.type){case"CIMSolidFill":case"CIMSolidStroke":{var C;const u=g.applyEffects(S.effects,k),v=c(u);if(!v)continue;const[N,b,O]=f(v,e.frame,e.size,e.anchorPoint,"Relative"!==e.anchorPointUnits),P="CIMSolidFill"===S.type,M={type:"sdf",geom:u,asFill:P},I=e.primitiveName,L=null!=(C=p(e.size))?C:10,w=p(e.rotation),X=p(e.offsetX),z=p(e.offsetY),x=S.path,J=S.primitiveName,H=m(P?l.getFillColor(S):l.getStrokeColor(S)),Y=P?{r:0,g:0,b:0,a:0}:m(l.getStrokeColor(S)),R=l.getStrokeWidth(S);if(!P&&!R)break;let A=!1,$="";for(const e of o)e.primitiveName!==J&&e.primitiveName!==I||(void 0!==e.value?$+=`-${e.primitiveName}-${e.propertyName}-${JSON.stringify(e.value)}`:e.valueExpressionInfo&&(A=!0));const F=JSON.stringify({...e,markerGraphics:null}),j=r(JSON.stringify(M)+x).toString(),W={type:"marker",templateHash:r(JSON.stringify(i)+JSON.stringify(S)+F+$).toString(),materialHash:A?()=>j:j,cim:M,materialOverrides:null,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:h,anchorPoint:{x:b,y:O},isAbsoluteAnchorPoint:!1,size:U(e.primitiveName,n,"Size",a,L),rotation:U(e.primitiveName,n,"Rotation",a,w),offsetX:U(e.primitiveName,n,"OffsetX",a,X),offsetY:U(e.primitiveName,n,"OffsetY",a,z),scaleX:1,frameHeight:d,rotateClockwise:e.rotateClockwise,referenceSize:y,sizeRatio:N,color:U(J,n,"Color",a,H,G),outlineColor:U(J,n,"Color",a,Y,G),outlineWidth:U(J,n,"Width",a,R),markerPlacement:e.markerPlacement,path:x};s.push(W);break}default:T(e,t,i,n,o,a,s,u,h,y,d)}}}function W(e,t,i,o,n,a,s,u,h,y){const g=t.geometry,d=i[0],S=i[1],v=c(g);if(!v)return;const[N,b,k]=f(v,e.frame,e.size,e.anchorPoint,"Relative"!==e.anchorPointUnits),C={type:"sdf",geom:g,asFill:!0},O=e.primitiveName,P=p(e.size),M=p(e.rotation),I=p(e.offsetX),L=p(e.offsetY),w=S.path,X=S.primitiveName,z=d.primitiveName,x=m(l.getFillColor(S)),J=m(l.getStrokeColor(d)),H=l.getStrokeWidth(d);let Y=!1,R="";for(const r of o)r.primitiveName!==X&&r.primitiveName!==z&&r.primitiveName!==O||(void 0!==r.value?R+=`-${r.primitiveName}-${r.propertyName}-${JSON.stringify(r.value)}`:r.valueExpressionInfo&&(Y=!0));const A=JSON.stringify({...e,markerGraphics:null}),$=r(JSON.stringify(C)+w).toString(),F={type:"marker",templateHash:r(JSON.stringify(t)+JSON.stringify(S)+JSON.stringify(d)+A+R).toString(),materialHash:Y?()=>$:$,cim:C,materialOverrides:null,colorLocked:e.colorLocked,effects:e.effects,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:b,y:k},isAbsoluteAnchorPoint:!1,size:U(e.primitiveName,n,"Size",a,P),rotation:U(e.primitiveName,n,"Rotation",a,M),offsetX:U(e.primitiveName,n,"OffsetX",a,I),offsetY:U(e.primitiveName,n,"OffsetY",a,L),scaleX:1,frameHeight:y,rotateClockwise:e.rotateClockwise,referenceSize:h,sizeRatio:N,color:U(X,n,"Color",a,x,G),outlineColor:U(z,n,"Color",a,J,G),outlineWidth:U(z,n,"Width",a,H),markerPlacement:e.markerPlacement,path:w};s.push(F)}function T(e,t,i,n,a,s,c,f,m,u,h){const y=D(e,i);let g=[];const d=["Rotation","OffsetX","OffsetY"];g=a.filter((t=>t.primitiveName!==e.primitiveName||-1===d.indexOf(t.propertyName)));let S="";for(const o of a)void 0!==o.value&&(S+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`);const[v,N,b]=l.getTextureAnchor(y,f),k=e.primitiveName,C=p(e.rotation),O=p(e.offsetX),P=p(e.offsetY),M=r(JSON.stringify(y)+S).toString(),I={type:"marker",templateHash:M,materialHash:0===g.length?M:B(M,n,g,s),cim:y,materialOverrides:g,colorLocked:e.colorLocked,effects:t,scaleSymbolsProportionally:e.scaleSymbolsProportionally,alignment:m,anchorPoint:{x:v,y:N},isAbsoluteAnchorPoint:!1,size:e.size,rotation:U(k,n,"Rotation",s,C),offsetX:U(k,n,"OffsetX",s,O),offsetY:U(k,n,"OffsetY",s,P),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:h,rotateClockwise:e.rotateClockwise,referenceSize:u,sizeRatio:b/o(e.size),markerPlacement:e.markerPlacement};c.push(I)}function D(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function E(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.substr(6),10);if(NaN!==t)return t}return 0}function G(t){if(!t||0===t.length)return null;const i=new e(t).toRgba();return{r:i[0],g:i[1],b:i[2],a:i[3]}}function U(e,t,i,o,r,n,l){const s=t[e];if(s){const e=s[i];if("string"==typeof e||"number"==typeof e||e instanceof Array)return n?n.call(null,e,l):e;if(null!=e&&e instanceof a)return(t,i,a)=>{let s=d(e,t,{$view:a},o.geometryType,i);return null!==s&&n&&(s=n.call(null,s,l)),null!==s?s:r}}return r}function B(e,t,i,o){for(const r of i){if(r.valueExpressionInfo){const e=t[r.primitiveName]&&t[r.primitiveName][r.propertyName];e instanceof a&&(r.fn=(t,i,r)=>d(e,t,{$view:r},o.geometryType,i))}}return(t,o,n)=>{for(const e of i)e.fn&&(e.value=e.fn(t,o,n));return r(e+s.buildOverrideKey(i)).toString()}}function q(e,t){if(!t||0===t.length)return e;const i=JSON.parse(JSON.stringify(e));return s.applyOverrides(i,t),i}function V(e,t){let i=!1,o="";for(const r of e)r.primitiveName===t&&(void 0!==r.value?o+=`-${r.primitiveName}-${r.propertyName}-${JSON.stringify(r.value)}`:r.valueExpressionInfo&&(i=!0));return[i,o]}function K(e,t,i){if(e&&t)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const o=e.symbolLayers;if(!o)return;for(const e of o)switch(e.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in e&&e.url&&i.push(t.fetchResource(e.url,null));break;case"CIMVectorMarker":{const o=e.markerGraphics;if(!o)continue;for(const e of o)if(e){const o=e.symbol;o&&K(o,t,i)}}}}}}const _=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&!e[0].effects&&!e[1].effects;export{q as analyzeCIMResource,I as analyzeCIMSymbol};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/Logger.js";import{analyzeCIMResource as t}from"../../../../../../symbols/cim/cimAnalyzer.js";import{evaluateValueOrFunction as a}from"../../../../../../symbols/cim/utils.js";import s from"./WGLMeshTemplate.js";const i=e.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class r extends s{constructor(e){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=e}analyze(e,s,r,n,o){const l=s.readLegacyFeature(),m=this._materialCache,c=this._cimLayer.materialHash;if(!c)return i.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const h="function"==typeof c?c(l,r,n):c;if(m.has(h)){const e=m.get(h);return Promise.resolve(e)}if(this._ongoingMaterialRequestMap.has(h))return this._ongoingMaterialRequestMap.get(h);const u=this._cimLayer,p=t(u.cim,this._cimLayer.materialOverrides),{type:g,url:M}=u,y={cim:p,type:g,mosaicHash:h,url:M,size:null,dashTemplate:null,text:null,fontName:null};switch(g){case"marker":y.size=a(u.size,l,r,n);break;case"line":y.dashTemplate=u.dashTemplate;break;case"text":y.text=a(u.text,l,r,n),y.fontName=a(u.fontName,l,r,n)}const f=e.getMosaicItem(y,o).then((e=>(this._ongoingMaterialRequestMap.delete(h),m.set(h,e),e))).catch((e=>(this._ongoingMaterialRequestMap.delete(h),i.error(".analyze()",e.message),null)));return this._ongoingMaterialRequestMap.set(h,f),f}}export{r as default};
5
+ import e from"../../../../../../core/Logger.js";import{analyzeCIMResource as t}from"../../../../../../symbols/cim/cimAnalyzer.js";import{evaluateValueOrFunction as a}from"../../../../../../symbols/cim/utils.js";import s from"./WGLMeshTemplate.js";const i=e.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class r extends s{constructor(e){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=e}analyze(e,s,r,n,o){if(o&&0===o.length)return null;const l=o&&o.length>0,m=s.readLegacyFeature(),c=this._materialCache,h=this._cimLayer.materialHash;if(!h)return i.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const u="function"==typeof h?h(m,r,n):h;if(c.has(u)){const e=c.get(u);return Promise.resolve(e)}const p=this._ongoingMaterialRequestMap.get(u);if(p)return p;const g=this._cimLayer,y=t(g.cim,this._cimLayer.materialOverrides);y.mosaicHash=u;const{type:M,url:f}=g,_={cim:y,type:M,mosaicHash:u,url:f,size:null,dashTemplate:null,text:null,fontName:null};switch(M){case"marker":_.size=a(g.size,m,r,n);break;case"line":_.dashTemplate=g.dashTemplate;break;case"text":_.text=a(g.text,m,r,n),_.fontName=a(g.fontName,m,r,n)}const d=e.getMosaicItem(_,o).then((e=>(l||(this._ongoingMaterialRequestMap.delete(u),c.set(u,e)),e))).catch((e=>(this._ongoingMaterialRequestMap.delete(u),i.error(".analyze()",e.message),null)));return l||this._ongoingMaterialRequestMap.set(u,d),d}}export{r as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as t}from"../../../../../../core/screenUtils.js";import{getXAnchorDirection as e,getYAnchorDirection as i}from"../../alignmentUtils.js";import{premultiplyAlphaRGBA as s}from"../../color.js";import{MIN_MAX_ZOOM_PRECISION_FACTOR as o,GLYPH_SIZE as a}from"../../definitions.js";import{i1616to32 as n}from"../../number.js";import{TextMaterialKey as r}from"../../materialKey/MaterialKey.js";import{isFunction as l,getMinMaxZoom as h}from"./util.js";import c from"./WGLBaseTextTemplate.js";import m from"./WGLDynamicMeshTemplate.js";import{codepoints as _}from"../../../../layers/features/textUtils.js";const f=5;function y(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}class p extends(c(m)){constructor(e,i,a){super(e),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=n(Math.round(i*o),Math.round(a*o));const h=e.scaleFactor||1;if(this._cimTextLayer=e,l(e.color)){const t=(t,i,o)=>s(e.color(t,i,o));this._dynamicPropertyMap.set("_color",t)}else this._color=s(e.color);if(l(e.color)){const t=(t,i,o)=>s(e.outlineColor(t,i,o));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=s(e.outlineColor);let c;l(e.size)||(c=Math.min(Math.round(t(e.size*e.sizeRatio)),127));const m=(i,s,o)=>l(e.size)?Math.min(Math.round(t(e.size(i,s,o)*e.sizeRatio)),127):c;if(this._dynamicPropertyMap.set("_size",m),l(e.outlineSize)){const i=(i,s,o)=>Math.min(Math.floor(f*t(e.outlineSize(i,s,o)*e.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",i)}else this._haloSize=Math.min(Math.floor(f*t(e.outlineSize*e.sizeRatio)),127);let _;l(e.offsetX)||(_=Math.round(t(e.offsetX*e.sizeRatio)));const y=(i,s,o)=>l(e.offsetX)?Math.round(t(e.offsetX(i,s,o)*e.sizeRatio)):_;let p;this._dynamicPropertyMap.set("_xOffset",y),l(e.offsetY)||(p=Math.round(t(e.offsetY*e.sizeRatio)));const d=(i,s,o)=>l(e.offsetY)?Math.round(t(e.offsetY(i,s,o)*e.sizeRatio)):p;this._dynamicPropertyMap.set("_yOffset",d),l(e.angle)?this._dynamicPropertyMap.set("_angle",e.angle):this._angle=e.angle,l(e.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",e.horizontalAlignment):this._horizontalAlignment=e.horizontalAlignment,l(e.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",e.verticalAlignment):this._verticalAlignment=e.verticalAlignment,this._scaleFactor=h,l(e.text)?this._dynamicPropertyMap.set("_text",e.text):this._text=e.text;const M=Math.min(Math.round(t(e.referenceSize*e.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*M)),this._materialKey=e.materialKey;const u=r.load(this._materialKey);u.sdf=!0,this._bitset=(1===e.alignment?1:0)|(e.colorLocked?1:0)<<1,this._materialKey=u.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._textPlacement=e.markerPlacement,this._effects=e.effects,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=h(t.scaleInfo,e);return new p(t,i,s)}async analyze(t,e,i,s){const o=e.readLegacyFeature(),a=y(this._cimTextLayer,o,i,s),n=await super.analyze(t,e,i,s,_(a));return this._textToGlyphs.set(a,n.glyphMosaicItems),n}bindFeature(t,s,o){const n=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach(((t,e)=>{this[e]=t(n,s,o)})),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/a,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=e(this._horizontalAlignment||"center"),this._yAlignD=i(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}export{p as default};
5
+ import{pt2px as t}from"../../../../../../core/screenUtils.js";import{getXAnchorDirection as e,getYAnchorDirection as i}from"../../alignmentUtils.js";import{premultiplyAlphaRGBA as s}from"../../color.js";import{MIN_MAX_ZOOM_PRECISION_FACTOR as o,GLYPH_SIZE as a}from"../../definitions.js";import{i1616to32 as n}from"../../number.js";import{TextMaterialKey as r}from"../../materialKey/MaterialKey.js";import{isFunction as l,getMinMaxZoom as h}from"./util.js";import c from"./WGLBaseTextTemplate.js";import m from"./WGLDynamicMeshTemplate.js";import{codepoints as _}from"../../../../layers/features/textUtils.js";const f=5;function y(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}class p extends(c(m)){constructor(e,i,a){super(e),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=n(Math.round(i*o),Math.round(a*o));const h=e.scaleFactor||1;if(this._cimTextLayer=e,l(e.color)){const t=(t,i,o)=>s(e.color(t,i,o));this._dynamicPropertyMap.set("_color",t)}else this._color=s(e.color);if(l(e.color)){const t=(t,i,o)=>s(e.outlineColor(t,i,o));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=s(e.outlineColor);let c;l(e.size)||(c=Math.min(Math.round(t(e.size*e.sizeRatio)),127));const m=(i,s,o)=>l(e.size)?Math.min(Math.round(t(e.size(i,s,o)*e.sizeRatio)),127):c;if(this._dynamicPropertyMap.set("_size",m),l(e.outlineSize)){const i=(i,s,o)=>Math.min(Math.floor(f*t(e.outlineSize(i,s,o)*e.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",i)}else this._haloSize=Math.min(Math.floor(f*t(e.outlineSize*e.sizeRatio)),127);let _;l(e.offsetX)||(_=Math.round(t(e.offsetX*e.sizeRatio)));const y=(i,s,o)=>l(e.offsetX)?Math.round(t(e.offsetX(i,s,o)*e.sizeRatio)):_;let p;this._dynamicPropertyMap.set("_xOffset",y),l(e.offsetY)||(p=Math.round(t(e.offsetY*e.sizeRatio)));const d=(i,s,o)=>l(e.offsetY)?Math.round(t(e.offsetY(i,s,o)*e.sizeRatio)):p;this._dynamicPropertyMap.set("_yOffset",d),l(e.angle)?this._dynamicPropertyMap.set("_angle",e.angle):this._angle=e.angle,l(e.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",e.horizontalAlignment):this._horizontalAlignment=e.horizontalAlignment,l(e.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",e.verticalAlignment):this._verticalAlignment=e.verticalAlignment,this._scaleFactor=h,l(e.text)?this._dynamicPropertyMap.set("_text",e.text):this._text=e.text;const M=Math.min(Math.round(t(e.referenceSize*e.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*M)),this._materialKey=e.materialKey;const g=r.load(this._materialKey);g.sdf=!0,this._bitset=(1===e.alignment?1:0)|(e.colorLocked?1:0)<<1,this._materialKey=g.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._textPlacement=e.markerPlacement,this._effects=e.effects,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=h(t.scaleInfo,e);return new p(t,i,s)}async analyze(t,e,i,s){const o=e.readLegacyFeature(),a=y(this._cimTextLayer,o,i,s),n=await super.analyze(t,e,i,s,_(a));return n&&n.glyphMosaicItems&&this._textToGlyphs.set(a,n.glyphMosaicItems),n}bindFeature(t,s,o){const n=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach(((t,e)=>{this[e]=t(n,s,o)})),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/a,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=e(this._horizontalAlignment||"center"),this._yAlignD=i(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import i from"../../TimeInterval.js";import n from"../../core/Collection.js";import{deprecatedProperty as s}from"../../core/deprecate.js";import r from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import l from"../../core/Logger.js";import{isNone as a,isSome as m,unwrap as u}from"../../core/maybe.js";import{after as d,isAbortError as p,createTask as h}from"../../core/promiseUtils.js";import{offsetDate as c}from"../../core/timeUtils.js";import{init as f,watch as v,whenFalseOnce as w}from"../../core/watchUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{ensureType as T}from"../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import x from"../../webdoc/Widgets.js";import E from"../../webdoc/widgets/TimeSlider.js";import{getFullTimeExtentFromWebDocument as y,getModeFromTimeSlider as b,getStopsFromTimeSlider as C,getTimeExtentFromTimeSlider as S}from"./utils.js";var j;const W=1e4;function A(t){return m(t)&&void 0!==t.count}function D(t){return m(t)&&void 0!==t.interval}function M(t){return m(t)&&void 0!==t.dates}function R(t){return"esri.WebMap"===t.declaredClass}const k="esri.widgets.Popup.PopupViewModel",I=l.getLogger(k);let V=j=class extends(o(r.EventedAccessor)){constructor(t){super(t),this._animationController=null,this._loadingWebDocument=!1,this._timerId=null,this._updateTimeSliderTask=null,this.actions=new n,this.view=null}initialize(){this.handles.add([f(this,"effectiveStops",(()=>{a(this.timeExtent)&&this._set("timeExtent",this._getDefaultTimeExtent())})),f(this,"view.map",(t=>{m(this._updateTimeSliderTask)&&(this._updateTimeSliderTask.abort(),this._updateTimeSliderTask=null),this._updateTimeSliderTask=h((async e=>{this._loadingWebDocument=!0,await this._updateTimeSliderFromMap(t,e),this._loadingWebDocument=!1}))})),f(this,"view",((t,e)=>{this._unregisterWidget(e),this._registerWidget(t)}),!0),f(this,"timeExtent",(t=>{if(a(this.view))return;const e=this.view.timeExtent;(a(t)||t.isAllTime)&&(a(e)||e.isAllTime)||m(t)&&m(e)&&t.equals(e)||(this.view.timeExtent=u(t))})),v(this,"view.timeExtent",(t=>{(a(t)||t.isAllTime)&&(a(this.timeExtent)||this.timeExtent.isAllTime)||m(t)&&m(this.timeExtent)&&t.equals(this.timeExtent)||(this.timeExtent=t)}))])}destroy(){m(this._timerId)&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,m(this._animationController)&&(this._animationController.abort(),this._animationController=null),m(this._updateTimeSliderTask)&&(this._updateTimeSliderTask.abort(),this._updateTimeSliderTask=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(M(e)){const{dates:i}=e;if(null==i||0===i.length)return null;const n=i.sort(((t,e)=>t.getTime()-e.getTime()));if(a(t))return n;const{start:s,end:r}=t;if(a(s)||a(r))return n;return n.filter((t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime())))}if(A(e)){var i;const n=null!=(i=e.timeExtent)?i:u(t);return this._divideTimeExtentByCount(n,e.count)}if(D(e)){var n;const i=null!=(n=e.timeExtent)?n:u(t);return this._divideTimeExtentByInterval(i,e.interval)}return[]}set fullTimeExtent(t){this._override("fullTimeExtent",t)}set loop(t){this._override("loop",t)}set mode(t){this._override("mode",t)}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._override("playRate",t))}get state(){return a(this.fullTimeExtent)||this._loadingWebDocument?"disabled":m(this._animationController)?"playing":"ready"}set stops(t){this._override("stops",t)}set timeExtent(t){this._override("timeExtent",t)}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(a(e)||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return m(i)?[i.getTime()]:null;case"cumulative-from-start":return m(n)?[n.getTime()]:null;case"time-window":return m(i)&&m(n)?[i.getTime(),n.getTime()]:null}}get values(){s(I,"values",{replacement:"timeExtent",version:"4.20"});const{mode:t,timeExtent:e}=this;if(a(e))return null;if(e.isAllTime)return"time-window"===t?[null,null]:[null];if(e.isEmpty)return"time-window"===t?[void 0,void 0]:[void 0];const{start:i,end:n}=e;switch(t){case"time-window":return[i,n];case"instant":case"cumulative-from-end":return[i];case"cumulative-from-start":return[n]}}set values(t){if(s(I,"values",{replacement:"timeExtent",version:"4.20"}),a(t))return void(this.timeExtent=null);const i=t[0];if(a(i))return void(this.timeExtent=new e({start:i,end:i}));const n=t.length>1&&t[1];switch(this.mode){case"time-window":return void(this.timeExtent=new e({start:i,end:n}));case"instant":return void(this.timeExtent=new e({start:i,end:i}));case"cumulative-from-end":return void(this.timeExtent=new e({start:i,end:null}));case"cumulative-from-start":return void(this.timeExtent=new e({start:null,end:i}))}}static async getPropertiesFromWebMap(t,e){var i,n;if(!t||!R(t))return null;await t.load({signal:e});const s=null==t||null==(i=t.widgets)?void 0:i.timeSlider;if(!s)return null;const r=await y(t,e),o=s.loop,l=b(s);return{fullTimeExtent:r,loop:o,mode:l,playRate:null!=(n=s.stopDelay)?n:2e3,stops:C(s),timeExtent:S(s,l)}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){if(R(t)){const e=new E({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:A(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:D(this.stops)?this.stops.interval:null,stops:M(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new x({timeSlider:e})}}valuesToTimeExtent(t){if(a(t))return null;const i=t.sort(((t,e)=>t-e)).map((t=>new Date(t))),n=i.length>0?i[0]:null,s=i.length>1?i[1]:null;switch(this.mode){case"time-window":return new e({start:n,end:s});case"instant":return new e({start:n,end:n});case"cumulative-from-start":return new e({start:null,end:n});case"cumulative-from-end":return new e({start:n,end:null});default:return e.allTime}}async _animate(){try{await Promise.all([d(this.playRate,null,m(this._animationController)&&this._animationController.signal),m(this.view)&&w(this.view,"updating",m(this._animationController)&&this._animationController.signal)])}catch(t){return p(t)||I.error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),a(this._animationController)||this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(a(i)||a(n))return[];if(e>W)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=W){if(!t||!e)return[];const{start:n,end:s}=t;if(a(n)||a(s))return[];if((s.getTime()-n.getTime())/e.toMilliseconds()>i)return this._divideTimeExtentByCount(t);const r=[],{value:o,unit:l}=e;let m=n;for(;m.getTime()<=s.getTime();)r.push(new Date(m.getTime())),m=c(m,o,l);return r}_getDefaultTimeExtent(){const{effectiveStops:t,mode:i}=this;if(a(t)||!i)return null;switch(i){case"time-window":return t.length>1?new e({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new e({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new e({start:t[0],end:null}):null;case"instant":return t.length>0?new e({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(m(t)){t.persistableViewModels.some((t=>t===this))||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(a(this.timeExtentValues)||a(n))return;const s=n.map((t=>t.getTime())),r=this.timeExtentValues.map((t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e));return s.indexOf(i)})),o=r.map((t=>t+(e?1:-1))),l=o.some((t=>t<0||t>s.length-1)),{loop:m,state:u}=this;if(l)if(m||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map((e=>e-t)):r.map((t=>t+(s.length-1-i)))).map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===u&&this.stop();else{const t=o.map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){m(this._animationController)&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){m(t)&&t.persistableViewModels.remove(this)}async _updateTimeSliderFromMap(t,e){const i=await j.getPropertiesFromWebMap(t,e);if(!a(i))for(const n in i)this._isOverridden(n)||(this[n]=i[n])}};t([g()],V.prototype,"_animationController",void 0),t([g()],V.prototype,"_loadingWebDocument",void 0),t([g({type:n})],V.prototype,"actions",void 0),t([g({readOnly:!0})],V.prototype,"effectiveStops",null),t([g({type:e,value:null})],V.prototype,"fullTimeExtent",null),t([g({nonNullable:!0,value:!1})],V.prototype,"loop",null),t([g({nonNullable:!0,value:"time-window"})],V.prototype,"mode",null),t([g({nonNullable:!0,value:1e3})],V.prototype,"playRate",null),t([g({readOnly:!0})],V.prototype,"state",null),t([g({cast:t=>a(t)?null:(D(t)&&(t.interval=T(i,t.interval)),(D(t)||A(t))&&(t.timeExtent=T(e,t.timeExtent)),t),value:{count:10}})],V.prototype,"stops",null),t([g({type:e,value:null})],V.prototype,"timeExtent",null),t([g({readOnly:!0})],V.prototype,"timeExtentValues",null),t([g({value:null})],V.prototype,"values",null),t([g()],V.prototype,"view",void 0),t([g()],V.prototype,"next",null),t([g()],V.prototype,"play",null),t([g()],V.prototype,"previous",null),t([g()],V.prototype,"stop",null),t([g()],V.prototype,"updateWebDocument",null),V=j=t([_(k)],V);const O=V;export{O as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import i from"../../TimeInterval.js";import n from"../../core/Collection.js";import{deprecatedProperty as s}from"../../core/deprecate.js";import r from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import l from"../../core/Logger.js";import{isNone as a,isSome as m,unwrap as u}from"../../core/maybe.js";import{after as d,isAbortError as p,createTask as h}from"../../core/promiseUtils.js";import{offsetDate as c}from"../../core/timeUtils.js";import{init as f,watch as v,whenFalseOnce as w}from"../../core/watchUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{ensureType as T}from"../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import x from"../../webdoc/Widgets.js";import E from"../../webdoc/widgets/TimeSlider.js";import{getFullTimeExtentFromWebDocument as y,getModeFromTimeSlider as b,getStopsFromTimeSlider as C,getTimeExtentFromTimeSlider as S}from"./utils.js";var j;const W=1e4;function A(t){return m(t)&&void 0!==t.count}function D(t){return m(t)&&void 0!==t.interval}function M(t){return m(t)&&void 0!==t.dates}function I(t){return"esri.WebMap"===t.declaredClass}const R="esri.widgets.Popup.PopupViewModel",V=l.getLogger(R);let k=j=class extends(o(r.EventedAccessor)){constructor(t){super(t),this._animationController=null,this._isViewTimeExtentInitialized=!1,this._loadingWebDocument=!1,this._timerId=null,this._updateTimeSliderTask=null,this.actions=new n,this.view=null}initialize(){this.handles.add([f(this,"effectiveStops",(()=>{a(this.timeExtent)&&this._set("timeExtent",this._getDefaultTimeExtent())})),f(this,"view.map",(t=>{m(this._updateTimeSliderTask)&&(this._updateTimeSliderTask.abort(),this._updateTimeSliderTask=null),this._updateTimeSliderTask=h((async e=>{this._loadingWebDocument=!0,await this._updateTimeSliderFromMap(t,e),this._loadingWebDocument=!1}))})),f(this,"view",((t,e)=>{this._unregisterWidget(e),this._registerWidget(t)}),!0),f(this,"timeExtent",(t=>{if(a(this.view))return;const e=this.view.timeExtent;(a(t)||t.isAllTime)&&(a(e)||e.isAllTime)||m(t)&&m(e)&&t.equals(e)||(this.view.timeExtent=u(t))})),v(this,"view.timeExtent",(t=>{this._isViewTimeExtentInitialized?(a(t)||t.isAllTime)&&(a(this.timeExtent)||this.timeExtent.isAllTime)||m(t)&&m(this.timeExtent)&&t.equals(this.timeExtent)||(this.timeExtent=t):this._isViewTimeExtentInitialized=!0}))])}destroy(){m(this._timerId)&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,m(this._animationController)&&(this._animationController.abort(),this._animationController=null),m(this._updateTimeSliderTask)&&(this._updateTimeSliderTask.abort(),this._updateTimeSliderTask=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(M(e)){const{dates:i}=e;if(null==i||0===i.length)return null;const n=i.sort(((t,e)=>t.getTime()-e.getTime()));if(a(t))return n;const{start:s,end:r}=t;if(a(s)||a(r))return n;return n.filter((t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime())))}if(A(e)){var i;const n=null!=(i=e.timeExtent)?i:u(t);return this._divideTimeExtentByCount(n,e.count)}if(D(e)){var n;const i=null!=(n=e.timeExtent)?n:u(t);return this._divideTimeExtentByInterval(i,e.interval)}return[]}set fullTimeExtent(t){this._override("fullTimeExtent",t)}set loop(t){this._override("loop",t)}set mode(t){this._override("mode",t)}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._override("playRate",t))}get state(){return a(this.fullTimeExtent)||this._loadingWebDocument?"disabled":m(this._animationController)?"playing":"ready"}set stops(t){this._override("stops",t)}set timeExtent(t){this._override("timeExtent",t)}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(a(e)||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return m(i)?[i.getTime()]:null;case"cumulative-from-start":return m(n)?[n.getTime()]:null;case"time-window":return m(i)&&m(n)?[i.getTime(),n.getTime()]:null}}get values(){s(V,"values",{replacement:"timeExtent",version:"4.20"});const{mode:t,timeExtent:e}=this;if(a(e))return null;if(e.isAllTime)return"time-window"===t?[null,null]:[null];if(e.isEmpty)return"time-window"===t?[void 0,void 0]:[void 0];const{start:i,end:n}=e;switch(t){case"time-window":return[i,n];case"instant":case"cumulative-from-end":return[i];case"cumulative-from-start":return[n]}}set values(t){if(s(V,"values",{replacement:"timeExtent",version:"4.20"}),a(t))return void(this.timeExtent=null);const i=t[0];if(a(i))return void(this.timeExtent=new e({start:i,end:i}));const n=t.length>1&&t[1];switch(this.mode){case"time-window":return void(this.timeExtent=new e({start:i,end:n}));case"instant":return void(this.timeExtent=new e({start:i,end:i}));case"cumulative-from-end":return void(this.timeExtent=new e({start:i,end:null}));case"cumulative-from-start":return void(this.timeExtent=new e({start:null,end:i}))}}static async getPropertiesFromWebMap(t,e){var i,n;if(!t||!I(t))return null;await t.load({signal:e});const s=null==t||null==(i=t.widgets)?void 0:i.timeSlider;if(!s)return null;const r=await y(t,e),o=s.loop,l=b(s);return{fullTimeExtent:r,loop:o,mode:l,playRate:null!=(n=s.stopDelay)?n:2e3,stops:C(s),timeExtent:S(s,l)}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){if(I(t)){const e=new E({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:A(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:D(this.stops)?this.stops.interval:null,stops:M(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new x({timeSlider:e})}}valuesToTimeExtent(t){if(a(t))return null;const i=t.sort(((t,e)=>t-e)).map((t=>new Date(t))),n=i.length>0?i[0]:null,s=i.length>1?i[1]:null;switch(this.mode){case"time-window":return new e({start:n,end:s});case"instant":return new e({start:n,end:n});case"cumulative-from-start":return new e({start:null,end:n});case"cumulative-from-end":return new e({start:n,end:null});default:return e.allTime}}async _animate(){try{await Promise.all([d(this.playRate,null,m(this._animationController)&&this._animationController.signal),m(this.view)&&w(this.view,"updating",m(this._animationController)&&this._animationController.signal)])}catch(t){return p(t)||V.error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),a(this._animationController)||this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(a(i)||a(n))return[];if(e>W)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=W){if(!t||!e)return[];const{start:n,end:s}=t;if(a(n)||a(s))return[];if((s.getTime()-n.getTime())/e.toMilliseconds()>i)return this._divideTimeExtentByCount(t);const r=[],{value:o,unit:l}=e;let m=n;for(;m.getTime()<=s.getTime();)r.push(new Date(m.getTime())),m=c(m,o,l);return r}_getDefaultTimeExtent(){const{effectiveStops:t,mode:i}=this;if(a(t)||!i)return null;switch(i){case"time-window":return t.length>1?new e({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new e({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new e({start:t[0],end:null}):null;case"instant":return t.length>0?new e({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(m(t)){t.persistableViewModels.some((t=>t===this))||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(a(this.timeExtentValues)||a(n))return;const s=n.map((t=>t.getTime())),r=this.timeExtentValues.map((t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e));return s.indexOf(i)})),o=r.map((t=>t+(e?1:-1))),l=o.some((t=>t<0||t>s.length-1)),{loop:m,state:u}=this;if(l)if(m||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map((e=>e-t)):r.map((t=>t+(s.length-1-i)))).map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===u&&this.stop();else{const t=o.map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){m(this._animationController)&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){m(t)&&t.persistableViewModels.remove(this)}async _updateTimeSliderFromMap(t,e){const i=await j.getPropertiesFromWebMap(t,e);if(!a(i))for(const n in i)this._isOverridden(n)||(this[n]=i[n])}};t([g()],k.prototype,"_animationController",void 0),t([g()],k.prototype,"_loadingWebDocument",void 0),t([g({type:n})],k.prototype,"actions",void 0),t([g({readOnly:!0})],k.prototype,"effectiveStops",null),t([g({type:e,value:null})],k.prototype,"fullTimeExtent",null),t([g({nonNullable:!0,value:!1})],k.prototype,"loop",null),t([g({nonNullable:!0,value:"time-window"})],k.prototype,"mode",null),t([g({nonNullable:!0,value:1e3})],k.prototype,"playRate",null),t([g({readOnly:!0})],k.prototype,"state",null),t([g({cast:t=>a(t)?null:(D(t)&&(t.interval=T(i,t.interval)),(D(t)||A(t))&&(t.timeExtent=T(e,t.timeExtent)),t),value:{count:10}})],k.prototype,"stops",null),t([g({type:e,value:null})],k.prototype,"timeExtent",null),t([g({readOnly:!0})],k.prototype,"timeExtentValues",null),t([g({value:null})],k.prototype,"values",null),t([g()],k.prototype,"view",void 0),t([g()],k.prototype,"next",null),t([g()],k.prototype,"play",null),t([g()],k.prototype,"previous",null),t([g()],k.prototype,"stop",null),t([g()],k.prototype,"updateWebDocument",null),k=j=t([_(R)],k);const O=k;export{O as default};