@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 18.1 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[708],{27647:(t,e,n)=>{function r(t,e){return t?e?4:3:e?3:2}function o(t,e,n,o){if(!e?.lengths.length)return null;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const u=t.coords,i=[],c=n?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:h,coords:f}=e,a=r(n,o);let d=0;for(const t of h){const e=s(c,f,d,t,n,o);e&&i.push(e),d+=t*a}if(i.sort(((t,e)=>{let r=t[2]-e[2];return 0===r&&n&&(r=t[4]-e[4]),r})),i.length){let t=6*i[0][2];u[0]=i[0][0]/t,u[1]=i[0][1]/t,n&&(t=6*i[0][4],u[2]=0!==t?i[0][3]/t:0),(u[0]<c[0]||u[0]>c[1]||u[1]<c[2]||u[1]>c[3]||n&&(u[2]<c[4]||u[2]>c[5]))&&(u.length=0)}if(!u.length){const t=e.lengths[0]?l(f,0,h[0],n,o):null;if(!t)return null;u[0]=t[0],u[1]=t[1],n&&t.length>2&&(u[2]=t[2])}return t}function s(t,e,n,o,s,l){const u=r(s,l);let i=n,c=n+u,h=0,f=0,a=0,d=0,g=0;for(let n=0,r=o-1;n<r;n++,i+=u,c+=u){const n=e[i],r=e[i+1],o=e[i+2],l=e[c],u=e[c+1],m=e[c+2];let y=n*u-l*r;d+=y,h+=(n+l)*y,f+=(r+u)*y,s&&(y=n*m-l*o,a+=(o+m)*y,g+=y),n<t[0]&&(t[0]=n),n>t[1]&&(t[1]=n),r<t[2]&&(t[2]=r),r>t[3]&&(t[3]=r),s&&(o<t[4]&&(t[4]=o),o>t[5]&&(t[5]=o))}if(d>0&&(d*=-1),g>0&&(g*=-1),!d)return null;const m=[h,f,.5*d];return s&&(m[3]=a,m[4]=.5*g),m}function l(t,e,n,o,s){const l=r(o,s);let f=e,a=e+l,d=0,g=0,m=0,y=0;for(let e=0,r=n-1;e<r;e++,f+=l,a+=l){const e=t[f],n=t[f+1],r=t[f+2],s=t[a],l=t[a+1],p=t[a+2],I=o?i(e,n,r,s,l,p):u(e,n,s,l);if(I)if(d+=I,o){const t=h(e,n,r,s,l,p);g+=I*t[0],m+=I*t[1],y+=I*t[2]}else{const t=c(e,n,s,l);g+=I*t[0],m+=I*t[1]}}return d>0?o?[g/d,m/d,y/d]:[g/d,m/d]:n>0?o?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function u(t,e,n,r){const o=n-t,s=r-e;return Math.sqrt(o*o+s*s)}function i(t,e,n,r,o,s){const l=r-t,u=o-e,i=s-n;return Math.sqrt(l*l+u*u+i*i)}function c(t,e,n,r){return[t+.5*(n-t),e+.5*(r-e)]}function h(t,e,n,r,o,s){return[t+.5*(r-t),e+.5*(o-e),n+.5*(s-n)]}n.d(e,{Q:()=>o})},43334:(t,e,n)=>{n.d(e,{N3:()=>u,Om:()=>l});var r=n(69397),o=n(27647),s=n(92722);class l{constructor(t=null,e={},n,r,o=0){this.geometry=t,this.attributes=e,this.centroid=n,this.objectId=r,this.displayId=o}static fromJSON(t){const e=t.geometry?s.A.fromJSON(t.geometry):null,n=t.centroid?s.A.fromJSON(t.centroid):null,r=t.objectId;return new l(e,t.attributes,n,r)}weakClone(){const t=new l(this.geometry,this.attributes,this.centroid,this.objectId);return t.displayId=this.displayId,t}clone(){const t=this.geometry?.clone(),e=new l(t,{...this.attributes},this.centroid?.clone(),this.objectId);return e.displayId=this.displayId,e}ensureCentroid(t){return this.centroid??=(0,o.Q)(new s.A,this.geometry,t.hasZ,t.hasM),this.centroid}get usedMemory(){return 128+(0,r.lM)(this.attributes)+(this.geometry?.usedMemory??0)}}function u(t){return!!t.geometry?.coords?.length}},58512:(t,e,n)=>{n.d(e,{A:()=>r});class r{constructor(){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 t=new r;return t.globalIdFieldName=this.globalIdFieldName,t.geohashFieldName=this.geohashFieldName,t.geometryProperties=this.geometryProperties,t.geometryType=this.geometryType,t.spatialReference=this.spatialReference,t.hasZ=this.hasZ,t.hasM=this.hasM,t.features=this.features,t.fields=this.fields,t.transform=this.transform,t.exceededTransferLimit=this.exceededTransferLimit,t.uniqueIdField=this.uniqueIdField,t.queryGeometry=this.queryGeometry,t.queryGeometryType=this.queryGeometryType,t}}},69397:(t,e,n)=>{n.d(e,{$B:()=>o,Qf:()=>c,Qh:()=>u,RS:()=>s,ez:()=>a,lM:()=>l,qK:()=>f});var r=n(34275);function o(t){return 32+t.length}const s=16;function l(t){if(!t)return 0;let e=f;for(const n in t)t.hasOwnProperty(n)&&(e+=i(t[n],!1));return e}function u(t){if(!t)return 0;if("number"==typeof t[0])return c(t);if(Array.isArray(t))return function(t){const e=t.length;if(0===e||"number"==typeof t[0])return h(t,8);let n=a;for(let r=0;r<e;r++)n+=i(t[r]);return n}(t);let e=f;for(const n in t)t.hasOwnProperty(n)&&(e+=i(t[n]));return e}function i(t,e=!0){switch(typeof t){case"object":return e?u(t):f;case"string":return o(t);case"number":return s;case"boolean":return 4;default:return 8}}function c(...t){return t.reduce(((t,e)=>t+(e?(0,r.iu)(e)?e.byteLength+d:Array.isArray(e)?h(e,s):0:0)),0)}function h(t,e){return a+t.length*e}const f=32,a=16,d=145},90708:(t,e,n)=>{n.d(e,{B2:()=>T,BW:()=>v,Ch:()=>ut,DF:()=>P,Di:()=>B,E2:()=>W,IE:()=>w,Nl:()=>nt,Q4:()=>it,Rk:()=>ht,Ux:()=>J,Ye:()=>C,ZF:()=>H,eU:()=>U,eY:()=>tt,hK:()=>at,jH:()=>et,jQ:()=>lt,kz:()=>rt,oN:()=>$,q3:()=>X,qK:()=>_,qN:()=>S,z5:()=>z,zv:()=>D});var r=n(49186),o=n(53966),s=n(97768),l=n(70328),u=n(19419),i=n(65864),c=n(43334),h=n(58512),f=n(92722),a=n(54339);function d(t,e){return t?e?4:3:e?3:2}const g=()=>o.A.getLogger("esri.layers.graphics.featureConversionUtils"),m={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},y=(t,e,n,r,o,s)=>{t[n]=o,t[n+1]=s},p=(t,e,n,r,o,s)=>{t[n]=o,t[n+1]=s,t[n+2]=e[r+2]},I=(t,e,n,r,o,s)=>{t[n]=o,t[n+1]=s,t[n+2]=e[r+3]},N=(t,e,n,r,o,s)=>{t[n]=o,t[n+1]=s,t[n+2]=e[r+2],t[n+3]=e[r+3]};function b(t,e,n,r){if(t){if(n)return e&&r?N:p;if(e&&r)return I}else if(e&&r)return p;return y}function w({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function T({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function M({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function G({scale:t,translate:e},n){return Math.round((n-e[1])/t[1])}function A({scale:t,translate:e},n,r){return n*t[r]+e[r]}function P(t,e,n){return t?e?n?k(t):Z(t):n?O(t):F(t):null}function F(t){const e=t.coords;return{x:e[0],y:e[1]}}function E(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function Z(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function x(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function O(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function q(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function k(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function Y(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function V(t,e){return t&&e?Y:t?x:e?q:E}function S(t,e,n=V(null!=e.z,null!=e.m)){return n(t,e)}function _(t,e,n){if(null==t)return null;const r=d(e,n),o=[];for(let e=0;e<t.coords.length;e+=r){const n=[];for(let o=0;o<r;o++)n.push(t.coords[e+o]);o.push(n)}return e?n?{points:o,hasZ:e,hasM:n}:{points:o,hasZ:e}:n?{points:o,hasM:n}:{points:o}}function R(t,e,n=d(e.hasZ,e.hasM)){t.lengths[0]=e.points.length;const r=t.coords;let o=0;for(const t of e.points)for(let e=0;e<n;e++)r[o++]=t[e];return t}function v(t,e,n){if(!t)return null;const r=d(e,n),{coords:o,lengths:s}=t,l=[];let u=0;for(const t of s){const e=[];for(let n=0;n<t;n++){const t=[];for(let e=0;e<r;e++)t.push(o[u++]);e.push(t)}l.push(e)}return e?n?{paths:l,hasZ:e,hasM:n}:{paths:l,hasZ:e}:n?{paths:l,hasM:n}:{paths:l}}function L(t,e,n=d(e.hasZ,e.hasM)){const{lengths:r,coords:o}=t;let s=0;for(const t of e.paths){for(const e of t)for(let t=0;t<n;t++)o[s++]=e[t];r.push(t.length)}return t}function z(t,e,n){if(!t)return null;const r=d(e,n),{coords:o,lengths:s}=t,l=[];let u=0;for(const t of s){const e=[];for(let n=0;n<t;n++){const t=[];for(let e=0;e<r;e++)t.push(o[u++]);e.push(t)}l.push(e)}return e?n?{rings:l,hasZ:e,hasM:n}:{rings:l,hasZ:e}:n?{rings:l,hasM:n}:{rings:l}}function C(t,e,n=e.hasZ,r=e.hasM){return U(t,e.rings,n,r)}function U(t,e,n,r){const o=d(n,r),{lengths:s,coords:l}=t;let u=0;dt(t);for(const t of e){for(const e of t)for(let t=0;t<o;t++)l[u++]=e[t];s.push(t.length)}return t}const j=[],Q=[];function W(t,e,n,r,o){j[0]=t;const[s]=B(Q,j,e,n,r,o);return gt(j),gt(Q),s}function B(t,e,n,o,s,l){if(gt(t),!n){for(const n of e){const e=(0,a.W)(n,l);t.push(new c.Om(null,n.attributes,null,e))}return t}switch(n){case"esriGeometryPoint":return function(t,e,n,r,o){const s=V(n,r);for(const n of e){const e=null!=n.geometry?s(new f.A,n.geometry):null;t.push(new c.Om(e,n.attributes,null,(0,a.W)(n,o)))}return t}(t,e,o,s,l);case"esriGeometryMultipoint":return function(t,e,n,r,o){const s=d(n,r);for(const n of e){const e=null!=n.geometry?R(new f.A,n.geometry,s):null;t.push(new c.Om(e,n.attributes,null,(0,a.W)(n,o)))}return t}(t,e,o,s,l);case"esriGeometryPolyline":return function(t,e,n,r,o){const s=d(n,r);for(const n of e){const e=null!=n.geometry?L(new f.A,n.geometry,s):null,r=null!=n.centroid?S(new f.A,n.centroid):null;t.push(new c.Om(e,n.attributes,r,(0,a.W)(n,o)))}return t}(t,e,o,s,l);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return function(t,e,n,r,o){for(const s of e){const e=null!=s.geometry?C(new f.A,s.geometry,n,r):null,l=(0,a.W)(s,o);null!=s.centroid?t.push(new c.Om(e,s.attributes,E(new f.A,s.centroid),l)):t.push(new c.Om(e,s.attributes,null,l))}return t}(t,e,o,s,l);default:g().error("convertToFeatureSet:unknown-geometry",new r.A("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),gt(t)}return t}function $(t,e,n,r){Q[0]=t,K(j,Q,e,n,r);const o=j[0];return gt(j),gt(Q),o}function J(t,e,n){if(null==t)return null;const o=new f.A;return"hasZ"in t&&null==e&&(e=t.hasZ),"hasM"in t&&null==n&&(n=t.hasM),(0,i.fT)(t)?V(null!=e?e:null!=t.z,null!=n?n:null!=t.m)(o,t):(0,i.Bi)(t)?C(o,t,e,n):(0,i.Rg)(t)?L(o,t,d(e,n)):(0,i.U9)(t)?R(o,t,d(e,n)):void g().error("convertFromGeometry:unknown-geometry",new r.A("internal:geometry",`Unable to parse unknown geometry type '${t}'`))}function D(t,e,n,o){const s=t&&("coords"in t?t:t.geometry);if(null==s)return null;switch(e){case"esriGeometryPoint":{let t=F;return n&&o?t=k:n?t=Z:o&&(t=O),t(s)}case"esriGeometryMultipoint":return _(s,n,o);case"esriGeometryPolyline":return v(s,n,o);case"esriGeometryPolygon":return z(s,n,o);default:return g().error("convertToGeometry:unknown-geometry",new r.A("internal:geometry",`Unable to parse unknown geometry type '${e}'`)),null}}function K(t,e,n,o,s){if(gt(t),null==n)return function(t,e){for(const n of e)t.push({attributes:n.attributes});return t}(t,e);switch(n){case"esriGeometryPoint":return function(t,e,n,r){let o=F;n&&r?o=k:n?o=Z:r&&(o=O);for(const n of e){const{geometry:e,attributes:r}=n,s=null!=e?o(e):null;t.push({attributes:r,geometry:s})}return t}(t,e,o,s);case"esriGeometryMultipoint":return function(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:null!=o?_(o,n,r):null});return t}(t,e,o,s);case"esriGeometryPolyline":return function(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:null!=o?v(o,n,r):null});return t}(t,e,o,s);case"esriGeometryPolygon":return function(t,e,n,r){for(const{geometry:o,attributes:s,centroid:l}of e){const e=null!=o?z(o,n,r):null;if(null!=l){const n=F(l);t.push({attributes:s,centroid:n,geometry:e})}else t.push({attributes:s,geometry:e})}return t}(t,e,o,s);default:g().error("convertToFeatureSet:unknown-geometry",new r.A("internal:geometry",`Unable to parse unknown geometry type '${n}'`))}return t}function H(t){const{spatialReference:e,transform:n,fields:r,hasM:o,hasZ:s,features:l,geometryType:u,exceededTransferLimit:i,queryGeometry:c,queryGeometryType:h}=t,f={features:K([],l,u,s,o),fields:r,geometryType:u,spatialReference:e,queryGeometry:D(c,h,!1,!1)};return n&&(f.transform=n),i&&(f.exceededTransferLimit=i),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const n=new h.A,{hasM:r,hasZ:o,features:s,spatialReference:l,geometryType:u,exceededTransferLimit:i,transform:c,fields:f}=t;return f&&(n.fields=f),n.geometryType=u??null,n.spatialReference=l??null,s&&B(n.features,s,u,o,r,e),i&&(n.exceededTransferLimit=i),r&&(n.hasM=r),o&&(n.hasZ=o),c&&(n.transform=c),n}function tt(t){const{transform:e,features:n,hasM:r,hasZ:o}=t;if(!e)return t;for(const t of n)null!=t.geometry&&ut(t.geometry,t.geometry,r,o,e),null!=t.centroid&&ut(t.centroid,t.centroid,r,o,e);return t.transform=null,t}function et(t,e){const{geometryType:n,features:r,hasM:o,hasZ:s}=e;if(!t)return e;for(let e=0;e<r.length;e++){const l=r[e],u=l.weakClone();u.geometry=new f.A,nt(u.geometry,l.geometry,o,s,n,t),l.centroid&&(u.centroid=new f.A,nt(u.centroid,l.centroid,o,s,"esriGeometryPoint",t)),r[e]=u}return e.transform=t,e}function nt(t,e,n,r,o,s,l=n,u=r){if(dt(t),!e?.coords.length)return null;const i=m[o],{coords:c,lengths:h}=e,f=d(n,r),a=d(n&&l,r&&u),g=b(n,r,l,u);if(!h.length)return g(t.coords,c,0,0,w(s,c[0]),T(s,c[1])),dt(t,f,0),t;let y,p,I,N,M=0,G=0,A=G;for(const e of h){if(e<i)continue;let n=0;G=A,I=y=w(s,c[M]),N=p=T(s,c[M+1]),g(t.coords,c,G,M,I,N),n++,M+=f,G+=a;for(let r=1;r<e;r++,M+=f)I=w(s,c[M]),N=T(s,c[M+1]),I===y&&N===p||(g(t.coords,c,G,M,I-y,N-p),G+=a,n++,y=I,p=N);n>=i&&(t.lengths.push(n),A=G)}return gt(t.coords,A),t.coords.length?t:null}function rt(t,e,n,r,o,s,l=n,u=r){if(dt(t),!e?.coords.length)return null;const i=m[o],{coords:c,lengths:h}=e,f=d(n,r),a=d(n&&l,r&&u),g=b(n,r,l,u);if(!h.length)return g(t.coords,c,0,0,c[0],c[1]),dt(t,f,0),t;let y=0;const p=s*s;for(const e of h){if(e<i){y+=e*f;continue}const n=t.coords.length/a,r=y,o=y+(e-1)*f;g(t.coords,c,t.coords.length,r,c[r],c[r+1]),st(t.coords,c,f,p,g,r,o),g(t.coords,c,t.coords.length,o,c[o],c[o+1]);const s=t.coords.length/a-n;s>=i?t.lengths.push(s):gt(t.coords,n*a),y+=e*f}return t.coords.length?t:null}function ot(t,e,n,r){const o=t[e],s=t[e+1],l=t[n],u=t[n+1],i=t[r],c=t[r+1];let h=l,f=u,a=i-h,d=c-f;if(0!==a||0!==d){const t=((o-h)*a+(s-f)*d)/(a*a+d*d);t>1?(h=i,f=c):t>0&&(h+=a*t,f+=d*t)}return a=o-h,d=s-f,a*a+d*d}function st(t,e,n,r,o,s,l){let u,i=r,c=0;for(let t=s+n;t<l;t+=n)u=ot(e,t,s,l),u>i&&(c=t,i=u);i>r&&(c-s>n&&st(t,e,n,r,o,s,c),o(t,e,t.length,c,e[c],e[c+1]),l-c>n&&st(t,e,n,r,o,c,l))}function lt(t,e,n,r){if(!e?.coords?.length)return null;const o=d(n,r);let s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if(e&&e.coords){const t=e.coords;for(let e=0;e<t.length;e+=o){const n=t[e],r=t[e+1];s=Math.min(s,n),c=Math.max(c,n),i=Math.min(i,r),h=Math.max(h,r)}}return(0,l.is)(t)?(0,l.BI)(t,s,i,c,h):(0,u.fA)(s,i,c,h,t),t}function ut(t,e,n,r,o){const{coords:l,lengths:u}=e,i=d(n,r);if(!l.length)return t!==e&&dt(t),t;(0,s.Lw)(o);const{originPosition:c,scale:h,translate:f}=o,a=mt;a.originPosition=c;const g=a.scale;g[0]=h[0]??1,g[1]=-(h[1]??1),g[2]=h[2]??1,g[3]=h[3]??1;const m=a.translate;if(m[0]=f[0]??0,m[1]=f[1]??0,m[2]=f[2]??0,m[3]=f[3]??0,!u.length){for(let e=0;e<i;++e)t.coords[e]=A(a,l[e],e);return t!==e&&dt(t,i,0),t}let y=0;for(let e=0;e<u.length;e++){const n=u[e];t.lengths[e]=n;for(let e=0;e<i;++e)t.coords[y+e]=A(a,l[y+e],e);let r=t.coords[y],o=t.coords[y+1];y+=i;for(let e=1;e<n;e++,y+=i){r+=l[y]*g[0],o+=l[y+1]*g[1],t.coords[y]=r,t.coords[y+1]=o;for(let e=2;e<i;++e)t.coords[y+e]=A(a,l[y+e],e)}}return t!==e&&dt(t,l.length,u.length),t}function it(t,e,n,r,o,s){if(dt(t),t.lengths.push(...e.lengths),n===o&&r===s)for(let n=0;n<e.coords.length;n++)t.coords.push(e.coords[n]);else{const l=d(n,r),u=b(n,r,o,s),i=e.coords;for(let e=0;e<i.length;e+=l)u(t.coords,i,t.coords.length,e,i[e],i[e+1])}return t}function ct(t,e,n,r){let o=0,s=t[r*e],l=t[r*(e+1)];for(let u=1;u<n;u++){const n=s+t[r*(e+u)],i=l+t[r*(e+u)+1],c=(n-s)*(i+l);s=n,l=i,o+=c}return.5*o}function ht(t,e){const{coords:n,lengths:r}=t;let o=0,s=0;for(let t=0;t<r.length;t++){const l=r[t];s+=ct(n,o,l,e),o+=l}return Math.abs(s)}function ft(t,e,n,r){return 0===t*r-n*e&&t*n+e*r>0}function at(t,e,n,r,o){const s=d(r,o);if(!t.lengths.length){if(t.coords.length<2)return null;const[n,r]=t.coords,o=M(e,n),s=G(e,r);return new f.A([],[o,s])}const l=new f.A([],[0,0]),u=m[n],i="esriGeometryPolygon"===n||"esriGeometryPolyline"===n;let c=0,h=0;for(let n=0;n<t.lengths.length;n++){const r=t.lengths[n],o=h;let f=M(e,t.coords[s*c]),a=G(e,t.coords[s*c+1]);l.coords[h++]=f,l.coords[h++]=a;let d=0,g=0,m=1;for(let n=1;n<r;n++){const r=M(e,t.coords[s*(n+c)]),o=G(e,t.coords[s*(n+c)+1]);if(r!==f||o!==a){const t=r-f,e=o-a;i&&ft(d,g,t,e)?(l.coords[h-2]+=t,l.coords[h-1]+=e,f+=t,a+=e):(l.coords[h++]=r,l.coords[h++]=o,f=r,a=o,d=t,g=e,m+=1)}}m<u?h=o:l.lengths.push(m),c+=r}return 0===l.lengths.length?null:l}function dt(t,e=0,n=0){gt(t.lengths,n),gt(t.coords,e)}function gt(t,e=0){t.length!==e&&(t.length=e)}const mt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},92722:(t,e,n)=>{n.d(e,{A:()=>o});var r=n(69397);class o{constructor(t=[],e=[]){this.lengths=t??[],this.coords=e??[]}static fromJSON(t){return new o(t.lengths,t.coords)}static fromRect(t){const[e,n,r,s]=t,l=r-e,u=s-n;return new o([5],[e,n,l,0,0,u,-l,0,0,-u])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((t,e)=>t+e))}get usedMemory(){return 64+(0,r.Qf)(this.lengths,this.coords)}area(){let t=0,e=0;if(!this.lengths.length)return 0;for(let n=0;n<this.lengths.length;n++){const r=this.lengths[n];if(r<3)continue;let o=this.coords[2*e],s=this.coords[2*e+1];for(let n=1;n<r;n+=1){const r=this.coords[2*(n+e)],l=this.coords[2*(n+e)+1];t+=-.5*(r-o)*(l+s),o=r,s=l}e+=r}return t}forEachVertex(t){let e=0;this.lengths.length||t(this.coords[0],this.coords[1]);for(let n=0;n<this.lengths.length;n++){const r=this.lengths[n];for(let n=0;n<r;n++)t(this.coords[2*(n+e)],this.coords[2*(n+e)+1]);e+=r}}deltaDecode(){const t=this.clone(),{coords:e,lengths:n}=t;let r=0;for(const t of n){for(let n=1;n<t;n++)e[2*(r+n)]+=e[2*(r+n)-2],e[2*(r+n)+1]+=e[2*(r+n)-1];r+=t}return t}clone(t){if(0===this.lengths.length)return new o([],[this.coords[0],this.coords[1]]);const e=2*(0===this.lengths.length?1:this.lengths.reduce(((t,e)=>t+e))),n=this.coords.slice(0,e);return t?(t.set(n),new o(this.lengths,t)):new o(Array.from(this.lengths),Array.from(n))}}}}]);