12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216 |
- import {
- T
- } from "./chunk-L553EHL3.js";
- import {
- a,
- f,
- l as l2
- } from "./chunk-2GP5D74I.js";
- import {
- s
- } from "./chunk-R24MO4IV.js";
- import {
- b
- } from "./chunk-YQBYWPBD.js";
- import {
- X
- } from "./chunk-XO5VJRK4.js";
- import {
- t as t2
- } from "./chunk-4OM3EX6P.js";
- import {
- C
- } from "./chunk-3OFVLRSL.js";
- import {
- e
- } from "./chunk-5FHRTN6L.js";
- import {
- p,
- v,
- z
- } from "./chunk-NDUYF7XW.js";
- import {
- l
- } from "./chunk-X4SA4ELJ.js";
- import {
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/MemoryBuffer.js
- var t3 = class {
- constructor(t7) {
- this._array = [], t7 <= 0 && console.error("strideInBytes must be positive!"), this._stride = t7;
- }
- get array() {
- return this._array;
- }
- get index() {
- return 4 * this._array.length / this._stride;
- }
- get itemSize() {
- return this._stride;
- }
- get sizeInBytes() {
- return 4 * this._array.length;
- }
- reset() {
- this.array.length = 0;
- }
- toBuffer() {
- return new Uint32Array(this._array).buffer;
- }
- static i1616to32(t7, r2) {
- return 65535 & t7 | r2 << 16;
- }
- static i8888to32(t7, r2, e3, s2) {
- return 255 & t7 | (255 & r2) << 8 | (255 & e3) << 16 | s2 << 24;
- }
- static i8816to32(t7, r2, e3) {
- return 255 & t7 | (255 & r2) << 8 | e3 << 16;
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/enums.js
- var N;
- var R;
- !function(N3) {
- N3[N3.R8_SIGNED = 0] = "R8_SIGNED", N3[N3.R8_UNSIGNED = 1] = "R8_UNSIGNED", N3[N3.R16_SIGNED = 2] = "R16_SIGNED", N3[N3.R16_UNSIGNED = 3] = "R16_UNSIGNED", N3[N3.R8G8_SIGNED = 4] = "R8G8_SIGNED", N3[N3.R8G8_UNSIGNED = 5] = "R8G8_UNSIGNED", N3[N3.R16G16_SIGNED = 6] = "R16G16_SIGNED", N3[N3.R16G16_UNSIGNED = 7] = "R16G16_UNSIGNED", N3[N3.R8G8B8A8_SIGNED = 8] = "R8G8B8A8_SIGNED", N3[N3.R8G8B8A8_UNSIGNED = 9] = "R8G8B8A8_UNSIGNED", N3[N3.R8G8B8A8_COLOR = 10] = "R8G8B8A8_COLOR", N3[N3.R16G16B16A16_DASHARRAY = 11] = "R16G16B16A16_DASHARRAY", N3[N3.R16G16B16A16_PATTERN = 12] = "R16G16B16A16_PATTERN";
- }(N || (N = {})), function(N3) {
- N3[N3.UNIFORM = 0] = "UNIFORM", N3[N3.DATA_DRIVEN = 1] = "DATA_DRIVEN", N3[N3.INTERPOLATED_DATA_DRIVEN = 2] = "INTERPOLATED_DATA_DRIVEN", N3[N3.UNUSED = 3] = "UNUSED";
- }(R || (R = {}));
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterial.js
- var i = class {
- constructor(t7) {
- this._locations = /* @__PURE__ */ new Map(), this._key = t7;
- }
- get key() {
- return this._key;
- }
- get type() {
- return 7 & this._key;
- }
- defines() {
- return [];
- }
- getStride() {
- return this._layoutInfo || this._buildAttributesInfo(), this._stride;
- }
- getAttributeLocations() {
- return 0 === this._locations.size && this._buildAttributesInfo(), this._locations;
- }
- getLayoutInfo() {
- return this._layoutInfo || this._buildAttributesInfo(), this._layoutInfo;
- }
- getEncodingInfos() {
- return this._propertyEncodingInfo || this._buildAttributesInfo(), this._propertyEncodingInfo;
- }
- getUniforms() {
- return this._uniforms || this._buildAttributesInfo(), this._uniforms;
- }
- getShaderHeader() {
- return this._shaderHeader || this._buildAttributesInfo(), this._shaderHeader;
- }
- getShaderMain() {
- return this._shaderMain || this._buildAttributesInfo(), this._shaderMain;
- }
- setDataUniforms(t7, e3, n2, o2, s2) {
- const r2 = this.getUniforms();
- for (const i5 of r2) {
- const { name: r3, type: a5, getValue: c5 } = i5, u2 = c5(n2, e3, o2, s2);
- if (null !== u2)
- switch (a5) {
- case "float":
- t7.setUniform1f(r3, u2);
- break;
- case "vec2":
- t7.setUniform2fv(r3, u2);
- break;
- case "vec4":
- t7.setUniform4fv(r3, u2);
- }
- }
- }
- encodeAttributes(t7, e3, o2, s2) {
- var _a;
- const r2 = this.attributesInfo(), i5 = this.getEncodingInfos(), a5 = [];
- let c5 = 0, u2 = 0;
- for (const f4 of Object.keys(i5)) {
- const _3 = i5[f4], { type: h2, precisionFactor: d4, isLayout: l6 } = r2[f4], y2 = l6 ? o2.getLayoutProperty(f4) : o2.getPaintProperty(f4), m2 = (_a = y2.interpolator) == null ? void 0 : _a.getInterpolationRange(e3);
- let I2 = 0;
- for (const o3 of _3) {
- const { offset: r3, bufferElementsToAdd: i6 } = o3;
- if (i6 > 0) {
- for (let t8 = 0; t8 < i6; t8++)
- a5.push(0);
- c5 += u2, u2 = o3.bufferElementsToAdd;
- }
- const f5 = s2 != null ? s2 : y2.getValue(m2 ? m2[I2] : e3, t7);
- switch (h2) {
- case N.R8_SIGNED:
- case N.R8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3);
- break;
- case N.R16_SIGNED:
- case N.R16_UNSIGNED:
- a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3);
- break;
- case N.R8G8_SIGNED:
- case N.R8G8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8);
- break;
- case N.R16G16_SIGNED:
- case N.R16G16_UNSIGNED:
- a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3 + 16);
- break;
- case N.R8G8B8A8_SIGNED:
- case N.R8G8B8A8_UNSIGNED:
- a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 16), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 24);
- break;
- case N.R8G8B8A8_COLOR:
- a5[c5] = this._encodeColor(f5);
- break;
- case N.R16G16B16A16_DASHARRAY:
- case N.R16G16B16A16_PATTERN:
- this._encodePattern(c5, a5, f5);
- break;
- default:
- throw new Error("Unsupported encoding type");
- }
- I2++;
- }
- }
- return a5;
- }
- getAtributeState(t7) {
- let e3 = 0;
- const n2 = 3 + 2 * t7;
- return e3 |= this._bit(n2), e3 |= this._bit(n2 + 1) << 1, e3;
- }
- _buildAttributesInfo() {
- const t7 = [], e3 = {}, n2 = {};
- let r2 = -1;
- const a5 = this.attributesInfo(), c5 = this.attributes();
- let u2 = -1;
- for (const s2 of c5) {
- u2++;
- const c6 = this.getAtributeState(u2);
- if (c6 === R.UNIFORM || c6 === R.UNUSED)
- continue;
- const f5 = a5[s2], _4 = [];
- e3[s2] = _4;
- const h3 = f5.type;
- for (let e4 = 0; e4 < c6; e4++) {
- const { dataType: e5, bytesPerElement: o2, count: s3, normalized: a6 } = i._encodingInfo[h3], c7 = o2 * s3, u3 = `${e5}-${true === a6}`;
- let f6 = n2[u3], d4 = 0;
- if (!f6 || f6.count + s3 > 4)
- r2++, f6 = { dataIndex: r2, count: 0, offset: 0 }, 4 !== s3 && (n2[u3] = f6), t7.push({ location: -1, name: "a_data_" + r2, count: s3, type: e5, normalized: a6 }), d4 = Math.ceil(Math.max(c7 / 4, 1));
- else {
- const e6 = t7[f6.dataIndex];
- e6.count += s3;
- d4 = Math.ceil(Math.max(e6.count * o2 / 4, 1)) - Math.ceil(Math.max(f6.offset / 4, 1));
- }
- _4.push({ dataIndex: f6.dataIndex, offset: f6.offset, bufferElementsToAdd: d4 }), f6.offset += c7, f6.count += s3;
- }
- }
- for (const o2 of t7)
- switch (o2.type) {
- case C.BYTE:
- case C.UNSIGNED_BYTE:
- o2.count = 4;
- break;
- case C.SHORT:
- case C.UNSIGNED_SHORT:
- o2.count += o2.count % 2;
- }
- this._buildVertexBufferLayout(t7);
- let f4 = 0;
- const _3 = this._layoutInfo.geometry;
- for (const o2 of _3)
- this._locations.set(o2.name, f4++);
- const h2 = this._layoutInfo.opacity;
- if (h2)
- for (const o2 of h2)
- this._locations.set(o2.name, f4++);
- this._buildShaderInfo(t7, e3), this._propertyEncodingInfo = e3;
- }
- _buildVertexBufferLayout(t7) {
- const e3 = {}, n2 = this.geometryInfo();
- let o2 = n2[0].stride;
- if (0 === t7.length)
- e3.geometry = n2;
- else {
- const s2 = [];
- let i5 = o2;
- for (const e4 of t7)
- o2 += a2(e4.type) * e4.count;
- for (const t8 of n2)
- s2.push(new t2(t8.name, t8.count, t8.type, t8.offset, o2, t8.normalized));
- for (const e4 of t7)
- s2.push(new t2(e4.name, e4.count, e4.type, i5, o2, e4.normalized)), i5 += a2(e4.type) * e4.count;
- e3.geometry = s2;
- }
- this.opacityInfo() && (e3.opacity = this.opacityInfo()), this._layoutInfo = e3, this._stride = o2;
- }
- _buildShaderInfo(e3, s2) {
- let r2 = "\n", a5 = "\n";
- const u2 = [];
- for (const t7 of e3)
- r2 += `attribute ${this._getType(t7.count)} ${t7.name};
- `;
- const f4 = this.attributes(), _3 = this.attributesInfo();
- let h2 = -1;
- for (const d4 of f4) {
- h2++;
- const { name: e4, type: f5, precisionFactor: l6, isLayout: y2 } = _3[d4], m2 = l6 && 1 !== l6 ? " * " + 1 / l6 : "", { bytesPerElement: I2, count: E2 } = i._encodingInfo[f5], p2 = (t7) => `a_data_${t7.dataIndex}${c(E2, t7.offset, I2)}`;
- switch (this.getAtributeState(h2)) {
- case R.UNIFORM:
- {
- const o2 = this._getType(E2), s3 = `u_${e4}`;
- u2.push({ name: s3, type: o2, getValue: (e5, o3, s4, r3) => {
- const i5 = y2 ? e5.getLayoutValue(d4, o3) : e5.getPaintValue(d4, o3);
- if (f5 === N.R16G16B16A16_DASHARRAY) {
- const n2 = e5.getDashKey(i5, e5.getLayoutValue("line-cap", o3)), s5 = r3.getMosaicItemPosition(n2, false);
- if (t(s5))
- return null;
- const { tl: a6, br: c5 } = s5;
- return [a6[0], c5[1], c5[0], a6[1]];
- }
- if (f5 === N.R16G16B16A16_PATTERN) {
- const e6 = r3.getMosaicItemPosition(i5, !d4.includes("line-"));
- if (t(e6))
- return null;
- const { tl: n2, br: o4 } = e6;
- return [n2[0], o4[1], o4[0], n2[1]];
- }
- if (f5 === N.R8G8B8A8_COLOR) {
- const t7 = i5[3];
- return [t7 * i5[0], t7 * i5[1], t7 * i5[2], t7];
- }
- return i5;
- } }), r2 += `uniform ${o2} ${s3};
- `, a5 += `${o2} ${e4} = ${s3};
- `;
- }
- break;
- case R.DATA_DRIVEN:
- {
- const t7 = p2(s2[d4][0]);
- a5 += `${this._getType(E2)} ${e4} = ${t7}${m2};
- `;
- }
- break;
- case R.INTERPOLATED_DATA_DRIVEN: {
- const t7 = `u_t_${e4}`;
- u2.push({ name: t7, type: "float", getValue: (t8, e5, n3, o3) => (y2 ? t8.getLayoutProperty(d4) : t8.getPaintProperty(d4)).interpolator.interpolationUniformValue(n3, e5) }), r2 += `uniform float ${t7};
- `;
- const n2 = p2(s2[d4][0]), o2 = p2(s2[d4][1]);
- a5 += `${this._getType(E2)} ${e4} = mix(${n2}${m2}, ${o2}${m2}, ${t7});
- `;
- }
- }
- }
- this._shaderHeader = r2, this._shaderMain = a5, this._uniforms = u2;
- }
- _bit(t7) {
- return (this._key & 1 << t7) >> t7;
- }
- _getType(t7) {
- switch (t7) {
- case 1:
- return "float";
- case 2:
- return "vec2";
- case 3:
- return "vec3";
- case 4:
- return "vec4";
- }
- throw new Error("Invalid count");
- }
- _encodeColor(t7) {
- const n2 = 255 * t7[3];
- return t3.i8888to32(t7[0] * n2, t7[1] * n2, t7[2] * n2, n2);
- }
- _encodePattern(t7, e3, n2) {
- if (!n2 || !n2.rect)
- return;
- const o2 = 2, s2 = n2.rect, r2 = n2.width, i5 = n2.height;
- e3[t7] = this._encodeShort(s2.x + o2, 0), e3[t7] |= this._encodeShort(s2.y + o2 + i5, 16), e3[t7 + 1] = this._encodeShort(s2.x + o2 + r2, 0), e3[t7 + 1] |= this._encodeShort(s2.y + o2, 16);
- }
- _encodeByte(t7, e3) {
- return (255 & t7) << e3;
- }
- _encodeShort(t7, e3) {
- return (65535 & t7) << e3;
- }
- };
- i._encodingInfo = { [N.R8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 1, normalized: false }, [N.R16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 1, normalized: false }, [N.R8G8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R8G8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 2, normalized: false }, [N.R16G16_SIGNED]: { dataType: C.SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R16G16_UNSIGNED]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 2, normalized: false }, [N.R8G8B8A8_SIGNED]: { dataType: C.BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_UNSIGNED]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: false }, [N.R8G8B8A8_COLOR]: { dataType: C.UNSIGNED_BYTE, bytesPerElement: 1, count: 4, normalized: true }, [N.R16G16B16A16_DASHARRAY]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false }, [N.R16G16B16A16_PATTERN]: { dataType: C.UNSIGNED_SHORT, bytesPerElement: 2, count: 4, normalized: false } };
- var a2 = (t7) => {
- switch (t7) {
- case C.FLOAT:
- case C.INT:
- case C.UNSIGNED_INT:
- return 4;
- case C.SHORT:
- case C.UNSIGNED_SHORT:
- return 2;
- case C.BYTE:
- case C.UNSIGNED_BYTE:
- return 1;
- }
- };
- var c = (t7, e3, n2) => {
- const o2 = e3 / n2;
- if (1 === t7)
- switch (o2) {
- case 0:
- return ".x";
- case 1:
- return ".y";
- case 2:
- return ".z";
- case 3:
- return ".w";
- }
- else if (2 === t7)
- switch (o2) {
- case 0:
- return ".xy";
- case 1:
- return ".yz";
- case 2:
- return ".zw";
- }
- else if (3 === t7)
- switch (o2) {
- case 0:
- return ".xyz";
- case 1:
- return ".yzw";
- }
- return "";
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js
- var T2 = class extends i {
- constructor(r2) {
- super(r2);
- }
- geometryInfo() {
- return T2.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return T2.ATTRIBUTES;
- }
- attributesInfo() {
- return T2.ATTRIBUTES_INFO;
- }
- };
- T2.ATTRIBUTES = [], T2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.BYTE, 0, 2)], T2.ATTRIBUTES_INFO = {};
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js
- var t4 = class extends i {
- constructor(r2) {
- super(r2);
- }
- geometryInfo() {
- return t4.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return t4.ATTRIBUTES;
- }
- attributesInfo() {
- return t4.ATTRIBUTES_INFO;
- }
- };
- t4.ATTRIBUTES = ["circle-radius", "circle-color", "circle-opacity", "circle-stroke-width", "circle-stroke-color", "circle-stroke-opacity", "circle-blur"], t4.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], t4.ATTRIBUTES_INFO = { "circle-radius": { name: "radius", type: N.R8_UNSIGNED }, "circle-color": { name: "color", type: N.R8G8B8A8_COLOR }, "circle-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-stroke-width": { name: "stroke_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "circle-stroke-color": { name: "stroke_color", type: N.R8G8B8A8_COLOR }, "circle-stroke-opacity": { name: "stroke_opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "circle-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 32 } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js
- var l3 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return l3.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return l3.ATTRIBUTES;
- }
- attributesInfo() {
- return l3.ATTRIBUTES_INFO;
- }
- };
- l3.ATTRIBUTES = ["fill-color", "fill-opacity", "fill-pattern"], l3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 4)], l3.ATTRIBUTES_INFO = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "fill-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true } };
- var T3 = class extends i {
- constructor(o2, t7) {
- super(o2), this._usefillColor = t7;
- }
- geometryInfo() {
- return T3.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return this._usefillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE;
- }
- attributesInfo() {
- return this._usefillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE;
- }
- };
- T3.ATTRIBUTES_OUTLINE = ["fill-outline-color", "fill-opacity"], T3.ATTRIBUTES_FILL = ["fill-color", "fill-opacity"], T3.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 8), new t2("a_offset", 2, C.BYTE, 4, 8), new t2("a_xnormal", 2, C.BYTE, 6, 8)], T3.ATTRIBUTES_INFO_OUTLINE = { "fill-outline-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } }, T3.ATTRIBUTES_INFO_FILL = { "fill-color": { name: "color", type: N.R8G8B8A8_COLOR }, "fill-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js
- var i2 = class extends i {
- constructor(e3) {
- super(e3);
- }
- geometryInfo() {
- return i2.GEOMETRY_LAYOUT;
- }
- opacityInfo() {
- return null;
- }
- attributes() {
- return i2.ATTRIBUTES;
- }
- attributesInfo() {
- return i2.ATTRIBUTES_INFO;
- }
- };
- i2.ATTRIBUTES = ["line-blur", "line-color", "line-gap-width", "line-offset", "line-opacity", "line-width", "line-pattern", "line-dasharray"], i2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_extrude_offset", 4, C.BYTE, 4, 16), new t2("a_dir_normal", 4, C.BYTE, 8, 16), new t2("a_accumulatedDistance", 2, C.UNSIGNED_SHORT, 12, 16)], i2.ATTRIBUTES_INFO = { "line-width": { name: "width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-gap-width": { name: "gap_width", type: N.R8_UNSIGNED, precisionFactor: 2 }, "line-offset": { name: "offset", type: N.R8_SIGNED, precisionFactor: 2 }, "line-color": { name: "color", type: N.R8G8B8A8_COLOR }, "line-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "line-blur": { name: "blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "line-pattern": { name: "tlbr", type: N.R16G16B16A16_PATTERN, isOptional: true }, "line-dasharray": { name: "tlbr", type: N.R16G16B16A16_DASHARRAY, isOptional: true } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js
- var a3 = [new t2("a_pos", 2, C.SHORT, 0, 16), new t2("a_vertexOffset", 2, C.SHORT, 4, 16), new t2("a_texAngleRange", 4, C.UNSIGNED_BYTE, 8, 16), new t2("a_levelInfo", 4, C.UNSIGNED_BYTE, 12, 16)];
- var n = [new t2("a_opacityInfo", 1, C.UNSIGNED_BYTE, 0, 1)];
- var i3 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return a3;
- }
- opacityInfo() {
- return n;
- }
- attributes() {
- return i3.ATTRIBUTES;
- }
- attributesInfo() {
- return i3.ATTRIBUTES_INFO;
- }
- };
- i3.ATTRIBUTES = ["icon-color", "icon-opacity", "icon-halo-blur", "icon-halo-color", "icon-halo-width", "icon-size"], i3.ATTRIBUTES_INFO = { "icon-color": { name: "color", type: N.R8G8B8A8_COLOR }, "icon-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "icon-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "icon-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "icon-size": { name: "size", type: N.R8_UNSIGNED, precisionFactor: 32, isLayout: true } };
- var c2 = class extends i {
- constructor(o2) {
- super(o2);
- }
- geometryInfo() {
- return a3;
- }
- opacityInfo() {
- return n;
- }
- attributes() {
- return c2.ATTRIBUTES;
- }
- attributesInfo() {
- return c2.ATTRIBUTES_INFO;
- }
- };
- c2.ATTRIBUTES = ["text-color", "text-opacity", "text-halo-blur", "text-halo-color", "text-halo-width", "text-size"], c2.ATTRIBUTES_INFO = { "text-color": { name: "color", type: N.R8G8B8A8_COLOR }, "text-opacity": { name: "opacity", type: N.R8_UNSIGNED, precisionFactor: 100 }, "text-halo-color": { name: "halo_color", type: N.R8G8B8A8_COLOR }, "text-halo-width": { name: "halo_width", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-halo-blur": { name: "halo_blur", type: N.R8_UNSIGNED, precisionFactor: 4 }, "text-size": { name: "size", type: N.R8_UNSIGNED, isLayout: true } };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/types.js
- var r = { kind: "null" };
- var e2 = { kind: "number" };
- var t5 = { kind: "string" };
- var i4 = { kind: "boolean" };
- var o = { kind: "color" };
- var f2 = { kind: "object" };
- var u = { kind: "value" };
- function a4(n2, r2) {
- return { kind: "array", itemType: n2, n: r2 };
- }
- var y = [r, e2, t5, i4, o, f2, a4(u)];
- function k(n2) {
- if ("array" === n2.kind) {
- const r2 = k(n2.itemType);
- return "number" == typeof n2.n ? `array<${r2}, ${n2.n}>` : "value" === n2.itemType.kind ? "array" : `array<${r2}>`;
- }
- return n2.kind;
- }
- function l4(y2) {
- if (null === y2)
- return r;
- if ("string" == typeof y2)
- return t5;
- if ("boolean" == typeof y2)
- return i4;
- if ("number" == typeof y2)
- return e2;
- if (y2 instanceof l)
- return o;
- if (Array.isArray(y2)) {
- let n2;
- for (const r2 of y2) {
- const e3 = l4(r2);
- if (n2) {
- if (n2 !== e3) {
- n2 = u;
- break;
- }
- } else
- n2 = e3;
- }
- return a4(n2 || u, y2.length);
- }
- return "object" == typeof y2 ? f2 : u;
- }
- function c3(n2, r2) {
- if ("array" === r2.kind)
- return "array" === n2.kind && (0 === n2.n && "value" === n2.itemType.kind || c3(n2.itemType, r2.itemType)) && ("number" != typeof r2.n || r2.n === n2.n);
- if ("value" === r2.kind) {
- for (const e3 of y)
- if (c3(n2, e3))
- return true;
- }
- return r2.kind === n2.kind;
- }
- function d(r2) {
- if (null === r2)
- return "";
- const e3 = typeof r2;
- return "string" === e3 ? r2 : "number" === e3 || "boolean" === e3 ? String(r2) : r2 instanceof l ? r2.toString() : JSON.stringify(r2);
- }
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/expression.js
- var _ = class {
- constructor(t7) {
- this._parent = t7, this._vars = {};
- }
- add(t7, e3) {
- this._vars[t7] = e3;
- }
- get(t7) {
- return this._vars[t7] ? this._vars[t7] : this._parent ? this._parent.get(t7) : null;
- }
- };
- var v2 = class {
- constructor() {
- this.type = u;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"id" does not expect arguments');
- return new v2();
- }
- evaluate(t7, e3) {
- return t7 == null ? void 0 : t7.id;
- }
- };
- var b2 = class {
- constructor() {
- this.type = t5;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"geometry-type" does not expect arguments');
- return new b2();
- }
- evaluate(t7, e3) {
- if (!t7)
- return null;
- switch (t7.type) {
- case s.Point:
- return "Point";
- case s.LineString:
- return "LineString";
- case s.Polygon:
- return "Polygon";
- default:
- return null;
- }
- }
- };
- var d2 = class {
- constructor() {
- this.type = f2;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"properties" does not expect arguments');
- return new d2();
- }
- evaluate(t7, e3) {
- return t7 == null ? void 0 : t7.values;
- }
- };
- var x = class {
- constructor() {
- this.type = e2;
- }
- static parse(t7) {
- if (t7.length > 1)
- throw new Error('"zoom" does not expect arguments');
- return new x();
- }
- evaluate(t7, e3) {
- return e3;
- }
- };
- var E = class {
- constructor(t7, e3, r2) {
- this._lhs = t7, this._rhs = e3, this._compare = r2, this.type = i4;
- }
- static parse(t7, e3, r2) {
- if (3 !== t7.length && 4 !== t7.length)
- throw new Error(`"${t7[0]}" expects 2 or 3 arguments`);
- if (4 === t7.length)
- throw new Error(`"${t7[0]}" collator not supported`);
- return new E(pt(t7[1], e3), pt(t7[2], e3), r2);
- }
- evaluate(t7, e3) {
- return this._compare(this._lhs.evaluate(t7, e3), this._rhs.evaluate(t7, e3));
- }
- };
- var $ = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 === e4);
- }
- };
- var M = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 !== e4);
- }
- };
- var k2 = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 < e4);
- }
- };
- var A = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 <= e4);
- }
- };
- var j = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 > e4);
- }
- };
- var q = class extends E {
- static parse(t7, e3) {
- return E.parse(t7, e3, (t8, e4) => t8 >= e4);
- }
- };
- var N2 = class {
- constructor(t7) {
- this._arg = t7, this.type = i4;
- }
- static parse(t7, e3) {
- if (2 !== t7.length)
- throw new Error('"!" expects 1 argument');
- return new N2(pt(t7[1], e3));
- }
- evaluate(t7, e3) {
- return !this._arg.evaluate(t7, e3);
- }
- };
- var R2 = class {
- constructor(t7) {
- this._args = t7, this.type = i4;
- }
- static parse(t7, e3) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e3));
- return new R2(r2);
- }
- evaluate(t7, e3) {
- for (const r2 of this._args)
- if (!r2.evaluate(t7, e3))
- return false;
- return true;
- }
- };
- var C2 = class {
- constructor(t7) {
- this._args = t7, this.type = i4;
- }
- static parse(t7, e3) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e3));
- return new C2(r2);
- }
- evaluate(t7, e3) {
- for (const r2 of this._args)
- if (r2.evaluate(t7, e3))
- return true;
- return false;
- }
- };
- var z2 = class {
- constructor(t7) {
- this._args = t7, this.type = i4;
- }
- static parse(t7, e3) {
- const r2 = [];
- for (let s2 = 1; s2 < t7.length; s2++)
- r2.push(pt(t7[s2], e3));
- return new z2(r2);
- }
- evaluate(t7, e3) {
- for (const r2 of this._args)
- if (r2.evaluate(t7, e3))
- return false;
- return true;
- }
- };
- var I = class {
- constructor(t7, e3, r2) {
- this.type = t7, this._args = e3, this._fallback = r2;
- }
- static parse(t7, e3, r2) {
- if (t7.length < 4)
- throw new Error('"case" expects at least 3 arguments');
- if (t7.length % 2 == 1)
- throw new Error('"case" expects an odd number of arguments');
- let s2;
- const n2 = [];
- for (let o2 = 1; o2 < t7.length - 1; o2 += 2) {
- const a6 = pt(t7[o2], e3), i5 = pt(t7[o2 + 1], e3, r2);
- s2 || (s2 = i5.type), n2.push({ condition: a6, output: i5 });
- }
- const a5 = pt(t7[t7.length - 1], e3, r2);
- return s2 || (s2 = a5.type), new I(s2, n2, a5);
- }
- evaluate(t7, e3) {
- for (const r2 of this._args)
- if (r2.condition.evaluate(t7, e3))
- return r2.output.evaluate(t7, e3);
- return this._fallback.evaluate(t7, e3);
- }
- };
- var L = class {
- constructor(t7, e3) {
- this.type = t7, this._args = e3;
- }
- static parse(t7, e3) {
- if (t7.length < 2)
- throw new Error('"coalesce" expects at least 1 argument');
- let r2;
- const s2 = [];
- for (let n2 = 1; n2 < t7.length; n2++) {
- const a5 = pt(t7[n2], e3);
- r2 || (r2 = a5.type), s2.push(a5);
- }
- return new L(r2, s2);
- }
- evaluate(t7, e3) {
- for (const r2 of this._args) {
- const s2 = r2.evaluate(t7, e3);
- if (null !== s2)
- return s2;
- }
- return null;
- }
- };
- var U = class {
- constructor(t7, e3, r2, s2, n2) {
- this.type = t7, this._input = e3, this._labels = r2, this._outputs = s2, this._fallback = n2;
- }
- static parse(t7, e3) {
- if (t7.length < 3)
- throw new Error('"match" expects at least 3 arguments');
- if (t7.length % 2 == 0)
- throw new Error('"case" expects an even number of arguments');
- let r2;
- const s2 = pt(t7[1], e3), n2 = [], a5 = {};
- let o2;
- for (let i5 = 2; i5 < t7.length - 1; i5 += 2) {
- let s3 = t7[i5];
- Array.isArray(s3) || (s3 = [s3]);
- for (const t8 of s3) {
- const e4 = typeof t8;
- if ("string" !== e4 && "number" !== e4)
- throw new Error('"match" requires string or number literal as labels');
- if (o2) {
- if (e4 !== o2)
- throw new Error('"match" requires labels to have the same type');
- } else
- o2 = e4;
- a5[t8] = n2.length;
- }
- const l6 = pt(t7[i5 + 1], e3);
- r2 || (r2 = l6.type), n2.push(l6);
- }
- return new U(r2, s2, a5, n2, pt(t7[t7.length - 1], e3));
- }
- evaluate(t7, e3) {
- const r2 = this._input.evaluate(t7, e3);
- return (this._outputs[this._labels[r2]] || this._fallback).evaluate(t7, e3);
- }
- };
- var P = class {
- constructor(t7, e3, r2, s2, n2) {
- this._operator = t7, this.type = e3, this.interpolation = r2, this.input = s2, this._stops = n2;
- }
- static parse(t7, e3, r2) {
- const s2 = t7[0];
- if (t7.length < 5)
- throw new Error(`"${s2}" expects at least 4 arguments`);
- const n2 = t7[1];
- if (!Array.isArray(n2) || 0 === n2.length)
- throw new Error(`"${n2}" is not a valid interpolation`);
- switch (n2[0]) {
- case "linear":
- if (1 !== n2.length)
- throw new Error("Linear interpolation cannot have parameters");
- break;
- case "exponential":
- if (2 !== n2.length || "number" != typeof n2[1])
- throw new Error("Exponential interpolation requires one numeric argument");
- break;
- case "cubic-bezier":
- if (5 !== n2.length)
- throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
- for (let t8 = 1; t8 < 5; t8++) {
- const e4 = n2[t8];
- if ("number" != typeof e4 || e4 < 0 || e4 > 1)
- throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
- }
- break;
- default:
- throw new Error(`"${t7[0]}" unknown interpolation type "${n2[0]}"`);
- }
- if (t7.length % 2 != 1)
- throw new Error(`"${s2}" expects an even number of arguments`);
- const a5 = pt(t7[2], e3, e2);
- let o2;
- "interpolate-hcl" === s2 || "interpolate-lab" === s2 ? o2 = o : r2 && "value" !== r2.kind && (o2 = r2);
- const i5 = [];
- for (let l6 = 3; l6 < t7.length; l6 += 2) {
- const r3 = t7[l6];
- if ("number" != typeof r3)
- throw new Error(`"${s2}" requires stop inputs as literal numbers`);
- if (i5.length && i5[i5.length - 1][0] >= r3)
- throw new Error(`"${s2}" requires strictly ascending stop inputs`);
- const n3 = pt(t7[l6 + 1], e3, o2);
- o2 || (o2 = n3.type), i5.push([r3, n3]);
- }
- if (o2 && o2 !== o && o2 !== e2 && ("array" !== o2.kind || o2.itemType !== e2))
- throw new Error(`"${s2}" cannot interpolate type ${k(o2)}`);
- return new P(s2, o2, n2, a5, i5);
- }
- evaluate(n2, o2) {
- const i5 = this._stops;
- if (1 === i5.length)
- return i5[0][1].evaluate(n2, o2);
- const l6 = this.input.evaluate(n2, o2);
- if (l6 <= i5[0][0])
- return i5[0][1].evaluate(n2, o2);
- if (l6 >= i5[i5.length - 1][0])
- return i5[i5.length - 1][1].evaluate(n2, o2);
- let u2 = 0;
- for (; ++u2 < i5.length && !(l6 < i5[u2][0]); )
- ;
- const c5 = i5[u2 - 1][0], h2 = i5[u2][0], g = P.interpolationRatio(this.interpolation, l6, c5, h2), f4 = i5[u2 - 1][1].evaluate(n2, o2), w = i5[u2][1].evaluate(n2, o2);
- if ("interpolate" === this._operator) {
- if ("array" === this.type.kind && Array.isArray(f4) && Array.isArray(w))
- return f4.map((t7, e3) => b(t7, w[e3], g));
- if ("color" === this.type.kind && f4 instanceof l && w instanceof l) {
- const e3 = new l(f4), r2 = new l(w);
- return new l([b(e3.r, r2.r, g), b(e3.g, r2.g, g), b(e3.b, r2.b, g), b(e3.a, r2.a, g)]);
- }
- if ("number" === this.type.kind && "number" == typeof f4 && "number" == typeof w)
- return b(f4, w, g);
- throw new Error(`"${this._operator}" cannot interpolate type ${k(this.type)}`);
- }
- if ("interpolate-hcl" === this._operator) {
- const s2 = v(f4), n3 = v(w), o3 = n3.h - s2.h, i6 = p({ h: s2.h + g * (o3 > 180 || o3 < -180 ? o3 - 360 * Math.round(o3 / 360) : o3), c: b(s2.c, n3.c, g), l: b(s2.l, n3.l, g) });
- return new l({ a: b(f4.a, w.a, g), ...i6 });
- }
- if ("interpolate-lab" === this._operator) {
- const e3 = z(f4), n3 = z(w), o3 = p({ l: b(e3.l, n3.l, g), a: b(e3.a, n3.a, g), b: b(e3.b, n3.b, g) });
- return new l({ a: b(f4.a, w.a, g), ...o3 });
- }
- throw new Error(`Unexpected operator "${this._operator}"`);
- }
- interpolationUniformValue(t7, e3) {
- const r2 = this._stops;
- if (1 === r2.length)
- return 0;
- if (t7 >= r2[r2.length - 1][0])
- return 0;
- let s2 = 0;
- for (; ++s2 < r2.length && !(t7 < r2[s2][0]); )
- ;
- const n2 = r2[s2 - 1][0], a5 = r2[s2][0];
- return P.interpolationRatio(this.interpolation, e3, n2, a5);
- }
- getInterpolationRange(t7) {
- const e3 = this._stops;
- if (1 === e3.length) {
- const t8 = e3[0][0];
- return [t8, t8];
- }
- const r2 = e3[e3.length - 1][0];
- if (t7 >= r2)
- return [r2, r2];
- let s2 = 0;
- for (; ++s2 < e3.length && !(t7 < e3[s2][0]); )
- ;
- return [e3[s2 - 1][0], e3[s2][0]];
- }
- static interpolationRatio(t7, e3, r2, s2) {
- let a5 = 0;
- if ("linear" === t7[0])
- a5 = P._exponentialInterpolationRatio(e3, 1, r2, s2);
- else if ("exponential" === t7[0])
- a5 = P._exponentialInterpolationRatio(e3, t7[1], r2, s2);
- else if ("cubic-bezier" === t7[0]) {
- a5 = e(t7[1], t7[2], t7[3], t7[4])(P._exponentialInterpolationRatio(e3, 1, r2, s2), 1e-5);
- }
- return a5 < 0 ? a5 = 0 : a5 > 1 && (a5 = 1), a5;
- }
- static _exponentialInterpolationRatio(t7, e3, r2, s2) {
- const n2 = s2 - r2;
- if (0 === n2)
- return 0;
- const a5 = t7 - r2;
- return 1 === e3 ? a5 / n2 : (e3 ** a5 - 1) / (e3 ** n2 - 1);
- }
- };
- var S = class {
- constructor(t7, e3, r2) {
- this.type = t7, this._input = e3, this._stops = r2;
- }
- static parse(t7, e3) {
- if (t7.length < 5)
- throw new Error('"step" expects at least 4 arguments');
- if (t7.length % 2 != 1)
- throw new Error('"step" expects an even number of arguments');
- const r2 = pt(t7[1], e3, e2);
- let s2;
- const n2 = [];
- n2.push([-1 / 0, pt(t7[2], e3)]);
- for (let a5 = 3; a5 < t7.length; a5 += 2) {
- const r3 = t7[a5];
- if ("number" != typeof r3)
- throw new Error('"step" requires stop inputs as literal numbers');
- if (n2.length && n2[n2.length - 1][0] >= r3)
- throw new Error('"step" requires strictly ascending stop inputs');
- const o2 = pt(t7[a5 + 1], e3);
- s2 || (s2 = o2.type), n2.push([r3, o2]);
- }
- return new S(s2, r2, n2);
- }
- evaluate(t7, e3) {
- const r2 = this._stops;
- if (1 === r2.length)
- return r2[0][1].evaluate(t7, e3);
- const s2 = this._input.evaluate(t7, e3);
- let n2 = 0;
- for (; ++n2 < r2.length && !(s2 < r2[n2][0]); )
- ;
- return this._stops[n2 - 1][1].evaluate(t7, e3);
- }
- };
- var B = class {
- constructor(t7, e3) {
- this.type = t7, this._output = e3;
- }
- static parse(t7, e3, r2) {
- if (t7.length < 4)
- throw new Error('"let" expects at least 3 arguments');
- if (t7.length % 2 == 1)
- throw new Error('"let" expects an odd number of arguments');
- const s2 = new _(e3);
- for (let a5 = 1; a5 < t7.length - 1; a5 += 2) {
- const r3 = t7[a5];
- if ("string" != typeof r3)
- throw new Error(`"let" requires a string to define variable names - found ${r3}`);
- s2.add(r3, pt(t7[a5 + 1], e3));
- }
- const n2 = pt(t7[t7.length - 1], s2, r2);
- return new B(n2.type, n2);
- }
- evaluate(t7, e3) {
- return this._output.evaluate(t7, e3);
- }
- };
- var G = class {
- constructor(t7, e3) {
- this.type = t7, this.output = e3;
- }
- static parse(t7, e3, r2) {
- if (2 !== t7.length || "string" != typeof t7[1])
- throw new Error('"var" requires just one literal string argument');
- const s2 = e3.get(t7[1]);
- if (!s2)
- throw new Error(`${t7[1]} must be defined before being used in a "var" expression`);
- return new G(r2 || u, s2);
- }
- evaluate(t7, e3) {
- return this.output.evaluate(t7, e3);
- }
- };
- var O = class {
- constructor(t7, e3, r2) {
- this.type = t7, this._index = e3, this._array = r2;
- }
- static parse(t7, e3) {
- if (3 !== t7.length)
- throw new Error('"at" expects 2 arguments');
- const r2 = pt(t7[1], e3, e2), s2 = pt(t7[2], e3);
- return new O(s2.type.itemType, r2, s2);
- }
- evaluate(t7, e3) {
- const r2 = this._index.evaluate(t7, e3), s2 = this._array.evaluate(t7, e3);
- if (r2 < 0 || r2 >= s2.length)
- throw new Error('"at" index out of bounds');
- if (r2 !== Math.floor(r2))
- throw new Error('"at" index must be an integer');
- return s2[r2];
- }
- };
- var T4 = class {
- constructor(t7, e3) {
- this._key = t7, this._obj = e3, this.type = u;
- }
- static parse(t7, e3) {
- let r2, s2;
- switch (t7.length) {
- case 2:
- return r2 = pt(t7[1], e3), new T4(r2);
- case 3:
- return r2 = pt(t7[1], e3), s2 = pt(t7[2], e3), new T4(r2, s2);
- default:
- throw new Error('"get" expects 1 or 2 arguments');
- }
- }
- evaluate(t7, e3) {
- const r2 = this._key.evaluate(t7, e3);
- if (this._obj) {
- return this._obj.evaluate(t7, e3)[r2];
- }
- return t7 == null ? void 0 : t7.values[r2];
- }
- };
- var F = class {
- constructor(t7, e3) {
- this._key = t7, this._obj = e3, this.type = i4;
- }
- static parse(t7, e3) {
- let r2, s2;
- switch (t7.length) {
- case 2:
- return r2 = pt(t7[1], e3), new F(r2);
- case 3:
- return r2 = pt(t7[1], e3), s2 = pt(t7[2], e3), new F(r2, s2);
- default:
- throw new Error('"has" expects 1 or 2 arguments');
- }
- }
- evaluate(t7, e3) {
- const r2 = this._key.evaluate(t7, e3);
- if (this._obj) {
- return r2 in this._obj.evaluate(t7, e3);
- }
- return !!(t7 == null ? void 0 : t7.values[r2]);
- }
- };
- var V = class {
- constructor(t7, e3) {
- this._key = t7, this._vals = e3, this.type = i4;
- }
- static parse(t7, e3) {
- if (3 !== t7.length)
- throw new Error('"in" expects 2 arguments');
- return new V(pt(t7[1], e3), pt(t7[2], e3));
- }
- evaluate(t7, e3) {
- const r2 = this._key.evaluate(t7, e3);
- return this._vals.evaluate(t7, e3).includes(r2);
- }
- };
- var D = class {
- constructor(t7, e3, r2) {
- this._item = t7, this._array = e3, this._from = r2, this.type = e2;
- }
- static parse(t7, e3) {
- if (t7.length < 3 || t7.length > 4)
- throw new Error('"index-of" expects 3 or 4 arguments');
- const r2 = pt(t7[1], e3), s2 = pt(t7[2], e3);
- if (4 === t7.length) {
- const n2 = pt(t7[3], e3, e2);
- return new D(r2, s2, n2);
- }
- return new D(r2, s2);
- }
- evaluate(t7, e3) {
- const r2 = this._item.evaluate(t7, e3), s2 = this._array.evaluate(t7, e3);
- if (this._from) {
- const n2 = this._from.evaluate(t7, e3);
- if (n2 !== Math.floor(n2))
- throw new Error('"index-of" index must be an integer');
- return s2.indexOf(r2, n2);
- }
- return s2.indexOf(r2);
- }
- };
- var H = class {
- constructor(t7) {
- this._arg = t7, this.type = e2;
- }
- static parse(t7, e3) {
- if (2 !== t7.length)
- throw new Error('"length" expects 2 arguments');
- const r2 = pt(t7[1], e3);
- return new H(r2);
- }
- evaluate(t7, e3) {
- const r2 = this._arg.evaluate(t7, e3);
- if ("string" == typeof r2)
- return r2.length;
- if (Array.isArray(r2))
- return r2.length;
- throw new Error('"length" expects string or array');
- }
- };
- var J = class {
- constructor(t7, e3, r2, s2) {
- this.type = t7, this._array = e3, this._from = r2, this._to = s2;
- }
- static parse(t7, e3) {
- if (t7.length < 3 || t7.length > 4)
- throw new Error('"slice" expects 2 or 3 arguments');
- const r2 = pt(t7[1], e3), s2 = pt(t7[2], e3, e2);
- if (s2.type !== e2)
- throw new Error('"slice" index must return a number');
- if (4 === t7.length) {
- const n2 = pt(t7[3], e3, e2);
- if (n2.type !== e2)
- throw new Error('"slice" index must return a number');
- return new J(r2.type, r2, s2, n2);
- }
- return new J(r2.type, r2, s2);
- }
- evaluate(t7, e3) {
- const r2 = this._array.evaluate(t7, e3);
- if (!Array.isArray(r2) && "string" != typeof r2)
- throw new Error('"slice" input must be an array or a string');
- const s2 = this._from.evaluate(t7, e3);
- if (s2 < 0 || s2 >= r2.length)
- throw new Error('"slice" index out of bounds');
- if (s2 !== Math.floor(s2))
- throw new Error('"slice" index must be an integer');
- if (this._to) {
- const n2 = this._to.evaluate(t7, e3);
- if (n2 < 0 || n2 >= r2.length)
- throw new Error('"slice" index out of bounds');
- if (n2 !== Math.floor(n2))
- throw new Error('"slice" index must be an integer');
- return r2.slice(s2, n2);
- }
- return r2.slice(s2);
- }
- };
- var K = class {
- constructor() {
- this.type = i4;
- }
- static parse(t7) {
- if (1 !== t7.length)
- throw new Error('"has-id" expects no arguments');
- return new K();
- }
- evaluate(t7, e3) {
- return t7 && void 0 !== t7.id;
- }
- };
- var Q = class {
- constructor(t7, e3) {
- this._args = t7, this._calculate = e3, this.type = e2;
- }
- static parse(t7, e3, r2) {
- const s2 = t7.slice(1).map((t8) => pt(t8, e3));
- return new Q(s2, r2);
- }
- evaluate(t7, e3) {
- let r2;
- return this._args && (r2 = this._args.map((r3) => r3.evaluate(t7, e3))), this._calculate(r2);
- }
- };
- var W = class extends Q {
- static parse(t7, e3) {
- switch (t7.length) {
- case 2:
- return Q.parse(t7, e3, (t8) => -t8[0]);
- case 3:
- return Q.parse(t7, e3, (t8) => t8[0] - t8[1]);
- default:
- throw new Error('"-" expects 1 or 2 arguments');
- }
- }
- };
- var X2 = class extends Q {
- static parse(t7, e3) {
- return Q.parse(t7, e3, (t8) => {
- let e4 = 1;
- for (const r2 of t8)
- e4 *= r2;
- return e4;
- });
- }
- };
- var Y = class extends Q {
- static parse(t7, e3) {
- if (3 === t7.length)
- return Q.parse(t7, e3, (t8) => t8[0] / t8[1]);
- throw new Error('"/" expects 2 arguments');
- }
- };
- var Z = class extends Q {
- static parse(t7, e3) {
- if (3 === t7.length)
- return Q.parse(t7, e3, (t8) => t8[0] % t8[1]);
- throw new Error('"%" expects 2 arguments');
- }
- };
- var tt = class extends Q {
- static parse(t7, e3) {
- if (3 === t7.length)
- return Q.parse(t7, e3, (t8) => t8[0] ** t8[1]);
- throw new Error('"^" expects 1 or 2 arguments');
- }
- };
- var et = class extends Q {
- static parse(t7, e3) {
- return Q.parse(t7, e3, (t8) => {
- let e4 = 0;
- for (const r2 of t8)
- e4 += r2;
- return e4;
- });
- }
- };
- var rt = class {
- constructor(t7, e3) {
- this._args = t7, this._calculate = e3, this.type = e2;
- }
- static parse(t7, e3) {
- const r2 = t7.slice(1).map((t8) => pt(t8, e3));
- return new rt(r2, rt.ops[t7[0]]);
- }
- evaluate(t7, e3) {
- let r2;
- return this._args && (r2 = this._args.map((r3) => r3.evaluate(t7, e3))), this._calculate(r2);
- }
- };
- rt.ops = { abs: (t7) => Math.abs(t7[0]), acos: (t7) => Math.acos(t7[0]), asin: (t7) => Math.asin(t7[0]), atan: (t7) => Math.atan(t7[0]), ceil: (t7) => Math.ceil(t7[0]), cos: (t7) => Math.cos(t7[0]), e: () => Math.E, floor: (t7) => Math.floor(t7[0]), ln: (t7) => Math.log(t7[0]), ln2: () => Math.LN2, log10: (t7) => Math.log(t7[0]) / Math.LN10, log2: (t7) => Math.log(t7[0]) / Math.LN2, max: (t7) => Math.max(...t7), min: (t7) => Math.min(...t7), pi: () => Math.PI, round: (t7) => Math.round(t7[0]), sin: (t7) => Math.sin(t7[0]), sqrt: (t7) => Math.sqrt(t7[0]), tan: (t7) => Math.tan(t7[0]) };
- var st = class {
- constructor(t7) {
- this._args = t7, this.type = t5;
- }
- static parse(t7, e3) {
- return new st(t7.slice(1).map((t8) => pt(t8, e3)));
- }
- evaluate(t7, e3) {
- return this._args.map((r2) => r2.evaluate(t7, e3)).join("");
- }
- };
- var nt = class {
- constructor(t7, e3) {
- this._arg = t7, this._calculate = e3, this.type = t5;
- }
- static parse(t7, e3) {
- if (2 !== t7.length)
- throw new Error(`${t7[0]} expects 1 argument`);
- const r2 = pt(t7[1], e3);
- return new nt(r2, nt.ops[t7[0]]);
- }
- evaluate(t7, e3) {
- return this._calculate(this._arg.evaluate(t7, e3));
- }
- };
- nt.ops = { downcase: (t7) => t7.toLowerCase(), upcase: (t7) => t7.toUpperCase() };
- var at = class {
- constructor(t7) {
- this._args = t7, this.type = o;
- }
- static parse(t7, e3) {
- if (4 !== t7.length)
- throw new Error('"rgb" expects 3 arguments');
- const r2 = t7.slice(1).map((t8) => pt(t8, e3));
- return new at(r2);
- }
- evaluate(e3, r2) {
- const s2 = this._validate(this._args[0].evaluate(e3, r2)), n2 = this._validate(this._args[1].evaluate(e3, r2)), a5 = this._validate(this._args[2].evaluate(e3, r2));
- return new l({ r: s2, g: n2, b: a5 });
- }
- _validate(t7) {
- if ("number" != typeof t7 || t7 < 0 || t7 > 255)
- throw new Error(`${t7}: invalid color component`);
- return Math.round(t7);
- }
- };
- var ot = class {
- constructor(t7) {
- this._args = t7, this.type = o;
- }
- static parse(t7, e3) {
- if (5 !== t7.length)
- throw new Error('"rgba" expects 4 arguments');
- const r2 = t7.slice(1).map((t8) => pt(t8, e3));
- return new ot(r2);
- }
- evaluate(e3, r2) {
- const s2 = this._validate(this._args[0].evaluate(e3, r2)), n2 = this._validate(this._args[1].evaluate(e3, r2)), a5 = this._validate(this._args[2].evaluate(e3, r2)), o2 = this._validateAlpha(this._args[3].evaluate(e3, r2));
- return new l({ r: s2, g: n2, b: a5, a: o2 });
- }
- _validate(t7) {
- if ("number" != typeof t7 || t7 < 0 || t7 > 255)
- throw new Error(`${t7}: invalid color component`);
- return Math.round(t7);
- }
- _validateAlpha(t7) {
- if ("number" != typeof t7 || t7 < 0 || t7 > 1)
- throw new Error(`${t7}: invalid alpha color component`);
- return t7;
- }
- };
- var it = class {
- constructor(t7) {
- this._color = t7, this.type = a4(e2, 4);
- }
- static parse(t7, e3) {
- if (2 !== t7.length)
- throw new Error('"to-rgba" expects 1 argument');
- const r2 = pt(t7[1], e3);
- return new it(r2);
- }
- evaluate(e3, r2) {
- return new l(this._color.evaluate(e3, r2)).toRgba();
- }
- };
- var lt = class {
- constructor(t7, e3) {
- this.type = t7, this._args = e3;
- }
- static parse(t7, e3) {
- const r2 = t7[0];
- if (t7.length < 2)
- throw new Error(`${r2} expects at least one argument`);
- let s2, n2 = 1;
- if ("array" === r2) {
- if (t7.length > 2) {
- switch (t7[1]) {
- case "string":
- s2 = t5;
- break;
- case "number":
- s2 = e2;
- break;
- case "boolean":
- s2 = i4;
- break;
- default:
- throw new Error('"array" type argument must be string, number or boolean');
- }
- n2++;
- } else
- s2 = u;
- let e4;
- if (t7.length > 3) {
- if (e4 = t7[2], null !== e4 && ("number" != typeof e4 || e4 < 0 || e4 !== Math.floor(e4)))
- throw new Error('"array" length argument must be a positive integer literal');
- n2++;
- }
- s2 = a4(s2, e4);
- } else
- switch (r2) {
- case "string":
- s2 = t5;
- break;
- case "number":
- s2 = e2;
- break;
- case "boolean":
- s2 = i4;
- break;
- case "object":
- s2 = f2;
- }
- const a5 = [];
- for (; n2 < t7.length; n2++) {
- const r3 = pt(t7[n2], e3);
- a5.push(r3);
- }
- return new lt(s2, a5);
- }
- evaluate(t7, e3) {
- let r2;
- for (const s2 of this._args) {
- const n2 = s2.evaluate(t7, e3);
- if (r2 = l4(n2), c3(r2, this.type))
- return n2;
- }
- throw new Error(`Expected ${k(this.type)} but got ${k(r2)}`);
- }
- };
- var ut = class {
- constructor(t7, e3) {
- this.type = t7, this._args = e3;
- }
- static parse(t7, e3) {
- const r2 = t7[0], s2 = ut.types[r2];
- if (s2 === i4 || s2 === t5) {
- if (2 !== t7.length)
- throw new Error(`${r2} expects one argument`);
- } else if (t7.length < 2)
- throw new Error(`${r2} expects at least one argument`);
- const n2 = [];
- for (let a5 = 1; a5 < t7.length; a5++) {
- const r3 = pt(t7[a5], e3);
- n2.push(r3);
- }
- return new ut(s2, n2);
- }
- evaluate(e3, r2) {
- if (this.type === i4)
- return Boolean(this._args[0].evaluate(e3, r2));
- if (this.type === t5)
- return d(this._args[0].evaluate(e3, r2));
- if (this.type === e2) {
- for (const t7 of this._args) {
- const s2 = Number(t7.evaluate(e3, r2));
- if (!isNaN(s2))
- return s2;
- }
- return null;
- }
- if (this.type === o) {
- for (const s2 of this._args)
- try {
- const n2 = ut.toColor(s2.evaluate(e3, r2));
- if (n2 instanceof l)
- return n2;
- } catch {
- }
- return null;
- }
- }
- static toBoolean(t7) {
- return Boolean(t7);
- }
- static toString(t7) {
- return d(t7);
- }
- static toNumber(t7) {
- const e3 = Number(t7);
- if (isNaN(e3))
- throw new Error(`"${t7}" is not a number`);
- return e3;
- }
- static toColor(e3) {
- if (e3 instanceof l)
- return e3;
- if ("string" == typeof e3) {
- const r2 = l.fromString(e3);
- if (r2)
- return r2;
- throw new Error(`"${e3}" is not a color`);
- }
- if (Array.isArray(e3))
- return l.fromArray(e3);
- throw new Error(`"${e3}" is not a color`);
- }
- };
- ut.types = { "to-boolean": i4, "to-color": o, "to-number": e2, "to-string": t5 };
- var ct = class {
- constructor(t7) {
- this._val = t7, this.type = l4(t7);
- }
- static parse(t7) {
- if (2 !== t7.length)
- throw new Error('"literal" expects 1 argument');
- return new ct(t7[1]);
- }
- evaluate(t7, e3) {
- return this._val;
- }
- };
- var ht = class {
- constructor(t7) {
- this._arg = t7, this.type = t5;
- }
- static parse(t7, e3) {
- if (2 !== t7.length)
- throw new Error('"typeof" expects 1 argument');
- return new ht(pt(t7[1], e3));
- }
- evaluate(t7, e3) {
- return k(l4(this._arg.evaluate(t7, e3)));
- }
- };
- function pt(t7, e3, r2) {
- const s2 = typeof t7;
- if ("string" === s2 || "boolean" === s2 || "number" === s2 || null === t7) {
- if (r2)
- switch (r2.kind) {
- case "string":
- "string" !== s2 && (t7 = ut.toString(t7));
- break;
- case "number":
- "number" !== s2 && (t7 = ut.toNumber(t7));
- break;
- case "color":
- t7 = ut.toColor(t7);
- }
- t7 = ["literal", t7];
- }
- if (!Array.isArray(t7) || 0 === t7.length)
- throw new Error("Expression must be a non empty array");
- const n2 = t7[0];
- if ("string" != typeof n2)
- throw new Error("First element of expression must be a string");
- const a5 = gt[n2];
- if (void 0 === a5)
- throw new Error(`Invalid expression operator "${n2}"`);
- if (!a5)
- throw new Error(`Unimplemented expression operator "${n2}"`);
- return a5.parse(t7, e3, r2);
- }
- var gt = { array: lt, boolean: lt, collator: null, format: null, image: null, literal: ct, number: lt, "number-format": null, object: lt, string: lt, "to-boolean": ut, "to-color": ut, "to-number": ut, "to-string": ut, typeof: ht, accumulated: null, "feature-state": null, "geometry-type": b2, id: v2, "line-progress": null, properties: d2, at: O, get: T4, has: F, in: V, "index-of": D, length: H, slice: J, "!": N2, "!=": M, "<": k2, "<=": A, "==": $, ">": j, ">=": q, all: R2, any: C2, case: I, coalesce: L, match: U, within: null, interpolate: P, "interpolate-hcl": P, "interpolate-lab": P, step: S, let: B, var: G, concat: st, downcase: nt, "is-supported-script": null, "resolved-locale": null, upcase: nt, rgb: at, rgba: ot, "to-rgba": it, "-": W, "*": X2, "/": Y, "%": Z, "^": tt, "+": et, abs: rt, acos: rt, asin: rt, atan: rt, ceil: rt, cos: rt, e: rt, floor: rt, ln: rt, ln2: rt, log10: rt, log2: rt, max: rt, min: rt, pi: rt, round: rt, sin: rt, sqrt: rt, tan: rt, zoom: x, "heatmap-density": null, "has-id": K, none: z2 };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/Filter.js
- var t6 = class {
- constructor(e3) {
- this._expression = e3;
- }
- filter(e3, r2) {
- if (!this._expression)
- return true;
- try {
- return this._expression.evaluate(e3, r2);
- } catch (t7) {
- return console.log(t7.message), true;
- }
- }
- static createFilter(n2) {
- if (!n2)
- return null;
- this.isLegacyFilter(n2) && (n2 = this.convertLegacyFilter(n2));
- try {
- const s2 = pt(n2, null, i4);
- return new t6(s2);
- } catch (s2) {
- return console.log(s2.message), null;
- }
- }
- static isLegacyFilter(e3) {
- if (!Array.isArray(e3))
- return true;
- if (0 === e3.length)
- return true;
- switch (e3[0]) {
- case "==":
- case "!=":
- case ">":
- case "<":
- case ">=":
- case "<=":
- return 3 === e3.length && "string" == typeof e3[1] && !Array.isArray(e3[2]);
- case "in":
- return e3.length >= 3 && "string" == typeof e3[1] && !Array.isArray(e3[2]);
- case "!in":
- case "none":
- case "!has":
- return true;
- case "any":
- case "all":
- for (let r2 = 1; r2 < e3.length; r2++)
- if (this.isLegacyFilter(e3[r2]))
- return true;
- return false;
- case "has":
- return 2 === e3.length && ("$id" === e3[1] || "$type" === e3[1]);
- default:
- return false;
- }
- }
- static convertLegacyFilter(e3) {
- if (!Array.isArray(e3) || 0 === e3.length)
- return true;
- const r2 = e3[0];
- if (1 === e3.length)
- return "any" !== r2;
- switch (r2) {
- case "==":
- return t6.convertComparison("==", e3[1], e3[2]);
- case "!=":
- return t6.negate(t6.convertComparison("==", e3[1], e3[2]));
- case ">":
- case "<":
- case ">=":
- case "<=":
- return t6.convertComparison(r2, e3[1], e3[2]);
- case "in":
- return t6.convertIn(e3[1], e3.slice(2));
- case "!in":
- return t6.negate(t6.convertIn(e3[1], e3.slice(2)));
- case "any":
- case "all":
- case "none":
- return t6.convertCombining(r2, e3.slice(1));
- case "has":
- return t6.convertHas(e3[1]);
- case "!has":
- return t6.negate(t6.convertHas(e3[1]));
- default:
- throw new Error("Unexpected legacy filter.");
- }
- }
- static convertComparison(e3, r2, t7) {
- switch (r2) {
- case "$type":
- return [e3, ["geometry-type"], t7];
- case "$id":
- return [e3, ["id"], t7];
- default:
- return [e3, ["get", r2], t7];
- }
- }
- static convertIn(e3, r2) {
- switch (e3) {
- case "$type":
- return ["in", ["geometry-type"], ["literal", r2]];
- case "$id":
- return ["in", ["id"], ["literal", r2]];
- default:
- return ["in", ["get", e3], ["literal", r2]];
- }
- }
- static convertHas(e3) {
- switch (e3) {
- case "$type":
- return true;
- case "$id":
- return ["has-id"];
- default:
- return ["has", e3];
- }
- }
- static convertCombining(e3, r2) {
- return [e3].concat(r2.map(this.convertLegacyFilter));
- }
- static negate(e3) {
- return ["!", e3];
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleProperty.js
- var h = class {
- constructor(t7, e3) {
- let n2;
- switch (this.isDataDriven = false, this.interpolator = null, t7.type) {
- case "number":
- case "color":
- n2 = true;
- break;
- case "array":
- n2 = "number" === t7.value;
- break;
- default:
- n2 = false;
- }
- if (null == e3 && (e3 = t7.default), Array.isArray(e3) && e3.length > 0 && gt[e3[0]]) {
- const r2 = { number: e2, color: o, string: t5, boolean: i4, enum: t5 };
- try {
- const n3 = "array" === t7.type ? a4(r2[t7.value] || u, t7.length) : r2[t7.type], u2 = pt(e3, null, n3);
- this.getValue = this._buildExpression(u2, t7), this.isDataDriven = true, u2 instanceof P && u2.input instanceof x && (this.interpolator = u2);
- } catch (c5) {
- console.log(c5.message), this.getValue = this._buildSimple(t7.default);
- }
- return;
- }
- n2 && "interval" === e3.type && (n2 = false);
- const h2 = e3 && e3.stops && e3.stops.length > 0;
- if (h2)
- for (const r2 of e3.stops)
- r2[1] = this._validate(r2[1], t7);
- if (this.isDataDriven = !!e3 && !!e3.property, this.isDataDriven)
- if (void 0 !== e3.default && (e3.default = this._validate(e3.default, t7)), h2)
- switch (e3.type) {
- case "identity":
- this.getValue = this._buildIdentity(e3, t7);
- break;
- case "categorical":
- this.getValue = this._buildCategorical(e3, t7);
- break;
- default:
- this.getValue = n2 ? this._buildInterpolate(e3, t7) : this._buildInterval(e3, t7);
- }
- else
- this.getValue = this._buildIdentity(e3, t7);
- else
- h2 ? this.getValue = n2 ? this._buildZoomInterpolate(e3) : this._buildZoomInterval(e3) : (e3 = this._validate(e3, t7), this.getValue = this._buildSimple(e3));
- }
- _validate(t7, e3) {
- if ("number" === e3.type) {
- if (t7 < e3.minimum)
- return e3.minimum;
- if (t7 > e3.maximum)
- return e3.maximum;
- } else
- "color" === e3.type ? t7 = h._parseColor(t7) : "enum" === e3.type ? "string" == typeof t7 && (t7 = e3.values.indexOf(t7)) : "array" === e3.type && "enum" === e3.value ? t7 = t7.map((t8) => "string" == typeof t8 ? e3.values.indexOf(t8) : t8) : "string" === e3.type && (t7 = d(t7));
- return t7;
- }
- _buildSimple(t7) {
- return () => t7;
- }
- _buildExpression(t7, e3) {
- return (r2, i5) => {
- try {
- const l6 = t7.evaluate(i5, r2);
- return void 0 === l6 ? e3.default : this._validate(l6, e3);
- } catch (l6) {
- return console.log(l6.message), e3.default;
- }
- };
- }
- _buildIdentity(t7, e3) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), void 0 !== l6 && (l6 = this._validate(l6, e3)), null != l6 ? l6 : void 0 !== t7.default ? t7.default : e3.default;
- };
- }
- _buildCategorical(t7, e3) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), l6 = this._categorical(l6, t7.stops), void 0 !== l6 ? l6 : void 0 !== t7.default ? t7.default : e3.default;
- };
- }
- _buildInterval(t7, e3) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), "number" == typeof l6 ? this._interval(l6, t7.stops) : void 0 !== t7.default ? t7.default : e3.default;
- };
- }
- _buildInterpolate(t7, e3) {
- return (r2, i5) => {
- let l6;
- return i5 && (l6 = i5.values[t7.property]), "number" == typeof l6 ? this._interpolate(l6, t7.stops, t7.base || 1) : void 0 !== t7.default ? t7.default : e3.default;
- };
- }
- _buildZoomInterpolate(t7) {
- return (e3) => this._interpolate(e3, t7.stops, t7.base || 1);
- }
- _buildZoomInterval(t7) {
- return (e3) => this._interval(e3, t7.stops);
- }
- _categorical(t7, e3) {
- const r2 = e3.length;
- for (let i5 = 0; i5 < r2; i5++)
- if (e3[i5][0] === t7)
- return e3[i5][1];
- }
- _interval(t7, e3) {
- const r2 = e3.length;
- let i5 = 0;
- for (let l6 = 0; l6 < r2 && e3[l6][0] <= t7; l6++)
- i5 = l6;
- return e3[i5][1];
- }
- _interpolate(t7, r2, i5) {
- let l6, a5;
- const s2 = r2.length;
- for (let e3 = 0; e3 < s2; e3++) {
- const i6 = r2[e3];
- if (!(i6[0] <= t7)) {
- a5 = i6;
- break;
- }
- l6 = i6;
- }
- if (l6 && a5) {
- const r3 = a5[0] - l6[0], s3 = t7 - l6[0], o2 = 1 === i5 ? s3 / r3 : (i5 ** s3 - 1) / (i5 ** r3 - 1);
- if (Array.isArray(l6[1])) {
- const t8 = l6[1], r4 = a5[1], i6 = [];
- for (let l7 = 0; l7 < t8.length; l7++)
- i6.push(b(t8[l7], r4[l7], o2));
- return i6;
- }
- return b(l6[1], a5[1], o2);
- }
- return l6 ? l6[1] : a5 ? a5[1] : void 0;
- }
- static _isEmpty(t7) {
- for (const e3 in t7)
- if (t7.hasOwnProperty(e3))
- return false;
- return true;
- }
- static _parseColor(e3) {
- return Array.isArray(e3) ? e3 : ("string" == typeof e3 && (e3 = new l(e3)), e3 instanceof l && !this._isEmpty(e3) ? l.toUnitRGBA(e3) : void 0);
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleLayer.js
- var D2;
- !function(t7) {
- t7[t7.BUTT = 0] = "BUTT", t7[t7.ROUND = 1] = "ROUND", t7[t7.SQUARE = 2] = "SQUARE", t7[t7.UNKNOWN = 4] = "UNKNOWN";
- }(D2 || (D2 = {}));
- var P2 = class {
- constructor(t7, i5, e3, a5) {
- switch (this.type = t7, this.typeName = i5.type, this.id = i5.id, this.source = i5.source, this.sourceLayer = i5["source-layer"], this.minzoom = i5.minzoom, this.maxzoom = i5.maxzoom, this.filter = i5.filter, this.layout = i5.layout, this.paint = i5.paint, this.z = e3, this.uid = a5, t7) {
- case a.BACKGROUND:
- this._layoutDefinition = f.backgroundLayoutDefinition, this._paintDefinition = f.backgroundPaintDefinition;
- break;
- case a.FILL:
- this._layoutDefinition = f.fillLayoutDefinition, this._paintDefinition = f.fillPaintDefinition;
- break;
- case a.LINE:
- this._layoutDefinition = f.lineLayoutDefinition, this._paintDefinition = f.linePaintDefinition;
- break;
- case a.SYMBOL:
- this._layoutDefinition = f.symbolLayoutDefinition, this._paintDefinition = f.symbolPaintDefinition;
- break;
- case a.CIRCLE:
- this._layoutDefinition = f.circleLayoutDefinition, this._paintDefinition = f.circlePaintDefinition;
- }
- this._layoutProperties = this._parseLayout(this.layout), this._paintProperties = this._parsePaint(this.paint);
- }
- getFeatureFilter() {
- return void 0 !== this._featureFilter ? this._featureFilter : this._featureFilter = t6.createFilter(this.filter);
- }
- getLayoutProperty(t7) {
- return this._layoutProperties[t7];
- }
- getPaintProperty(t7) {
- return this._paintProperties[t7];
- }
- getLayoutValue(t7, i5, e3) {
- let a5;
- const o2 = this._layoutProperties[t7];
- return o2 && (a5 = o2.getValue(i5, e3)), void 0 === a5 && (a5 = this._layoutDefinition[t7].default), a5;
- }
- getPaintValue(t7, i5, e3) {
- let a5;
- const o2 = this._paintProperties[t7];
- return o2 && (a5 = o2.getValue(i5, e3)), void 0 === a5 && (a5 = this._paintDefinition[t7].default), a5;
- }
- isPainterDataDriven() {
- const t7 = this._paintProperties;
- if (t7) {
- for (const i5 in t7)
- if (t7[i5].isDataDriven)
- return true;
- }
- return false;
- }
- _parseLayout(t7) {
- const i5 = {};
- for (const e3 in t7) {
- const a5 = this._layoutDefinition[e3];
- a5 && (i5[e3] = new h(a5, t7[e3]));
- }
- return i5;
- }
- _parsePaint(t7) {
- const i5 = {};
- for (const e3 in t7) {
- const a5 = this._paintDefinition[e3];
- a5 && (i5[e3] = new h(a5, t7[e3]));
- }
- return i5;
- }
- computeAttributesKey(t7, i5, e3, a5) {
- let o2 = 0, r2 = 0;
- for (const s2 of i5) {
- let t8 = 3;
- if (!s2 || s2 !== a5) {
- const i6 = e3[s2], { isLayout: a6, isOptional: o3 } = i6, r3 = a6 ? this.getLayoutProperty(s2) : this.getPaintProperty(s2);
- t8 = (r3 == null ? void 0 : r3.interpolator) ? 2 : (r3 == null ? void 0 : r3.isDataDriven) ? 1 : o3 && !r3 ? 3 : 0;
- }
- r2 |= t8 << o2, o2 += 2;
- }
- return r2 << 3 | t7;
- }
- };
- var c4 = class extends P2 {
- constructor(e3, a5, o2, r2) {
- super(e3, a5, o2, r2), this.backgroundMaterial = new T2(this.computeAttributesKey(T.BACKGROUND, T2.ATTRIBUTES, T2.ATTRIBUTES_INFO));
- }
- };
- var f3 = class extends P2 {
- constructor(i5, e3, r2, s2) {
- super(i5, e3, r2, s2);
- const n2 = this.getPaintProperty("fill-color"), h2 = this.getPaintProperty("fill-opacity"), l6 = this.getPaintProperty("fill-pattern");
- this.hasDataDrivenColor = n2 == null ? void 0 : n2.isDataDriven, this.hasDataDrivenOpacity = h2 == null ? void 0 : h2.isDataDriven, this.hasDataDrivenFill = this.hasDataDrivenColor || this.hasDataDrivenOpacity || (l6 == null ? void 0 : l6.isDataDriven);
- const p2 = this.getPaintProperty("fill-outline-color");
- this.outlineUsesFillColor = !p2, this.hasDataDrivenOutlineColor = p2 == null ? void 0 : p2.isDataDriven, this.hasDataDrivenOutline = p2 ? p2.isDataDriven : !!n2 && n2.isDataDriven, this.hasDataDrivenOutline = (p2 ? this.hasDataDrivenOutlineColor : this.hasDataDrivenColor) || this.hasDataDrivenOpacity, this.fillMaterial = new l3(this.computeAttributesKey(T.FILL, l3.ATTRIBUTES, l3.ATTRIBUTES_INFO)), this.outlineMaterial = new T3(this.computeAttributesKey(T.OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE, this.outlineUsesFillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE), this.outlineUsesFillColor);
- }
- };
- var _2 = class extends P2 {
- constructor(i5, e3, a5, o2) {
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
- super(i5, e3, a5, o2);
- const s2 = this.getPaintProperty("line-pattern");
- if (this.lineMaterial = new i2(this.computeAttributesKey(T.LINE, i2.ATTRIBUTES, i2.ATTRIBUTES_INFO, s2 ? "line-dasharray" : "")), this.hasDataDrivenLine = ((_a = this.getPaintProperty("line-blur")) == null ? void 0 : _a.isDataDriven) || ((_b = this.getPaintProperty("line-color")) == null ? void 0 : _b.isDataDriven) || ((_c = this.getPaintProperty("line-gap-width")) == null ? void 0 : _c.isDataDriven) || ((_d = this.getPaintProperty("line-offset")) == null ? void 0 : _d.isDataDriven) || ((_e = this.getPaintProperty("line-opacity")) == null ? void 0 : _e.isDataDriven) || ((_f = this.getPaintProperty("line-pattern")) == null ? void 0 : _f.isDataDriven) || ((_g = this.getPaintProperty("line-dasharray")) == null ? void 0 : _g.isDataDriven) || ((_h = this.getLayoutProperty("line-cap")) == null ? void 0 : _h.isDataDriven) || ((_i = this.getPaintProperty("line-width")) == null ? void 0 : _i.isDataDriven), this.canUseThinTessellation = false, !this.hasDataDrivenLine) {
- const t7 = this.getPaintProperty("line-width");
- if (!t7 || "number" == typeof t7 && 0.5 * t7 < X) {
- const t8 = this.getPaintProperty("line-offset");
- (!t8 || "number" == typeof t8 && 0 === t8) && (this.canUseThinTessellation = true);
- }
- }
- }
- getDashKey(t7, i5) {
- let e3;
- switch (i5) {
- case D2.BUTT:
- e3 = "Butt";
- break;
- case D2.ROUND:
- e3 = "Round";
- break;
- case D2.SQUARE:
- e3 = "Square";
- break;
- default:
- e3 = "Butt";
- }
- return `dasharray-[${t7.toString()}]-${e3}`;
- }
- };
- var L2 = class extends P2 {
- constructor(i5, e3, a5, o2) {
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
- super(i5, e3, a5, o2), this.iconMaterial = new i3(this.computeAttributesKey(T.ICON, i3.ATTRIBUTES, i3.ATTRIBUTES_INFO)), this.textMaterial = new c2(this.computeAttributesKey(T.TEXT, c2.ATTRIBUTES, c2.ATTRIBUTES_INFO)), this.hasDataDrivenIcon = ((_a = this.getPaintProperty("icon-color")) == null ? void 0 : _a.isDataDriven) || ((_b = this.getPaintProperty("icon-halo-blur")) == null ? void 0 : _b.isDataDriven) || ((_c = this.getPaintProperty("icon-halo-color")) == null ? void 0 : _c.isDataDriven) || ((_d = this.getPaintProperty("icon-halo-width")) == null ? void 0 : _d.isDataDriven) || ((_e = this.getPaintProperty("icon-opacity")) == null ? void 0 : _e.isDataDriven) || ((_f = this.getLayoutProperty("icon-size")) == null ? void 0 : _f.isDataDriven), this.hasDataDrivenText = ((_g = this.getPaintProperty("text-color")) == null ? void 0 : _g.isDataDriven) || ((_h = this.getPaintProperty("text-halo-blur")) == null ? void 0 : _h.isDataDriven) || ((_i = this.getPaintProperty("text-halo-color")) == null ? void 0 : _i.isDataDriven) || ((_j = this.getPaintProperty("text-halo-width")) == null ? void 0 : _j.isDataDriven) || ((_k = this.getPaintProperty("text-opacity")) == null ? void 0 : _k.isDataDriven) || ((_l = this.getLayoutProperty("text-size")) == null ? void 0 : _l.isDataDriven);
- }
- };
- var d3 = class extends P2 {
- constructor(i5, a5, o2, r2) {
- super(i5, a5, o2, r2), this.circleMaterial = new t4(this.computeAttributesKey(T.CIRCLE, t4.ATTRIBUTES, t4.ATTRIBUTES_INFO));
- }
- };
- var T5 = class {
- constructor(t7, i5, e3) {
- let a5;
- this.allowOverlap = t7.getLayoutValue("icon-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("icon-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("icon-keep-upright", i5), this.optional = t7.getLayoutValue("icon-optional", i5), this.rotationAlignment = t7.getLayoutValue("icon-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e3 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("icon-anchor"), (a5 == null ? void 0 : a5.isDataDriven) ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("icon-anchor", i5), a5 = t7.getLayoutProperty("icon-offset"), (a5 == null ? void 0 : a5.isDataDriven) ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("icon-offset", i5), a5 = t7.getLayoutProperty("icon-padding"), (a5 == null ? void 0 : a5.isDataDriven) ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("icon-padding", i5), a5 = t7.getLayoutProperty("icon-rotate"), (a5 == null ? void 0 : a5.isDataDriven) ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("icon-rotate", i5), a5 = t7.getLayoutProperty("icon-size"), (a5 == null ? void 0 : a5.isDataDriven) ? this._sizeProp = a5 : this.size = t7.getLayoutValue("icon-size", i5);
- }
- update(t7, i5) {
- this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5));
- }
- };
- var m = class {
- constructor(t7, i5, e3) {
- let a5;
- this.allowOverlap = t7.getLayoutValue("text-allow-overlap", i5), this.ignorePlacement = t7.getLayoutValue("text-ignore-placement", i5), this.keepUpright = t7.getLayoutValue("text-keep-upright", i5), this.optional = t7.getLayoutValue("text-optional", i5), this.rotationAlignment = t7.getLayoutValue("text-rotation-alignment", i5), this.rotationAlignment === l2.AUTO && (this.rotationAlignment = e3 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("text-anchor"), (a5 == null ? void 0 : a5.isDataDriven) ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("text-anchor", i5), a5 = t7.getLayoutProperty("text-justify"), (a5 == null ? void 0 : a5.isDataDriven) ? this._justifyProp = a5 : this.justify = t7.getLayoutValue("text-justify", i5), a5 = t7.getLayoutProperty("text-letter-spacing"), (a5 == null ? void 0 : a5.isDataDriven) ? this._letterSpacingProp = a5 : this.letterSpacing = t7.getLayoutValue("text-letter-spacing", i5), a5 = t7.getLayoutProperty("text-line-height"), (a5 == null ? void 0 : a5.isDataDriven) ? this._lineHeightProp = a5 : this.lineHeight = t7.getLayoutValue("text-line-height", i5), a5 = t7.getLayoutProperty("text-max-angle"), (a5 == null ? void 0 : a5.isDataDriven) ? this._maxAngleProp = a5 : this.maxAngle = t7.getLayoutValue("text-max-angle", i5), a5 = t7.getLayoutProperty("text-max-width"), (a5 == null ? void 0 : a5.isDataDriven) ? this._maxWidthProp = a5 : this.maxWidth = t7.getLayoutValue("text-max-width", i5), a5 = t7.getLayoutProperty("text-offset"), (a5 == null ? void 0 : a5.isDataDriven) ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("text-offset", i5), a5 = t7.getLayoutProperty("text-padding"), (a5 == null ? void 0 : a5.isDataDriven) ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("text-padding", i5), a5 = t7.getLayoutProperty("text-rotate"), (a5 == null ? void 0 : a5.isDataDriven) ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("text-rotate", i5), a5 = t7.getLayoutProperty("text-size"), (a5 == null ? void 0 : a5.isDataDriven) ? this._sizeProp = a5 : this.size = t7.getLayoutValue("text-size", i5), a5 = t7.getLayoutProperty("text-writing-mode"), (a5 == null ? void 0 : a5.isDataDriven) ? this._writingModeProp = a5 : this.writingMode = t7.getLayoutValue("text-writing-mode", i5);
- }
- update(t7, i5) {
- this._anchorProp && (this.anchor = this._anchorProp.getValue(t7, i5)), this._justifyProp && (this.justify = this._justifyProp.getValue(t7, i5)), this._letterSpacingProp && (this.letterSpacing = this._letterSpacingProp.getValue(t7, i5)), this._lineHeightProp && (this.lineHeight = this._lineHeightProp.getValue(t7, i5)), this._maxAngleProp && (this.maxAngle = this._maxAngleProp.getValue(t7, i5)), this._maxWidthProp && (this.maxWidth = this._maxWidthProp.getValue(t7, i5)), this._offsetProp && (this.offset = this._offsetProp.getValue(t7, i5)), this._paddingProp && (this.padding = this._paddingProp.getValue(t7, i5)), this._rotateProp && (this.rotate = this._rotateProp.getValue(t7, i5)), this._sizeProp && (this.size = this._sizeProp.getValue(t7, i5)), this._writingModeProp && (this.writingMode = this._writingModeProp.getValue(t7, i5));
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleRepository.js
- var l5 = class {
- constructor(t7) {
- if (this._style = t7, this.backgroundBucketIds = [], this._uidToLayer = /* @__PURE__ */ new Map(), this._layerByName = {}, this._runningId = 0, t7.layers || (t7.layers = []), this.version = parseFloat(t7.version), this.layers = t7.layers.map((e3, t8, r2) => this._create(e3, t8, r2)).filter((e3) => !!e3), this.layers) {
- let t8;
- for (let r2 = 0; r2 < this.layers.length; r2++)
- t8 = this.layers[r2], this._layerByName[t8.id] = t8, this._uidToLayer.set(t8.uid, t8), t8.type === a.BACKGROUND && this.backgroundBucketIds.push(t8.id);
- }
- this._identifyRefLayers();
- }
- isPainterDataDriven(e3) {
- const t7 = this._layerByName[e3];
- return !!t7 && t7.isPainterDataDriven();
- }
- getStyleLayerId(e3) {
- return e3 >= this.layers.length ? null : this.layers[e3].id;
- }
- getStyleLayerByUID(e3) {
- var _a;
- return (_a = this._uidToLayer.get(e3)) != null ? _a : null;
- }
- getStyleLayerIndex(e3) {
- const t7 = this._layerByName[e3];
- return t7 ? this.layers.indexOf(t7) : -1;
- }
- setStyleLayer(e3, t7) {
- if (!e3 || !e3.id)
- return;
- const r2 = this._style;
- null != t7 && t7 >= this.layers.length && (t7 = this.layers.length - 1);
- let i5, s2 = true;
- const a5 = this._layerByName[e3.id];
- if (a5) {
- const y2 = this.layers.indexOf(a5);
- t7 || (t7 = y2), t7 === y2 ? (s2 = false, i5 = l5._recreateLayer(e3, a5), this.layers[t7] = i5, r2.layers[t7] = e3) : (this.layers.splice(y2, 1), r2.layers.splice(y2, 1), i5 = this._create(e3, t7, this.layers), this.layers.splice(t7, 0, i5), r2.layers.splice(t7, 0, e3));
- } else
- i5 = this._create(e3, t7, this.layers), !t7 || t7 >= this.layers.length ? (this.layers.push(i5), r2.layers.push(e3)) : (this.layers.splice(t7, 0, i5), r2.layers.splice(t7, 0, e3));
- this._layerByName[e3.id] = i5, this._uidToLayer.set(i5.uid, i5), s2 && this._recomputeZValues(), this._identifyRefLayers();
- }
- getStyleLayer(e3) {
- const t7 = this._layerByName[e3];
- return t7 ? { type: t7.typeName, id: t7.id, source: t7.source, "source-layer": t7.sourceLayer, minzoom: t7.minzoom, maxzoom: t7.maxzoom, filter: t7.filter, layout: t7.layout, paint: t7.paint } : null;
- }
- deleteStyleLayer(e3) {
- const t7 = this._layerByName[e3];
- if (t7) {
- delete this._layerByName[e3], this._uidToLayer.delete(t7.uid);
- const r2 = this.layers.indexOf(t7);
- this.layers.splice(r2, 1), this._style.layers.splice(r2, 1), this._recomputeZValues(), this._identifyRefLayers();
- }
- }
- getLayerById(e3) {
- return this._layerByName[e3];
- }
- getLayoutProperties(e3) {
- const t7 = this._layerByName[e3];
- return t7 ? t7.layout : null;
- }
- getPaintProperties(e3) {
- const t7 = this._layerByName[e3];
- return t7 ? t7.paint : null;
- }
- setPaintProperties(e3, t7) {
- const r2 = this._layerByName[e3];
- if (!r2)
- return;
- const i5 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: r2.layout, paint: t7 }, s2 = l5._recreateLayer(i5, r2), a5 = this.layers.indexOf(r2);
- this.layers[a5] = s2, this._style.layers[a5].paint = t7, this._layerByName[r2.id] = s2, this._uidToLayer.set(r2.uid, s2);
- }
- setLayoutProperties(e3, t7) {
- const r2 = this._layerByName[e3];
- if (!r2)
- return;
- const i5 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: t7, paint: r2.paint }, s2 = l5._recreateLayer(i5, r2), a5 = this.layers.indexOf(r2);
- this.layers[a5] = s2, this._style.layers[a5].layout = t7, this._layerByName[r2.id] = s2, this._uidToLayer.set(r2.uid, s2);
- }
- setStyleLayerVisibility(e3, t7) {
- const r2 = this._layerByName[e3];
- if (!r2)
- return;
- const i5 = r2.layout || {};
- i5.visibility = t7;
- const s2 = { type: r2.typeName, id: r2.id, source: r2.source, "source-layer": r2.sourceLayer, minzoom: r2.minzoom, maxzoom: r2.maxzoom, filter: r2.filter, layout: i5, paint: r2.paint }, a5 = l5._recreateLayer(s2, r2), y2 = this.layers.indexOf(r2);
- this.layers[y2] = a5, this._style.layers[y2].layout = i5, this._layerByName[r2.id] = a5, this._uidToLayer.set(r2.uid, a5);
- }
- getStyleLayerVisibility(e3) {
- var _a, _b;
- const t7 = this._layerByName[e3];
- if (!t7)
- return "none";
- return (_b = (_a = t7.layout) == null ? void 0 : _a.visibility) != null ? _b : "visible";
- }
- _recomputeZValues() {
- const e3 = this.layers, t7 = 1 / (e3.length + 1);
- for (let r2 = 0; r2 < e3.length; r2++)
- e3[r2].z = 1 - (1 + r2) * t7;
- }
- _identifyRefLayers() {
- var _a, _b;
- const t7 = [], r2 = [];
- let i5 = 0;
- for (const s2 of this.layers) {
- const a5 = s2.layout;
- if (s2.type === a.FILL) {
- const e3 = s2;
- let r3 = s2.source + "|" + s2.sourceLayer;
- r3 += "|" + ((_a = a5 == null ? void 0 : a5.visibility) != null ? _a : ""), r3 += "|" + s2.minzoom, r3 += "|" + s2.maxzoom, r3 += "|" + JSON.stringify(s2.filter), (e3.hasDataDrivenFill || e3.hasDataDrivenOutline) && (r3 += "|" + i5), t7.push({ key: r3, layer: s2 });
- } else if (s2.type === a.LINE) {
- const e3 = s2, t8 = s2.paint, l6 = null != t8 && (null != t8["line-pattern"] || null != t8["line-dasharray"]);
- let y2 = s2.source + "|" + s2.sourceLayer;
- y2 += "|" + ((_b = a5 == null ? void 0 : a5.visibility) != null ? _b : ""), y2 += "|" + s2.minzoom, y2 += "|" + s2.maxzoom, y2 += "|" + JSON.stringify(s2.filter), y2 += "|" + (void 0 !== a5 ? a5["line-cap"] : ""), y2 += "|" + (void 0 !== a5 ? a5["line-join"] : ""), (e3.hasDataDrivenLine || l6) && (y2 += "|" + i5), r2.push({ key: y2, layer: s2 });
- }
- ++i5;
- }
- this._assignRefLayers(t7), this._assignRefLayers(r2);
- }
- _assignRefLayers(t7) {
- let r2, i5;
- t7.sort((e3, t8) => e3.key < t8.key ? -1 : e3.key > t8.key ? 1 : 0);
- const s2 = t7.length;
- for (let a5 = 0; a5 < s2; a5++) {
- const l6 = t7[a5];
- if (l6.key === r2)
- l6.layer.refLayerId = i5;
- else if (r2 = l6.key, i5 = l6.layer.id, l6.layer.type === a.FILL) {
- if (!l6.layer.getPaintProperty("fill-outline-color"))
- for (let e3 = a5 + 1; e3 < s2; e3++) {
- const s3 = t7[e3];
- if (s3.key !== r2)
- break;
- if (s3.layer.getPaintProperty("fill-outline-color")) {
- t7[a5] = s3, t7[e3] = l6, i5 = s3.layer.id;
- break;
- }
- }
- } else if (l6.layer.type === a.LINE) {
- let e3 = l6.layer;
- for (let y2 = a5 + 1; y2 < s2; y2++) {
- const s3 = t7[y2];
- if (s3.key !== r2)
- break;
- const n2 = s3.layer;
- (e3.canUseThinTessellation && !n2.canUseThinTessellation || !e3.canUseThinTessellation && (n2.getPaintProperty("line-pattern") || n2.getPaintProperty("line-dasharray"))) && (e3 = n2, t7[a5] = s3, t7[y2] = l6, i5 = s3.layer.id);
- }
- }
- }
- }
- _create(l6, y2, n2) {
- const o2 = 1 - (1 + y2) * (1 / (n2.length + 1)), u2 = this._runningId++;
- switch (l6.type) {
- case "background":
- return new c4(a.BACKGROUND, l6, o2, u2);
- case "fill":
- return new f3(a.FILL, l6, o2, u2);
- case "line":
- return new _2(a.LINE, l6, o2, u2);
- case "symbol":
- return new L2(a.SYMBOL, l6, o2, u2);
- case "raster":
- console.warn(`Unsupported vector tile raster layer ${l6.id}`);
- case "circle":
- return new d3(a.CIRCLE, l6, o2, u2);
- }
- }
- static _recreateLayer(l6, y2) {
- switch (l6.type) {
- case "background":
- return new c4(a.BACKGROUND, l6, y2.z, y2.uid);
- case "fill":
- return new f3(a.FILL, l6, y2.z, y2.uid);
- case "line":
- return new _2(a.LINE, l6, y2.z, y2.uid);
- case "symbol":
- return new L2(a.SYMBOL, l6, y2.z, y2.uid);
- case "raster":
- console.warn(`Unsupported vector tile raster layer ${l6.id}`);
- case "circle":
- return new d3(a.CIRCLE, l6, y2.z, y2.uid);
- }
- }
- };
- export {
- t3 as t,
- T5 as T,
- m,
- l5 as l
- };
- //# sourceMappingURL=chunk-LC47RING.js.map
|