chunk-Y4YDGLMZ.js 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209
  1. import {
  2. T
  3. } from "./chunk-VGSBB3MM.js";
  4. import {
  5. a,
  6. f,
  7. l as l2
  8. } from "./chunk-3T4BXU2T.js";
  9. import {
  10. s
  11. } from "./chunk-SRMDO2KR.js";
  12. import {
  13. b
  14. } from "./chunk-PZKZIMMP.js";
  15. import {
  16. e
  17. } from "./chunk-YLVXZ2PS.js";
  18. import {
  19. X
  20. } from "./chunk-WFSV2B2I.js";
  21. import {
  22. t as t2
  23. } from "./chunk-J525NRN3.js";
  24. import {
  25. C
  26. } from "./chunk-MI7HWWFL.js";
  27. import {
  28. e as e2
  29. } from "./chunk-EZZVK4K6.js";
  30. import {
  31. p,
  32. v,
  33. z
  34. } from "./chunk-EGVIPYN2.js";
  35. import {
  36. l
  37. } from "./chunk-7XXXCK2A.js";
  38. import {
  39. t
  40. } from "./chunk-GZT4BVFP.js";
  41. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/MemoryBuffer.js
  42. var t3 = class {
  43. constructor(t7) {
  44. this._array = [], t7 <= 0 && console.error("strideInBytes must be positive!"), this._stride = t7;
  45. }
  46. get array() {
  47. return this._array;
  48. }
  49. get index() {
  50. return 4 * this._array.length / this._stride;
  51. }
  52. get itemSize() {
  53. return this._stride;
  54. }
  55. get sizeInBytes() {
  56. return 4 * this._array.length;
  57. }
  58. reset() {
  59. this.array.length = 0;
  60. }
  61. toBuffer() {
  62. return new Uint32Array(this._array).buffer;
  63. }
  64. static i1616to32(t7, r2) {
  65. return 65535 & t7 | r2 << 16;
  66. }
  67. static i8888to32(t7, r2, e4, s2) {
  68. return 255 & t7 | (255 & r2) << 8 | (255 & e4) << 16 | s2 << 24;
  69. }
  70. static i8816to32(t7, r2, e4) {
  71. return 255 & t7 | (255 & r2) << 8 | e4 << 16;
  72. }
  73. };
  74. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/enums.js
  75. var N;
  76. var R;
  77. !function(N3) {
  78. 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";
  79. }(N || (N = {})), function(N3) {
  80. 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";
  81. }(R || (R = {}));
  82. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterial.js
  83. var i = class {
  84. constructor(t7) {
  85. this._locations = new Map(), this._key = t7;
  86. }
  87. get key() {
  88. return this._key;
  89. }
  90. get type() {
  91. return 7 & this._key;
  92. }
  93. defines() {
  94. return [];
  95. }
  96. getStride() {
  97. return this._layoutInfo || this._buildAttributesInfo(), this._stride;
  98. }
  99. getAttributeLocations() {
  100. return this._locations.size === 0 && this._buildAttributesInfo(), this._locations;
  101. }
  102. getLayoutInfo() {
  103. return this._layoutInfo || this._buildAttributesInfo(), this._layoutInfo;
  104. }
  105. getEncodingInfos() {
  106. return this._propertyEncodingInfo || this._buildAttributesInfo(), this._propertyEncodingInfo;
  107. }
  108. getUniforms() {
  109. return this._uniforms || this._buildAttributesInfo(), this._uniforms;
  110. }
  111. getShaderHeader() {
  112. return this._shaderHeader || this._buildAttributesInfo(), this._shaderHeader;
  113. }
  114. getShaderMain() {
  115. return this._shaderMain || this._buildAttributesInfo(), this._shaderMain;
  116. }
  117. setDataUniforms(t7, e4, n2, o2, s2) {
  118. const r2 = this.getUniforms();
  119. for (const i5 of r2) {
  120. const { name: r3, type: a5, getValue: c5 } = i5, u2 = c5(n2, e4, o2, s2);
  121. if (u2 !== null)
  122. switch (a5) {
  123. case "float":
  124. t7.setUniform1f(r3, u2);
  125. break;
  126. case "vec2":
  127. t7.setUniform2fv(r3, u2);
  128. break;
  129. case "vec4":
  130. t7.setUniform4fv(r3, u2);
  131. }
  132. }
  133. }
  134. encodeAttributes(t7, e4, o2, s2) {
  135. const r2 = this.attributesInfo(), i5 = this.getEncodingInfos(), a5 = [];
  136. let c5 = 0, u2 = 0;
  137. for (const f4 of Object.keys(i5)) {
  138. const _3 = i5[f4], { type: h2, precisionFactor: d4, isLayout: l6 } = r2[f4], y2 = l6 ? o2.getLayoutProperty(f4) : o2.getPaintProperty(f4), m2 = y2.interpolator?.getInterpolationRange(e4);
  139. let I2 = 0;
  140. for (const o3 of _3) {
  141. const { offset: r3, bufferElementsToAdd: i6 } = o3;
  142. if (i6 > 0) {
  143. for (let t8 = 0; t8 < i6; t8++)
  144. a5.push(0);
  145. c5 += u2, u2 = o3.bufferElementsToAdd;
  146. }
  147. const f5 = s2 ?? y2.getValue(m2 ? m2[I2] : e4, t7);
  148. switch (h2) {
  149. case N.R8_SIGNED:
  150. case N.R8_UNSIGNED:
  151. a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3);
  152. break;
  153. case N.R16_SIGNED:
  154. case N.R16_UNSIGNED:
  155. a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3);
  156. break;
  157. case N.R8G8_SIGNED:
  158. case N.R8G8_UNSIGNED:
  159. a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeByte(f5 * (d4 || 1), 8 * r3 + 8);
  160. break;
  161. case N.R16G16_SIGNED:
  162. case N.R16G16_UNSIGNED:
  163. a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3), a5[c5] |= this._encodeShort(f5 * (d4 || 1), 8 * r3 + 16);
  164. break;
  165. case N.R8G8B8A8_SIGNED:
  166. case N.R8G8B8A8_UNSIGNED:
  167. 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);
  168. break;
  169. case N.R8G8B8A8_COLOR:
  170. a5[c5] = this._encodeColor(f5);
  171. break;
  172. case N.R16G16B16A16_DASHARRAY:
  173. case N.R16G16B16A16_PATTERN:
  174. this._encodePattern(c5, a5, f5);
  175. break;
  176. default:
  177. throw new Error("Unsupported encoding type");
  178. }
  179. I2++;
  180. }
  181. }
  182. return a5;
  183. }
  184. getAtributeState(t7) {
  185. let e4 = 0;
  186. const n2 = 3 + 2 * t7;
  187. return e4 |= this._bit(n2), e4 |= this._bit(n2 + 1) << 1, e4;
  188. }
  189. _buildAttributesInfo() {
  190. const t7 = [], e4 = {}, n2 = {};
  191. let r2 = -1;
  192. const a5 = this.attributesInfo(), c5 = this.attributes();
  193. let u2 = -1;
  194. for (const s2 of c5) {
  195. u2++;
  196. const c6 = this.getAtributeState(u2);
  197. if (c6 === R.UNIFORM || c6 === R.UNUSED)
  198. continue;
  199. const f5 = a5[s2], _4 = [];
  200. e4[s2] = _4;
  201. const h3 = f5.type;
  202. for (let e5 = 0; e5 < c6; e5++) {
  203. const { dataType: e6, bytesPerElement: o2, count: s3, normalized: a6 } = i._encodingInfo[h3], c7 = o2 * s3, u3 = `${e6}-${a6 === true}`;
  204. let f6 = n2[u3], d4 = 0;
  205. if (!f6 || f6.count + s3 > 4)
  206. r2++, f6 = { dataIndex: r2, count: 0, offset: 0 }, s3 !== 4 && (n2[u3] = f6), t7.push({ location: -1, name: "a_data_" + r2, count: s3, type: e6, normalized: a6 }), d4 = Math.ceil(Math.max(c7 / 4, 1));
  207. else {
  208. const e7 = t7[f6.dataIndex];
  209. e7.count += s3;
  210. d4 = Math.ceil(Math.max(e7.count * o2 / 4, 1)) - Math.ceil(Math.max(f6.offset / 4, 1));
  211. }
  212. _4.push({ dataIndex: f6.dataIndex, offset: f6.offset, bufferElementsToAdd: d4 }), f6.offset += c7, f6.count += s3;
  213. }
  214. }
  215. for (const o2 of t7)
  216. switch (o2.type) {
  217. case C.BYTE:
  218. case C.UNSIGNED_BYTE:
  219. o2.count = 4;
  220. break;
  221. case C.SHORT:
  222. case C.UNSIGNED_SHORT:
  223. o2.count += o2.count % 2;
  224. }
  225. this._buildVertexBufferLayout(t7);
  226. let f4 = 0;
  227. const _3 = this._layoutInfo.geometry;
  228. for (const o2 of _3)
  229. this._locations.set(o2.name, f4++);
  230. const h2 = this._layoutInfo.opacity;
  231. if (h2)
  232. for (const o2 of h2)
  233. this._locations.set(o2.name, f4++);
  234. this._buildShaderInfo(t7, e4), this._propertyEncodingInfo = e4;
  235. }
  236. _buildVertexBufferLayout(t7) {
  237. const e4 = {}, n2 = this.geometryInfo();
  238. let o2 = n2[0].stride;
  239. if (t7.length === 0)
  240. e4.geometry = n2;
  241. else {
  242. const s2 = [];
  243. let i5 = o2;
  244. for (const e5 of t7)
  245. o2 += a2(e5.type) * e5.count;
  246. for (const t8 of n2)
  247. s2.push(new t2(t8.name, t8.count, t8.type, t8.offset, o2, t8.normalized));
  248. for (const e5 of t7)
  249. s2.push(new t2(e5.name, e5.count, e5.type, i5, o2, e5.normalized)), i5 += a2(e5.type) * e5.count;
  250. e4.geometry = s2;
  251. }
  252. this.opacityInfo() && (e4.opacity = this.opacityInfo()), this._layoutInfo = e4, this._stride = o2;
  253. }
  254. _buildShaderInfo(e4, s2) {
  255. let r2 = "\n", a5 = "\n";
  256. const u2 = [];
  257. for (const t7 of e4)
  258. r2 += `attribute ${this._getType(t7.count)} ${t7.name};
  259. `;
  260. const f4 = this.attributes(), _3 = this.attributesInfo();
  261. let h2 = -1;
  262. for (const d4 of f4) {
  263. h2++;
  264. const { name: e5, type: f5, precisionFactor: l6, isLayout: y2 } = _3[d4], m2 = l6 && l6 !== 1 ? " * " + 1 / l6 : "", { bytesPerElement: I2, count: E2 } = i._encodingInfo[f5], p2 = (t7) => `a_data_${t7.dataIndex}${c(E2, t7.offset, I2)}`;
  265. switch (this.getAtributeState(h2)) {
  266. case R.UNIFORM:
  267. {
  268. const o2 = this._getType(E2), s3 = `u_${e5}`;
  269. u2.push({ name: s3, type: o2, getValue: (e6, o3, s4, r3) => {
  270. const i5 = y2 ? e6.getLayoutValue(d4, o3) : e6.getPaintValue(d4, o3);
  271. if (f5 === N.R16G16B16A16_DASHARRAY) {
  272. const n2 = e6.getDashKey(i5, e6.getLayoutValue("line-cap", o3)), s5 = r3.getMosaicItemPosition(n2, false);
  273. if (t(s5))
  274. return null;
  275. const { tl: a6, br: c5 } = s5;
  276. return [a6[0], c5[1], c5[0], a6[1]];
  277. }
  278. if (f5 === N.R16G16B16A16_PATTERN) {
  279. const e7 = r3.getMosaicItemPosition(i5, !d4.includes("line-"));
  280. if (t(e7))
  281. return null;
  282. const { tl: n2, br: o4 } = e7;
  283. return [n2[0], o4[1], o4[0], n2[1]];
  284. }
  285. if (f5 === N.R8G8B8A8_COLOR) {
  286. const t7 = i5[3];
  287. return [t7 * i5[0], t7 * i5[1], t7 * i5[2], t7];
  288. }
  289. return i5;
  290. } }), r2 += `uniform ${o2} ${s3};
  291. `, a5 += `${o2} ${e5} = ${s3};
  292. `;
  293. }
  294. break;
  295. case R.DATA_DRIVEN:
  296. {
  297. const t7 = p2(s2[d4][0]);
  298. a5 += `${this._getType(E2)} ${e5} = ${t7}${m2};
  299. `;
  300. }
  301. break;
  302. case R.INTERPOLATED_DATA_DRIVEN: {
  303. const t7 = `u_t_${e5}`;
  304. u2.push({ name: t7, type: "float", getValue: (t8, e6, n3, o3) => (y2 ? t8.getLayoutProperty(d4) : t8.getPaintProperty(d4)).interpolator.interpolationUniformValue(n3, e6) }), r2 += `uniform float ${t7};
  305. `;
  306. const n2 = p2(s2[d4][0]), o2 = p2(s2[d4][1]);
  307. a5 += `${this._getType(E2)} ${e5} = mix(${n2}${m2}, ${o2}${m2}, ${t7});
  308. `;
  309. }
  310. }
  311. }
  312. this._shaderHeader = r2, this._shaderMain = a5, this._uniforms = u2;
  313. }
  314. _bit(t7) {
  315. return (this._key & 1 << t7) >> t7;
  316. }
  317. _getType(t7) {
  318. switch (t7) {
  319. case 1:
  320. return "float";
  321. case 2:
  322. return "vec2";
  323. case 3:
  324. return "vec3";
  325. case 4:
  326. return "vec4";
  327. }
  328. throw new Error("Invalid count");
  329. }
  330. _encodeColor(t7) {
  331. const n2 = 255 * t7[3];
  332. return t3.i8888to32(t7[0] * n2, t7[1] * n2, t7[2] * n2, n2);
  333. }
  334. _encodePattern(t7, e4, n2) {
  335. if (!n2 || !n2.rect)
  336. return;
  337. const o2 = 2, s2 = n2.rect, r2 = n2.width, i5 = n2.height;
  338. e4[t7] = this._encodeShort(s2.x + o2, 0), e4[t7] |= this._encodeShort(s2.y + o2 + i5, 16), e4[t7 + 1] = this._encodeShort(s2.x + o2 + r2, 0), e4[t7 + 1] |= this._encodeShort(s2.y + o2, 16);
  339. }
  340. _encodeByte(t7, e4) {
  341. return (255 & t7) << e4;
  342. }
  343. _encodeShort(t7, e4) {
  344. return (65535 & t7) << e4;
  345. }
  346. };
  347. 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 } };
  348. var a2 = (t7) => {
  349. switch (t7) {
  350. case C.FLOAT:
  351. case C.INT:
  352. case C.UNSIGNED_INT:
  353. return 4;
  354. case C.SHORT:
  355. case C.UNSIGNED_SHORT:
  356. return 2;
  357. case C.BYTE:
  358. case C.UNSIGNED_BYTE:
  359. return 1;
  360. }
  361. };
  362. var c = (t7, e4, n2) => {
  363. const o2 = e4 / n2;
  364. if (t7 === 1)
  365. switch (o2) {
  366. case 0:
  367. return ".x";
  368. case 1:
  369. return ".y";
  370. case 2:
  371. return ".z";
  372. case 3:
  373. return ".w";
  374. }
  375. else if (t7 === 2)
  376. switch (o2) {
  377. case 0:
  378. return ".xy";
  379. case 1:
  380. return ".yz";
  381. case 2:
  382. return ".zw";
  383. }
  384. else if (t7 === 3)
  385. switch (o2) {
  386. case 0:
  387. return ".xyz";
  388. case 1:
  389. return ".yzw";
  390. }
  391. return "";
  392. };
  393. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js
  394. var T2 = class extends i {
  395. constructor(r2) {
  396. super(r2);
  397. }
  398. geometryInfo() {
  399. return T2.GEOMETRY_LAYOUT;
  400. }
  401. opacityInfo() {
  402. return null;
  403. }
  404. attributes() {
  405. return T2.ATTRIBUTES;
  406. }
  407. attributesInfo() {
  408. return T2.ATTRIBUTES_INFO;
  409. }
  410. };
  411. T2.ATTRIBUTES = [], T2.GEOMETRY_LAYOUT = [new t2("a_pos", 2, C.BYTE, 0, 2)], T2.ATTRIBUTES_INFO = {};
  412. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js
  413. var t4 = class extends i {
  414. constructor(r2) {
  415. super(r2);
  416. }
  417. geometryInfo() {
  418. return t4.GEOMETRY_LAYOUT;
  419. }
  420. opacityInfo() {
  421. return null;
  422. }
  423. attributes() {
  424. return t4.ATTRIBUTES;
  425. }
  426. attributesInfo() {
  427. return t4.ATTRIBUTES_INFO;
  428. }
  429. };
  430. 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 } };
  431. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js
  432. var l3 = class extends i {
  433. constructor(o2) {
  434. super(o2);
  435. }
  436. geometryInfo() {
  437. return l3.GEOMETRY_LAYOUT;
  438. }
  439. opacityInfo() {
  440. return null;
  441. }
  442. attributes() {
  443. return l3.ATTRIBUTES;
  444. }
  445. attributesInfo() {
  446. return l3.ATTRIBUTES_INFO;
  447. }
  448. };
  449. 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 } };
  450. var T3 = class extends i {
  451. constructor(o2, t7) {
  452. super(o2), this.usefillColor = t7;
  453. }
  454. geometryInfo() {
  455. return T3.GEOMETRY_LAYOUT;
  456. }
  457. opacityInfo() {
  458. return null;
  459. }
  460. attributes() {
  461. return this.usefillColor ? T3.ATTRIBUTES_FILL : T3.ATTRIBUTES_OUTLINE;
  462. }
  463. attributesInfo() {
  464. return this.usefillColor ? T3.ATTRIBUTES_INFO_FILL : T3.ATTRIBUTES_INFO_OUTLINE;
  465. }
  466. };
  467. 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 } };
  468. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js
  469. var i2 = class extends i {
  470. constructor(e4) {
  471. super(e4);
  472. }
  473. geometryInfo() {
  474. return i2.GEOMETRY_LAYOUT;
  475. }
  476. opacityInfo() {
  477. return null;
  478. }
  479. attributes() {
  480. return i2.ATTRIBUTES;
  481. }
  482. attributesInfo() {
  483. return i2.ATTRIBUTES_INFO;
  484. }
  485. };
  486. 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 } };
  487. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js
  488. 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)];
  489. var n = [new t2("a_opacityInfo", 1, C.UNSIGNED_BYTE, 0, 1)];
  490. var i3 = class extends i {
  491. constructor(o2) {
  492. super(o2);
  493. }
  494. geometryInfo() {
  495. return a3;
  496. }
  497. opacityInfo() {
  498. return n;
  499. }
  500. attributes() {
  501. return i3.ATTRIBUTES;
  502. }
  503. attributesInfo() {
  504. return i3.ATTRIBUTES_INFO;
  505. }
  506. };
  507. 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 } };
  508. var c2 = class extends i {
  509. constructor(o2) {
  510. super(o2);
  511. }
  512. geometryInfo() {
  513. return a3;
  514. }
  515. opacityInfo() {
  516. return n;
  517. }
  518. attributes() {
  519. return c2.ATTRIBUTES;
  520. }
  521. attributesInfo() {
  522. return c2.ATTRIBUTES_INFO;
  523. }
  524. };
  525. 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 } };
  526. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/types.js
  527. var r = { kind: "null" };
  528. var e3 = { kind: "number" };
  529. var t5 = { kind: "string" };
  530. var i4 = { kind: "boolean" };
  531. var o = { kind: "color" };
  532. var f2 = { kind: "object" };
  533. var u = { kind: "value" };
  534. function a4(n2, r2) {
  535. return { kind: "array", itemType: n2, n: r2 };
  536. }
  537. var y = [r, e3, t5, i4, o, f2, a4(u)];
  538. function k(n2) {
  539. if (n2.kind === "array") {
  540. const r2 = k(n2.itemType);
  541. return typeof n2.n == "number" ? `array<${r2}, ${n2.n}>` : n2.itemType.kind === "value" ? "array" : `array<${r2}>`;
  542. }
  543. return n2.kind;
  544. }
  545. function l4(y2) {
  546. if (y2 === null)
  547. return r;
  548. if (typeof y2 == "string")
  549. return t5;
  550. if (typeof y2 == "boolean")
  551. return i4;
  552. if (typeof y2 == "number")
  553. return e3;
  554. if (y2 instanceof l)
  555. return o;
  556. if (Array.isArray(y2)) {
  557. let n2;
  558. for (const r2 of y2) {
  559. const e4 = l4(r2);
  560. if (n2) {
  561. if (n2 !== e4) {
  562. n2 = u;
  563. break;
  564. }
  565. } else
  566. n2 = e4;
  567. }
  568. return a4(n2 || u, y2.length);
  569. }
  570. return typeof y2 == "object" ? f2 : u;
  571. }
  572. function c3(n2, r2) {
  573. if (r2.kind === "array")
  574. return n2.kind === "array" && (n2.n === 0 && n2.itemType.kind === "value" || c3(n2.itemType, r2.itemType)) && (typeof r2.n != "number" || r2.n === n2.n);
  575. if (r2.kind === "value") {
  576. for (const e4 of y)
  577. if (c3(n2, e4))
  578. return true;
  579. }
  580. return r2.kind === n2.kind;
  581. }
  582. function d(r2) {
  583. if (r2 === null)
  584. return "";
  585. const e4 = typeof r2;
  586. return e4 === "string" ? r2 : e4 === "number" || e4 === "boolean" ? String(r2) : r2 instanceof l ? r2.toString() : JSON.stringify(r2);
  587. }
  588. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/expression.js
  589. var v2 = class {
  590. constructor(t7) {
  591. this.parent = t7, this.vars = {};
  592. }
  593. add(t7, e4) {
  594. this.vars[t7] = e4;
  595. }
  596. get(t7) {
  597. return this.vars[t7] ? this.vars[t7] : this.parent ? this.parent.get(t7) : null;
  598. }
  599. };
  600. var b2 = class {
  601. constructor() {
  602. this.type = u;
  603. }
  604. static parse(t7) {
  605. if (t7.length > 1)
  606. throw new Error('"id" does not expect arguments');
  607. return new b2();
  608. }
  609. evaluate(t7, e4) {
  610. return t7?.id;
  611. }
  612. };
  613. var d2 = class {
  614. constructor() {
  615. this.type = t5;
  616. }
  617. static parse(t7) {
  618. if (t7.length > 1)
  619. throw new Error('"geometry-type" does not expect arguments');
  620. return new d2();
  621. }
  622. evaluate(t7, e4) {
  623. if (!t7)
  624. return null;
  625. switch (t7.type) {
  626. case s.Point:
  627. return "Point";
  628. case s.LineString:
  629. return "LineString";
  630. case s.Polygon:
  631. return "Polygon";
  632. default:
  633. return null;
  634. }
  635. }
  636. };
  637. var x = class {
  638. constructor() {
  639. this.type = f2;
  640. }
  641. static parse(t7) {
  642. if (t7.length > 1)
  643. throw new Error('"properties" does not expect arguments');
  644. return new x();
  645. }
  646. evaluate(t7, e4) {
  647. return t7?.values;
  648. }
  649. };
  650. var E = class {
  651. constructor() {
  652. this.type = e3;
  653. }
  654. static parse(t7) {
  655. if (t7.length > 1)
  656. throw new Error('"zoom" does not expect arguments');
  657. return new E();
  658. }
  659. evaluate(t7, e4) {
  660. return e4;
  661. }
  662. };
  663. var $ = class {
  664. constructor(t7, e4, r2) {
  665. this.lhs = t7, this.rhs = e4, this.compare = r2, this.type = i4;
  666. }
  667. static parse(t7, e4, r2) {
  668. if (t7.length !== 3 && t7.length !== 4)
  669. throw new Error(`"${t7[0]}" expects 2 or 3 arguments`);
  670. if (t7.length === 4)
  671. throw new Error(`"${t7[0]}" collator not supported`);
  672. return new $(pt(t7[1], e4), pt(t7[2], e4), r2);
  673. }
  674. evaluate(t7, e4) {
  675. return this.compare(this.lhs.evaluate(t7, e4), this.rhs.evaluate(t7, e4));
  676. }
  677. };
  678. var M = class extends $ {
  679. static parse(t7, e4) {
  680. return $.parse(t7, e4, (t8, e5) => t8 === e5);
  681. }
  682. };
  683. var k2 = class extends $ {
  684. static parse(t7, e4) {
  685. return $.parse(t7, e4, (t8, e5) => t8 !== e5);
  686. }
  687. };
  688. var A = class extends $ {
  689. static parse(t7, e4) {
  690. return $.parse(t7, e4, (t8, e5) => t8 < e5);
  691. }
  692. };
  693. var j = class extends $ {
  694. static parse(t7, e4) {
  695. return $.parse(t7, e4, (t8, e5) => t8 <= e5);
  696. }
  697. };
  698. var q = class extends $ {
  699. static parse(t7, e4) {
  700. return $.parse(t7, e4, (t8, e5) => t8 > e5);
  701. }
  702. };
  703. var _ = class extends $ {
  704. static parse(t7, e4) {
  705. return $.parse(t7, e4, (t8, e5) => t8 >= e5);
  706. }
  707. };
  708. var N2 = class {
  709. constructor(t7) {
  710. this.arg = t7, this.type = i4;
  711. }
  712. static parse(t7, e4) {
  713. if (t7.length !== 2)
  714. throw new Error('"!" expects 1 argument');
  715. return new N2(pt(t7[1], e4));
  716. }
  717. evaluate(t7, e4) {
  718. return !this.arg.evaluate(t7, e4);
  719. }
  720. };
  721. var R2 = class {
  722. constructor(t7) {
  723. this.args = t7, this.type = i4;
  724. }
  725. static parse(t7, e4) {
  726. const r2 = [];
  727. for (let s2 = 1; s2 < t7.length; s2++)
  728. r2.push(pt(t7[s2], e4));
  729. return new R2(r2);
  730. }
  731. evaluate(t7, e4) {
  732. for (const r2 of this.args)
  733. if (!r2.evaluate(t7, e4))
  734. return false;
  735. return true;
  736. }
  737. };
  738. var C2 = class {
  739. constructor(t7) {
  740. this.args = t7, this.type = i4;
  741. }
  742. static parse(t7, e4) {
  743. const r2 = [];
  744. for (let s2 = 1; s2 < t7.length; s2++)
  745. r2.push(pt(t7[s2], e4));
  746. return new C2(r2);
  747. }
  748. evaluate(t7, e4) {
  749. for (const r2 of this.args)
  750. if (r2.evaluate(t7, e4))
  751. return true;
  752. return false;
  753. }
  754. };
  755. var z2 = class {
  756. constructor(t7) {
  757. this.args = t7, this.type = i4;
  758. }
  759. static parse(t7, e4) {
  760. const r2 = [];
  761. for (let s2 = 1; s2 < t7.length; s2++)
  762. r2.push(pt(t7[s2], e4));
  763. return new z2(r2);
  764. }
  765. evaluate(t7, e4) {
  766. for (const r2 of this.args)
  767. if (r2.evaluate(t7, e4))
  768. return false;
  769. return true;
  770. }
  771. };
  772. var I = class {
  773. constructor(t7, e4, r2) {
  774. this.type = t7, this.args = e4, this.fallback = r2;
  775. }
  776. static parse(t7, e4, r2) {
  777. if (t7.length < 4)
  778. throw new Error('"case" expects at least 3 arguments');
  779. if (t7.length % 2 == 1)
  780. throw new Error('"case" expects an odd number of arguments');
  781. let s2;
  782. const n2 = [];
  783. for (let o2 = 1; o2 < t7.length - 1; o2 += 2) {
  784. const a6 = pt(t7[o2], e4), i5 = pt(t7[o2 + 1], e4, r2);
  785. s2 || (s2 = i5.type), n2.push({ condition: a6, output: i5 });
  786. }
  787. const a5 = pt(t7[t7.length - 1], e4, r2);
  788. return s2 || (s2 = a5.type), new I(s2, n2, a5);
  789. }
  790. evaluate(t7, e4) {
  791. for (const r2 of this.args)
  792. if (r2.condition.evaluate(t7, e4))
  793. return r2.output.evaluate(t7, e4);
  794. return this.fallback.evaluate(t7, e4);
  795. }
  796. };
  797. var L = class {
  798. constructor(t7, e4) {
  799. this.type = t7, this.args = e4;
  800. }
  801. static parse(t7, e4) {
  802. if (t7.length < 2)
  803. throw new Error('"coalesce" expects at least 1 argument');
  804. let r2;
  805. const s2 = [];
  806. for (let n2 = 1; n2 < t7.length; n2++) {
  807. const a5 = pt(t7[n2], e4);
  808. r2 || (r2 = a5.type), s2.push(a5);
  809. }
  810. return new L(r2, s2);
  811. }
  812. evaluate(t7, e4) {
  813. for (const r2 of this.args) {
  814. const s2 = r2.evaluate(t7, e4);
  815. if (s2 !== null)
  816. return s2;
  817. }
  818. return null;
  819. }
  820. };
  821. var U = class {
  822. constructor(t7, e4, r2, s2, n2) {
  823. this.type = t7, this.input = e4, this.labels = r2, this.outputs = s2, this.fallback = n2;
  824. }
  825. static parse(t7, e4) {
  826. if (t7.length < 3)
  827. throw new Error('"match" expects at least 3 arguments');
  828. if (t7.length % 2 == 0)
  829. throw new Error('"case" expects an even number of arguments');
  830. let r2;
  831. const s2 = pt(t7[1], e4), n2 = [], a5 = {};
  832. let o2;
  833. for (let i5 = 2; i5 < t7.length - 1; i5 += 2) {
  834. let s3 = t7[i5];
  835. Array.isArray(s3) || (s3 = [s3]);
  836. for (const t8 of s3) {
  837. const e5 = typeof t8;
  838. if (e5 !== "string" && e5 !== "number")
  839. throw new Error('"match" requires string or number literal as labels');
  840. if (o2) {
  841. if (e5 !== o2)
  842. throw new Error('"match" requires labels to have the same type');
  843. } else
  844. o2 = e5;
  845. a5[t8] = n2.length;
  846. }
  847. const l6 = pt(t7[i5 + 1], e4);
  848. r2 || (r2 = l6.type), n2.push(l6);
  849. }
  850. return new U(r2, s2, a5, n2, pt(t7[t7.length - 1], e4));
  851. }
  852. evaluate(t7, e4) {
  853. const r2 = this.input.evaluate(t7, e4);
  854. return (this.outputs[this.labels[r2]] || this.fallback).evaluate(t7, e4);
  855. }
  856. };
  857. var P = class {
  858. constructor(t7, e4, r2, s2, n2) {
  859. this.operator = t7, this.type = e4, this.interpolation = r2, this.input = s2, this.stops = n2;
  860. }
  861. static parse(t7, e4, r2) {
  862. const s2 = t7[0];
  863. if (t7.length < 5)
  864. throw new Error(`"${s2}" expects at least 4 arguments`);
  865. const n2 = t7[1];
  866. if (!Array.isArray(n2) || n2.length === 0)
  867. throw new Error(`"${n2}" is not a valid interpolation`);
  868. switch (n2[0]) {
  869. case "linear":
  870. if (n2.length !== 1)
  871. throw new Error("Linear interpolation cannot have parameters");
  872. break;
  873. case "exponential":
  874. if (n2.length !== 2 || typeof n2[1] != "number")
  875. throw new Error("Exponential interpolation requires one numeric argument");
  876. break;
  877. case "cubic-bezier":
  878. if (n2.length !== 5)
  879. throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
  880. for (let t8 = 1; t8 < 5; t8++) {
  881. const e5 = n2[t8];
  882. if (typeof e5 != "number" || e5 < 0 || e5 > 1)
  883. throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");
  884. }
  885. break;
  886. default:
  887. throw new Error(`"${t7[0]}" unknown interpolation type "${n2[0]}"`);
  888. }
  889. if (t7.length % 2 != 1)
  890. throw new Error(`"${s2}" expects an even number of arguments`);
  891. const a5 = pt(t7[2], e4, e3);
  892. let o2;
  893. s2 === "interpolate-hcl" || s2 === "interpolate-lab" ? o2 = o : r2 && r2.kind !== "value" && (o2 = r2);
  894. const i5 = [];
  895. for (let l6 = 3; l6 < t7.length; l6 += 2) {
  896. const r3 = t7[l6];
  897. if (typeof r3 != "number")
  898. throw new Error(`"${s2}" requires stop inputs as literal numbers`);
  899. if (i5.length && i5[i5.length - 1][0] >= r3)
  900. throw new Error(`"${s2}" requires strictly ascending stop inputs`);
  901. const n3 = pt(t7[l6 + 1], e4, o2);
  902. o2 || (o2 = n3.type), i5.push([r3, n3]);
  903. }
  904. if (o2 && o2 !== o && o2 !== e3 && (o2.kind !== "array" || o2.itemType !== e3))
  905. throw new Error(`"${s2}" cannot interpolate type ${k(o2)}`);
  906. return new P(s2, o2, n2, a5, i5);
  907. }
  908. evaluate(n2, o2) {
  909. const i5 = this.stops;
  910. if (i5.length === 1)
  911. return i5[0][1].evaluate(n2, o2);
  912. const l6 = this.input.evaluate(n2, o2);
  913. if (l6 <= i5[0][0])
  914. return i5[0][1].evaluate(n2, o2);
  915. if (l6 >= i5[i5.length - 1][0])
  916. return i5[i5.length - 1][1].evaluate(n2, o2);
  917. let u2 = 0;
  918. for (; ++u2 < i5.length && !(l6 < i5[u2][0]); )
  919. ;
  920. 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);
  921. if (this.operator === "interpolate") {
  922. if (this.type.kind === "array" && Array.isArray(f4) && Array.isArray(w))
  923. return f4.map((t7, e4) => b(t7, w[e4], g));
  924. if (this.type.kind === "color" && f4 instanceof l && w instanceof l) {
  925. const e4 = new l(f4), r2 = new l(w);
  926. return new l([b(e4.r, r2.r, g), b(e4.g, r2.g, g), b(e4.b, r2.b, g), b(e4.a, r2.a, g)]);
  927. }
  928. if (this.type.kind === "number" && typeof f4 == "number" && typeof w == "number")
  929. return b(f4, w, g);
  930. throw new Error(`"${this.operator}" cannot interpolate type ${k(this.type)}`);
  931. }
  932. if (this.operator === "interpolate-hcl") {
  933. 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) });
  934. return new l({ a: b(f4.a, w.a, g), ...i6 });
  935. }
  936. if (this.operator === "interpolate-lab") {
  937. const e4 = z(f4), n3 = z(w), o3 = p({ l: b(e4.l, n3.l, g), a: b(e4.a, n3.a, g), b: b(e4.b, n3.b, g) });
  938. return new l({ a: b(f4.a, w.a, g), ...o3 });
  939. }
  940. throw new Error(`Unexpected operator "${this.operator}"`);
  941. }
  942. interpolationUniformValue(t7, e4) {
  943. const r2 = this.stops;
  944. if (r2.length === 1)
  945. return 0;
  946. if (t7 >= r2[r2.length - 1][0])
  947. return 0;
  948. let s2 = 0;
  949. for (; ++s2 < r2.length && !(t7 < r2[s2][0]); )
  950. ;
  951. const n2 = r2[s2 - 1][0], a5 = r2[s2][0];
  952. return P.interpolationRatio(this.interpolation, e4, n2, a5);
  953. }
  954. getInterpolationRange(t7) {
  955. const e4 = this.stops;
  956. if (e4.length === 1) {
  957. const t8 = e4[0][0];
  958. return [t8, t8];
  959. }
  960. const r2 = e4[e4.length - 1][0];
  961. if (t7 >= r2)
  962. return [r2, r2];
  963. let s2 = 0;
  964. for (; ++s2 < e4.length && !(t7 < e4[s2][0]); )
  965. ;
  966. return [e4[s2 - 1][0], e4[s2][0]];
  967. }
  968. static interpolationRatio(t7, e4, r2, s2) {
  969. let a5 = 0;
  970. if (t7[0] === "linear")
  971. a5 = P._exponentialInterpolationRatio(e4, 1, r2, s2);
  972. else if (t7[0] === "exponential")
  973. a5 = P._exponentialInterpolationRatio(e4, t7[1], r2, s2);
  974. else if (t7[0] === "cubic-bezier") {
  975. a5 = e2(t7[1], t7[2], t7[3], t7[4])(P._exponentialInterpolationRatio(e4, 1, r2, s2), 1e-5);
  976. }
  977. return a5 < 0 ? a5 = 0 : a5 > 1 && (a5 = 1), a5;
  978. }
  979. static _exponentialInterpolationRatio(t7, e4, r2, s2) {
  980. const n2 = s2 - r2;
  981. if (n2 === 0)
  982. return 0;
  983. const a5 = t7 - r2;
  984. return e4 === 1 ? a5 / n2 : (e4 ** a5 - 1) / (e4 ** n2 - 1);
  985. }
  986. };
  987. var S = class {
  988. constructor(t7, e4, r2) {
  989. this.type = t7, this.input = e4, this.stops = r2;
  990. }
  991. static parse(t7, e4) {
  992. if (t7.length < 5)
  993. throw new Error('"step" expects at least 4 arguments');
  994. if (t7.length % 2 != 1)
  995. throw new Error('"step" expects an even number of arguments');
  996. const r2 = pt(t7[1], e4, e3);
  997. let s2;
  998. const n2 = [];
  999. n2.push([-1 / 0, pt(t7[2], e4)]);
  1000. for (let a5 = 3; a5 < t7.length; a5 += 2) {
  1001. const r3 = t7[a5];
  1002. if (typeof r3 != "number")
  1003. throw new Error('"step" requires stop inputs as literal numbers');
  1004. if (n2.length && n2[n2.length - 1][0] >= r3)
  1005. throw new Error('"step" requires strictly ascending stop inputs');
  1006. const o2 = pt(t7[a5 + 1], e4);
  1007. s2 || (s2 = o2.type), n2.push([r3, o2]);
  1008. }
  1009. return new S(s2, r2, n2);
  1010. }
  1011. evaluate(t7, e4) {
  1012. const r2 = this.stops;
  1013. if (r2.length === 1)
  1014. return r2[0][1].evaluate(t7, e4);
  1015. const s2 = this.input.evaluate(t7, e4);
  1016. let n2 = 0;
  1017. for (; ++n2 < r2.length && !(s2 < r2[n2][0]); )
  1018. ;
  1019. return this.stops[n2 - 1][1].evaluate(t7, e4);
  1020. }
  1021. };
  1022. var B = class {
  1023. constructor(t7, e4) {
  1024. this.type = t7, this.output = e4;
  1025. }
  1026. static parse(t7, e4, r2) {
  1027. if (t7.length < 4)
  1028. throw new Error('"let" expects at least 3 arguments');
  1029. if (t7.length % 2 == 1)
  1030. throw new Error('"let" expects an odd number of arguments');
  1031. const s2 = new v2(e4);
  1032. for (let a5 = 1; a5 < t7.length - 1; a5 += 2) {
  1033. const r3 = t7[a5];
  1034. if (typeof r3 != "string")
  1035. throw new Error(`"let" requires a string to define variable names - found ${r3}`);
  1036. s2.add(r3, pt(t7[a5 + 1], e4));
  1037. }
  1038. const n2 = pt(t7[t7.length - 1], s2, r2);
  1039. return new B(n2.type, n2);
  1040. }
  1041. evaluate(t7, e4) {
  1042. return this.output.evaluate(t7, e4);
  1043. }
  1044. };
  1045. var G = class {
  1046. constructor(t7, e4) {
  1047. this.type = t7, this.output = e4;
  1048. }
  1049. static parse(t7, e4, r2) {
  1050. if (t7.length !== 2 || typeof t7[1] != "string")
  1051. throw new Error('"var" requires just one literal string argument');
  1052. const s2 = e4.get(t7[1]);
  1053. if (!s2)
  1054. throw new Error(`${t7[1]} must be defined before being used in a "var" expression`);
  1055. return new G(r2 || u, s2);
  1056. }
  1057. evaluate(t7, e4) {
  1058. return this.output.evaluate(t7, e4);
  1059. }
  1060. };
  1061. var O = class {
  1062. constructor(t7, e4, r2) {
  1063. this.type = t7, this.index = e4, this.array = r2;
  1064. }
  1065. static parse(t7, e4) {
  1066. if (t7.length !== 3)
  1067. throw new Error('"at" expects 2 arguments');
  1068. const r2 = pt(t7[1], e4, e3), s2 = pt(t7[2], e4);
  1069. return new O(s2.type.itemType, r2, s2);
  1070. }
  1071. evaluate(t7, e4) {
  1072. const r2 = this.index.evaluate(t7, e4), s2 = this.array.evaluate(t7, e4);
  1073. if (r2 < 0 || r2 >= s2.length)
  1074. throw new Error('"at" index out of bounds');
  1075. if (r2 !== Math.floor(r2))
  1076. throw new Error('"at" index must be an integer');
  1077. return s2[r2];
  1078. }
  1079. };
  1080. var T4 = class {
  1081. constructor(t7, e4) {
  1082. this.key = t7, this.obj = e4, this.type = u;
  1083. }
  1084. static parse(t7, e4) {
  1085. let r2, s2;
  1086. switch (t7.length) {
  1087. case 2:
  1088. return r2 = pt(t7[1], e4), new T4(r2);
  1089. case 3:
  1090. return r2 = pt(t7[1], e4), s2 = pt(t7[2], e4), new T4(r2, s2);
  1091. default:
  1092. throw new Error('"get" expects 1 or 2 arguments');
  1093. }
  1094. }
  1095. evaluate(t7, e4) {
  1096. const r2 = this.key.evaluate(t7, e4);
  1097. if (this.obj) {
  1098. return this.obj.evaluate(t7, e4)[r2];
  1099. }
  1100. return t7?.values[r2];
  1101. }
  1102. };
  1103. var F = class {
  1104. constructor(t7, e4) {
  1105. this.key = t7, this.obj = e4, this.type = i4;
  1106. }
  1107. static parse(t7, e4) {
  1108. let r2, s2;
  1109. switch (t7.length) {
  1110. case 2:
  1111. return r2 = pt(t7[1], e4), new F(r2);
  1112. case 3:
  1113. return r2 = pt(t7[1], e4), s2 = pt(t7[2], e4), new F(r2, s2);
  1114. default:
  1115. throw new Error('"has" expects 1 or 2 arguments');
  1116. }
  1117. }
  1118. evaluate(t7, e4) {
  1119. const r2 = this.key.evaluate(t7, e4);
  1120. if (this.obj) {
  1121. return r2 in this.obj.evaluate(t7, e4);
  1122. }
  1123. return !!t7?.values[r2];
  1124. }
  1125. };
  1126. var V = class {
  1127. constructor(t7, e4) {
  1128. this.key = t7, this.vals = e4, this.type = i4;
  1129. }
  1130. static parse(t7, e4) {
  1131. if (t7.length !== 3)
  1132. throw new Error('"in" expects 2 arguments');
  1133. return new V(pt(t7[1], e4), pt(t7[2], e4));
  1134. }
  1135. evaluate(t7, e4) {
  1136. const r2 = this.key.evaluate(t7, e4);
  1137. return this.vals.evaluate(t7, e4).includes(r2);
  1138. }
  1139. };
  1140. var D = class {
  1141. constructor(t7, e4, r2) {
  1142. this.item = t7, this.array = e4, this.from = r2, this.type = e3;
  1143. }
  1144. static parse(t7, e4) {
  1145. if (t7.length < 3 || t7.length > 4)
  1146. throw new Error('"index-of" expects 3 or 4 arguments');
  1147. const r2 = pt(t7[1], e4), s2 = pt(t7[2], e4);
  1148. if (t7.length === 4) {
  1149. const n2 = pt(t7[3], e4, e3);
  1150. return new D(r2, s2, n2);
  1151. }
  1152. return new D(r2, s2);
  1153. }
  1154. evaluate(t7, e4) {
  1155. const r2 = this.item.evaluate(t7, e4), s2 = this.array.evaluate(t7, e4);
  1156. if (this.from) {
  1157. const n2 = this.from.evaluate(t7, e4);
  1158. if (n2 !== Math.floor(n2))
  1159. throw new Error('"index-of" index must be an integer');
  1160. return s2.indexOf(r2, n2);
  1161. }
  1162. return s2.indexOf(r2);
  1163. }
  1164. };
  1165. var H = class {
  1166. constructor(t7) {
  1167. this.arg = t7, this.type = e3;
  1168. }
  1169. static parse(t7, e4) {
  1170. if (t7.length !== 2)
  1171. throw new Error('"length" expects 2 arguments');
  1172. const r2 = pt(t7[1], e4);
  1173. return new H(r2);
  1174. }
  1175. evaluate(t7, e4) {
  1176. const r2 = this.arg.evaluate(t7, e4);
  1177. if (typeof r2 == "string")
  1178. return r2.length;
  1179. if (Array.isArray(r2))
  1180. return r2.length;
  1181. throw new Error('"length" expects string or array');
  1182. }
  1183. };
  1184. var J = class {
  1185. constructor(t7, e4, r2, s2) {
  1186. this.type = t7, this.array = e4, this.from = r2, this.to = s2;
  1187. }
  1188. static parse(t7, e4) {
  1189. if (t7.length < 3 || t7.length > 4)
  1190. throw new Error('"slice" expects 2 or 3 arguments');
  1191. const r2 = pt(t7[1], e4), s2 = pt(t7[2], e4, e3);
  1192. if (s2.type !== e3)
  1193. throw new Error('"slice" index must return a number');
  1194. if (t7.length === 4) {
  1195. const n2 = pt(t7[3], e4, e3);
  1196. if (n2.type !== e3)
  1197. throw new Error('"slice" index must return a number');
  1198. return new J(r2.type, r2, s2, n2);
  1199. }
  1200. return new J(r2.type, r2, s2);
  1201. }
  1202. evaluate(t7, e4) {
  1203. const r2 = this.array.evaluate(t7, e4);
  1204. if (!Array.isArray(r2) && typeof r2 != "string")
  1205. throw new Error('"slice" input must be an array or a string');
  1206. const s2 = this.from.evaluate(t7, e4);
  1207. if (s2 < 0 || s2 >= r2.length)
  1208. throw new Error('"slice" index out of bounds');
  1209. if (s2 !== Math.floor(s2))
  1210. throw new Error('"slice" index must be an integer');
  1211. if (this.to) {
  1212. const n2 = this.to.evaluate(t7, e4);
  1213. if (n2 < 0 || n2 >= r2.length)
  1214. throw new Error('"slice" index out of bounds');
  1215. if (n2 !== Math.floor(n2))
  1216. throw new Error('"slice" index must be an integer');
  1217. return r2.slice(s2, n2);
  1218. }
  1219. return r2.slice(s2);
  1220. }
  1221. };
  1222. var K = class {
  1223. constructor() {
  1224. this.type = i4;
  1225. }
  1226. static parse(t7) {
  1227. if (t7.length !== 1)
  1228. throw new Error('"has-id" expects no arguments');
  1229. return new K();
  1230. }
  1231. evaluate(t7, e4) {
  1232. return t7 && t7.id !== void 0;
  1233. }
  1234. };
  1235. var Q = class {
  1236. constructor(t7, e4) {
  1237. this.args = t7, this.calculate = e4, this.type = e3;
  1238. }
  1239. static parse(t7, e4, r2) {
  1240. const s2 = t7.slice(1).map((t8) => pt(t8, e4));
  1241. return new Q(s2, r2);
  1242. }
  1243. evaluate(t7, e4) {
  1244. let r2;
  1245. return this.args && (r2 = this.args.map((r3) => r3.evaluate(t7, e4))), this.calculate(r2);
  1246. }
  1247. };
  1248. var W = class extends Q {
  1249. static parse(t7, e4) {
  1250. switch (t7.length) {
  1251. case 2:
  1252. return Q.parse(t7, e4, (t8) => -t8[0]);
  1253. case 3:
  1254. return Q.parse(t7, e4, (t8) => t8[0] - t8[1]);
  1255. default:
  1256. throw new Error('"-" expects 1 or 2 arguments');
  1257. }
  1258. }
  1259. };
  1260. var X2 = class extends Q {
  1261. static parse(t7, e4) {
  1262. return Q.parse(t7, e4, (t8) => {
  1263. let e5 = 1;
  1264. for (const r2 of t8)
  1265. e5 *= r2;
  1266. return e5;
  1267. });
  1268. }
  1269. };
  1270. var Y = class extends Q {
  1271. static parse(t7, e4) {
  1272. if (t7.length === 3)
  1273. return Q.parse(t7, e4, (t8) => t8[0] / t8[1]);
  1274. throw new Error('"/" expects 2 arguments');
  1275. }
  1276. };
  1277. var Z = class extends Q {
  1278. static parse(t7, e4) {
  1279. if (t7.length === 3)
  1280. return Q.parse(t7, e4, (t8) => t8[0] % t8[1]);
  1281. throw new Error('"%" expects 2 arguments');
  1282. }
  1283. };
  1284. var tt = class extends Q {
  1285. static parse(t7, e4) {
  1286. if (t7.length === 3)
  1287. return Q.parse(t7, e4, (t8) => t8[0] ** t8[1]);
  1288. throw new Error('"^" expects 1 or 2 arguments');
  1289. }
  1290. };
  1291. var et = class extends Q {
  1292. static parse(t7, e4) {
  1293. return Q.parse(t7, e4, (t8) => {
  1294. let e5 = 0;
  1295. for (const r2 of t8)
  1296. e5 += r2;
  1297. return e5;
  1298. });
  1299. }
  1300. };
  1301. var rt = class {
  1302. constructor(t7, e4) {
  1303. this.args = t7, this.calculate = e4, this.type = e3;
  1304. }
  1305. static parse(t7, e4) {
  1306. const r2 = t7.slice(1).map((t8) => pt(t8, e4));
  1307. return new rt(r2, rt.ops[t7[0]]);
  1308. }
  1309. evaluate(t7, e4) {
  1310. let r2;
  1311. return this.args && (r2 = this.args.map((r3) => r3.evaluate(t7, e4))), this.calculate(r2);
  1312. }
  1313. };
  1314. 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]) };
  1315. var st = class {
  1316. constructor(t7) {
  1317. this.args = t7, this.type = t5;
  1318. }
  1319. static parse(t7, e4) {
  1320. return new st(t7.slice(1).map((t8) => pt(t8, e4)));
  1321. }
  1322. evaluate(t7, e4) {
  1323. return this.args.map((r2) => r2.evaluate(t7, e4)).join("");
  1324. }
  1325. };
  1326. var nt = class {
  1327. constructor(t7, e4) {
  1328. this.arg = t7, this.calculate = e4, this.type = t5;
  1329. }
  1330. static parse(t7, e4) {
  1331. if (t7.length !== 2)
  1332. throw new Error(`${t7[0]} expects 1 argument`);
  1333. const r2 = pt(t7[1], e4);
  1334. return new nt(r2, nt.ops[t7[0]]);
  1335. }
  1336. evaluate(t7, e4) {
  1337. return this.calculate(this.arg.evaluate(t7, e4));
  1338. }
  1339. };
  1340. nt.ops = { downcase: (t7) => t7.toLowerCase(), upcase: (t7) => t7.toUpperCase() };
  1341. var at = class {
  1342. constructor(t7) {
  1343. this.args = t7, this.type = o;
  1344. }
  1345. static parse(t7, e4) {
  1346. if (t7.length !== 4)
  1347. throw new Error('"rgb" expects 3 arguments');
  1348. const r2 = t7.slice(1).map((t8) => pt(t8, e4));
  1349. return new at(r2);
  1350. }
  1351. evaluate(e4, r2) {
  1352. const s2 = this._validate(this.args[0].evaluate(e4, r2)), n2 = this._validate(this.args[1].evaluate(e4, r2)), a5 = this._validate(this.args[2].evaluate(e4, r2));
  1353. return new l({ r: s2, g: n2, b: a5 });
  1354. }
  1355. _validate(t7) {
  1356. if (typeof t7 != "number" || t7 < 0 || t7 > 255)
  1357. throw new Error(`${t7}: invalid color component`);
  1358. return Math.round(t7);
  1359. }
  1360. };
  1361. var ot = class {
  1362. constructor(t7) {
  1363. this.args = t7, this.type = o;
  1364. }
  1365. static parse(t7, e4) {
  1366. if (t7.length !== 5)
  1367. throw new Error('"rgba" expects 4 arguments');
  1368. const r2 = t7.slice(1).map((t8) => pt(t8, e4));
  1369. return new ot(r2);
  1370. }
  1371. evaluate(e4, r2) {
  1372. const s2 = this._validate(this.args[0].evaluate(e4, r2)), n2 = this._validate(this.args[1].evaluate(e4, r2)), a5 = this._validate(this.args[2].evaluate(e4, r2)), o2 = this._validateAlpha(this.args[3].evaluate(e4, r2));
  1373. return new l({ r: s2, g: n2, b: a5, a: o2 });
  1374. }
  1375. _validate(t7) {
  1376. if (typeof t7 != "number" || t7 < 0 || t7 > 255)
  1377. throw new Error(`${t7}: invalid color component`);
  1378. return Math.round(t7);
  1379. }
  1380. _validateAlpha(t7) {
  1381. if (typeof t7 != "number" || t7 < 0 || t7 > 1)
  1382. throw new Error(`${t7}: invalid alpha color component`);
  1383. return t7;
  1384. }
  1385. };
  1386. var it = class {
  1387. constructor(t7) {
  1388. this.color = t7, this.type = a4(e3, 4);
  1389. }
  1390. static parse(t7, e4) {
  1391. if (t7.length !== 2)
  1392. throw new Error('"to-rgba" expects 1 argument');
  1393. const r2 = pt(t7[1], e4);
  1394. return new it(r2);
  1395. }
  1396. evaluate(e4, r2) {
  1397. return new l(this.color.evaluate(e4, r2)).toRgba();
  1398. }
  1399. };
  1400. var lt = class {
  1401. constructor(t7, e4) {
  1402. this.type = t7, this.args = e4;
  1403. }
  1404. static parse(t7, e4) {
  1405. const r2 = t7[0];
  1406. if (t7.length < 2)
  1407. throw new Error(`${r2} expects at least one argument`);
  1408. let s2, n2 = 1;
  1409. if (r2 === "array") {
  1410. if (t7.length > 2) {
  1411. switch (t7[1]) {
  1412. case "string":
  1413. s2 = t5;
  1414. break;
  1415. case "number":
  1416. s2 = e3;
  1417. break;
  1418. case "boolean":
  1419. s2 = i4;
  1420. break;
  1421. default:
  1422. throw new Error('"array" type argument must be string, number or boolean');
  1423. }
  1424. n2++;
  1425. } else
  1426. s2 = u;
  1427. let e5;
  1428. if (t7.length > 3) {
  1429. if (e5 = t7[2], e5 !== null && (typeof e5 != "number" || e5 < 0 || e5 !== Math.floor(e5)))
  1430. throw new Error('"array" length argument must be a positive integer literal');
  1431. n2++;
  1432. }
  1433. s2 = a4(s2, e5);
  1434. } else
  1435. switch (r2) {
  1436. case "string":
  1437. s2 = t5;
  1438. break;
  1439. case "number":
  1440. s2 = e3;
  1441. break;
  1442. case "boolean":
  1443. s2 = i4;
  1444. break;
  1445. case "object":
  1446. s2 = f2;
  1447. }
  1448. const a5 = [];
  1449. for (; n2 < t7.length; n2++) {
  1450. const r3 = pt(t7[n2], e4);
  1451. a5.push(r3);
  1452. }
  1453. return new lt(s2, a5);
  1454. }
  1455. evaluate(t7, e4) {
  1456. let r2;
  1457. for (const s2 of this.args) {
  1458. const n2 = s2.evaluate(t7, e4);
  1459. if (r2 = l4(n2), c3(r2, this.type))
  1460. return n2;
  1461. }
  1462. throw new Error(`Expected ${k(this.type)} but got ${k(r2)}`);
  1463. }
  1464. };
  1465. var ut = class {
  1466. constructor(t7, e4) {
  1467. this.type = t7, this.args = e4;
  1468. }
  1469. static parse(t7, e4) {
  1470. const r2 = t7[0], s2 = ut.types[r2];
  1471. if (s2 === i4 || s2 === t5) {
  1472. if (t7.length !== 2)
  1473. throw new Error(`${r2} expects one argument`);
  1474. } else if (t7.length < 2)
  1475. throw new Error(`${r2} expects at least one argument`);
  1476. const n2 = [];
  1477. for (let a5 = 1; a5 < t7.length; a5++) {
  1478. const r3 = pt(t7[a5], e4);
  1479. n2.push(r3);
  1480. }
  1481. return new ut(s2, n2);
  1482. }
  1483. evaluate(e4, r2) {
  1484. if (this.type === i4)
  1485. return Boolean(this.args[0].evaluate(e4, r2));
  1486. if (this.type === t5)
  1487. return d(this.args[0].evaluate(e4, r2));
  1488. if (this.type === e3) {
  1489. for (const t7 of this.args) {
  1490. const s2 = Number(t7.evaluate(e4, r2));
  1491. if (!isNaN(s2))
  1492. return s2;
  1493. }
  1494. return null;
  1495. }
  1496. if (this.type === o) {
  1497. for (const s2 of this.args)
  1498. try {
  1499. const n2 = ut.toColor(s2.evaluate(e4, r2));
  1500. if (n2 instanceof l)
  1501. return n2;
  1502. } catch {
  1503. }
  1504. return null;
  1505. }
  1506. }
  1507. static toBoolean(t7) {
  1508. return Boolean(t7);
  1509. }
  1510. static toString(t7) {
  1511. return d(t7);
  1512. }
  1513. static toNumber(t7) {
  1514. const e4 = Number(t7);
  1515. if (isNaN(e4))
  1516. throw new Error(`"${t7}" is not a number`);
  1517. return e4;
  1518. }
  1519. static toColor(e4) {
  1520. if (e4 instanceof l)
  1521. return e4;
  1522. if (typeof e4 == "string") {
  1523. const r2 = l.fromString(e4);
  1524. if (r2)
  1525. return r2;
  1526. throw new Error(`"${e4}" is not a color`);
  1527. }
  1528. if (Array.isArray(e4))
  1529. return l.fromArray(e4);
  1530. throw new Error(`"${e4}" is not a color`);
  1531. }
  1532. };
  1533. ut.types = { "to-boolean": i4, "to-color": o, "to-number": e3, "to-string": t5 };
  1534. var ct = class {
  1535. constructor(t7) {
  1536. this.val = t7, this.type = l4(t7);
  1537. }
  1538. static parse(t7) {
  1539. if (t7.length !== 2)
  1540. throw new Error('"literal" expects 1 argument');
  1541. return new ct(t7[1]);
  1542. }
  1543. evaluate(t7, e4) {
  1544. return this.val;
  1545. }
  1546. };
  1547. var ht = class {
  1548. constructor(t7) {
  1549. this.arg = t7, this.type = t5;
  1550. }
  1551. static parse(t7, e4) {
  1552. if (t7.length !== 2)
  1553. throw new Error('"typeof" expects 1 argument');
  1554. return new ht(pt(t7[1], e4));
  1555. }
  1556. evaluate(t7, e4) {
  1557. return k(l4(this.arg.evaluate(t7, e4)));
  1558. }
  1559. };
  1560. function pt(t7, e4, r2) {
  1561. const s2 = typeof t7;
  1562. if (s2 === "string" || s2 === "boolean" || s2 === "number" || t7 === null) {
  1563. if (r2)
  1564. switch (r2.kind) {
  1565. case "string":
  1566. s2 !== "string" && (t7 = ut.toString(t7));
  1567. break;
  1568. case "number":
  1569. s2 !== "number" && (t7 = ut.toNumber(t7));
  1570. break;
  1571. case "color":
  1572. t7 = ut.toColor(t7);
  1573. }
  1574. t7 = ["literal", t7];
  1575. }
  1576. if (!Array.isArray(t7) || t7.length === 0)
  1577. throw new Error("Expression must be a non empty array");
  1578. const n2 = t7[0];
  1579. if (typeof n2 != "string")
  1580. throw new Error("First element of expression must be a string");
  1581. const a5 = gt[n2];
  1582. if (a5 === void 0)
  1583. throw new Error(`Invalid expression operator "${n2}"`);
  1584. if (!a5)
  1585. throw new Error(`Unimplemented expression operator "${n2}"`);
  1586. return a5.parse(t7, e4, r2);
  1587. }
  1588. 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": d2, id: b2, "line-progress": null, properties: x, at: O, get: T4, has: F, in: V, "index-of": D, length: H, slice: J, "!": N2, "!=": k2, "<": A, "<=": j, "==": M, ">": 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: E, "heatmap-density": null, "has-id": K, none: z2 };
  1589. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/Filter.js
  1590. var t6 = class {
  1591. constructor(e4) {
  1592. this._expression = e4;
  1593. }
  1594. filter(e4, r2) {
  1595. if (!this._expression)
  1596. return true;
  1597. try {
  1598. return this._expression.evaluate(e4, r2);
  1599. } catch (t7) {
  1600. return console.log(t7.message), true;
  1601. }
  1602. }
  1603. static createFilter(n2) {
  1604. if (!n2)
  1605. return null;
  1606. this.isLegacyFilter(n2) && (n2 = this.convertLegacyFilter(n2));
  1607. try {
  1608. const s2 = pt(n2, null, i4);
  1609. return new t6(s2);
  1610. } catch (s2) {
  1611. return console.log(s2.message), null;
  1612. }
  1613. }
  1614. static isLegacyFilter(e4) {
  1615. if (!Array.isArray(e4))
  1616. return true;
  1617. if (e4.length === 0)
  1618. return true;
  1619. switch (e4[0]) {
  1620. case "==":
  1621. case "!=":
  1622. case ">":
  1623. case "<":
  1624. case ">=":
  1625. case "<=":
  1626. return e4.length === 3 && typeof e4[1] == "string" && !Array.isArray(e4[2]);
  1627. case "in":
  1628. return e4.length >= 3 && typeof e4[1] == "string" && !Array.isArray(e4[2]);
  1629. case "!in":
  1630. case "none":
  1631. case "!has":
  1632. return true;
  1633. case "any":
  1634. case "all":
  1635. for (let r2 = 1; r2 < e4.length; r2++)
  1636. if (this.isLegacyFilter(e4[r2]))
  1637. return true;
  1638. return false;
  1639. case "has":
  1640. return e4.length === 2 && (e4[1] === "$id" || e4[1] === "$type");
  1641. default:
  1642. return false;
  1643. }
  1644. }
  1645. static convertLegacyFilter(e4) {
  1646. if (!Array.isArray(e4) || e4.length === 0)
  1647. return true;
  1648. const r2 = e4[0];
  1649. if (e4.length === 1)
  1650. return r2 !== "any";
  1651. switch (r2) {
  1652. case "==":
  1653. return t6.convertComparison("==", e4[1], e4[2]);
  1654. case "!=":
  1655. return t6.negate(t6.convertComparison("==", e4[1], e4[2]));
  1656. case ">":
  1657. case "<":
  1658. case ">=":
  1659. case "<=":
  1660. return t6.convertComparison(r2, e4[1], e4[2]);
  1661. case "in":
  1662. return t6.convertIn(e4[1], e4.slice(2));
  1663. case "!in":
  1664. return t6.negate(t6.convertIn(e4[1], e4.slice(2)));
  1665. case "any":
  1666. case "all":
  1667. case "none":
  1668. return t6.convertCombining(r2, e4.slice(1));
  1669. case "has":
  1670. return t6.convertHas(e4[1]);
  1671. case "!has":
  1672. return t6.negate(t6.convertHas(e4[1]));
  1673. default:
  1674. throw new Error("Unexpected legacy filter.");
  1675. }
  1676. }
  1677. static convertComparison(e4, r2, t7) {
  1678. switch (r2) {
  1679. case "$type":
  1680. return [e4, ["geometry-type"], t7];
  1681. case "$id":
  1682. return [e4, ["id"], t7];
  1683. default:
  1684. return [e4, ["get", r2], t7];
  1685. }
  1686. }
  1687. static convertIn(e4, r2) {
  1688. switch (e4) {
  1689. case "$type":
  1690. return ["in", ["geometry-type"], ["literal", r2]];
  1691. case "$id":
  1692. return ["in", ["id"], ["literal", r2]];
  1693. default:
  1694. return ["in", ["get", e4], ["literal", r2]];
  1695. }
  1696. }
  1697. static convertHas(e4) {
  1698. switch (e4) {
  1699. case "$type":
  1700. return true;
  1701. case "$id":
  1702. return ["has-id"];
  1703. default:
  1704. return ["has", e4];
  1705. }
  1706. }
  1707. static convertCombining(e4, r2) {
  1708. return [e4].concat(r2.map(this.convertLegacyFilter));
  1709. }
  1710. static negate(e4) {
  1711. return ["!", e4];
  1712. }
  1713. };
  1714. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleProperty.js
  1715. var h = class {
  1716. constructor(t7, e4) {
  1717. let n2;
  1718. switch (this.isDataDriven = false, this.interpolator = null, t7.type) {
  1719. case "number":
  1720. case "color":
  1721. n2 = true;
  1722. break;
  1723. case "array":
  1724. n2 = t7.value === "number";
  1725. break;
  1726. default:
  1727. n2 = false;
  1728. }
  1729. if (e4 == null && (e4 = t7.default), Array.isArray(e4) && e4.length > 0 && gt[e4[0]]) {
  1730. const r2 = { number: e3, color: o, string: t5, boolean: i4, enum: t5 };
  1731. try {
  1732. const n3 = t7.type === "array" ? a4(r2[t7.value] || u, t7.length) : r2[t7.type], u2 = pt(e4, null, n3);
  1733. this.getValue = this._buildExpression(u2, t7), this.isDataDriven = true, u2 instanceof P && u2.input instanceof E && (this.interpolator = u2);
  1734. } catch (c5) {
  1735. console.log(c5.message), this.getValue = this._buildSimple(t7.default);
  1736. }
  1737. return;
  1738. }
  1739. n2 && e4.type === "interval" && (n2 = false);
  1740. const h2 = e4 && e4.stops && e4.stops.length > 0;
  1741. if (h2)
  1742. for (const r2 of e4.stops)
  1743. r2[1] = this._validate(r2[1], t7);
  1744. if (this.isDataDriven = !!e4 && !!e4.property, this.isDataDriven)
  1745. if (e4.default !== void 0 && (e4.default = this._validate(e4.default, t7)), h2)
  1746. switch (e4.type) {
  1747. case "identity":
  1748. this.getValue = this._buildIdentity(e4, t7);
  1749. break;
  1750. case "categorical":
  1751. this.getValue = this._buildCategorical(e4, t7);
  1752. break;
  1753. default:
  1754. this.getValue = n2 ? this._buildInterpolate(e4, t7) : this._buildInterval(e4, t7);
  1755. }
  1756. else
  1757. this.getValue = this._buildIdentity(e4, t7);
  1758. else
  1759. h2 ? this.getValue = n2 ? this._buildZoomInterpolate(e4) : this._buildZoomInterval(e4) : (e4 = this._validate(e4, t7), this.getValue = this._buildSimple(e4));
  1760. }
  1761. _validate(t7, e4) {
  1762. if (e4.type === "number") {
  1763. if (t7 < e4.minimum)
  1764. return e4.minimum;
  1765. if (t7 > e4.maximum)
  1766. return e4.maximum;
  1767. } else
  1768. e4.type === "color" ? t7 = h._parseColor(t7) : e4.type === "enum" ? typeof t7 == "string" && (t7 = e4.values.indexOf(t7)) : e4.type === "array" && e4.value === "enum" ? t7 = t7.map((t8) => typeof t8 == "string" ? e4.values.indexOf(t8) : t8) : e4.type === "string" && (t7 = d(t7));
  1769. return t7;
  1770. }
  1771. _buildSimple(t7) {
  1772. return () => t7;
  1773. }
  1774. _buildExpression(t7, e4) {
  1775. return (r2, i5) => {
  1776. try {
  1777. const l6 = t7.evaluate(i5, r2);
  1778. return l6 === void 0 ? e4.default : this._validate(l6, e4);
  1779. } catch (l6) {
  1780. return console.log(l6.message), e4.default;
  1781. }
  1782. };
  1783. }
  1784. _buildIdentity(t7, e4) {
  1785. return (r2, i5) => {
  1786. let l6;
  1787. return i5 && (l6 = i5.values[t7.property]), l6 !== void 0 && (l6 = this._validate(l6, e4)), l6 != null ? l6 : t7.default !== void 0 ? t7.default : e4.default;
  1788. };
  1789. }
  1790. _buildCategorical(t7, e4) {
  1791. return (r2, i5) => {
  1792. let l6;
  1793. return i5 && (l6 = i5.values[t7.property]), l6 = this._categorical(l6, t7.stops), l6 !== void 0 ? l6 : t7.default !== void 0 ? t7.default : e4.default;
  1794. };
  1795. }
  1796. _buildInterval(t7, e4) {
  1797. return (r2, i5) => {
  1798. let l6;
  1799. return i5 && (l6 = i5.values[t7.property]), typeof l6 == "number" ? this._interval(l6, t7.stops) : t7.default !== void 0 ? t7.default : e4.default;
  1800. };
  1801. }
  1802. _buildInterpolate(t7, e4) {
  1803. return (r2, i5) => {
  1804. let l6;
  1805. return i5 && (l6 = i5.values[t7.property]), typeof l6 == "number" ? this._interpolate(l6, t7.stops, t7.base || 1) : t7.default !== void 0 ? t7.default : e4.default;
  1806. };
  1807. }
  1808. _buildZoomInterpolate(t7) {
  1809. return (e4) => this._interpolate(e4, t7.stops, t7.base || 1);
  1810. }
  1811. _buildZoomInterval(t7) {
  1812. return (e4) => this._interval(e4, t7.stops);
  1813. }
  1814. _categorical(t7, e4) {
  1815. const r2 = e4.length;
  1816. for (let i5 = 0; i5 < r2; i5++)
  1817. if (e4[i5][0] === t7)
  1818. return e4[i5][1];
  1819. }
  1820. _interval(t7, e4) {
  1821. const r2 = e4.length;
  1822. let i5 = 0;
  1823. for (let l6 = 0; l6 < r2 && e4[l6][0] <= t7; l6++)
  1824. i5 = l6;
  1825. return e4[i5][1];
  1826. }
  1827. _interpolate(t7, r2, i5) {
  1828. let l6, a5;
  1829. const s2 = r2.length;
  1830. for (let e4 = 0; e4 < s2; e4++) {
  1831. const i6 = r2[e4];
  1832. if (!(i6[0] <= t7)) {
  1833. a5 = i6;
  1834. break;
  1835. }
  1836. l6 = i6;
  1837. }
  1838. if (l6 && a5) {
  1839. const r3 = a5[0] - l6[0], s3 = t7 - l6[0], o2 = i5 === 1 ? s3 / r3 : (i5 ** s3 - 1) / (i5 ** r3 - 1);
  1840. if (Array.isArray(l6[1])) {
  1841. const t8 = l6[1], r4 = a5[1], i6 = [];
  1842. for (let l7 = 0; l7 < t8.length; l7++)
  1843. i6.push(b(t8[l7], r4[l7], o2));
  1844. return i6;
  1845. }
  1846. return b(l6[1], a5[1], o2);
  1847. }
  1848. return l6 ? l6[1] : a5 ? a5[1] : void 0;
  1849. }
  1850. static _isEmpty(t7) {
  1851. for (const e4 in t7)
  1852. if (t7.hasOwnProperty(e4))
  1853. return false;
  1854. return true;
  1855. }
  1856. static _parseColor(e4) {
  1857. return Array.isArray(e4) ? e4 : (typeof e4 == "string" && (e4 = new l(e4)), e4 instanceof l && !this._isEmpty(e4) ? l.toUnitRGBA(e4) : void 0);
  1858. }
  1859. };
  1860. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleLayer.js
  1861. var P2 = class {
  1862. constructor(t7, i5, e4, a5) {
  1863. 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 = e4, this.uid = a5, t7) {
  1864. case a.BACKGROUND:
  1865. this._layoutDefinition = f.backgroundLayoutDefinition, this._paintDefinition = f.backgroundPaintDefinition;
  1866. break;
  1867. case a.FILL:
  1868. this._layoutDefinition = f.fillLayoutDefinition, this._paintDefinition = f.fillPaintDefinition;
  1869. break;
  1870. case a.LINE:
  1871. this._layoutDefinition = f.lineLayoutDefinition, this._paintDefinition = f.linePaintDefinition;
  1872. break;
  1873. case a.SYMBOL:
  1874. this._layoutDefinition = f.symbolLayoutDefinition, this._paintDefinition = f.symbolPaintDefinition;
  1875. break;
  1876. case a.CIRCLE:
  1877. this._layoutDefinition = f.circleLayoutDefinition, this._paintDefinition = f.circlePaintDefinition;
  1878. }
  1879. this._layoutProperties = this._parseLayout(this.layout), this._paintProperties = this._parsePaint(this.paint);
  1880. }
  1881. getFeatureFilter() {
  1882. return this._featureFilter !== void 0 ? this._featureFilter : this._featureFilter = t6.createFilter(this.filter);
  1883. }
  1884. getLayoutProperty(t7) {
  1885. return this._layoutProperties[t7];
  1886. }
  1887. getPaintProperty(t7) {
  1888. return this._paintProperties[t7];
  1889. }
  1890. getLayoutValue(t7, i5, e4) {
  1891. let a5;
  1892. const o2 = this._layoutProperties[t7];
  1893. return o2 && (a5 = o2.getValue(i5, e4)), a5 === void 0 && (a5 = this._layoutDefinition[t7].default), a5;
  1894. }
  1895. getPaintValue(t7, i5, e4) {
  1896. let a5;
  1897. const o2 = this._paintProperties[t7];
  1898. return o2 && (a5 = o2.getValue(i5, e4)), a5 === void 0 && (a5 = this._paintDefinition[t7].default), a5;
  1899. }
  1900. isPainterDataDriven() {
  1901. const t7 = this._paintProperties;
  1902. if (t7) {
  1903. for (const i5 in t7)
  1904. if (t7[i5].isDataDriven)
  1905. return true;
  1906. }
  1907. return false;
  1908. }
  1909. _parseLayout(t7) {
  1910. const i5 = {};
  1911. for (const e4 in t7) {
  1912. const a5 = this._layoutDefinition[e4];
  1913. a5 && (i5[e4] = new h(a5, t7[e4]));
  1914. }
  1915. return i5;
  1916. }
  1917. _parsePaint(t7) {
  1918. const i5 = {};
  1919. for (const e4 in t7) {
  1920. const a5 = this._paintDefinition[e4];
  1921. a5 && (i5[e4] = new h(a5, t7[e4]));
  1922. }
  1923. return i5;
  1924. }
  1925. computeAttributesKey(t7, i5, e4, a5) {
  1926. let o2 = 0, r2 = 0;
  1927. for (const s2 of i5) {
  1928. let t8 = 3;
  1929. if (!s2 || s2 !== a5) {
  1930. const i6 = e4[s2], { isLayout: a6, isOptional: o3 } = i6, r3 = a6 ? this.getLayoutProperty(s2) : this.getPaintProperty(s2);
  1931. t8 = r3?.interpolator ? 2 : r3?.isDataDriven ? 1 : o3 && !r3 ? 3 : 0;
  1932. }
  1933. r2 |= t8 << o2, o2 += 2;
  1934. }
  1935. return r2 << 3 | t7;
  1936. }
  1937. };
  1938. var c4 = class extends P2 {
  1939. constructor(t7, a5, o2, r2) {
  1940. super(t7, a5, o2, r2), this.backgroundMaterial = new T2(this.computeAttributesKey(T.BACKGROUND, T2.ATTRIBUTES, T2.ATTRIBUTES_INFO));
  1941. }
  1942. };
  1943. var f3 = class extends P2 {
  1944. constructor(t7, e4, a5, s2) {
  1945. super(t7, e4, a5, s2);
  1946. const n2 = this.getPaintProperty("fill-color"), h2 = this.getPaintProperty("fill-opacity"), l6 = this.getPaintProperty("fill-pattern");
  1947. this.hasDataDrivenColor = n2?.isDataDriven, this.hasDataDrivenOpacity = h2?.isDataDriven, this.hasDataDrivenFill = this.hasDataDrivenColor || this.hasDataDrivenOpacity || l6?.isDataDriven;
  1948. const p2 = this.getPaintProperty("fill-outline-color");
  1949. this.outlineUsesFillColor = !p2, this.hasDataDrivenOutlineColor = 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);
  1950. }
  1951. };
  1952. var _2 = class extends P2 {
  1953. constructor(t7, e4, a5, o2) {
  1954. super(t7, e4, a5, o2);
  1955. const r2 = this.getPaintProperty("line-pattern");
  1956. if (this.lineMaterial = new i2(this.computeAttributesKey(T.LINE, i2.ATTRIBUTES, i2.ATTRIBUTES_INFO, r2 ? "line-dasharray" : "")), this.hasDataDrivenLine = this.getPaintProperty("line-blur")?.isDataDriven || this.getPaintProperty("line-color")?.isDataDriven || this.getPaintProperty("line-gap-width")?.isDataDriven || this.getPaintProperty("line-offset")?.isDataDriven || this.getPaintProperty("line-opacity")?.isDataDriven || this.getPaintProperty("line-pattern")?.isDataDriven || this.getPaintProperty("line-dasharray")?.isDataDriven || this.getLayoutProperty("line-cap")?.isDataDriven || this.getPaintProperty("line-width")?.isDataDriven, this.canUseThinTessellation = false, !this.hasDataDrivenLine) {
  1957. const t8 = this.getPaintProperty("line-width");
  1958. if (!t8 || typeof t8 == "number" && 0.5 * t8 < X) {
  1959. const t9 = this.getPaintProperty("line-offset");
  1960. (!t9 || typeof t9 == "number" && t9 === 0) && (this.canUseThinTessellation = true);
  1961. }
  1962. }
  1963. }
  1964. getDashKey(i5, e4) {
  1965. let a5;
  1966. switch (e4) {
  1967. case e.BUTT:
  1968. a5 = "Butt";
  1969. break;
  1970. case e.ROUND:
  1971. a5 = "Round";
  1972. break;
  1973. case e.SQUARE:
  1974. a5 = "Square";
  1975. break;
  1976. default:
  1977. a5 = "Butt";
  1978. }
  1979. return `dasharray-[${i5.toString()}]-${a5}`;
  1980. }
  1981. };
  1982. var L2 = class extends P2 {
  1983. constructor(t7, e4, a5, o2) {
  1984. super(t7, e4, 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 = this.getPaintProperty("icon-color")?.isDataDriven || this.getPaintProperty("icon-halo-blur")?.isDataDriven || this.getPaintProperty("icon-halo-color")?.isDataDriven || this.getPaintProperty("icon-halo-width")?.isDataDriven || this.getPaintProperty("icon-opacity")?.isDataDriven || this.getLayoutProperty("icon-size")?.isDataDriven, this.hasDataDrivenText = this.getPaintProperty("text-color")?.isDataDriven || this.getPaintProperty("text-halo-blur")?.isDataDriven || this.getPaintProperty("text-halo-color")?.isDataDriven || this.getPaintProperty("text-halo-width")?.isDataDriven || this.getPaintProperty("text-opacity")?.isDataDriven || this.getLayoutProperty("text-size")?.isDataDriven;
  1985. }
  1986. };
  1987. var d3 = class extends P2 {
  1988. constructor(t7, e4, o2, r2) {
  1989. super(t7, e4, o2, r2), this.circleMaterial = new t4(this.computeAttributesKey(T.CIRCLE, t4.ATTRIBUTES, t4.ATTRIBUTES_INFO));
  1990. }
  1991. };
  1992. var m = class {
  1993. constructor(t7, i5, e4) {
  1994. let a5;
  1995. 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 = e4 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("icon-anchor"), a5?.isDataDriven ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("icon-anchor", i5), a5 = t7.getLayoutProperty("icon-offset"), a5?.isDataDriven ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("icon-offset", i5), a5 = t7.getLayoutProperty("icon-padding"), a5?.isDataDriven ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("icon-padding", i5), a5 = t7.getLayoutProperty("icon-rotate"), a5?.isDataDriven ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("icon-rotate", i5), a5 = t7.getLayoutProperty("icon-size"), a5?.isDataDriven ? this._sizeProp = a5 : this.size = t7.getLayoutValue("icon-size", i5);
  1996. }
  1997. update(t7, i5) {
  1998. 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));
  1999. }
  2000. };
  2001. var T5 = class {
  2002. constructor(t7, i5, e4) {
  2003. let a5;
  2004. 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 = e4 ? l2.MAP : l2.VIEWPORT), a5 = t7.getLayoutProperty("text-anchor"), a5?.isDataDriven ? this._anchorProp = a5 : this.anchor = t7.getLayoutValue("text-anchor", i5), a5 = t7.getLayoutProperty("text-justify"), a5?.isDataDriven ? this._justifyProp = a5 : this.justify = t7.getLayoutValue("text-justify", i5), a5 = t7.getLayoutProperty("text-letter-spacing"), a5?.isDataDriven ? this._letterSpacingProp = a5 : this.letterSpacing = t7.getLayoutValue("text-letter-spacing", i5), a5 = t7.getLayoutProperty("text-line-height"), a5?.isDataDriven ? this._lineHeightProp = a5 : this.lineHeight = t7.getLayoutValue("text-line-height", i5), a5 = t7.getLayoutProperty("text-max-angle"), a5?.isDataDriven ? this._maxAngleProp = a5 : this.maxAngle = t7.getLayoutValue("text-max-angle", i5), a5 = t7.getLayoutProperty("text-max-width"), a5?.isDataDriven ? this._maxWidthProp = a5 : this.maxWidth = t7.getLayoutValue("text-max-width", i5), a5 = t7.getLayoutProperty("text-offset"), a5?.isDataDriven ? this._offsetProp = a5 : this.offset = t7.getLayoutValue("text-offset", i5), a5 = t7.getLayoutProperty("text-padding"), a5?.isDataDriven ? this._paddingProp = a5 : this.padding = t7.getLayoutValue("text-padding", i5), a5 = t7.getLayoutProperty("text-rotate"), a5?.isDataDriven ? this._rotateProp = a5 : this.rotate = t7.getLayoutValue("text-rotate", i5), a5 = t7.getLayoutProperty("text-size"), a5?.isDataDriven ? this._sizeProp = a5 : this.size = t7.getLayoutValue("text-size", i5), a5 = t7.getLayoutProperty("text-writing-mode"), a5?.isDataDriven ? this._writingModeProp = a5 : this.writingMode = t7.getLayoutValue("text-writing-mode", i5);
  2005. }
  2006. update(t7, i5) {
  2007. 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));
  2008. }
  2009. };
  2010. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleRepository.js
  2011. var l5 = class {
  2012. constructor(t7) {
  2013. if (this._style = t7, this.backgroundBucketIds = [], this._uidToLayer = new Map(), this._layerByName = {}, this._runningId = 0, t7.layers || (t7.layers = []), this.version = parseFloat(t7.version), this.layers = t7.layers.map((e4, t8, r2) => this._create(e4, t8, r2)).filter((e4) => !!e4), this.layers) {
  2014. let t8;
  2015. for (let r2 = 0; r2 < this.layers.length; r2++)
  2016. t8 = this.layers[r2], this._layerByName[t8.id] = t8, this._uidToLayer.set(t8.uid, t8), t8.type === a.BACKGROUND && this.backgroundBucketIds.push(t8.id);
  2017. }
  2018. this._identifyRefLayers();
  2019. }
  2020. isPainterDataDriven(e4) {
  2021. const t7 = this._layerByName[e4];
  2022. return !!t7 && t7.isPainterDataDriven();
  2023. }
  2024. getStyleLayerId(e4) {
  2025. return e4 >= this.layers.length ? null : this.layers[e4].id;
  2026. }
  2027. getStyleLayerByUID(e4) {
  2028. return this._uidToLayer.get(e4) ?? null;
  2029. }
  2030. getStyleLayerIndex(e4) {
  2031. const t7 = this._layerByName[e4];
  2032. return t7 ? this.layers.indexOf(t7) : -1;
  2033. }
  2034. setStyleLayer(e4, t7) {
  2035. if (!e4 || !e4.id)
  2036. return;
  2037. const r2 = this._style;
  2038. t7 != null && t7 >= this.layers.length && (t7 = this.layers.length - 1);
  2039. let s2, i5 = true;
  2040. const a5 = this._layerByName[e4.id];
  2041. if (a5) {
  2042. const y2 = this.layers.indexOf(a5);
  2043. t7 || (t7 = y2), t7 === y2 ? (i5 = false, s2 = l5._recreateLayer(e4, a5), this.layers[t7] = s2, r2.layers[t7] = e4) : (this.layers.splice(y2, 1), r2.layers.splice(y2, 1), s2 = this._create(e4, t7, this.layers), this.layers.splice(t7, 0, s2), r2.layers.splice(t7, 0, e4));
  2044. } else
  2045. s2 = this._create(e4, t7, this.layers), !t7 || t7 >= this.layers.length ? (this.layers.push(s2), r2.layers.push(e4)) : (this.layers.splice(t7, 0, s2), r2.layers.splice(t7, 0, e4));
  2046. this._layerByName[e4.id] = s2, this._uidToLayer.set(s2.uid, s2), i5 && this._recomputeZValues(), this._identifyRefLayers();
  2047. }
  2048. getStyleLayer(e4) {
  2049. const t7 = this._layerByName[e4];
  2050. 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;
  2051. }
  2052. deleteStyleLayer(e4) {
  2053. const t7 = this._layerByName[e4];
  2054. if (t7) {
  2055. delete this._layerByName[e4], this._uidToLayer.delete(t7.uid);
  2056. const r2 = this.layers.indexOf(t7);
  2057. this.layers.splice(r2, 1), this._style.layers.splice(r2, 1), this._recomputeZValues(), this._identifyRefLayers();
  2058. }
  2059. }
  2060. getLayerById(e4) {
  2061. return this._layerByName[e4];
  2062. }
  2063. getLayoutProperties(e4) {
  2064. const t7 = this._layerByName[e4];
  2065. return t7 ? t7.layout : null;
  2066. }
  2067. getPaintProperties(e4) {
  2068. const t7 = this._layerByName[e4];
  2069. return t7 ? t7.paint : null;
  2070. }
  2071. setPaintProperties(e4, t7) {
  2072. const r2 = this._layerByName[e4];
  2073. if (!r2)
  2074. return;
  2075. 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: r2.layout, paint: t7 }, i5 = l5._recreateLayer(s2, r2), a5 = this.layers.indexOf(r2);
  2076. this.layers[a5] = i5, this._style.layers[a5].paint = t7, this._layerByName[r2.id] = i5, this._uidToLayer.set(r2.uid, i5);
  2077. }
  2078. setLayoutProperties(e4, t7) {
  2079. const r2 = this._layerByName[e4];
  2080. if (!r2)
  2081. return;
  2082. 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: t7, paint: r2.paint }, i5 = l5._recreateLayer(s2, r2), a5 = this.layers.indexOf(r2);
  2083. this.layers[a5] = i5, this._style.layers[a5].layout = t7, this._layerByName[r2.id] = i5, this._uidToLayer.set(r2.uid, i5);
  2084. }
  2085. setStyleLayerVisibility(e4, t7) {
  2086. const r2 = this._layerByName[e4];
  2087. if (!r2)
  2088. return;
  2089. const s2 = r2.layout || {};
  2090. s2.visibility = t7;
  2091. 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: s2, paint: r2.paint }, a5 = l5._recreateLayer(i5, r2), y2 = this.layers.indexOf(r2);
  2092. this.layers[y2] = a5, this._style.layers[y2].layout = s2, this._layerByName[r2.id] = a5, this._uidToLayer.set(r2.uid, a5);
  2093. }
  2094. getStyleLayerVisibility(e4) {
  2095. const t7 = this._layerByName[e4];
  2096. if (!t7)
  2097. return "none";
  2098. return t7.layout?.visibility ?? "visible";
  2099. }
  2100. _recomputeZValues() {
  2101. const e4 = this.layers, t7 = 1 / (e4.length + 1);
  2102. for (let r2 = 0; r2 < e4.length; r2++)
  2103. e4[r2].z = 1 - (1 + r2) * t7;
  2104. }
  2105. _identifyRefLayers() {
  2106. const t7 = [], r2 = [];
  2107. let s2 = 0;
  2108. for (const i5 of this.layers) {
  2109. const a5 = i5.layout;
  2110. if (i5.type === a.FILL) {
  2111. const e4 = i5;
  2112. let r3 = i5.source + "|" + i5.sourceLayer;
  2113. r3 += "|" + a5?.visibility, r3 += "|" + i5.minzoom, r3 += "|" + i5.maxzoom, r3 += "|" + JSON.stringify(i5.filter), (e4.hasDataDrivenFill || e4.hasDataDrivenOutline) && (r3 += "|" + s2), t7.push({ key: r3, layer: i5 });
  2114. } else if (i5.type === a.LINE) {
  2115. const e4 = i5;
  2116. let t8 = i5.source + "|" + i5.sourceLayer;
  2117. t8 += "|" + a5?.visibility, t8 += "|" + i5.minzoom, t8 += "|" + i5.maxzoom, t8 += "|" + JSON.stringify(i5.filter), t8 += "|" + (a5 !== void 0 ? a5["line-cap"] : ""), t8 += "|" + (a5 !== void 0 ? a5["line-join"] : ""), e4.hasDataDrivenLine && (t8 += "|" + s2), r2.push({ key: t8, layer: i5 });
  2118. }
  2119. ++s2;
  2120. }
  2121. this._assignRefLayers(t7), this._assignRefLayers(r2);
  2122. }
  2123. _assignRefLayers(t7) {
  2124. let r2, s2;
  2125. t7.sort((e4, t8) => e4.key < t8.key ? -1 : e4.key > t8.key ? 1 : 0);
  2126. const i5 = t7.length;
  2127. for (let a5 = 0; a5 < i5; a5++) {
  2128. const l6 = t7[a5];
  2129. if (l6.key === r2)
  2130. l6.layer.refLayerId = s2;
  2131. else if (r2 = l6.key, s2 = l6.layer.id, l6.layer.type === a.FILL) {
  2132. if (!l6.layer.getPaintProperty("fill-outline-color"))
  2133. for (let e4 = a5 + 1; e4 < i5; e4++) {
  2134. const i6 = t7[e4];
  2135. if (i6.key !== r2)
  2136. break;
  2137. if (i6.layer.getPaintProperty("fill-outline-color")) {
  2138. t7[a5] = i6, t7[e4] = l6, s2 = i6.layer.id;
  2139. break;
  2140. }
  2141. }
  2142. } else if (l6.layer.type === a.LINE) {
  2143. let e4 = l6.layer;
  2144. for (let y2 = a5 + 1; y2 < i5; y2++) {
  2145. const i6 = t7[y2];
  2146. if (i6.key !== r2)
  2147. break;
  2148. const n2 = i6.layer;
  2149. (e4.canUseThinTessellation && !n2.canUseThinTessellation || !e4.canUseThinTessellation && (n2.getPaintProperty("line-pattern") || n2.getPaintProperty("line-dasharray"))) && (e4 = n2, t7[a5] = i6, t7[y2] = l6, s2 = i6.layer.id);
  2150. }
  2151. }
  2152. }
  2153. }
  2154. _create(l6, y2, n2) {
  2155. const o2 = 1 - (1 + y2) * (1 / (n2.length + 1)), u2 = this._runningId++;
  2156. switch (l6.type) {
  2157. case "background":
  2158. return new c4(a.BACKGROUND, l6, o2, u2);
  2159. case "fill":
  2160. return new f3(a.FILL, l6, o2, u2);
  2161. case "line":
  2162. return new _2(a.LINE, l6, o2, u2);
  2163. case "symbol":
  2164. return new L2(a.SYMBOL, l6, o2, u2);
  2165. case "raster":
  2166. console.warn(`Unsupported vector tile raster layer ${l6.id}`);
  2167. case "circle":
  2168. return new d3(a.CIRCLE, l6, o2, u2);
  2169. }
  2170. }
  2171. static _recreateLayer(l6, y2) {
  2172. switch (l6.type) {
  2173. case "background":
  2174. return new c4(a.BACKGROUND, l6, y2.z, y2.uid);
  2175. case "fill":
  2176. return new f3(a.FILL, l6, y2.z, y2.uid);
  2177. case "line":
  2178. return new _2(a.LINE, l6, y2.z, y2.uid);
  2179. case "symbol":
  2180. return new L2(a.SYMBOL, l6, y2.z, y2.uid);
  2181. case "raster":
  2182. console.warn(`Unsupported vector tile raster layer ${l6.id}`);
  2183. case "circle":
  2184. return new d3(a.CIRCLE, l6, y2.z, y2.uid);
  2185. }
  2186. }
  2187. };
  2188. export {
  2189. t3 as t,
  2190. m,
  2191. T5 as T,
  2192. l5 as l
  2193. };
  2194. //# sourceMappingURL=chunk-Y4YDGLMZ.js.map