UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 14.8 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7984],{68197:(e,t,r)=>{r.d(t,{A:()=>d});var o,s,i=r(40876),n=r(34727),l=r(56507);function a(e){return(0,n.qE)((0,l.Vr)(e),0,255)}function p(e,t,r){return e=Number(e),isNaN(e)?r:e<t?t:e>r?r:e}function u(e,t){const r=e.toString(16).padStart(2,"0");return t?r.slice(0,1):r}class d{static blendColors(e,t,r,o=new d){return o.r=Math.round(e.r+(t.r-e.r)*r),o.g=Math.round(e.g+(t.g-e.g)*r),o.b=Math.round(e.b+(t.b-e.b)*r),o.a=e.a+(t.a-e.a)*r,o._sanitize()}static fromRgb(e,t){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s.\-,%0-9]+)\)/);if(r){const e=r[2].split(/\s*,\s*/),o=r[1];if("rgb"===o&&3===e.length||"rgba"===o&&4===e.length){const r=e[0];if("%"===r.charAt(r.length-1)){const r=e.map((e=>2.56*parseFloat(e)));return 4===e.length&&(r[3]=parseFloat(e[3])),d.fromArray(r,t)}return d.fromArray(e.map((e=>parseFloat(e))),t)}if("hsl"===o&&3===e.length||"hsla"===o&&4===e.length)return d.fromArray((0,i.z$)(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3])),t)}return null}static fromHex(e,t=new d){if("#"!==e[0]||isNaN(Number(`0x${e.slice(1)}`)))return null;switch(e.length){case 4:case 5:{const r=parseInt(e.slice(1,2),16),o=parseInt(e.slice(2,3),16),s=parseInt(e.slice(3,4),16),i=5===e.length?15:parseInt(e.slice(4),16);return d.fromArray([r+16*r,o+16*o,s+16*s,(i+16*i)/255],t)}case 7:case 9:{const r=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16),i=7===e.length?255:parseInt(e.slice(7),16);return d.fromArray([r,o,s,i/255],t)}default:return null}}static fromArray(e,t=new d){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=(0,i.V6)(e)?(0,i.TS)(e):null;return r&&d.fromArray(r,t)||d.fromRgb(e,t)||d.fromHex(e,t)}static fromJSON(e){return null!=e?new d([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return null!=e?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return null!=e?[e.r/255,e.g/255,e.b/255,null!=e.a?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return"string"==typeof e?d.fromString(e,this):Array.isArray(e)?d.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof d||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,r=e?.digits??6,o=3===r||4===r,s=4===r||8===r,i=`#${u(this.r,o)}${u(this.g,o)}${u(this.b,o)}${s?u(Math.round(255*this.a),o):""}`;return t?i.toUpperCase():i}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=d.AlphaMode.ALWAYS){const t=a(this.r),r=a(this.g),o=a(this.b);return e===d.AlphaMode.ALWAYS||1!==this.a?[t,r,o,a(255*this.a)]:[t,r,o]}clone(){return new d(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return null!=e&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(p(this.r,0,255)),this.g=Math.round(p(this.g,0,255)),this.b=Math.round(p(this.b,0,255)),this.a=p(this.a,0,1),this}_set(e,t,r,o){this.r=e,this.g=t,this.b=r,this.a=o}}d.prototype.declaredClass="esri.Color",(s=(o=d).AlphaMode||(o.AlphaMode={}))[s.ALWAYS=0]="ALWAYS",s[s.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"},69540:(e,t,r)=>{r.d(t,{A:()=>c});var o=r(90237),s=r(69622),i=(r(44208),r(4718)),n=(r(53966),r(97768)),l=r(35666),a=r(88620),p=r(40608);const u=e=>{let t=class extends e{clone(){const e=(0,a.oY)(this);(0,n.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,r=e.store,o={},s=new Map;for(const e in t){const n=t[e],a=r?.originOf(e),p=n.clonable;if(n.readOnly||!1===p||a!==l.Gr.USER&&a!==l.Gr.DEFAULTS&&a!==l.Gr.WEB_MAP&&a!==l.Gr.WEB_SCENE)continue;const u=this[e];let d=null;d="function"==typeof p?p(u):"reference"===p?u:(0,i.TU)(u),null!=u&&null==d||(a===l.Gr.DEFAULTS?s.set(e,d):o[e]=d)}const p=new(0,Object.getPrototypeOf(this).constructor)(o);if(s.size){const e=(0,a.oY)(p)?.store;if(e)for(const[t,r]of s)e.set(t,r,l.Gr.DEFAULTS)}return p}};return t=(0,o._)([(0,p.$)("esri.core.Clonable")],t),t};let d=class extends(u(s.A)){};d=(0,o._)([(0,p.$)("esri.core.Clonable")],d),(d||(d={})).ClonableMixin=u;const c=d},63531:(e,t,r)=>{r.d(t,{A:()=>g});var o,s=r(90237),i=r(4718),n=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),p=r(51857),u=r(20061),d=r(68197),c=r(25482),h=r(56507);let y=o=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new o({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:(0,i.o8)(this.color)})}};(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue",isRequired:!0}}})],y.prototype,"minValue",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue",isRequired:!0}}})],y.prototype,"maxValue",void 0),(0,s._)([(0,n.MZ)({type:d.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=o=(0,s._)([(0,a.$)("esri.renderers.support.pointCloud.ColorClassBreakInfo")],y);const f=y;var b;let m=b=class extends p.A{constructor(e){super(e),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new b({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:(0,i.o8)(this.colorClassBreakInfos),legendOptions:(0,i.o8)(this.legendOptions)})}};(0,s._)([(0,l.e)({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],m.prototype,"type",void 0),(0,s._)([(0,n.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s._)([(0,n.MZ)({type:u.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),(0,s._)([(0,n.MZ)({type:p.A.fieldTransformTypeKebabDict.apiValues,json:{type:p.A.fieldTransformTypeKebabDict.jsonValues,read:p.A.fieldTransformTypeKebabDict.read,write:p.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s._)([(0,n.MZ)({type:[f],json:{write:{isRequired:!0}}})],m.prototype,"colorClassBreakInfos",void 0),m=b=(0,s._)([(0,a.$)("esri.renderers.PointCloudClassBreaksRenderer")],m);const g=m},51857:(e,t,r)=>{r.d(t,{A:()=>S});var o,s=r(90237),i=r(66552),n=r(25482),l=r(4718),a=r(10107),p=(r(44208),r(53966),r(40608));r(87811);let u=o=class extends n.A{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new o({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};(0,s._)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"field",void 0),(0,s._)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],u.prototype,"minValue",void 0),(0,s._)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],u.prototype,"maxValue",void 0),u=o=(0,s._)([(0,p.$)("esri.renderers.support.pointCloud.ColorModulation")],u);const d=u,c=new i.J({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let h=class extends n.A{};(0,s._)([(0,a.MZ)({type:c.apiValues,readOnly:!0,nonNullable:!0,json:{type:c.jsonValues,read:!1,write:{writer:c.write,isRequired:!0}}})],h.prototype,"type",void 0),h=(0,s._)([(0,p.$)("esri.renderers.support.pointCloud.PointSizeAlgorithm")],h);const y=h;var f,b=r(93223);let m=f=class extends y{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new f({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};(0,s._)([(0,b.e)({pointCloudFixedSizeAlgorithm:"fixed-size"})],m.prototype,"type",void 0),(0,s._)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],m.prototype,"size",void 0),(0,s._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"useRealWorldSymbolSizes",void 0),m=f=(0,s._)([(0,p.$)("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],m);const g=m;var A;let v=A=class extends y{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new A({scaleFactor:this.scaleFactor})}};(0,s._)([(0,b.e)({pointCloudSplatAlgorithm:"splat"})],v.prototype,"type",void 0),(0,s._)([(0,a.MZ)({type:Number,value:1,nonNullable:!0,json:{write:{isRequired:!0}}})],v.prototype,"scaleFactor",void 0),v=A=(0,s._)([(0,p.$)("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],v);const w={key:"type",base:y,typeMap:{"fixed-size":g,splat:v}},_=(0,i.O)()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let M=class extends n.A{constructor(e){super(e),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:(0,l.o8)(this.pointSizeAlgorithm),colorModulation:(0,l.o8)(this.colorModulation),pointsPerInch:(0,l.o8)(this.pointsPerInch)}}};(0,s._)([(0,a.MZ)({type:_.apiValues,readOnly:!0,nonNullable:!0,json:{type:_.jsonValues,read:!1,write:{writer:_.write,isRequired:!0}}})],M.prototype,"type",void 0),(0,s._)([(0,a.MZ)({types:w,json:{write:!0}})],M.prototype,"pointSizeAlgorithm",void 0),(0,s._)([(0,a.MZ)({type:d,json:{write:!0}})],M.prototype,"colorModulation",void 0),(0,s._)([(0,a.MZ)({json:{write:!0},nonNullable:!0,type:Number})],M.prototype,"pointsPerInch",void 0),M=(0,s._)([(0,p.$)("esri.renderers.PointCloudRenderer")],M),(M||(M={})).fieldTransformTypeKebabDict=new i.J({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"});const S=M},69846:(e,t,r)=>{r.d(t,{A:()=>h});var o,s=r(90237),i=r(4718),n=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),p=r(51857),u=r(20061),d=r(72500);let c=o=class extends p.A{constructor(e){super(e),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new o({...this.cloneProperties(),field:(0,i.o8)(this.field),fieldTransformType:(0,i.o8)(this.fieldTransformType),stops:(0,i.o8)(this.stops),legendOptions:(0,i.o8)(this.legendOptions)})}};(0,s._)([(0,l.e)({pointCloudStretchRenderer:"point-cloud-stretch"})],c.prototype,"type",void 0),(0,s._)([(0,n.MZ)({json:{write:{isRequired:!0}},type:String})],c.prototype,"field",void 0),(0,s._)([(0,n.MZ)({type:u.A,json:{write:!0}})],c.prototype,"legendOptions",void 0),(0,s._)([(0,n.MZ)({type:p.A.fieldTransformTypeKebabDict.apiValues,json:{type:p.A.fieldTransformTypeKebabDict.jsonValues,read:p.A.fieldTransformTypeKebabDict.read,write:p.A.fieldTransformTypeKebabDict.write}})],c.prototype,"fieldTransformType",void 0),(0,s._)([(0,n.MZ)({type:[d.A],json:{write:{isRequired:!0}}})],c.prototype,"stops",void 0),c=o=(0,s._)([(0,a.$)("esri.renderers.PointCloudStretchRenderer")],c);const h=c},48425:(e,t,r)=>{r.d(t,{A:()=>g});var o,s=r(90237),i=r(4718),n=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),p=r(51857),u=r(20061),d=r(68197),c=r(25482),h=r(56507);let y=o=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new o({description:this.description,label:this.label,values:(0,i.o8)(this.values),color:(0,i.o8)(this.color)})}};(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s._)([(0,n.MZ)({type:[String],json:{write:{isRequired:!0}}})],y.prototype,"values",void 0),(0,s._)([(0,n.MZ)({type:d.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=o=(0,s._)([(0,a.$)("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],y);const f=y;var b;let m=b=class extends p.A{constructor(e){super(e),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new b({...this.cloneProperties(),field:(0,i.o8)(this.field),fieldTransformType:(0,i.o8)(this.fieldTransformType),colorUniqueValueInfos:(0,i.o8)(this.colorUniqueValueInfos),legendOptions:(0,i.o8)(this.legendOptions)})}};(0,s._)([(0,l.e)({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],m.prototype,"type",void 0),(0,s._)([(0,n.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s._)([(0,n.MZ)({type:p.A.fieldTransformTypeKebabDict.apiValues,json:{type:p.A.fieldTransformTypeKebabDict.jsonValues,read:p.A.fieldTransformTypeKebabDict.read,write:p.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s._)([(0,n.MZ)({type:[f],json:{write:{isRequired:!0}}})],m.prototype,"colorUniqueValueInfos",void 0),(0,s._)([(0,n.MZ)({type:u.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),m=b=(0,s._)([(0,a.$)("esri.renderers.PointCloudUniqueValueRenderer")],m);const g=m},20061:(e,t,r)=>{r.d(t,{A:()=>y});var o,s=r(90237),i=r(69540),n=r(66552),l=r(25482),a=r(10107),p=r(56507),u=(r(44208),r(87811),r(93223)),d=r(40608);const c=(0,n.O)()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let h=o=class extends(i.A.ClonableMixin(l.A)){static from(e){return(0,p.PZ)(o,e)}constructor(e){super(e),this.title=null,this.order=null}};(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,s._)([(0,u.e)(c)],h.prototype,"order",void 0),h=o=(0,s._)([(0,d.$)("esri.renderers.support.RendererLegendOptions")],h);const y=h},72500:(e,t,r)=>{r.d(t,{A:()=>c});var o,s=r(90237),i=r(68197),n=r(25482),l=r(10107),a=r(56507),p=(r(44208),r(87811),r(40608)),u=r(43937);let d=o=class extends n.A{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,r){t[r]=e??0}clone(){return new o({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};(0,s._)([(0,l.MZ)({type:i.A,json:{type:[a.jz],write:{isRequired:!0}}})],d.prototype,"color",void 0),(0,s._)([(0,l.MZ)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,s._)([(0,l.MZ)({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],d.prototype,"value",void 0),(0,s._)([(0,u.K)("value")],d.prototype,"writeValue",null),d=o=(0,s._)([(0,p.$)("esri.renderers.visualVariables.support.ColorStop")],d);const c=d}}]);