chunk-XQ6FMY5X.js 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743
  1. import {
  2. a,
  3. c as c2,
  4. d,
  5. o as o3,
  6. u,
  7. x as x2
  8. } from "./chunk-3BKH6ISD.js";
  9. import {
  10. c,
  11. g,
  12. h,
  13. i,
  14. k,
  15. o as o2,
  16. r as r4,
  17. w as w3,
  18. x,
  19. y as y3
  20. } from "./chunk-TDS6IBMU.js";
  21. import {
  22. m,
  23. p
  24. } from "./chunk-FNA5GLRW.js";
  25. import {
  26. r as r3
  27. } from "./chunk-5N7JLUJJ.js";
  28. import {
  29. s as s2
  30. } from "./chunk-HZRKBTHJ.js";
  31. import {
  32. o,
  33. w,
  34. w2
  35. } from "./chunk-6T6G6LCQ.js";
  36. import {
  37. s as s3
  38. } from "./chunk-YEJL5NEF.js";
  39. import {
  40. r as r2
  41. } from "./chunk-PQFTYGF5.js";
  42. import {
  43. e,
  44. l3 as l,
  45. n5 as n,
  46. y3 as y2
  47. } from "./chunk-2Z2TG5CU.js";
  48. import {
  49. s3 as s
  50. } from "./chunk-E5O6P5I2.js";
  51. import {
  52. y
  53. } from "./chunk-SPWQ3AWG.js";
  54. import {
  55. e as e2,
  56. r,
  57. t
  58. } from "./chunk-YXWMMD76.js";
  59. // node_modules/@arcgis/core/layers/support/rasterFunctions/BaseFunctionArguments.js
  60. var e3 = class extends l {
  61. constructor() {
  62. super(...arguments), this.raster = void 0;
  63. }
  64. };
  65. e([y2({ json: { write: true } })], e3.prototype, "raster", void 0), e3 = e([n("esri.layers.support.rasterFunctions.AspectFunctionArguments")], e3);
  66. var p2 = e3;
  67. // node_modules/@arcgis/core/layers/support/rasterFunctions/AspectFunctionArguments.js
  68. var e4;
  69. var t2 = e4 = class extends p2 {
  70. clone() {
  71. return new e4({ raster: this.raster });
  72. }
  73. };
  74. t2 = e4 = e([n("esri.layers.support.rasterFunctions.AspectFunctionArguments")], t2);
  75. var c3 = t2;
  76. // node_modules/@arcgis/core/layers/support/rasterFunctions/BaseRasterFunction.js
  77. var n2 = class extends l {
  78. constructor() {
  79. super(...arguments), this.functionArguments = null, this.readingBufferSize = 0;
  80. }
  81. bind(r8, t7 = false) {
  82. const s7 = this._getRasterValues();
  83. for (let e9 = 0; e9 < s7.length; e9++) {
  84. const o8 = s7[e9];
  85. if (o8 && "object" == typeof o8 && "bind" in o8 && (!o8.rasterInfo || t7)) {
  86. const s8 = o8.bind(r8, t7);
  87. if (!s8.success)
  88. return s8;
  89. }
  90. }
  91. return !this.rasterInfo || t7 ? (this.sourceRasterInfos = this._getSourceRasterInfos(r8), this._bindSourceRasters()) : { success: true };
  92. }
  93. process(r8) {
  94. const t7 = this._getRasterValues().map((t8) => this._readRasterValue(t8, r8));
  95. return this._processPixels({ ...r8, pixelBlocks: t7 });
  96. }
  97. getPrimaryRasters() {
  98. const r8 = [], t7 = [];
  99. return this._getPrimaryRasters(this, r8, t7), { rasters: r8, rasterIds: t7 };
  100. }
  101. _getOutputPixelType(r8) {
  102. var _a;
  103. return "unknown" === this.outputPixelType ? r8 : (_a = this.outputPixelType) != null ? _a : r8;
  104. }
  105. _getRasterValues() {
  106. const { rasterArgumentNames: r8 } = this;
  107. return "rasters" === r8[0] && Array.isArray(this.functionArguments.rasters) ? this.functionArguments.rasters : r8.map((r9) => this.functionArguments[r9]);
  108. }
  109. _getSourceRasterInfos(r8) {
  110. const t7 = this._getRasterValues(), { rasterInfos: s7, rasterIds: e9 } = r8;
  111. return t7.map((r9) => r9 && "object" == typeof r9 && "bind" in r9 && r9.rasterInfo ? r9.rasterInfo : "string" == typeof r9 && e9.includes(r9) ? s7[e9.indexOf(r9)] : s7[0]);
  112. }
  113. _getPrimaryRasterId(r8) {
  114. return r8 == null ? void 0 : r8.url;
  115. }
  116. _getPrimaryRasters(r8, t7 = [], s7 = []) {
  117. for (let e9 = 0; e9 < r8.sourceRasters.length; e9++) {
  118. const o8 = r8.sourceRasters[e9];
  119. if ("number" != typeof o8)
  120. if ("bind" in o8)
  121. this._getPrimaryRasters(o8, t7, s7);
  122. else {
  123. const r9 = o8, e10 = this._getPrimaryRasterId(r9);
  124. if (null == e10)
  125. continue;
  126. s7.includes(e10) || (this.mainPrimaryRasterId === e10 ? (t7.unshift(r9), s7.unshift(e10)) : (t7.push(r9), s7.push(e10)));
  127. }
  128. }
  129. }
  130. _readRasterValue(r8, t7) {
  131. const { primaryPixelBlocks: e9 } = t7;
  132. if (t(r8) || "$$" === r8) {
  133. const r9 = e9[0];
  134. return t(r9) ? null : r9.clone();
  135. }
  136. if ("string" == typeof r8) {
  137. const s7 = t7.primaryRasterIds.indexOf(r8);
  138. return -1 === s7 ? null : e9[s7];
  139. }
  140. if ("number" == typeof r8) {
  141. const t8 = e9[0];
  142. if (t(t8))
  143. return null;
  144. const o8 = new Float32Array(t8.width * t8.height);
  145. o8.fill(r8);
  146. const i16 = t8.clone();
  147. return i16.pixels = i16.pixels.map(() => o8), i16;
  148. }
  149. return r8.process(t7);
  150. }
  151. };
  152. e([y2({ json: { write: true } })], n2.prototype, "functionName", void 0), e([y2({ json: { write: true } })], n2.prototype, "functionArguments", void 0), e([y2()], n2.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } }), s3((r8) => r8 == null ? void 0 : r8.toLowerCase())], n2.prototype, "outputPixelType", void 0), e([y2({ json: { write: true } })], n2.prototype, "mainPrimaryRasterId", void 0), e([y2()], n2.prototype, "sourceRasters", void 0), e([y2({ json: { write: true } })], n2.prototype, "sourceRasterInfos", void 0), e([y2({ json: { write: true } })], n2.prototype, "rasterInfo", void 0), e([y2({ json: { write: true } })], n2.prototype, "readingBufferSize", void 0), n2 = e([n("esri.layers.support.rasterFunctions.BaseRasterFunction")], n2);
  153. var a2 = n2;
  154. // node_modules/@arcgis/core/layers/support/rasterFunctions/AspectFunction.js
  155. var c4 = class extends a2 {
  156. constructor() {
  157. super(...arguments), this.functionName = "Aspect", this.functionArguments = null, this.rasterArgumentNames = ["raster"], this.isGCS = false;
  158. }
  159. _bindSourceRasters() {
  160. const t7 = this.sourceRasterInfos[0];
  161. this.isGCS = t7.spatialReference.isGeographic, this.outputPixelType = this._getOutputPixelType("f32");
  162. const s7 = t7.clone();
  163. return s7.pixelType = this.outputPixelType, s7.statistics = null, s7.histograms = null, this.rasterInfo = s7, { success: true };
  164. }
  165. _processPixels(t7) {
  166. var _a;
  167. const e9 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  168. if (t(e9))
  169. return null;
  170. const { extent: r8 } = t7, o8 = r8 ? { x: r8.width / e9.width, y: r8.height / e9.height } : { x: 1, y: 1 };
  171. return o3(e9, { resolution: o8 });
  172. }
  173. };
  174. e([y2({ json: { write: true, name: "rasterFunction" } })], c4.prototype, "functionName", void 0), e([y2({ type: c3, json: { write: true, name: "rasterFunctionArguments" } })], c4.prototype, "functionArguments", void 0), e([y2()], c4.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], c4.prototype, "isGCS", void 0), c4 = e([n("esri.layers.support.rasterFunctions.AspectFunction")], c4);
  175. var p3 = c4;
  176. // node_modules/@arcgis/core/layers/support/rasterFunctions/customBandIndexUtils.js
  177. var e5 = /* @__PURE__ */ new Set(["+", "-", "*", "/", "(", ")"]);
  178. function t3(t7, n12) {
  179. (t7 = t7.replace(/ /g, "")).startsWith("-") && (t7 = "0" + t7), t7.startsWith("+") && (t7 = t7.slice(1, t7.length));
  180. const r8 = t7.split(""), l13 = [], o8 = [];
  181. let s7 = "";
  182. for (let a19 = 0; a19 < r8.length; a19++) {
  183. const t8 = r8[a19];
  184. if (e5.has(t8))
  185. "" !== s7 && o8.push(parseFloat(s7)), l13.push(t8), s7 = "";
  186. else {
  187. if ("b" === t8.toLowerCase()) {
  188. a19++, s7 = t8.concat(r8[a19]), o8.push(n12[parseInt(s7[1], 10) - 1]), s7 = "";
  189. continue;
  190. }
  191. s7 = s7.concat(t8), a19 === r8.length - 1 && o8.push(parseFloat(s7));
  192. }
  193. }
  194. return { ops: l13, nums: o8 };
  195. }
  196. function n3(e9, t7, n12, r8) {
  197. if ("number" == typeof n12 && "number" == typeof r8)
  198. return n12 + r8;
  199. let l13;
  200. if ("number" == typeof n12) {
  201. l13 = r8.length;
  202. const e10 = n12;
  203. (n12 = new Float32Array(l13)).fill(e10);
  204. } else if (l13 = n12.length, r8.constructor === Number) {
  205. const e10 = r8;
  206. (r8 = new Float32Array(l13)).fill(e10);
  207. }
  208. const o8 = new Float32Array(l13);
  209. switch (t7) {
  210. case "+":
  211. for (let t8 = 0; t8 < l13; t8++)
  212. (null == e9 || e9[t8]) && (o8[t8] = n12[t8] + r8[t8]);
  213. break;
  214. case "-":
  215. for (let t8 = 0; t8 < l13; t8++)
  216. (null == e9 || e9[t8]) && (o8[t8] = n12[t8] - r8[t8]);
  217. break;
  218. case "*":
  219. for (let t8 = 0; t8 < l13; t8++)
  220. (null == e9 || e9[t8]) && (o8[t8] = n12[t8] * r8[t8]);
  221. break;
  222. case "/":
  223. for (let t8 = 0; t8 < l13; t8++)
  224. (null == e9 || e9[t8]) && r8[t8] && (o8[t8] = n12[t8] / r8[t8]);
  225. break;
  226. case "(":
  227. case ")":
  228. throw "encountered error with custom band index equation";
  229. }
  230. return o8;
  231. }
  232. function r5(e9, t7) {
  233. e9.splice(t7, 1);
  234. let n12 = 0, r8 = 0;
  235. do {
  236. n12 = 0, r8 = 0;
  237. for (let t8 = 0; t8 < e9.length; t8++)
  238. if ("(" === e9[t8])
  239. n12 = t8;
  240. else if (")" === e9[t8]) {
  241. r8 = t8;
  242. break;
  243. }
  244. r8 === n12 + 1 && e9.splice(n12, 2);
  245. } while (r8 === n12 + 1);
  246. return e9;
  247. }
  248. function l2(e9) {
  249. if (1 === e9.length)
  250. return { opIndex: 0, numIndex: 0 };
  251. let t7 = 0, n12 = 0;
  252. for (let s7 = 0; s7 < e9.length; s7++)
  253. if ("(" === e9[s7])
  254. t7 = s7;
  255. else if (")" === e9[s7]) {
  256. n12 = s7;
  257. break;
  258. }
  259. const r8 = 0 === n12 ? e9 : e9.slice(t7 + 1, n12);
  260. let l13 = -1;
  261. for (let s7 = 0; s7 < r8.length; s7++)
  262. if ("*" === r8[s7] || "/" === r8[s7]) {
  263. l13 = s7;
  264. break;
  265. }
  266. if (l13 > -1)
  267. n12 > 0 && (l13 += t7 + 1);
  268. else {
  269. for (let e10 = 0; e10 < r8.length; e10++)
  270. if ("+" === r8[e10] || "-" === r8[e10]) {
  271. l13 = e10;
  272. break;
  273. }
  274. n12 > 0 && (l13 += t7 + 1);
  275. }
  276. let o8 = 0;
  277. for (let s7 = 0; s7 < l13; s7++)
  278. "(" === e9[s7] && o8++;
  279. return { opIndex: l13, numIndex: l13 - o8 };
  280. }
  281. function o4(e9, o8, s7) {
  282. let a19, { ops: f4, nums: i16 } = t3(s7, o8);
  283. if (0 === f4.length) {
  284. const e10 = 1 === i16.length ? i16[0] : o8[0];
  285. if (e10 instanceof Float32Array)
  286. return [e10];
  287. const t7 = new Float32Array(o8[0].length);
  288. return "number" == typeof e10 ? t7.fill(e10) : t7.set(e10), [t7];
  289. }
  290. for (; f4.length > 0; ) {
  291. const { numIndex: t7, opIndex: o9 } = l2(f4);
  292. if (a19 = n3(e9, f4[o9], i16[t7], i16[t7 + 1]), 1 === f4.length)
  293. break;
  294. f4 = r5(f4, o9), i16.splice(t7, 2, a19);
  295. }
  296. return [a19];
  297. }
  298. // node_modules/@arcgis/core/layers/support/rasterFunctions/bandIndexUtils.js
  299. var a3 = new s2({ 0: "custom", 1: "ndvi", 2: "savi", 3: "tsavi", 4: "msavi", 5: "gemi", 6: "pvi", 7: "gvitm", 8: "sultan", 9: "vari", 10: "gndvi", 11: "sr", 12: "ndvi-re", 13: "sr-re", 14: "mtvi2", 15: "rtvi-core", 16: "ci-re", 17: "ci-g", 18: "ndwi", 19: "evi", 20: "iron-oxide", 21: "ferrous-minerals", 22: "clay-minerals", 23: "wndwi", 24: "bai", 25: "nbr", 26: "ndbi", 27: "ndmi", 28: "ndsi", 29: "mndwi" }, { useNumericKeys: true });
  300. function s4(n12, a19) {
  301. var _a;
  302. if (!r4(n12))
  303. return n12;
  304. const { equation: s7, method: i16 } = a19, x4 = a19.bandIndexes.map((n13) => n13 - 1), { pixels: j2, mask: q2 } = n12;
  305. let M2;
  306. switch (i16) {
  307. case "gndvi":
  308. case "nbr":
  309. case "ndbi":
  310. case "ndvi":
  311. case "ndvi-re":
  312. case "ndsi":
  313. case "ndmi":
  314. case "mndwi":
  315. M2 = l3(q2, j2[x4[0]], j2[x4[1]]);
  316. break;
  317. case "ndwi":
  318. M2 = l3(q2, j2[x4[1]], j2[x4[0]]);
  319. break;
  320. case "sr":
  321. case "sr-re":
  322. case "iron-oxide":
  323. case "ferrous-minerals":
  324. case "clay-minerals":
  325. M2 = c5(q2, j2[x4[0]], j2[x4[1]]);
  326. break;
  327. case "ci-g":
  328. case "ci-re":
  329. M2 = u2(q2, j2[x4[0]], j2[x4[1]]);
  330. break;
  331. case "savi":
  332. M2 = f(q2, j2[x4[0]], j2[x4[1]], x4[2] + 1);
  333. break;
  334. case "tsavi":
  335. M2 = m2(q2, j2[x4[0]], j2[x4[1]], x4[2] + 1, x4[3] + 1, x4[4] + 1);
  336. break;
  337. case "msavi":
  338. M2 = w4(q2, j2[x4[0]], j2[x4[1]]);
  339. break;
  340. case "gemi":
  341. M2 = h2(q2, j2[x4[0]], j2[x4[1]]);
  342. break;
  343. case "pvi":
  344. M2 = d2(q2, j2[x4[0]], j2[x4[1]], x4[2] + 1, x4[3] + 1);
  345. break;
  346. case "gvitm":
  347. M2 = g2(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]], j2[x4[3]], j2[x4[4]], j2[x4[5]]]);
  348. break;
  349. case "sultan":
  350. M2 = y4(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]], j2[x4[3]], j2[x4[4]], j2[x4[5]]]);
  351. break;
  352. case "vari":
  353. M2 = b(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]]]);
  354. break;
  355. case "mtvi2":
  356. M2 = v(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]]]);
  357. break;
  358. case "rtvi-core":
  359. M2 = k2(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]]]);
  360. break;
  361. case "evi":
  362. M2 = p4(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]]]);
  363. break;
  364. case "wndwi":
  365. M2 = A(q2, [j2[x4[0]], j2[x4[1]], j2[x4[2]]], (_a = x4[3]) != null ? _a : 0.5);
  366. break;
  367. case "bai":
  368. M2 = F(q2, j2[x4[0]], j2[x4[1]]);
  369. break;
  370. case "custom":
  371. M2 = o4(q2, j2, s7);
  372. break;
  373. default:
  374. return n12;
  375. }
  376. const U2 = r(q2) ? new Uint8Array(q2.length) : null;
  377. r(q2) && r(U2) && U2.set(q2);
  378. const B2 = new g({ width: n12.width, height: n12.height, pixelType: "f32", pixels: M2, mask: U2 });
  379. return B2.updateStatistics(), B2;
  380. }
  381. function i2(n12, t7, r8, o8) {
  382. const { mask: a19, pixels: s7, width: i16, height: l13 } = n12, c23 = s7[r8], u11 = s7[t7], f4 = u11.length, m5 = o8 ? new Uint8Array(f4) : new Float32Array(f4), w6 = o8 ? 100 : 1, h6 = o8 ? 100 : 0;
  383. for (let e9 = 0; e9 < f4; e9++)
  384. if (null == a19 || a19[e9]) {
  385. const n13 = c23[e9], t8 = u11[e9], r9 = n13 + t8;
  386. r9 && (m5[e9] = (n13 - t8) / r9 * w6 + h6);
  387. }
  388. const d5 = new g({ width: i16, height: l13, mask: a19, pixelType: o8 ? "u8" : "f32", pixels: [m5] });
  389. return d5.updateStatistics(), d5;
  390. }
  391. function l3(n12, t7, e9) {
  392. const r8 = e9.length, o8 = new Float32Array(r8);
  393. for (let a19 = 0; a19 < r8; a19++)
  394. if (null == n12 || n12[a19]) {
  395. const n13 = t7[a19], r9 = e9[a19], s7 = n13 + r9;
  396. s7 && (o8[a19] = (n13 - r9) / s7);
  397. }
  398. return [o8];
  399. }
  400. function c5(n12, t7, e9) {
  401. const r8 = e9.length, o8 = new Float32Array(r8);
  402. for (let a19 = 0; a19 < r8; a19++)
  403. if (null == n12 || n12[a19]) {
  404. const n13 = t7[a19], r9 = e9[a19];
  405. r9 && (o8[a19] = n13 / r9);
  406. }
  407. return [o8];
  408. }
  409. function u2(n12, t7, e9) {
  410. const r8 = t7.length, o8 = new Float32Array(r8);
  411. for (let a19 = 0; a19 < r8; a19++)
  412. if (null == n12 || n12[a19]) {
  413. const n13 = t7[a19], r9 = e9[a19];
  414. r9 && (o8[a19] = n13 / r9 - 1);
  415. }
  416. return [o8];
  417. }
  418. function f(n12, t7, e9, r8) {
  419. const o8 = e9.length, a19 = new Float32Array(o8);
  420. for (let s7 = 0; s7 < o8; s7++)
  421. if (null == n12 || n12[s7]) {
  422. const n13 = e9[s7], o9 = t7[s7], i16 = o9 + n13 + r8;
  423. i16 && (a19[s7] = (o9 - n13) / i16 * (1 + r8));
  424. }
  425. return [a19];
  426. }
  427. function m2(n12, t7, e9, r8, o8, a19) {
  428. const s7 = e9.length, i16 = new Float32Array(s7), l13 = -o8 * r8 + a19 * (1 + r8 * r8);
  429. for (let c23 = 0; c23 < s7; c23++)
  430. if (null == n12 || n12[c23]) {
  431. const n13 = e9[c23], a20 = t7[c23], s8 = o8 * a20 + n13 + l13;
  432. s8 && (i16[c23] = r8 * (a20 - r8 * n13 - o8) / s8);
  433. }
  434. return [i16];
  435. }
  436. function w4(n12, t7, e9) {
  437. const r8 = e9.length, o8 = new Float32Array(r8);
  438. for (let a19 = 0; a19 < r8; a19++)
  439. if (null == n12 || n12[a19]) {
  440. const n13 = e9[a19], r9 = t7[a19];
  441. o8[a19] = 0.5 * (2 * (r9 + 1) - Math.sqrt((2 * r9 + 1) ** 2 - 8 * (r9 - n13)));
  442. }
  443. return [o8];
  444. }
  445. function h2(n12, t7, e9) {
  446. const r8 = e9.length, o8 = new Float32Array(r8);
  447. for (let a19 = 0; a19 < r8; a19++)
  448. if (null == n12 || n12[a19]) {
  449. const n13 = e9[a19], r9 = t7[a19];
  450. if (1 !== n13) {
  451. const t8 = (2 * (r9 * r9 - n13 * n13) + 1.5 * r9 + 0.5 * n13) / (r9 + n13 + 0.5);
  452. o8[a19] = t8 * (1 - 0.25 * t8) - (n13 - 0.125) / (1 - n13);
  453. }
  454. }
  455. return [o8];
  456. }
  457. function d2(n12, t7, e9, r8, o8) {
  458. const a19 = e9.length, s7 = new Float32Array(a19), i16 = Math.sqrt(1 + r8 * r8);
  459. for (let l13 = 0; l13 < a19; l13++)
  460. if (null == n12 || n12[l13]) {
  461. const n13 = e9[l13], a20 = t7[l13];
  462. s7[l13] = (a20 - r8 * n13 - o8) / i16;
  463. }
  464. return [s7];
  465. }
  466. function g2(n12, t7) {
  467. const [e9, r8, o8, a19, s7, i16] = t7, l13 = e9.length, c23 = new Float32Array(l13);
  468. for (let u11 = 0; u11 < l13; u11++)
  469. (null == n12 || n12[u11]) && (c23[u11] = -0.2848 * e9[u11] - 0.2435 * r8[u11] - 0.5436 * o8[u11] + 0.7243 * a19[u11] + 0.084 * s7[u11] - 1.18 * i16[u11]);
  470. return [c23];
  471. }
  472. function y4(n12, t7) {
  473. const [e9, , r8, o8, a19, s7] = t7, i16 = e9.length, l13 = new Float32Array(i16), c23 = new Float32Array(i16), u11 = new Float32Array(i16);
  474. for (let f4 = 0; f4 < i16; f4++)
  475. (null == n12 || n12[f4]) && (l13[f4] = s7[f4] ? a19[f4] / s7[f4] * 100 : 0, c23[f4] = e9[f4] ? a19[f4] / e9[f4] * 100 : 0, u11[f4] = o8[f4] ? r8[f4] / o8[f4] * (a19[f4] / o8[f4]) * 100 : 0);
  476. return [l13, c23, u11];
  477. }
  478. function b(n12, t7) {
  479. const [e9, r8, o8] = t7, a19 = e9.length, s7 = new Float32Array(a19);
  480. for (let i16 = 0; i16 < a19; i16++)
  481. if (null == n12 || n12[i16])
  482. for (i16 = 0; i16 < a19; i16++) {
  483. const n13 = e9[i16], t8 = r8[i16], a20 = t8 + n13 - o8[i16];
  484. a20 && (s7[i16] = (t8 - n13) / a20);
  485. }
  486. return [s7];
  487. }
  488. function v(n12, t7) {
  489. const [e9, r8, o8] = t7, a19 = e9.length, s7 = new Float32Array(a19);
  490. for (let i16 = 0; i16 < a19; i16++)
  491. if (null == n12 || n12[i16])
  492. for (i16 = 0; i16 < a19; i16++) {
  493. const n13 = e9[i16], t8 = r8[i16], a20 = o8[i16], l13 = Math.sqrt((2 * n13 + 1) ** 2 - 6 * n13 - 5 * Math.sqrt(t8) - 0.5);
  494. s7[i16] = 1.5 * (1.2 * (n13 - a20) - 2.5 * (t8 - a20)) * l13;
  495. }
  496. return [s7];
  497. }
  498. function k2(n12, t7) {
  499. const [e9, r8, o8] = t7, a19 = e9.length, s7 = new Float32Array(a19);
  500. for (let i16 = 0; i16 < a19; i16++)
  501. if (null == n12 || n12[i16])
  502. for (i16 = 0; i16 < a19; i16++) {
  503. const n13 = e9[i16], t8 = r8[i16], a20 = o8[i16];
  504. s7[i16] = 100 * (n13 - t8) - 10 * (n13 - a20);
  505. }
  506. return [s7];
  507. }
  508. function p4(n12, t7) {
  509. const [e9, r8, o8] = t7, a19 = e9.length, s7 = new Float32Array(a19);
  510. for (let i16 = 0; i16 < a19; i16++)
  511. if (null == n12 || n12[i16])
  512. for (i16 = 0; i16 < a19; i16++) {
  513. const n13 = e9[i16], t8 = r8[i16], a20 = n13 + 6 * t8 - 7.5 * o8[i16] + 1;
  514. a20 && (s7[i16] = 2.5 * (n13 - t8) / a20);
  515. }
  516. return [s7];
  517. }
  518. function A(n12, t7, e9 = 0.5) {
  519. const [r8, o8, a19] = t7, s7 = o8.length, i16 = new Float32Array(s7);
  520. for (let l13 = 0; l13 < s7; l13++)
  521. if (null == n12 || n12[l13])
  522. for (l13 = 0; l13 < s7; l13++) {
  523. const n13 = r8[l13], t8 = o8[l13], s8 = a19[l13], c23 = n13 + e9 * t8 + (1 - e9) * s8;
  524. c23 && (i16[l13] = (n13 - e9 * t8 - (1 - e9) * s8) / c23);
  525. }
  526. return [i16];
  527. }
  528. function F(n12, t7, e9) {
  529. const r8 = e9.length, o8 = new Float32Array(r8);
  530. for (let a19 = 0; a19 < r8; a19++)
  531. if (null == n12 || n12[a19])
  532. for (a19 = 0; a19 < r8; a19++) {
  533. const n13 = (0.1 - t7[a19]) ** 2 + (0.06 - e9[a19]) ** 2;
  534. n13 && (o8[a19] = 1 / n13);
  535. }
  536. return [o8];
  537. }
  538. // node_modules/@arcgis/core/layers/support/rasterFunctions/BandArithmeticFunctionArguments.js
  539. var p5;
  540. var a4 = p5 = class extends p2 {
  541. constructor() {
  542. super(...arguments), this.method = "custom";
  543. }
  544. clone() {
  545. return new p5({ method: this.method, bandIndexes: this.bandIndexes, raster: y(this.raster) });
  546. }
  547. };
  548. e([y2({ json: { type: String, write: true } })], a4.prototype, "bandIndexes", void 0), e([r3(a3)], a4.prototype, "method", void 0), a4 = p5 = e([n("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")], a4);
  549. var i3 = a4;
  550. // node_modules/@arcgis/core/layers/support/rasterFunctions/BandArithmeticFunction.js
  551. var u3 = class extends a2 {
  552. constructor() {
  553. super(...arguments), this.functionName = "BandArithmetic", this.functionArguments = null, this.rasterArgumentNames = ["raster"];
  554. }
  555. _bindSourceRasters() {
  556. this.outputPixelType = this._getOutputPixelType("f32");
  557. const t7 = this.sourceRasterInfos[0], s7 = t7.clone();
  558. return s7.pixelType = this.outputPixelType, s7.statistics = null, s7.histograms = null, s7.bandCount = "sultan" === this.functionArguments.method ? t7.bandCount : 1, this.rasterInfo = s7, { success: true };
  559. }
  560. _processPixels(t7) {
  561. var _a;
  562. const e9 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  563. if (t(e9))
  564. return e9;
  565. const { method: r8, bandIndexes: o8 } = this.functionArguments, i16 = o8.split(" ").map((t8) => parseFloat(t8));
  566. return s4(e9, { method: r8, bandIndexes: i16, equation: o8 });
  567. }
  568. };
  569. e([y2({ json: { write: true, name: "rasterFunction" } })], u3.prototype, "functionName", void 0), e([y2({ type: i3, json: { write: true, name: "rasterFunctionArguments" } })], u3.prototype, "functionArguments", void 0), e([y2()], u3.prototype, "rasterArgumentNames", void 0), u3 = e([n("esri.layers.support.rasterFunctions.BandArithmeticFunction")], u3);
  570. var a5 = u3;
  571. // node_modules/@arcgis/core/layers/support/rasterFunctions/ColormapFunctionArguments.js
  572. var c6;
  573. var l4 = c6 = class extends p2 {
  574. readColorRamp(o8) {
  575. return p(o8);
  576. }
  577. clone() {
  578. var _a;
  579. return new c6({ colormap: y(this.colormap), colormapName: this.colormapName, colorRamp: (_a = this.colorRamp) == null ? void 0 : _a.clone(), colorRampName: this.colorRampName });
  580. }
  581. };
  582. e([y2({ type: [[Number]], json: { write: true } })], l4.prototype, "colormap", void 0), e([y2({ type: String, json: { write: true } })], l4.prototype, "colormapName", void 0), e([y2({ types: m, json: { write: true } })], l4.prototype, "colorRamp", void 0), e([o("colorRamp")], l4.prototype, "readColorRamp", null), e([y2({ type: String, json: { write: true } })], l4.prototype, "colorRampName", void 0), l4 = c6 = e([n("esri.layers.support.rasterFunctions.ColormapFunctionArguments")], l4);
  583. var i4 = l4;
  584. // node_modules/@arcgis/core/layers/support/rasterFunctions/ColormapFunction.js
  585. var i5 = class extends a2 {
  586. constructor() {
  587. super(...arguments), this.functionName = "Colormap", this.functionArguments = null, this.rasterArgumentNames = ["raster"];
  588. }
  589. _bindSourceRasters() {
  590. const r8 = this.sourceRasterInfos[0];
  591. if (r8.bandCount > 1)
  592. return { success: false, error: "colormap-function: source data must be single band" };
  593. let { colormap: o8, colorRamp: t7 } = this.functionArguments;
  594. if ((o8 == null ? void 0 : o8.length) || t7 && (o8 = c2(t7, 256, true)), !(o8 == null ? void 0 : o8.length))
  595. return { success: false, error: "colormap-function: missing colormap argument" };
  596. this.outputPixelType = this._getOutputPixelType("u8");
  597. const s7 = r8.clone();
  598. return s7.pixelType = this.outputPixelType, s7.colormap = o8, this.rasterInfo = s7, { success: true };
  599. }
  600. _processPixels(r8) {
  601. var _a;
  602. return (_a = r8.pixelBlocks) == null ? void 0 : _a[0];
  603. }
  604. };
  605. e([y2({ json: { write: true, name: "rasterFunction" } })], i5.prototype, "functionName", void 0), e([y2({ type: i4, json: { write: true, name: "rasterFunctionArguments" } })], i5.prototype, "functionArguments", void 0), e([y2()], i5.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], i5.prototype, "indexedColormap", void 0), i5 = e([n("esri.layers.support.rasterFunctions.ColormapFunction")], i5);
  606. var p6 = i5;
  607. // node_modules/@arcgis/core/layers/support/rasterFunctions/CompositeBandFunctionArguments.js
  608. var a6;
  609. var c7 = a6 = class extends p2 {
  610. writeRasters(r8, s7) {
  611. s7.rasters = r8.map((r9) => "number" == typeof r9 || "string" == typeof r9 ? r9 : r9.toJSON());
  612. }
  613. clone() {
  614. return new a6({ rasters: y(this.rasters) });
  615. }
  616. };
  617. e([y2({ json: { write: true } })], c7.prototype, "rasters", void 0), e([r2("rasters")], c7.prototype, "writeRasters", null), c7 = a6 = e([n("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")], c7);
  618. var n4 = c7;
  619. // node_modules/@arcgis/core/layers/support/rasterFunctions/CompositeBandFunction.js
  620. var p7 = class extends a2 {
  621. constructor() {
  622. super(...arguments), this.functionName = "CompositeBand", this.functionArguments = null, this.rasterArgumentNames = ["rasters"];
  623. }
  624. _bindSourceRasters() {
  625. const { sourceRasterInfos: t7 } = this, r8 = t7[0];
  626. this.outputPixelType = this._getOutputPixelType(r8.pixelType);
  627. const e9 = r8.clone();
  628. if (e9.attributeTable = null, e9.colormap = null, e9.pixelType = this.outputPixelType, e9.bandCount = t7.map(({ bandCount: t8 }) => t8).reduce((t8, s7) => t8 + s7), t7.every(({ statistics: t8 }) => r(t8) && t8.length)) {
  629. const r9 = [];
  630. t7.forEach(({ statistics: t8 }) => r(t8) && r9.push(...t8)), e9.statistics = r9;
  631. }
  632. if (t7.every(({ histograms: t8 }) => r(t8) && t8.length)) {
  633. const r9 = [];
  634. t7.forEach(({ histograms: t8 }) => r(t8) && r9.push(...t8)), e9.histograms = r9;
  635. }
  636. return this.rasterInfo = e9, { success: true };
  637. }
  638. _processPixels(t7) {
  639. const { pixelBlocks: s7 } = t7;
  640. if (!s7)
  641. return null;
  642. const e9 = s7 == null ? void 0 : s7[0];
  643. return t(e9) ? null : h(s7);
  644. }
  645. };
  646. e([y2({ json: { write: true, name: "rasterFunction" } })], p7.prototype, "functionName", void 0), e([y2({ type: n4, json: { write: true, name: "rasterFunctionArguments" } })], p7.prototype, "functionArguments", void 0), e([y2()], p7.prototype, "rasterArgumentNames", void 0), p7 = e([n("esri.layers.support.rasterFunctions.CompositeBandFunction")], p7);
  647. var u4 = p7;
  648. // node_modules/@arcgis/core/layers/support/rasterFunctions/convolutionUtils.js
  649. var t4;
  650. !function(e9) {
  651. e9[e9.UserDefined = -1] = "UserDefined", e9[e9.LineDetectionHorizontal = 0] = "LineDetectionHorizontal", e9[e9.LineDetectionVertical = 1] = "LineDetectionVertical", e9[e9.LineDetectionLeftDiagonal = 2] = "LineDetectionLeftDiagonal", e9[e9.LineDetectionRightDiagonal = 3] = "LineDetectionRightDiagonal", e9[e9.GradientNorth = 4] = "GradientNorth", e9[e9.GradientWest = 5] = "GradientWest", e9[e9.GradientEast = 6] = "GradientEast", e9[e9.GradientSouth = 7] = "GradientSouth", e9[e9.GradientNorthEast = 8] = "GradientNorthEast", e9[e9.GradientNorthWest = 9] = "GradientNorthWest", e9[e9.SmoothArithmeticMean = 10] = "SmoothArithmeticMean", e9[e9.Smoothing3x3 = 11] = "Smoothing3x3", e9[e9.Smoothing5x5 = 12] = "Smoothing5x5", e9[e9.Sharpening3x3 = 13] = "Sharpening3x3", e9[e9.Sharpening5x5 = 14] = "Sharpening5x5", e9[e9.Laplacian3x3 = 15] = "Laplacian3x3", e9[e9.Laplacian5x5 = 16] = "Laplacian5x5", e9[e9.SobelHorizontal = 17] = "SobelHorizontal", e9[e9.SobelVertical = 18] = "SobelVertical", e9[e9.Sharpen = 19] = "Sharpen", e9[e9.Sharpen2 = 20] = "Sharpen2", e9[e9.PointSpread = 21] = "PointSpread", e9[e9.None = 255] = "None";
  652. }(t4 || (t4 = {}));
  653. var n5 = /* @__PURE__ */ new Map();
  654. function o5(e9) {
  655. const t7 = Math.sqrt(e9.length), n12 = e9.slice(0, t7), o8 = [1];
  656. for (let i16 = 1; i16 < t7; i16++) {
  657. let n13 = null;
  658. for (let o9 = 0; o9 < t7; o9++) {
  659. const r8 = e9[o9 + i16 * t7], a19 = e9[o9];
  660. if (null == n13)
  661. if (0 === a19) {
  662. if (r8)
  663. return { separable: false, row: null, col: null };
  664. } else
  665. n13 = r8 / a19;
  666. else if (r8 / a19 !== n13)
  667. return { separable: false, row: null, col: null };
  668. }
  669. if (null == n13)
  670. return { separable: false, row: null, col: null };
  671. o8.push(n13);
  672. }
  673. return { separable: true, row: n12, col: o8 };
  674. }
  675. function i6(e9, t7, n12, o8, i16, r8, a19) {
  676. const l13 = new Float32Array(t7 * n12), s7 = r8.length, h6 = a19 ? 0 : o8, c23 = a19 ? o8 : 0, p14 = a19 ? 1 : t7;
  677. for (let f4 = h6; f4 < n12 - h6; f4++) {
  678. const n13 = f4 * t7;
  679. for (let a20 = c23; a20 < t7 - c23; a20++) {
  680. if (i16 && !i16[n13 + a20])
  681. continue;
  682. let t8 = 0;
  683. for (let i17 = 0; i17 < s7; i17++)
  684. t8 += e9[n13 + a20 + (i17 - o8) * p14] * r8[i17];
  685. l13[n13 + a20] = t8;
  686. }
  687. }
  688. return l13;
  689. }
  690. function r6(e9, t7, n12, o8, i16, r8, a19) {
  691. const l13 = new Float32Array(t7 * n12), s7 = Math.floor(o8 / 2), h6 = Math.floor(i16 / 2);
  692. for (let c23 = s7; c23 < n12 - s7; c23++) {
  693. const n13 = c23 * t7;
  694. for (let c24 = h6; c24 < t7 - h6; c24++) {
  695. if (r8 && !r8[n13 + c24])
  696. continue;
  697. let p14 = 0;
  698. for (let r9 = 0; r9 < o8; r9++)
  699. for (let o9 = 0; o9 < i16; o9++)
  700. p14 += e9[n13 + c24 + (r9 - s7) * t7 + o9 - h6] * a19[r9 * i16 + o9];
  701. l13[n13 + c24] = p14;
  702. }
  703. }
  704. return l13;
  705. }
  706. function a7(t7, n12, o8 = true) {
  707. const { pixels: i16, width: a19, height: s7, pixelType: h6, mask: c23 } = t7, p14 = i16.length, f4 = [], { kernel: u11, rows: S2, cols: g4 } = n12;
  708. for (let e9 = 0; e9 < p14; e9++) {
  709. const t8 = r6(i16[e9], a19, s7, S2, g4, c23, u11);
  710. o8 && l5(t8, a19, s7, S2, g4), f4.push(t8);
  711. }
  712. return new g({ width: a19, height: s7, pixelType: h6, pixels: f4, mask: c23 });
  713. }
  714. function l5(e9, t7, n12, o8, i16) {
  715. const r8 = Math.floor(o8 / 2);
  716. for (let l13 = 0; l13 < r8; l13++)
  717. for (let o9 = 0; o9 < t7; o9++)
  718. e9[l13 * t7 + o9] = e9[(i16 - 1 - l13) * t7 + o9], e9[(n12 - 1 - l13) * t7 + o9] = e9[(n12 - i16 + l13) * t7 + o9];
  719. const a19 = Math.floor(i16 / 2);
  720. for (let l13 = 0; l13 < n12; l13++) {
  721. const n13 = l13 * t7;
  722. for (let o9 = 0; o9 < a19; o9++)
  723. e9[n13 + o9] = e9[n13 + i16 - 1 - o9], e9[n13 + t7 - o9 - 1] = e9[n13 + t7 + o9 - i16];
  724. }
  725. }
  726. function s5(t7, n12, o8, r8 = true) {
  727. const { pixels: a19, width: s7, height: h6, pixelType: c23, mask: p14 } = t7, f4 = a19.length, u11 = [], S2 = n12.length, g4 = o8.length, x4 = Math.floor(S2 / 2), d5 = Math.floor(g4 / 2);
  728. for (let e9 = 0; e9 < f4; e9++) {
  729. let t8 = i6(a19[e9], s7, h6, x4, p14, n12, true);
  730. t8 = i6(t8, s7, h6, d5, p14, o8, false), r8 && l5(t8, s7, h6, S2, g4), u11.push(t8);
  731. }
  732. return new g({ width: s7, height: h6, pixelType: c23, pixels: u11, mask: p14 });
  733. }
  734. function h3(e9, t7) {
  735. const n12 = o5(t7.kernel), i16 = false !== t7.mirrorEdges, r8 = n12.separable ? s5(e9, n12.row, n12.col, i16) : a7(e9, t7, i16), { outputPixelType: l13 } = t7;
  736. return l13 && r8.clamp(l13), r8;
  737. }
  738. n5.set(t4.None, [0, 0, 0, 0, 1, 0, 0, 0, 0]), n5.set(t4.LineDetectionHorizontal, [-1, -1, -1, 2, 2, 2, -1, -1, -1]), n5.set(t4.LineDetectionVertical, [-1, 2, -1, -1, 2, -1, -1, 2, -1]), n5.set(t4.LineDetectionLeftDiagonal, [2, -1, -1, -1, 2, -1, -1, -1, 2]), n5.set(t4.LineDetectionRightDiagonal, [-1, -1, 2, -1, 2, -1, 2, -1, -1]), n5.set(t4.GradientNorth, [-1, -2, -1, 0, 0, 0, 1, 2, 1]), n5.set(t4.GradientWest, [-1, 0, 1, -2, 0, 2, -1, 0, 1]), n5.set(t4.GradientEast, [1, 0, -1, 2, 0, -2, 1, 0, -1]), n5.set(t4.GradientSouth, [1, 2, 1, 0, 0, 0, -1, -2, -1]), n5.set(t4.GradientNorthEast, [0, -1, -2, 1, 0, -1, 2, 1, 0]), n5.set(t4.GradientNorthWest, [-2, -1, 0, -1, 0, 1, 0, 1, 2]), n5.set(t4.SmoothArithmeticMean, [0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111, 0.111111111111]), n5.set(t4.Smoothing3x3, [0.0625, 0.125, 0.0625, 0.125, 0.25, 0.125, 0.0625, 0.125, 0.0625]), n5.set(t4.Smoothing5x5, [1, 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 4, 12, 4, 1, 1, 4, 4, 4, 1, 1, 1, 1, 1, 1]), n5.set(t4.Sharpening3x3, [-1, -1, -1, -1, 9, -1, -1, -1, -1]), n5.set(t4.Sharpening5x5, [-1, -3, -4, -3, -1, -3, 0, 6, 0, -3, -4, 6, 21, 6, -4, -3, 0, 6, 0, -3, -1, -3, -4, -3, -1]), n5.set(t4.Laplacian3x3, [0, -1, 0, -1, 4, -1, 0, -1, 0]), n5.set(t4.Laplacian5x5, [0, 0, -1, 0, 0, 0, -1, -2, -1, 0, -1, -2, 17, -2, -1, 0, -1, -2, -1, 0, 0, 0, -1, 0, 0]), n5.set(t4.SobelHorizontal, [-1, -2, -1, 0, 0, 0, 1, 2, 1]), n5.set(t4.SobelVertical, [-1, 0, 1, -2, 0, 2, -1, 0, 1]), n5.set(t4.Sharpen, [0, -0.25, 0, -0.25, 2, -0.25, 0, -0.25, 0]), n5.set(t4.Sharpen2, [-0.25, -0.25, -0.25, -0.25, 3, -0.25, -0.25, -0.25, -0.25]), n5.set(t4.PointSpread, [-0.627, 0.352, -0.627, 0.352, 2.923, 0.352, -0.627, 0.352, -0.627]);
  739. // node_modules/@arcgis/core/layers/support/rasterFunctions/ConvolutionFunctionArguments.js
  740. var i7;
  741. var c8 = i7 = class extends p2 {
  742. constructor() {
  743. super(...arguments), this.rows = 3, this.cols = 3, this.kernel = [0, 0, 0, 0, 1, 0, 0, 0, 0];
  744. }
  745. set kernelType(e9) {
  746. this._set("kernelType", e9);
  747. const r8 = n5.get(e9);
  748. if (!r8 || e9 === t4.UserDefined || e9 === t4.None)
  749. return;
  750. const s7 = Math.sqrt(r8.length);
  751. this._set("kernel", r8), this._set("cols", s7), this._set("rows", s7);
  752. }
  753. clone() {
  754. return new i7({ cols: this.cols, rows: this.rows, kernel: [...this.kernel], kernelType: this.kernelType, raster: y(this.raster) });
  755. }
  756. };
  757. e([y2({ json: { type: Number, write: true } })], c8.prototype, "rows", void 0), e([y2({ json: { type: Number, write: true } })], c8.prototype, "cols", void 0), e([y2({ json: { name: "type", type: Number, write: true } })], c8.prototype, "kernelType", null), e([y2({ json: { type: [Number], write: true } })], c8.prototype, "kernel", void 0), c8 = i7 = e([n("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")], c8);
  758. var l6 = c8;
  759. // node_modules/@arcgis/core/layers/support/rasterFunctions/ConvolutionFunction.js
  760. var p8 = class extends a2 {
  761. constructor() {
  762. super(...arguments), this.functionName = "Convolution", this.rasterArgumentNames = ["raster"];
  763. }
  764. _bindSourceRasters() {
  765. const { kernelType: e9, rows: t7, cols: o8, kernel: s7 } = this.functionArguments;
  766. if (!n5.has(e9))
  767. return { success: false, error: `convolution-function: the specified kernel type is not supported ${e9}` };
  768. if (e9 !== t4.None && t7 * o8 !== s7.length)
  769. return { success: false, error: "convolution-function: the specified rows and cols do not match the length of the kernel" };
  770. const r8 = this.sourceRasterInfos[0];
  771. this.outputPixelType = this._getOutputPixelType(r8.pixelType);
  772. const n12 = r8.clone();
  773. n12.pixelType = this.outputPixelType;
  774. const c23 = [t4.None, t4.Sharpen, t4.Sharpen2, t4.Sharpening3x3, t4.Sharpening5x5];
  775. return "u8" === this.outputPixelType || c23.includes(e9) || (n12.statistics = null, n12.histograms = null), this.rasterInfo = n12, { success: true };
  776. }
  777. _processPixels(e9) {
  778. var _a;
  779. const o8 = (_a = e9.pixelBlocks) == null ? void 0 : _a[0];
  780. if (t(o8) || this.functionArguments.kernelType === t4.None)
  781. return o8;
  782. let { kernel: s7, rows: r8, cols: n12 } = this.functionArguments;
  783. const i16 = s7.reduce((e10, t7) => e10 + t7);
  784. return 0 !== i16 && 1 !== i16 && (s7 = s7.map((e10) => e10 / i16)), h3(o8, { kernel: s7, rows: r8, cols: n12, outputPixelType: this.outputPixelType });
  785. }
  786. };
  787. e([y2({ json: { write: true, name: "rasterFunction" } })], p8.prototype, "functionName", void 0), e([y2({ type: l6, json: { write: true, name: "rasterFunctionArguments" } })], p8.prototype, "functionArguments", void 0), e([y2()], p8.prototype, "rasterArgumentNames", void 0), p8 = e([n("esri.layers.support.rasterFunctions.ConvolutionFunction")], p8);
  788. var l7 = p8;
  789. // node_modules/@arcgis/core/layers/support/rasterFunctions/ExtractBandFunctionArguments.js
  790. var i8;
  791. var n6 = i8 = class extends p2 {
  792. constructor() {
  793. super(...arguments), this.bandIDs = [], this.missingBandAction = o2.bestMatch;
  794. }
  795. clone() {
  796. return new i8({ bandIDs: [...this.bandIDs], missingBandAction: this.missingBandAction });
  797. }
  798. };
  799. e([y2({ json: { write: true } })], n6.prototype, "bandIDs", void 0), e([y2({ json: { write: true } })], n6.prototype, "missingBandAction", void 0), n6 = i8 = e([n("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")], n6);
  800. var c9 = n6;
  801. // node_modules/@arcgis/core/layers/support/rasterFunctions/ExtractBandFunction.js
  802. var c10 = class extends a2 {
  803. constructor() {
  804. super(...arguments), this.functionName = "ExtractBand", this.functionArguments = null, this.rasterArgumentNames = ["raster"];
  805. }
  806. _bindSourceRasters() {
  807. const { sourceRasterInfos: t7 } = this, r8 = t7[0], { bandCount: e9 } = r8, { bandIDs: o8, missingBandAction: n12 } = this.functionArguments;
  808. if (n12 === o2.fail && o8.some((t8) => t8 < 0 || t8 >= e9))
  809. return { success: false, error: "extract-band-function: invalid bandIDs" };
  810. this.outputPixelType = this._getOutputPixelType("f32");
  811. const i16 = r8.clone();
  812. i16.pixelType = this.outputPixelType;
  813. const { statistics: c23, histograms: u11 } = i16;
  814. return r(c23) && c23.length && (i16.statistics = o8.map((t8) => c23[t8] || c23[c23.length - 1])), r(u11) && u11.length && (i16.histograms = o8.map((t8) => u11[t8] || u11[u11.length - 1])), this.rasterInfo = i16, { success: true };
  815. }
  816. _processPixels(t7) {
  817. var _a;
  818. const s7 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  819. if (t(s7))
  820. return null;
  821. const e9 = s7.pixels.length, o8 = this.functionArguments.bandIDs.map((t8) => t8 >= e9 ? e9 - 1 : t8);
  822. return s7.extractBands(o8);
  823. }
  824. };
  825. e([y2({ json: { write: true, name: "rasterFunction" } })], c10.prototype, "functionName", void 0), e([y2({ type: c9, json: { write: true, name: "rasterFunctionArguments" } })], c10.prototype, "functionArguments", void 0), e([y2()], c10.prototype, "rasterArgumentNames", void 0), c10 = e([n("esri.layers.support.rasterFunctions.ExtractBandFunction")], c10);
  826. var u5 = c10;
  827. // node_modules/@arcgis/core/layers/support/rasterFunctions/LocalFunctionArguments.js
  828. var a8;
  829. var i9 = a8 = class extends p2 {
  830. constructor() {
  831. super(...arguments), this.rasters = [], this.processAsMultiband = false;
  832. }
  833. writeRasters(r8, s7) {
  834. s7.rasters = r8.map((r9) => "number" == typeof r9 || "string" == typeof r9 ? r9 : r9.toJSON());
  835. }
  836. clone() {
  837. return new a8({ method: this.operation, processAsMultiband: this.processAsMultiband, rasters: y(this.rasters) });
  838. }
  839. };
  840. e([y2({ json: { write: true } })], i9.prototype, "operation", void 0), e([y2({ json: { write: true } })], i9.prototype, "rasters", void 0), e([r2("rasters")], i9.prototype, "writeRasters", null), e([y2({ json: { write: true } })], i9.prototype, "processAsMultiband", void 0), i9 = a8 = e([n("esri.layers.support.rasterFunctions.LocalFunctionArguments")], i9);
  841. var c11 = i9;
  842. // node_modules/@arcgis/core/layers/support/rasterFunctions/localUtils.js
  843. var o6;
  844. !function(t7) {
  845. t7[t7.Plus = 1] = "Plus", t7[t7.Minus = 2] = "Minus", t7[t7.Times = 3] = "Times", t7[t7.SquareRoot = 4] = "SquareRoot", t7[t7.Power = 5] = "Power", t7[t7.ACos = 6] = "ACos", t7[t7.ASin = 7] = "ASin", t7[t7.ATan = 8] = "ATan", t7[t7.ATanH = 9] = "ATanH", t7[t7.Abs = 10] = "Abs", t7[t7.BitwiseAnd = 11] = "BitwiseAnd", t7[t7.BitwiseLeftShift = 12] = "BitwiseLeftShift", t7[t7.BitwiseNot = 13] = "BitwiseNot", t7[t7.BitwiseOr = 14] = "BitwiseOr", t7[t7.BitwiseRightShift = 15] = "BitwiseRightShift", t7[t7.BitwiseXOr = 16] = "BitwiseXOr", t7[t7.BooleanAnd = 17] = "BooleanAnd", t7[t7.BooleanNot = 18] = "BooleanNot", t7[t7.BooleanOr = 19] = "BooleanOr", t7[t7.BooleanXOr = 20] = "BooleanXOr", t7[t7.Cos = 21] = "Cos", t7[t7.CosH = 22] = "CosH", t7[t7.Divide = 23] = "Divide", t7[t7.EqualTo = 24] = "EqualTo", t7[t7.Exp = 25] = "Exp", t7[t7.Exp10 = 26] = "Exp10", t7[t7.Exp2 = 27] = "Exp2", t7[t7.GreaterThan = 28] = "GreaterThan", t7[t7.GreaterThanEqual = 29] = "GreaterThanEqual", t7[t7.Int = 30] = "Int", t7[t7.IsNull = 31] = "IsNull", t7[t7.Float = 32] = "Float", t7[t7.LessThan = 33] = "LessThan", t7[t7.LessThanEqual = 34] = "LessThanEqual", t7[t7.Ln = 35] = "Ln", t7[t7.Log10 = 36] = "Log10", t7[t7.Log2 = 37] = "Log2", t7[t7.Majority = 38] = "Majority", t7[t7.Max = 39] = "Max", t7[t7.Mean = 40] = "Mean", t7[t7.Med = 41] = "Med", t7[t7.Min = 42] = "Min", t7[t7.Minority = 43] = "Minority", t7[t7.Mod = 44] = "Mod", t7[t7.Negate = 45] = "Negate", t7[t7.NotEqual = 46] = "NotEqual", t7[t7.Range = 47] = "Range", t7[t7.RoundDown = 48] = "RoundDown", t7[t7.RoundUp = 49] = "RoundUp", t7[t7.SetNull = 50] = "SetNull", t7[t7.Sin = 51] = "Sin", t7[t7.SinH = 52] = "SinH", t7[t7.Square = 53] = "Square", t7[t7.Std = 54] = "Std", t7[t7.Sum = 55] = "Sum", t7[t7.Tan = 56] = "Tan", t7[t7.TanH = 57] = "TanH", t7[t7.Variety = 58] = "Variety", t7[t7.ACosH = 59] = "ACosH", t7[t7.ASinH = 60] = "ASinH", t7[t7.ATan2 = 61] = "ATan2", t7[t7.FloatDivide = 64] = "FloatDivide", t7[t7.FloorDivide = 65] = "FloorDivide", t7[t7.MajorityIgnoreNoData = 66] = "MajorityIgnoreNoData", t7[t7.MaxIgnoreNoData = 67] = "MaxIgnoreNoData", t7[t7.MeanIgnoreNoData = 68] = "MeanIgnoreNoData", t7[t7.MedIgnoreNoData = 69] = "MedIgnoreNoData", t7[t7.MinIgnoreNoData = 70] = "MinIgnoreNoData", t7[t7.MinorityIgnoreNoData = 71] = "MinorityIgnoreNoData", t7[t7.RangeIgnoreNoData = 72] = "RangeIgnoreNoData", t7[t7.StdIgnoreNoData = 73] = "StdIgnoreNoData", t7[t7.SumIgnoreNoData = 74] = "SumIgnoreNoData", t7[t7.VarietyIgnoreNoData = 75] = "VarietyIgnoreNoData", t7[t7.Con = 76] = "Con";
  846. }(o6 || (o6 = {}));
  847. function a9(t7) {
  848. const n12 = t7.map((t8) => t8.mask).filter((t8) => r(t8));
  849. if (0 === n12.length)
  850. return null;
  851. const o8 = n12[0].length, r8 = new Uint8Array(o8);
  852. if (1 === n12.length)
  853. return r8.set(n12[0]), r8;
  854. let a19, s7 = n12[0];
  855. for (let e9 = 1; e9 < n12.length; e9++) {
  856. a19 = n12[e9];
  857. for (let t8 = 0; t8 < o8; t8++)
  858. r8[t8] = s7[t8] | a19[t8];
  859. s7 = a19;
  860. }
  861. return r8;
  862. }
  863. function s6(t7, e9, o8) {
  864. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  865. for (let n12 = 0; n12 < s7; n12++)
  866. e9 && !e9[n12] || (l13[n12] = r8[n12] + a19[n12]);
  867. return l13;
  868. }
  869. function l8(t7, e9, o8) {
  870. const [r8] = t7, a19 = r8.length, s7 = g.createEmptyBand("f32", a19);
  871. return s7.set(r8), s7;
  872. }
  873. function i10(t7, e9, o8) {
  874. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  875. for (let n12 = 0; n12 < s7; n12++)
  876. e9 && !e9[n12] || (l13[n12] = r8[n12] - a19[n12]);
  877. return l13;
  878. }
  879. function c12(t7, e9, o8) {
  880. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  881. for (let n12 = 0; n12 < s7; n12++)
  882. e9 && !e9[n12] || (l13[n12] = r8[n12] * a19[n12]);
  883. return l13;
  884. }
  885. function u6(t7, e9, o8) {
  886. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  887. for (let n12 = 0; n12 < s7; n12++)
  888. e9 && !e9[n12] || (l13[n12] = 0 === a19[n12] ? 0 : r8[n12] / a19[n12]);
  889. return l13;
  890. }
  891. function f2(t7, e9, n12) {
  892. return u6(t7, e9, "f32");
  893. }
  894. function h4(t7, e9, o8) {
  895. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  896. for (let n12 = 0; n12 < s7; n12++)
  897. e9 && !e9[n12] || (l13[n12] = 0 === a19[n12] ? 0 : Math.floor(r8[n12] / a19[n12]));
  898. return l13;
  899. }
  900. function g3(t7, e9, o8, r8) {
  901. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  902. for (let n12 = 0; n12 < s7; n12++)
  903. e9 && !e9[n12] || (l13[n12] = r8(a19[n12]));
  904. return l13;
  905. }
  906. function d3(t7, e9, o8, r8) {
  907. const [a19, s7] = t7, l13 = a19.length, i16 = g.createEmptyBand(o8, l13);
  908. for (let n12 = 0; n12 < l13; n12++)
  909. e9 && !e9[n12] || (i16[n12] = r8(a19[n12], s7[n12]));
  910. return i16;
  911. }
  912. function p9(t7, e9, o8) {
  913. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  914. for (let n12 = 0; n12 < s7; n12++)
  915. e9 && !e9[n12] || (l13[n12] = r8[n12] & a19[n12]);
  916. return l13;
  917. }
  918. function y5(t7, e9, o8) {
  919. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  920. for (let n12 = 0; n12 < s7; n12++)
  921. e9 && !e9[n12] || (l13[n12] = r8[n12] << a19[n12]);
  922. return l13;
  923. }
  924. function B(t7, e9, o8) {
  925. const [r8] = t7, a19 = r8.length, s7 = g.createEmptyBand(o8, a19);
  926. for (let n12 = 0; n12 < a19; n12++)
  927. e9 && !e9[n12] || (s7[n12] = ~r8[n12]);
  928. return s7;
  929. }
  930. function M(t7, e9, o8) {
  931. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  932. for (let n12 = 0; n12 < s7; n12++)
  933. e9 && !e9[n12] || (l13[n12] = r8[n12] | a19[n12]);
  934. return l13;
  935. }
  936. function m3(t7, e9, o8) {
  937. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  938. for (let n12 = 0; n12 < s7; n12++)
  939. e9 && !e9[n12] || (l13[n12] = r8[n12] >> a19[n12]);
  940. return l13;
  941. }
  942. function E(t7, e9, o8) {
  943. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  944. for (let n12 = 0; n12 < s7; n12++)
  945. e9 && !e9[n12] || (l13[n12] = r8[n12] ^ a19[n12]);
  946. return l13;
  947. }
  948. function N(t7, e9, o8) {
  949. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  950. for (let n12 = 0; n12 < s7; n12++)
  951. e9 && !e9[n12] || (l13[n12] = r8[n12] && a19[n12] ? 1 : 0);
  952. return l13;
  953. }
  954. function w5(t7, e9, o8) {
  955. const [r8] = t7, a19 = r8.length, s7 = g.createEmptyBand(o8, a19);
  956. for (let n12 = 0; n12 < a19; n12++)
  957. e9 && !e9[n12] || (s7[n12] = r8[n12] ? 0 : 1);
  958. return s7;
  959. }
  960. function D(t7, e9, o8) {
  961. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  962. for (let n12 = 0; n12 < s7; n12++)
  963. e9 && !e9[n12] || (l13[n12] = r8[n12] || a19[n12] ? 1 : 0);
  964. return l13;
  965. }
  966. function S(t7, e9, o8) {
  967. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  968. for (let n12 = 0; n12 < s7; n12++)
  969. e9 && !e9[n12] || (l13[n12] = (r8[n12] ? 1 : 0) ^ (a19[n12] ? 1 : 0));
  970. return l13;
  971. }
  972. function A2(t7, e9, o8) {
  973. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  974. for (let n12 = 0; n12 < s7; n12++)
  975. e9 && !e9[n12] || (l13[n12] = r8[n12] === a19[n12] ? 1 : 0);
  976. return l13;
  977. }
  978. function I(t7, e9, o8, r8) {
  979. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  980. for (let n12 = 0; n12 < s7; n12++)
  981. e9 && !e9[n12] || (l13[n12] = r8 ** a19[n12]);
  982. return l13;
  983. }
  984. function T(t7, e9, n12) {
  985. return I(t7, e9, n12, 10);
  986. }
  987. function x3(t7, e9, n12) {
  988. return I(t7, e9, n12, 2);
  989. }
  990. function q(t7, e9, o8) {
  991. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  992. for (let n12 = 0; n12 < s7; n12++)
  993. e9 && !e9[n12] || (l13[n12] = r8[n12] > a19[n12] ? 1 : 0);
  994. return l13;
  995. }
  996. function H(t7, e9, o8) {
  997. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  998. for (let n12 = 0; n12 < s7; n12++)
  999. e9 && !e9[n12] || (l13[n12] = r8[n12] >= a19[n12] ? 1 : 0);
  1000. return l13;
  1001. }
  1002. function L(t7, e9, o8) {
  1003. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  1004. for (let n12 = 0; n12 < s7; n12++)
  1005. e9 && !e9[n12] || (l13[n12] = r8[n12] < a19[n12] ? 1 : 0);
  1006. return l13;
  1007. }
  1008. function R(t7, e9, o8) {
  1009. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  1010. for (let n12 = 0; n12 < s7; n12++)
  1011. e9 && !e9[n12] || (l13[n12] = r8[n12] <= a19[n12] ? 1 : 0);
  1012. return l13;
  1013. }
  1014. function C(t7, e9, o8) {
  1015. const [r8] = t7, a19 = r8.length, s7 = g.createEmptyBand(o8, a19);
  1016. if (!e9)
  1017. return s7;
  1018. for (let n12 = 0; n12 < a19; n12++)
  1019. s7[n12] = e9[n12] ? 0 : 1;
  1020. return s7;
  1021. }
  1022. function F2(t7, e9, o8) {
  1023. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  1024. for (let n12 = 0; n12 < s7; n12++)
  1025. e9 && !e9[n12] || (l13[n12] = r8[n12] % a19[n12]);
  1026. return l13;
  1027. }
  1028. function O(t7, e9, o8) {
  1029. const [r8] = t7, a19 = r8.length, s7 = g.createEmptyBand(o8, a19);
  1030. for (let n12 = 0; n12 < a19; n12++)
  1031. e9 && !e9[n12] || (s7[n12] = -r8[n12]);
  1032. return s7;
  1033. }
  1034. function b2(t7, e9, o8) {
  1035. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7);
  1036. for (let n12 = 0; n12 < s7; n12++)
  1037. e9 && !e9[n12] || (l13[n12] = r8[n12] === a19[n12] ? 0 : 1);
  1038. return l13;
  1039. }
  1040. function k3(t7, e9, o8) {
  1041. const [r8, a19] = t7, s7 = r8.length, l13 = g.createEmptyBand(o8, s7), i16 = new Uint8Array(s7);
  1042. for (let n12 = 0; n12 < s7; n12++)
  1043. null != e9 && !e9[n12] || 0 !== r8[n12] || (l13[n12] = a19[n12], i16[n12] = 255);
  1044. return { band: l13, mask: i16 };
  1045. }
  1046. function v2(t7, e9, o8) {
  1047. const [r8, a19, s7] = t7, l13 = r8.length, i16 = g.createEmptyBand(o8, l13);
  1048. for (let n12 = 0; n12 < l13; n12++)
  1049. e9 && !e9[n12] || (i16[n12] = r8[n12] ? a19[n12] : s7[n12]);
  1050. return i16;
  1051. }
  1052. function j(t7, e9, o8) {
  1053. const r8 = t7.length;
  1054. if (r8 < 2)
  1055. return t7[0];
  1056. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1057. l13.set(a19);
  1058. for (let n12 = 0; n12 < s7; n12++)
  1059. if (!e9 || e9[n12])
  1060. for (let e10 = 1; e10 < r8; e10++) {
  1061. const o9 = t7[e10];
  1062. l13[n12] < o9[n12] && (l13[n12] = o9[n12]);
  1063. }
  1064. return l13;
  1065. }
  1066. function P(t7, e9, o8) {
  1067. const r8 = t7.length;
  1068. if (r8 < 2)
  1069. return t7[0];
  1070. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1071. l13.set(a19);
  1072. for (let n12 = 0; n12 < s7; n12++)
  1073. if (!e9 || e9[n12])
  1074. for (let e10 = 1; e10 < r8; e10++) {
  1075. const o9 = t7[e10];
  1076. l13[n12] > o9[n12] && (l13[n12] = o9[n12]);
  1077. }
  1078. return l13;
  1079. }
  1080. function G(t7, e9, o8) {
  1081. const r8 = t7.length;
  1082. if (r8 < 2)
  1083. return t7[0];
  1084. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1085. l13.set(a19);
  1086. for (let n12 = 0; n12 < s7; n12++)
  1087. if (!e9 || e9[n12]) {
  1088. let e10 = l13[n12];
  1089. for (let o9 = 1; o9 < r8; o9++) {
  1090. const r9 = t7[o9];
  1091. l13[n12] < r9[n12] && (l13[n12] = r9[n12]), e10 > r9[n12] && (e10 = r9[n12]);
  1092. }
  1093. l13[n12] -= e10;
  1094. }
  1095. return l13;
  1096. }
  1097. function U(t7, e9, o8) {
  1098. const r8 = t7.length;
  1099. if (r8 < 2)
  1100. return t7[0];
  1101. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1102. l13.set(a19);
  1103. for (let n12 = 0; n12 < s7; n12++)
  1104. if (!e9 || e9[n12]) {
  1105. for (let e10 = 1; e10 < r8; e10++) {
  1106. const o9 = t7[e10];
  1107. l13[n12] += o9[n12];
  1108. }
  1109. l13[n12] /= r8;
  1110. }
  1111. return l13;
  1112. }
  1113. function V(t7, e9, o8) {
  1114. const r8 = t7.length;
  1115. if (r8 < 2)
  1116. return t7[0];
  1117. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1118. l13.set(a19);
  1119. for (let n12 = 0; n12 < s7; n12++)
  1120. if (!e9 || e9[n12])
  1121. for (let e10 = 1; e10 < r8; e10++) {
  1122. const o9 = t7[e10];
  1123. l13[n12] += o9[n12];
  1124. }
  1125. return l13;
  1126. }
  1127. function X(t7, e9, o8) {
  1128. const r8 = t7.length;
  1129. if (r8 < 2)
  1130. return t7[0];
  1131. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7);
  1132. for (let n12 = 0; n12 < s7; n12++)
  1133. if (!e9 || e9[n12]) {
  1134. const e10 = new Float32Array(r8);
  1135. let o9 = 0;
  1136. for (let s8 = 0; s8 < r8; s8++) {
  1137. const r9 = t7[s8];
  1138. o9 += r9[n12], e10[s8] = r9[n12];
  1139. }
  1140. o9 /= r8;
  1141. let a20 = 0;
  1142. for (let t8 = 0; t8 < r8; t8++)
  1143. a20 += (e10[t8] - o9) * e10[t8] - o9;
  1144. l13[n12] = Math.sqrt(a20 / r8 - 1);
  1145. }
  1146. return l13;
  1147. }
  1148. function z(t7, e9, o8) {
  1149. const r8 = t7.length;
  1150. if (r8 < 2)
  1151. return t7[0];
  1152. const a19 = Math.floor(r8 / 2), [s7] = t7, l13 = s7.length, i16 = g.createEmptyBand(o8, l13), c23 = new Float32Array(r8);
  1153. for (let n12 = 0; n12 < l13; n12++)
  1154. if (!e9 || e9[n12]) {
  1155. for (let e10 = 0; e10 < r8; e10++)
  1156. c23[e10] = t7[e10][n12];
  1157. c23.sort(), i16[n12] = c23[a19];
  1158. }
  1159. return i16;
  1160. }
  1161. function J(t7, e9, o8) {
  1162. const r8 = t7.length;
  1163. if (r8 < 2)
  1164. return t7[0];
  1165. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7), i16 = /* @__PURE__ */ new Map();
  1166. for (let n12 = 0; n12 < s7; n12++)
  1167. if (!e9 || e9[n12]) {
  1168. let e10;
  1169. i16.clear();
  1170. for (let s8 = 0; s8 < r8; s8++)
  1171. e10 = t7[s8][n12], i16.set(e10, i16.has(e10) ? i16.get(e10) + 1 : 1);
  1172. let o9 = 0, a20 = 0;
  1173. for (const t8 of i16.keys())
  1174. o9 = i16.get(t8), o9 > a20 && (a20 = o9, e10 = t8);
  1175. l13[n12] = e10;
  1176. }
  1177. return l13;
  1178. }
  1179. function K(t7, e9, o8) {
  1180. const r8 = t7.length;
  1181. if (r8 < 2)
  1182. return t7[0];
  1183. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7), i16 = /* @__PURE__ */ new Map();
  1184. for (let n12 = 0; n12 < s7; n12++)
  1185. if (!e9 || e9[n12]) {
  1186. let e10;
  1187. i16.clear();
  1188. for (let s8 = 0; s8 < r8; s8++)
  1189. e10 = t7[s8][n12], i16.set(e10, i16.has(e10) ? i16.get(e10) + 1 : 1);
  1190. let o9 = 0, a20 = t7.length;
  1191. for (const t8 of i16.keys())
  1192. o9 = i16.get(t8), o9 < a20 && (a20 = o9, e10 = t8);
  1193. l13[n12] = e10;
  1194. }
  1195. return l13;
  1196. }
  1197. function Q(t7, e9, o8) {
  1198. const r8 = t7.length;
  1199. if (r8 < 2)
  1200. return t7[0];
  1201. const [a19] = t7, s7 = a19.length, l13 = g.createEmptyBand(o8, s7), i16 = /* @__PURE__ */ new Set();
  1202. for (let n12 = 0; n12 < s7; n12++)
  1203. if (!e9 || e9[n12]) {
  1204. let e10;
  1205. i16.clear();
  1206. for (let o9 = 0; o9 < r8; o9++)
  1207. e10 = t7[o9][n12], i16.add(e10);
  1208. l13[n12] = i16.size;
  1209. }
  1210. return l13;
  1211. }
  1212. function W(t7, e9, n12) {
  1213. return J(t7, null, n12);
  1214. }
  1215. function Y(t7, e9, n12) {
  1216. return K(t7, null, n12);
  1217. }
  1218. function Z(t7, e9, n12) {
  1219. return Q(t7, null, n12);
  1220. }
  1221. function $(t7, e9, n12) {
  1222. return j(t7, null, n12);
  1223. }
  1224. function _(t7, e9, n12) {
  1225. return P(t7, null, n12);
  1226. }
  1227. function tt(t7, e9, n12) {
  1228. return X(t7, null, n12);
  1229. }
  1230. function et(t7, e9, n12) {
  1231. return V(t7, null, n12);
  1232. }
  1233. function nt(t7, e9, n12) {
  1234. return U(t7, null, n12);
  1235. }
  1236. function ot(t7, e9, n12) {
  1237. return z(t7, null, n12);
  1238. }
  1239. function rt(t7, e9, n12) {
  1240. return G(t7, null, n12);
  1241. }
  1242. var at = /* @__PURE__ */ new Map();
  1243. var st = /* @__PURE__ */ new Map();
  1244. var lt = /* @__PURE__ */ new Map();
  1245. function it() {
  1246. at.size || (at.set(4, Math.sqrt), at.set(6, Math.acos), at.set(7, Math.asin), at.set(8, Math.atan), at.set(9, Math.atanh), at.set(10, Math.abs), at.set(21, Math.cos), at.set(22, Math.cosh), at.set(25, Math.exp), at.set(30, Math.floor), at.set(35, Math.log), at.set(36, Math.log10), at.set(37, Math.log2), at.set(48, Math.floor), at.set(49, Math.ceil), at.set(51, Math.sin), at.set(52, Math.sinh), at.set(56, Math.tan), at.set(57, Math.tanh), at.set(59, Math.acosh), at.set(60, Math.asinh), at.set(65, Math.floor), st.set(5, Math.pow), st.set(61, Math.atan2), lt.set(1, s6), lt.set(2, i10), lt.set(3, c12), lt.set(11, p9), lt.set(12, y5), lt.set(12, y5), lt.set(13, B), lt.set(14, M), lt.set(15, m3), lt.set(16, E), lt.set(17, N), lt.set(18, w5), lt.set(19, D), lt.set(20, S), lt.set(23, u6), lt.set(24, A2), lt.set(26, T), lt.set(27, x3), lt.set(28, q), lt.set(29, H), lt.set(31, C), lt.set(32, l8), lt.set(33, L), lt.set(34, R), lt.set(44, F2), lt.set(45, O), lt.set(46, b2), lt.set(64, f2), lt.set(65, h4), lt.set(76, v2), lt.set(38, J), lt.set(39, j), lt.set(40, U), lt.set(41, z), lt.set(42, P), lt.set(43, K), lt.set(47, G), lt.set(54, X), lt.set(55, V), lt.set(58, Q), lt.set(66, W), lt.set(67, $), lt.set(68, nt), lt.set(69, ot), lt.set(70, _), lt.set(71, Y), lt.set(72, rt), lt.set(73, tt), lt.set(74, et), lt.set(75, Z));
  1247. }
  1248. function ct(e9, r8, s7 = {}) {
  1249. it();
  1250. const l13 = e2(a9(e9)), { processAsMultiband: i16, outputPixelType: c23 = "f32" } = s7, u11 = i16 ? e9[0].pixels.length : 1, f4 = [];
  1251. let h6;
  1252. for (let t7 = 0; t7 < u11; t7++) {
  1253. const n12 = e9.map((e10) => e10.pixels[t7]);
  1254. let a19;
  1255. if (r8 === o6.SetNull) {
  1256. const t8 = k3(n12, l13, c23);
  1257. a19 = t8.band, h6 = t8.mask;
  1258. } else if (lt.has(r8)) {
  1259. a19 = lt.get(r8)(n12, l13, c23);
  1260. } else
  1261. at.has(r8) ? a19 = g3(n12, l13, c23, at.get(r8)) : st.has(r8) && (a19 = d3(n12, l13, c23, st.get(r8)));
  1262. if (null == a19)
  1263. return null;
  1264. f4.push(a19);
  1265. }
  1266. h6 || r8 === o6.IsNull || (h6 = l13);
  1267. const p14 = e9[0];
  1268. return new g({ width: p14.width, height: p14.height, pixelType: c23, mask: h6, pixels: f4 });
  1269. }
  1270. // node_modules/@arcgis/core/layers/support/rasterFunctions/LocalFunction.js
  1271. var u7 = class extends a2 {
  1272. constructor() {
  1273. super(...arguments), this.functionName = "Local", this.functionArguments = null, this.rasterArgumentNames = ["rasters"];
  1274. }
  1275. _bindSourceRasters() {
  1276. const { sourceRasterInfos: t7 } = this, s7 = t7[0], { bandCount: o8 } = s7, { processAsMultiband: r8 } = this.functionArguments;
  1277. if (r8 && t7.some((t8) => t8.bandCount !== o8))
  1278. return { success: false, error: "local-function: input rasters do not have same band count" };
  1279. this.outputPixelType = this._getOutputPixelType("f32");
  1280. const e9 = s7.clone();
  1281. return e9.pixelType = this.outputPixelType, e9.statistics = null, e9.histograms = null, r8 || (e9.bandCount = 1), this.rasterInfo = e9, { success: true };
  1282. }
  1283. _processPixels(t7) {
  1284. var _a;
  1285. const { pixelBlocks: o8 } = t7;
  1286. return t(o8) || o8.some((t8) => t(t8)) ? null : ct(o8, this.functionArguments.operation, { processAsMultiband: this.functionArguments.processAsMultiband, outputPixelType: (_a = this.outputPixelType) != null ? _a : void 0 });
  1287. }
  1288. };
  1289. e([y2({ json: { write: true, name: "rasterFunction" } })], u7.prototype, "functionName", void 0), e([y2({ type: c11, json: { write: true, name: "rasterFunctionArguments" } })], u7.prototype, "functionArguments", void 0), e([y2()], u7.prototype, "rasterArgumentNames", void 0), u7 = e([n("esri.layers.support.rasterFunctions.LocalFunction")], u7);
  1290. var c13 = u7;
  1291. // node_modules/@arcgis/core/layers/support/rasterFunctions/MaskFunctionArguments.js
  1292. var a10;
  1293. var n7 = a10 = class extends p2 {
  1294. constructor() {
  1295. super(...arguments), this.includedRanges = null, this.noDataValues = null, this.noDataInterpretation = i.matchAny;
  1296. }
  1297. clone() {
  1298. var _a, _b, _c, _d;
  1299. return new a10({ includedRanges: (_b = (_a = this.includedRanges) == null ? void 0 : _a.slice()) != null ? _b : [], noDataValues: (_d = (_c = this.noDataValues) == null ? void 0 : _c.slice()) != null ? _d : [], noDataInterpretation: this.noDataInterpretation });
  1300. }
  1301. };
  1302. e([y2({ json: { write: true } })], n7.prototype, "includedRanges", void 0), e([y2({ json: { write: true } })], n7.prototype, "noDataValues", void 0), e([y2({ json: { write: true } })], n7.prototype, "noDataInterpretation", void 0), n7 = a10 = e([n("esri.layers.support.rasterFunctions.MaskFunctionArguments")], n7);
  1303. var i11 = n7;
  1304. // node_modules/@arcgis/core/layers/support/rasterFunctions/MaskFunction.js
  1305. var p10 = class extends a2 {
  1306. constructor() {
  1307. super(...arguments), this.functionName = "Mask", this.functionArguments = null, this.rasterArgumentNames = ["raster"], this.lookup = null;
  1308. }
  1309. _bindSourceRasters() {
  1310. const t7 = this.sourceRasterInfos[0].clone(), { pixelType: s7 } = t7;
  1311. this.outputPixelType = this._getOutputPixelType(s7), t7.pixelType = this.outputPixelType, this.rasterInfo = t7;
  1312. const { includedRanges: e9, noDataValues: o8 } = this.functionArguments;
  1313. return (e9 == null ? void 0 : e9.length) || (o8 == null ? void 0 : o8.length) ? (this.lookup = k(s7, this.functionArguments.includedRanges, this.functionArguments.noDataValues), { success: true }) : { success: false, error: "missing includedRanges or noDataValues argument" };
  1314. }
  1315. _processPixels(t7) {
  1316. var _a;
  1317. const e9 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1318. if (t(e9))
  1319. return null;
  1320. const { outputPixelType: o8, lookup: r8 } = this, { includedRanges: n12, noDataValues: u11, noDataInterpretation: p14 } = this.functionArguments, c23 = p14 === i.matchAll;
  1321. return y3(e9, { includedRanges: n12, noDataValues: u11, outputPixelType: o8, matchAll: c23, lookup: r8 });
  1322. }
  1323. };
  1324. e([y2({ json: { write: true, name: "rasterFunction" } })], p10.prototype, "functionName", void 0), e([y2({ type: i11, json: { write: true, name: "rasterFunctionArguments" } })], p10.prototype, "functionArguments", void 0), e([y2()], p10.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], p10.prototype, "lookup", void 0), p10 = e([n("esri.layers.support.rasterFunctions.MaskFunction")], p10);
  1325. var c14 = p10;
  1326. // node_modules/@arcgis/core/layers/support/rasterFunctions/NDVIFunctionArguments.js
  1327. var t5;
  1328. var i12 = t5 = class extends p2 {
  1329. constructor() {
  1330. super(...arguments), this.visibleBandID = 0, this.infraredBandID = 1, this.scaled = true;
  1331. }
  1332. clone() {
  1333. const { visibleBandID: r8, infraredBandID: s7, scaled: e9 } = this;
  1334. return new t5({ visibleBandID: r8, infraredBandID: s7, scaled: e9 });
  1335. }
  1336. };
  1337. e([y2({ json: { write: true } })], i12.prototype, "visibleBandID", void 0), e([y2({ json: { write: true } })], i12.prototype, "infraredBandID", void 0), e([y2({ json: { write: true } })], i12.prototype, "scaled", void 0), i12 = t5 = e([n("esri.layers.support.rasterFunctions.NDVIFunctionArguments")], i12);
  1338. var a11 = i12;
  1339. // node_modules/@arcgis/core/layers/support/rasterFunctions/NDVIFunction.js
  1340. var c15 = class extends a2 {
  1341. constructor() {
  1342. super(...arguments), this.functionName = "NDVI", this.functionArguments = null, this.rasterArgumentNames = ["raster"];
  1343. }
  1344. _bindSourceRasters() {
  1345. const { scaled: t7 } = this.functionArguments;
  1346. this.outputPixelType = this._getOutputPixelType(t7 ? "u8" : "f32");
  1347. const s7 = this.sourceRasterInfos[0].clone();
  1348. s7.pixelType = this.outputPixelType, s7.colormap = null, s7.histograms = null;
  1349. const [r8, e9, o8, n12] = t7 ? [0, 200, 100, 10] : [-1, 1, 0, 0.1];
  1350. return s7.statistics = [{ min: r8, max: e9, avg: o8, stddev: n12 }], this.rasterInfo = s7, { success: true };
  1351. }
  1352. _processPixels(t7) {
  1353. var _a;
  1354. const r8 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1355. if (t(r8))
  1356. return null;
  1357. const { visibleBandID: e9, infraredBandID: n12, scaled: i16 } = this.functionArguments;
  1358. return i2(r8, e9, n12, i16);
  1359. }
  1360. };
  1361. e([y2({ json: { write: true, name: "rasterFunction" } })], c15.prototype, "functionName", void 0), e([y2({ type: a11, json: { write: true, name: "rasterFunctionArguments" } })], c15.prototype, "functionArguments", void 0), e([y2()], c15.prototype, "rasterArgumentNames", void 0), c15 = e([n("esri.layers.support.rasterFunctions.NDVIFunction")], c15);
  1362. var u8 = c15;
  1363. // node_modules/@arcgis/core/layers/support/rasterFunctions/RemapFunctionArguments.js
  1364. var r7;
  1365. var a12 = r7 = class extends p2 {
  1366. constructor() {
  1367. super(...arguments), this.inputRanges = null, this.outputValues = null, this.noDataRanges = null, this.allowUnmatched = false;
  1368. }
  1369. clone() {
  1370. return new r7({ inputRanges: [...this.inputRanges], outputValues: [...this.outputValues], noDataRanges: [...this.noDataRanges], allowUnmatched: this.allowUnmatched });
  1371. }
  1372. };
  1373. e([y2({ json: { write: true } })], a12.prototype, "inputRanges", void 0), e([y2({ json: { write: true } })], a12.prototype, "outputValues", void 0), e([y2({ json: { write: true } })], a12.prototype, "noDataRanges", void 0), e([y2({ json: { write: true } })], a12.prototype, "allowUnmatched", void 0), a12 = r7 = e([n("esri.layers.support.rasterFunctions.RemapFunctionArguments")], a12);
  1374. var n8 = a12;
  1375. // node_modules/@arcgis/core/layers/support/rasterFunctions/RemapFunction.js
  1376. var l9 = class extends a2 {
  1377. constructor() {
  1378. super(...arguments), this.functionName = "Remap", this.functionArguments = null, this.rasterArgumentNames = ["raster"], this.lookup = null;
  1379. }
  1380. _bindSourceRasters() {
  1381. const t7 = this.sourceRasterInfos[0].clone(), { pixelType: o8 } = t7;
  1382. this.outputPixelType = this._getOutputPixelType(o8), t7.pixelType = this.outputPixelType, t7.colormap = null, t7.histograms = null;
  1383. const { statistics: s7 } = t7, { allowUnmatched: r8, outputValues: n12 } = this.functionArguments;
  1384. if (r(s7) && s7.length && !r8) {
  1385. let t8 = n12[0], e9 = t8;
  1386. for (let o9 = 0; o9 < n12.length; o9++)
  1387. t8 = t8 > n12[o9] ? n12[o9] : t8, e9 = e9 > n12[o9] ? e9 : n12[o9];
  1388. for (let o9 = 0; o9 < s7.length; o9++)
  1389. s7[o9] = { ...s7[o9], min: t8, max: e9 };
  1390. }
  1391. return this.rasterInfo = t7, this.lookup = r8 ? null : w3(o8, this.functionArguments.inputRanges, n12), { success: true };
  1392. }
  1393. _processPixels(t7) {
  1394. var _a;
  1395. const e9 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1396. if (t(e9))
  1397. return null;
  1398. const { lookup: s7, outputPixelType: r8 } = this;
  1399. if (s7)
  1400. return c(e9, { lut: [s7.lut], offset: s7.offset, outputPixelType: r8 });
  1401. const { inputRanges: n12, outputValues: u11, noDataRanges: a19, allowUnmatched: l13 } = this.functionArguments;
  1402. return x(e9, { inputRanges: n12, outputValues: u11, noDataRanges: a19, allowUnmatched: l13, outputPixelType: r8 });
  1403. }
  1404. };
  1405. e([y2({ json: { write: true, name: "rasterFunction" } })], l9.prototype, "functionName", void 0), e([y2({ type: n8, json: { write: true, name: "rasterFunctionArguments" } })], l9.prototype, "functionArguments", void 0), e([y2()], l9.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], l9.prototype, "lookup", void 0), l9 = e([n("esri.layers.support.rasterFunctions.RemapFunction")], l9);
  1406. var c16 = l9;
  1407. // node_modules/@arcgis/core/layers/support/rasterFunctions/SlopeFunctionArguments.js
  1408. var i13;
  1409. var c17 = new s2({ 0: "degree", 1: "percent-rise", 2: "adjusted" }, { useNumericKeys: true });
  1410. var a13 = i13 = class extends p2 {
  1411. constructor() {
  1412. super(...arguments), this.slopeType = "degree", this.zFactor = 1, this.pixelSizePower = 0.664, this.pixelSizeFactor = 0.024;
  1413. }
  1414. clone() {
  1415. return new i13({ slopeType: this.slopeType, zFactor: this.zFactor, pixelSizePower: this.pixelSizePower, pixelSizeFactor: this.pixelSizeFactor, raster: this.raster });
  1416. }
  1417. };
  1418. e([r3(c17)], a13.prototype, "slopeType", void 0), e([y2({ type: Number, json: { write: true } })], a13.prototype, "zFactor", void 0), e([y2({ type: Number, json: { name: "psPower", write: true } })], a13.prototype, "pixelSizePower", void 0), e([y2({ type: Number, json: { name: "psFactor", write: true } })], a13.prototype, "pixelSizeFactor", void 0), a13 = i13 = e([n("esri.layers.support.rasterFunctions.SlopeFunctionArguments")], a13);
  1419. var n9 = a13;
  1420. // node_modules/@arcgis/core/layers/support/rasterFunctions/SlopeFunction.js
  1421. var p11 = class extends a2 {
  1422. constructor() {
  1423. super(...arguments), this.functionName = "Slope", this.functionArguments = null, this.rasterArgumentNames = ["raster"], this.isGCS = false;
  1424. }
  1425. _bindSourceRasters() {
  1426. this.outputPixelType = this._getOutputPixelType("f32");
  1427. const t7 = this.sourceRasterInfos[0].clone();
  1428. return t7.pixelType = this.outputPixelType, t7.statistics = null, t7.histograms = null, this.rasterInfo = t7, this.isGCS = t7.spatialReference.isGeographic, { success: true };
  1429. }
  1430. _processPixels(t7) {
  1431. var _a;
  1432. const s7 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1433. if (t(s7))
  1434. return null;
  1435. const { zFactor: r8, slopeType: o8, pixelSizePower: i16, pixelSizeFactor: p14 } = this.functionArguments, { isGCS: c23 } = this, { extent: u11 } = t7, a19 = u11 ? { x: u11.width / s7.width, y: u11.height / s7.height } : { x: 1, y: 1 };
  1436. return a(s7, { zFactor: r8, slopeType: o8, pixelSizePower: i16, pixelSizeFactor: p14, isGCS: c23, resolution: a19 });
  1437. }
  1438. };
  1439. e([y2({ json: { write: true, name: "rasterFunction" } })], p11.prototype, "functionName", void 0), e([y2({ type: n9, json: { write: true, name: "rasterFunctionArguments" } })], p11.prototype, "functionArguments", void 0), e([y2()], p11.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], p11.prototype, "isGCS", void 0), p11 = e([n("esri.layers.support.rasterFunctions.SlopeFunction")], p11);
  1440. var c18 = p11;
  1441. // node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsHistogramsFunctionArguments.js
  1442. var e6;
  1443. var c19 = e6 = class extends p2 {
  1444. constructor() {
  1445. super(...arguments), this.statistics = null, this.histograms = null;
  1446. }
  1447. clone() {
  1448. return new e6({ statistics: y(this.statistics), histograms: y(this.histograms) });
  1449. }
  1450. };
  1451. e([y2({ json: { write: true } })], c19.prototype, "statistics", void 0), e([y2({ json: { write: true } })], c19.prototype, "histograms", void 0), c19 = e6 = e([n("esri.layers.support.rasterFunctions.StatisticsHistogramsFunctionArguments")], c19);
  1452. var a14 = c19;
  1453. // node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsHistogramsFunction.js
  1454. var i14 = class extends a2 {
  1455. constructor() {
  1456. super(...arguments), this.functionName = "StatisticsHistograms", this.functionArguments = null, this.rasterArgumentNames = ["raster"];
  1457. }
  1458. _bindSourceRasters() {
  1459. const t7 = this.sourceRasterInfos[0];
  1460. this.outputPixelType = this._getOutputPixelType("u8");
  1461. const s7 = t7.clone(), { statistics: r8, histograms: o8 } = this.functionArguments;
  1462. return s7.histograms = o8, r8 && (s7.statistics = r8.map(([t8, s8, r9, o9]) => ({ min: t8, max: s8, avg: r9, stddev: o9 }))), this.rasterInfo = s7, { success: true };
  1463. }
  1464. _processPixels(t7) {
  1465. var _a;
  1466. return (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1467. }
  1468. };
  1469. e([y2({ json: { write: true, name: "rasterFunction" } })], i14.prototype, "functionName", void 0), e([y2({ type: a14, json: { write: true, name: "rasterFunctionArguments" } })], i14.prototype, "functionArguments", void 0), e([y2()], i14.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], i14.prototype, "indexedColormap", void 0), i14 = e([n("esri.layers.support.rasterFunctions.StatisticsHistogramsFunction")], i14);
  1470. var n10 = i14;
  1471. // node_modules/@arcgis/core/layers/support/rasterFunctions/StretchFunctionArguments.js
  1472. var n11;
  1473. var p12 = new s2({ 0: "none", 3: "standard-deviation", 4: "histogram-equalization", 5: "min-max", 6: "percent-clip", 7: "sigmoid" }, { useNumericKeys: true });
  1474. var c20 = n11 = class extends p2 {
  1475. constructor() {
  1476. super(...arguments), this.computeGamma = false, this.dynamicRangeAdjustment = false, this.gamma = [], this.histograms = null, this.statistics = null, this.stretchType = "none", this.useGamma = false;
  1477. }
  1478. writeStatistics(t7, e9, o8) {
  1479. (t7 == null ? void 0 : t7.length) && (Array.isArray(t7[0]) || (t7 = t7.map((t8) => [t8.min, t8.max, t8.avg, t8.stddev])), e9[o8] = t7);
  1480. }
  1481. clone() {
  1482. return new n11({ stretchType: this.stretchType, outputMin: this.outputMin, outputMax: this.outputMax, useGamma: this.useGamma, computeGamma: this.computeGamma, statistics: y(this.statistics), gamma: y(this.gamma), sigmoidStrengthLevel: this.sigmoidStrengthLevel, numberOfStandardDeviations: this.numberOfStandardDeviations, minPercent: this.minPercent, maxPercent: this.maxPercent, histograms: y(this.histograms), dynamicRangeAdjustment: this.dynamicRangeAdjustment, raster: this.raster });
  1483. }
  1484. };
  1485. e([y2({ type: Boolean, json: { write: true } })], c20.prototype, "computeGamma", void 0), e([y2({ type: Boolean, json: { name: "dra", write: true } })], c20.prototype, "dynamicRangeAdjustment", void 0), e([y2({ type: [Number], json: { write: true } })], c20.prototype, "gamma", void 0), e([y2()], c20.prototype, "histograms", void 0), e([y2({ type: Number, json: { write: true } })], c20.prototype, "maxPercent", void 0), e([y2({ type: Number, json: { write: true } })], c20.prototype, "minPercent", void 0), e([y2({ type: Number, json: { write: true } })], c20.prototype, "numberOfStandardDeviations", void 0), e([y2({ type: Number, json: { name: "max", write: true } })], c20.prototype, "outputMax", void 0), e([y2({ type: Number, json: { name: "min", write: true } })], c20.prototype, "outputMin", void 0), e([y2({ type: Number, json: { write: true } })], c20.prototype, "sigmoidStrengthLevel", void 0), e([y2({ json: { type: [[Number]], write: true } })], c20.prototype, "statistics", void 0), e([r2("statistics")], c20.prototype, "writeStatistics", null), e([r3(p12)], c20.prototype, "stretchType", void 0), e([y2({ type: Boolean, json: { write: true } })], c20.prototype, "useGamma", void 0), c20 = n11 = e([n("esri.layers.support.rasterFunctions.StretchFunctionArguments")], c20);
  1486. var u9 = c20;
  1487. // node_modules/@arcgis/core/layers/support/rasterFunctions/StretchFunction.js
  1488. var a15 = class extends a2 {
  1489. constructor() {
  1490. super(...arguments), this.functionName = "Stretch", this.functionArguments = null, this.rasterArgumentNames = ["raster"], this.lookup = null, this.cutOffs = null;
  1491. }
  1492. _bindSourceRasters() {
  1493. this.lookup = null, this.cutOffs = null;
  1494. const t7 = this.sourceRasterInfos[0], { pixelType: s7 } = t7, { functionArguments: e9 } = this, { dynamicRangeAdjustment: o8, gamma: r8, useGamma: i16 } = e9;
  1495. if (!o8 && ["u8", "u16", "s8", "s16"].includes(s7)) {
  1496. const o9 = x2(e9.toJSON(), { rasterInfo: t7 });
  1497. this.lookup = u({ pixelType: s7, ...o9, gamma: i16 ? r8 : null });
  1498. } else
  1499. o8 && (this.cutOffs = x2(e9.toJSON(), { rasterInfo: t7 }));
  1500. this.outputPixelType = this._getOutputPixelType(s7);
  1501. const u11 = t7.clone();
  1502. return u11.pixelType = this.outputPixelType, u11.statistics = null, u11.histograms = null, "u8" === this.outputPixelType && (u11.keyProperties.DataType = "processed"), this.rasterInfo = u11, { success: true };
  1503. }
  1504. _processPixels(t7) {
  1505. var _a;
  1506. const e9 = (_a = t7.pixelBlocks) == null ? void 0 : _a[0];
  1507. if (t(e9))
  1508. return e9;
  1509. const { lookup: o8 } = this;
  1510. if (o8)
  1511. return c(e9, { ...o8, outputPixelType: this.rasterInfo.pixelType });
  1512. const { functionArguments: r8 } = this, u11 = this.cutOffs || x2(r8.toJSON(), { rasterInfo: this.sourceRasterInfos[0], pixelBlock: e9 }), p14 = r8.useGamma ? r8.gamma : null;
  1513. return d(e9, { ...u11, gamma: p14, outputPixelType: this.outputPixelType });
  1514. }
  1515. };
  1516. e([y2({ json: { write: true, name: "rasterFunction" } })], a15.prototype, "functionName", void 0), e([y2({ type: u9, json: { write: true, name: "rasterFunctionArguments" } })], a15.prototype, "functionArguments", void 0), e([y2()], a15.prototype, "rasterArgumentNames", void 0), e([y2({ json: { write: true } })], a15.prototype, "lookup", void 0), e([y2({ json: { write: true } })], a15.prototype, "cutOffs", void 0), a15 = e([n("esri.layers.support.rasterFunctions.StretchFunction")], a15);
  1517. var l10 = a15;
  1518. // node_modules/@arcgis/core/layers/support/rasterFunctions/rasterFunctionHelper.js
  1519. var d4 = /* @__PURE__ */ new Map();
  1520. function l11(r8, e9) {
  1521. if ("rasterFunction" in r8)
  1522. return h5(r8, e9 != null ? e9 : {});
  1523. throw new s("raster-function-helper", "unsupported raster function json.");
  1524. }
  1525. function N2(t7, r8) {
  1526. return "rasters" === r8[0] && Array.isArray(t7.rasters) ? t7.rasters : r8.map((r9) => t7[r9]);
  1527. }
  1528. function h5(r8, e9) {
  1529. var _a, _b;
  1530. const { rasterFunction: s7, rasterFunctionArguments: n12 } = r8, o8 = (_a = r8.outputPixelType) == null ? void 0 : _a.toLowerCase();
  1531. if (null == s7 || !d4.has(s7))
  1532. throw new s("raster-function-helper", `unsupported raster function: ${s7}`);
  1533. const a19 = d4.get(s7), c23 = ("function" == typeof a19.ctor ? a19.ctor : a19.ctor.default).fromJSON({ ...r8, outputPixelType: o8 }), { rasterArgumentNames: i16 } = c23, u11 = [], m5 = N2(n12, i16), p14 = "rasters" === i16[0], f4 = [];
  1534. for (let t7 = 0; t7 < m5.length; t7++) {
  1535. const r9 = m5[t7];
  1536. let s8;
  1537. null == r9 || "string" == typeof r9 && r9.startsWith("$") ? u11.push(e9 == null ? void 0 : e9.raster) : "string" == typeof r9 ? e9[r9] && u11.push(e9[r9]) : "number" != typeof r9 && "rasterFunction" in r9 && (s8 = h5(r9, e9), p14 || (c23.functionArguments[i16[t7]] = s8), u11.push(s8)), p14 && f4.push(s8 != null ? s8 : r9);
  1538. }
  1539. if (p14 && (c23.functionArguments.rasters = f4), e9) {
  1540. c23.sourceRasters = u11;
  1541. const t7 = (_b = e9.raster) == null ? void 0 : _b.url;
  1542. t7 && (c23.mainPrimaryRasterId = t7);
  1543. }
  1544. return c23;
  1545. }
  1546. d4.set("Aspect", { desc: "Aspect Function", ctor: p3, rasterArgumentNames: ["raster"] }), d4.set("BandArithmetic", { desc: "Band Arithmetic Function", ctor: a5, rasterArgumentNames: ["raster"] }), d4.set("Colormap", { desc: "Colormap Function", ctor: p6, rasterArgumentNames: ["raster"] }), d4.set("CompositeBand", { desc: "CompositeBand Function", ctor: u4, rasterArgumentNames: ["rasters"] }), d4.set("Convolution", { desc: "Convolution Function", ctor: l7, rasterArgumentNames: ["raster"] }), d4.set("ExtractBand", { desc: "ExtractBand Function", ctor: u5, rasterArgumentNames: ["raster"] }), d4.set("Local", { desc: "Local Function", ctor: c13, rasterArgumentNames: ["rasters"] }), d4.set("Mask", { desc: "Mask Function", ctor: c14, rasterArgumentNames: ["raster"] }), d4.set("NDVI", { desc: "NDVI Function", ctor: u8, rasterArgumentNames: ["raster"] }), d4.set("Remap", { desc: "Remap Function", ctor: c16, rasterArgumentNames: ["raster"] }), d4.set("Slope", { desc: "Slope Function", ctor: c18, rasterArgumentNames: ["raster"] }), d4.set("StatisticsHistograms", { desc: "Statistics Histograms Function", ctor: n10, rasterArgumentNames: ["raster"] }), d4.set("Stretch", { desc: "Stretch Function", ctor: l10, rasterArgumentNames: ["raster"] });
  1547. // node_modules/@arcgis/core/layers/support/rasterTransforms/BaseRasterTransform.js
  1548. var t6 = class extends l {
  1549. get affectsPixelSize() {
  1550. return false;
  1551. }
  1552. forwardTransform(r8) {
  1553. return r8;
  1554. }
  1555. inverseTransform(r8) {
  1556. return r8;
  1557. }
  1558. };
  1559. e([y2()], t6.prototype, "affectsPixelSize", null), e([y2({ json: { write: true } })], t6.prototype, "spatialReference", void 0), t6 = e([n("esri.layers.support.rasterTransforms.BaseRasterTransform")], t6);
  1560. var a16 = t6;
  1561. // node_modules/@arcgis/core/layers/support/rasterTransforms/GCSShiftTransform.js
  1562. var a17 = class extends a16 {
  1563. constructor() {
  1564. super(...arguments), this.type = "gcs-shift", this.tolerance = 1e-8;
  1565. }
  1566. forwardTransform(r8) {
  1567. return "point" === (r8 = r8.clone()).type ? (r8.x > 180 + this.tolerance && (r8.x -= 360), r8) : (r8.xmin >= 180 - this.tolerance ? (r8.xmax -= 360, r8.xmin -= 360) : r8.xmax > 180 + this.tolerance && (r8.xmin = -180, r8.xmax = 180), r8);
  1568. }
  1569. inverseTransform(r8) {
  1570. return "point" === (r8 = r8.clone()).type ? (r8.x < -this.tolerance && (r8.x += 360), r8) : (r8.xmin < -this.tolerance && (r8.xmin += 360, r8.xmax += 360), r8);
  1571. }
  1572. };
  1573. e([r3({ GCSShiftXform: "gcs-shift" })], a17.prototype, "type", void 0), e([y2()], a17.prototype, "tolerance", void 0), a17 = e([n("esri.layers.support.rasterTransforms.GCSShiftTransform")], a17);
  1574. var c21 = a17;
  1575. // node_modules/@arcgis/core/layers/support/rasterTransforms/IdentityTransform.js
  1576. var e7 = class extends a16 {
  1577. constructor() {
  1578. super(...arguments), this.type = "identity";
  1579. }
  1580. };
  1581. e([r3({ IdentityXform: "identity" })], e7.prototype, "type", void 0), e7 = e([n("esri.layers.support.rasterTransforms.IdentityTransform")], e7);
  1582. var p13 = e7;
  1583. // node_modules/@arcgis/core/layers/support/rasterTransforms/PolynomialTransform.js
  1584. function l12(e9, r8, o8) {
  1585. const { x: t7, y: s7 } = r8;
  1586. if (o8 < 2) {
  1587. return { x: e9[0] + t7 * e9[2] + s7 * e9[4], y: e9[1] + t7 * e9[3] + s7 * e9[5] };
  1588. }
  1589. if (2 === o8) {
  1590. const r9 = t7 * t7, o9 = s7 * s7, n13 = t7 * s7;
  1591. return { x: e9[0] + t7 * e9[2] + s7 * e9[4] + r9 * e9[6] + n13 * e9[8] + o9 * e9[10], y: e9[1] + t7 * e9[3] + s7 * e9[5] + r9 * e9[7] + n13 * e9[9] + o9 * e9[11] };
  1592. }
  1593. const n12 = t7 * t7, i16 = s7 * s7, f4 = t7 * s7, p14 = n12 * t7, l13 = n12 * s7, a19 = t7 * i16, c23 = s7 * i16;
  1594. return { x: e9[0] + t7 * e9[2] + s7 * e9[4] + n12 * e9[6] + f4 * e9[8] + i16 * e9[10] + p14 * e9[12] + l13 * e9[14] + a19 * e9[16] + c23 * e9[18], y: e9[1] + t7 * e9[3] + s7 * e9[5] + n12 * e9[7] + f4 * e9[9] + i16 * e9[11] + p14 * e9[13] + l13 * e9[15] + a19 * e9[17] + c23 * e9[19] };
  1595. }
  1596. function a18(e9, r8, o8) {
  1597. const { xmin: t7, ymin: s7, xmax: n12, ymax: i16, spatialReference: f4 } = r8;
  1598. let a19 = [];
  1599. if (o8 < 2)
  1600. a19.push({ x: t7, y: i16 }), a19.push({ x: n12, y: i16 }), a19.push({ x: t7, y: s7 }), a19.push({ x: n12, y: s7 });
  1601. else {
  1602. let e10 = 10;
  1603. for (let r9 = 0; r9 < e10; r9++)
  1604. a19.push({ x: t7, y: s7 + (i16 - s7) * r9 / (e10 - 1) }), a19.push({ x: n12, y: s7 + (i16 - s7) * r9 / (e10 - 1) });
  1605. e10 = 8;
  1606. for (let r9 = 1; r9 <= e10; r9++)
  1607. a19.push({ x: t7 + (n12 - t7) * r9 / e10, y: s7 }), a19.push({ x: t7 + (n12 - t7) * r9 / e10, y: i16 });
  1608. }
  1609. a19 = a19.map((r9) => l12(e9, r9, o8));
  1610. const c23 = a19.map((e10) => e10.x), u11 = a19.map((e10) => e10.y);
  1611. return new w2({ xmin: Math.min.apply(null, c23), xmax: Math.max.apply(null, c23), ymin: Math.min.apply(null, u11), ymax: Math.max.apply(null, u11), spatialReference: f4 });
  1612. }
  1613. function c22(e9) {
  1614. const [r8, o8, t7, s7, n12, i16] = e9, f4 = t7 * i16 - n12 * s7, p14 = n12 * s7 - t7 * i16;
  1615. return [(n12 * o8 - r8 * i16) / f4, (t7 * o8 - r8 * s7) / p14, i16 / f4, s7 / p14, -n12 / f4, -t7 / p14];
  1616. }
  1617. var u10 = class extends a16 {
  1618. constructor() {
  1619. super(...arguments), this.polynomialOrder = 1, this.type = "polynomial";
  1620. }
  1621. readForwardCoefficients(e9, r8) {
  1622. const { coeffX: o8, coeffY: t7 } = r8;
  1623. if (!(o8 == null ? void 0 : o8.length) || !(t7 == null ? void 0 : t7.length) || o8.length !== t7.length)
  1624. return null;
  1625. const s7 = [];
  1626. for (let n12 = 0; n12 < o8.length; n12++)
  1627. s7.push(o8[n12]), s7.push(t7[n12]);
  1628. return s7;
  1629. }
  1630. writeForwardCoefficients(e9, r8, o8) {
  1631. const t7 = [], s7 = [];
  1632. for (let n12 = 0; n12 < (e9 == null ? void 0 : e9.length); n12++)
  1633. n12 % 2 == 0 ? t7.push(e9[n12]) : s7.push(e9[n12]);
  1634. r8.coeffX = t7, r8.coeffY = s7;
  1635. }
  1636. get inverseCoefficients() {
  1637. let e9 = this._get("inverseCoefficients");
  1638. const r8 = this._get("forwardCoefficients");
  1639. return !e9 && r8 && this.polynomialOrder < 2 && (e9 = c22(r8)), e9;
  1640. }
  1641. set inverseCoefficients(e9) {
  1642. this._set("inverseCoefficients", e9);
  1643. }
  1644. readInverseCoefficients(e9, r8) {
  1645. const { inverseCoeffX: o8, inverseCoeffY: t7 } = r8;
  1646. if (!(o8 == null ? void 0 : o8.length) || !(t7 == null ? void 0 : t7.length) || o8.length !== t7.length)
  1647. return null;
  1648. const s7 = [];
  1649. for (let n12 = 0; n12 < o8.length; n12++)
  1650. s7.push(o8[n12]), s7.push(t7[n12]);
  1651. return s7;
  1652. }
  1653. writeInverseCoefficients(e9, r8, o8) {
  1654. const t7 = [], s7 = [];
  1655. for (let n12 = 0; n12 < (e9 == null ? void 0 : e9.length); n12++)
  1656. n12 % 2 == 0 ? t7.push(e9[n12]) : s7.push(e9[n12]);
  1657. r8.inverseCoeffX = t7, r8.inverseCoeffY = s7;
  1658. }
  1659. get affectsPixelSize() {
  1660. return this.polynomialOrder > 0;
  1661. }
  1662. forwardTransform(e9) {
  1663. if ("point" === e9.type) {
  1664. const r8 = l12(this.forwardCoefficients, e9, this.polynomialOrder);
  1665. return new w({ x: r8.x, y: r8.y, spatialReference: e9.spatialReference });
  1666. }
  1667. return a18(this.forwardCoefficients, e9, this.polynomialOrder);
  1668. }
  1669. inverseTransform(e9) {
  1670. if ("point" === e9.type) {
  1671. const r8 = l12(this.inverseCoefficients, e9, this.polynomialOrder);
  1672. return new w({ x: r8.x, y: r8.y, spatialReference: e9.spatialReference });
  1673. }
  1674. return a18(this.inverseCoefficients, e9, this.polynomialOrder);
  1675. }
  1676. };
  1677. e([y2({ json: { write: true } })], u10.prototype, "polynomialOrder", void 0), e([y2()], u10.prototype, "forwardCoefficients", void 0), e([o("forwardCoefficients", ["coeffX", "coeffY"])], u10.prototype, "readForwardCoefficients", null), e([r2("forwardCoefficients")], u10.prototype, "writeForwardCoefficients", null), e([y2({ json: { write: true } })], u10.prototype, "inverseCoefficients", null), e([o("inverseCoefficients", ["inverseCoeffX", "inverseCoeffY"])], u10.prototype, "readInverseCoefficients", null), e([r2("inverseCoefficients")], u10.prototype, "writeInverseCoefficients", null), e([y2()], u10.prototype, "affectsPixelSize", null), e([r3({ PolynomialXform: "polynomial" })], u10.prototype, "type", void 0), u10 = e([n("esri.layers.support.rasterTransforms.PolynomialTransform")], u10);
  1678. var m4 = u10;
  1679. // node_modules/@arcgis/core/layers/support/rasterTransforms/utils.js
  1680. var o7 = { GCSShiftXform: c21, IdentityXform: p13, PolynomialXform: m4 };
  1681. var e8 = Object.keys(o7);
  1682. function f3(r8) {
  1683. const t7 = r8 == null ? void 0 : r8.type;
  1684. return !r8 || e8.includes(t7);
  1685. }
  1686. function i15(r8) {
  1687. const t7 = r8 == null ? void 0 : r8.type;
  1688. if (!t7)
  1689. return null;
  1690. const n12 = o7[r8 == null ? void 0 : r8.type];
  1691. if (n12) {
  1692. const t8 = new n12();
  1693. return t8.read(r8), t8;
  1694. }
  1695. return null;
  1696. }
  1697. export {
  1698. l11 as l,
  1699. c21 as c,
  1700. m4 as m,
  1701. f3 as f,
  1702. i15 as i
  1703. };
  1704. //# sourceMappingURL=chunk-XQ6FMY5X.js.map