chunk-F2ZAJBUD.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. import {
  2. I,
  3. e as e4,
  4. r as r3
  5. } from "./chunk-RMZNH22Z.js";
  6. import {
  7. t as t3
  8. } from "./chunk-A22ACVMF.js";
  9. import {
  10. e as e2
  11. } from "./chunk-44FMXGSC.js";
  12. import {
  13. e as e3
  14. } from "./chunk-XFDO4CMR.js";
  15. import {
  16. e
  17. } from "./chunk-GHN7C53L.js";
  18. import {
  19. Ze
  20. } from "./chunk-WM52QDLS.js";
  21. import {
  22. n as n2,
  23. r as r2
  24. } from "./chunk-C7742RNZ.js";
  25. import {
  26. u as u2
  27. } from "./chunk-2H5MD622.js";
  28. import {
  29. x
  30. } from "./chunk-YUA3AHKR.js";
  31. import {
  32. j
  33. } from "./chunk-LU5IJZB4.js";
  34. import {
  35. n,
  36. t as t2
  37. } from "./chunk-TJNOJH33.js";
  38. import {
  39. U
  40. } from "./chunk-DVUG3KID.js";
  41. import {
  42. s
  43. } from "./chunk-FWSQEIAR.js";
  44. import {
  45. E,
  46. w
  47. } from "./chunk-V6P2MAQQ.js";
  48. import {
  49. f,
  50. u2 as u
  51. } from "./chunk-2TIUKVZN.js";
  52. import {
  53. r,
  54. t
  55. } from "./chunk-YXWMMD76.js";
  56. // node_modules/@arcgis/core/layers/support/capabilities.js
  57. var t4 = { analytics: { supportsCacheHint: false }, attachment: { supportsContentType: false, supportsExifInfo: false, supportsKeywords: false, supportsName: false, supportsSize: false, supportsCacheHint: false, supportsResize: false }, data: { isVersioned: false, supportsAttachment: false, supportsM: false, supportsZ: false }, editing: { supportsDeleteByAnonymous: false, supportsDeleteByOthers: false, supportsGeometryUpdate: false, supportsGlobalId: false, supportsReturnServiceEditsInSourceSpatialReference: false, supportsRollbackOnFailure: false, supportsUpdateByAnonymous: false, supportsUpdateByOthers: false, supportsUpdateWithoutM: false, supportsUploadWithItemId: false }, metadata: { supportsAdvancedFieldProperties: false }, operations: { supportsCalculate: false, supportsTruncate: false, supportsValidateSql: false, supportsAdd: false, supportsDelete: false, supportsEditing: false, supportsChangeTracking: false, supportsQuery: false, supportsQueryAnalytics: false, supportsQueryAttachments: false, supportsQueryTopFeatures: false, supportsResizeAttachments: false, supportsSync: false, supportsUpdate: false, supportsExceedsLimitStatistics: false }, queryRelated: { supportsCount: false, supportsOrderBy: false, supportsPagination: false, supportsCacheHint: false }, queryTopFeatures: { supportsCacheHint: false }, query: { maxRecordCount: 0, maxRecordCountFactor: 0, standardMaxRecordCount: 0, supportsCacheHint: false, supportsCentroid: false, supportsCompactGeometry: false, supportsDefaultSpatialReference: false, supportsFullTextSearch: false, supportsDisjointSpatialRelationship: false, supportsDistance: false, supportsDistinct: false, supportsExtent: false, supportsFormatPBF: false, supportsGeometryProperties: false, supportsHavingClause: false, supportsHistoricMoment: false, supportsMaxRecordCountFactor: false, supportsOrderBy: false, supportsPagination: false, supportsPercentileStatistics: false, supportsQuantization: false, supportsQuantizationEditMode: false, supportsQueryByOthers: false, supportsQueryGeometry: false, supportsResultType: false, supportsSqlExpression: false, supportsStandardizedQueriesOnly: false, supportsTopFeaturesQuery: false, supportsSpatialAggregationStatistics: false, supportedSpatialAggregationStatistics: { envelope: false, centroid: false, convexHull: false }, supportsStatistics: false, tileMaxRecordCount: 0 } };
  58. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SProjectionUtil.js
  59. var s2 = 1;
  60. var c = 5 - s2;
  61. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/interfaces.js
  62. var A;
  63. !function(A3) {
  64. A3[A3.INVISIBLE = 0] = "INVISIBLE", A3[A3.TRANSPARENT = 1] = "TRANSPARENT", A3[A3.OPAQUE = 2] = "OPAQUE";
  65. }(A || (A = {}));
  66. // node_modules/@arcgis/core/views/3d/layers/support/edgeUtils.js
  67. function m(e9) {
  68. return { ...g, ...e9, type: "solid" };
  69. }
  70. var g = { color: r2(0, 0, 0, 0.2), size: 1, extensionLength: 0, opacity: 1, objectTransparency: A.OPAQUE, hasSlicePlane: false };
  71. var d = { color: r2(0, 0, 0, 0.2), size: 1, extensionLength: 0, opacity: 1, objectTransparency: A.OPAQUE, hasSlicePlane: false };
  72. // node_modules/@arcgis/core/views/3d/support/orientedBoundingBox.js
  73. var w3 = e3();
  74. var A2 = n();
  75. var B2 = n();
  76. var I2 = n2();
  77. var C = e();
  78. function E3(t6 = [0, 0, 0], e9 = [-1, -1, -1], a3 = [0, 0, 0, 1]) {
  79. return { center: t2(t6), halfSize: t3(e9), quaternion: r3(a3) };
  80. }
  81. var T = (() => {
  82. const t6 = new Int8Array(162);
  83. let e9 = 0;
  84. const a3 = (a4) => {
  85. for (let n5 = 0; n5 < a4.length; n5++)
  86. t6[e9 + n5] = a4[n5];
  87. e9 += 6;
  88. };
  89. return a3([6, 2, 3, 1, 5, 4]), a3([0, 2, 3, 1, 5, 4]), a3([0, 2, 3, 7, 5, 4]), a3([0, 1, 3, 2, 6, 4]), a3([0, 1, 3, 2, 0, 0]), a3([0, 1, 5, 7, 3, 2]), a3([0, 1, 3, 7, 6, 4]), a3([0, 1, 3, 7, 6, 2]), a3([0, 1, 5, 7, 6, 2]), a3([0, 1, 5, 4, 6, 2]), a3([0, 1, 5, 4, 0, 0]), a3([0, 1, 3, 7, 5, 4]), a3([0, 2, 6, 4, 0, 0]), a3([0, 0, 0, 0, 0, 0]), a3([1, 3, 7, 5, 0, 0]), a3([2, 3, 7, 6, 4, 0]), a3([2, 3, 7, 6, 0, 0]), a3([2, 3, 1, 5, 7, 6]), a3([0, 1, 5, 7, 6, 2]), a3([0, 1, 5, 7, 6, 4]), a3([0, 1, 3, 7, 6, 4]), a3([4, 5, 7, 6, 2, 0]), a3([4, 5, 7, 6, 0, 0]), a3([4, 5, 1, 3, 7, 6]), a3([0, 2, 3, 7, 5, 4]), a3([6, 2, 3, 7, 5, 4]), a3([6, 2, 3, 1, 5, 4]), t6;
  90. })();
  91. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SUtil.js
  92. var ie = u2();
  93. var ce;
  94. function ye(t6, r6, n5, o2, a3) {
  95. const s5 = [];
  96. for (const e9 of r6)
  97. if (e9 && a3.includes(e9.name)) {
  98. const r7 = `${t6}/nodes/${n5}/attributes/${e9.key}/0`;
  99. s5.push({ url: r7, storageInfo: e9 });
  100. }
  101. return E(s5.map((t7) => U(t7.url, { responseType: "array-buffer" }).then((e9) => I(t7.storageInfo, e9.data)))).then((e9) => {
  102. const t7 = [];
  103. for (const r7 of o2) {
  104. const n6 = {};
  105. for (let t8 = 0; t8 < e9.length; t8++)
  106. null != e9[t8].value && (n6[s5[t8].storageInfo.name] = be(e9[t8].value, r7));
  107. t7.push(n6);
  108. }
  109. return t7;
  110. });
  111. }
  112. !function(e9) {
  113. e9[e9.OUTSIDE = 0] = "OUTSIDE", e9[e9.INTERSECTS_CENTER_OUTSIDE = 1] = "INTERSECTS_CENTER_OUTSIDE", e9[e9.INTERSECTS_CENTER_INSIDE = 2] = "INTERSECTS_CENTER_INSIDE", e9[e9.INSIDE = 3] = "INSIDE";
  114. }(ce || (ce = {}));
  115. var Se = -32768;
  116. var ge = -(2 ** 31);
  117. function be(e9, t6) {
  118. if (!e9)
  119. return null;
  120. const r6 = e9[t6];
  121. if (u(e9))
  122. return r6 === Se ? null : r6;
  123. if (f(e9))
  124. return r6 === ge ? null : r6;
  125. return r6 != r6 ? null : r6;
  126. }
  127. var We = m({ color: [0, 0, 0, 0], opacity: 0 });
  128. var Ge = n();
  129. var Ke = n();
  130. var Le = n();
  131. var Be = e3();
  132. var $e = new Float64Array(24);
  133. var Ve = n();
  134. var Ze2 = n();
  135. var He = e();
  136. var it = e2();
  137. var st = e4();
  138. var lt = u2();
  139. var ft = u2();
  140. var ut = E3();
  141. var ht = { data: new Array(72), size: 3 };
  142. var mt = e2();
  143. // node_modules/@arcgis/core/layers/support/FetchAssociatedFeatureLayer.js
  144. var l4 = class {
  145. constructor(t6, r6, e9, a3) {
  146. var _a;
  147. this._parsedUrl = t6, this._portalItem = r6, this._apiKey = e9, this.signal = a3, this._rootDocument = null;
  148. const i2 = (_a = this._parsedUrl) == null ? void 0 : _a.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);
  149. i2 && (this._urlParts = { root: i2[1], layerId: parseInt(i2[2], 10) });
  150. }
  151. async fetch() {
  152. var _a;
  153. if (!this._urlParts)
  154. return null;
  155. const t6 = (_a = this._portalItem) != null ? _a : await this._portalItemFromServiceItemId();
  156. if (t(t6))
  157. return this._loadFromUrl();
  158. const r6 = await this._findAndLoadRelatedPortalItem(t6);
  159. return t(r6) ? null : this._loadFeatureLayerFromPortalItem(r6);
  160. }
  161. async fetchPortalItem() {
  162. var _a;
  163. if (!this._urlParts)
  164. return null;
  165. const t6 = (_a = this._portalItem) != null ? _a : await this._portalItemFromServiceItemId();
  166. return t(t6) ? null : this._findAndLoadRelatedPortalItem(t6);
  167. }
  168. async _fetchRootDocument() {
  169. if (r(this._rootDocument))
  170. return this._rootDocument;
  171. if (t(this._urlParts))
  172. return this._rootDocument = {}, {};
  173. const t6 = { query: { f: "json", token: this._apiKey }, responseType: "json", signal: this.signal }, i2 = `${this._urlParts.root}/SceneServer`;
  174. try {
  175. const e9 = await U(i2, t6);
  176. this._rootDocument = e9.data;
  177. } catch {
  178. this._rootDocument = {};
  179. }
  180. return this._rootDocument;
  181. }
  182. async _fetchServiceOwningPortalUrl() {
  183. var _a, _b;
  184. const e9 = (_a = this._parsedUrl) == null ? void 0 : _a.path, a3 = e9 ? (_b = s) == null ? void 0 : _b.findServerInfo(e9) : null;
  185. if (a3 == null ? void 0 : a3.owningSystemUrl)
  186. return a3.owningSystemUrl;
  187. const s5 = e9 ? e9.replace(/(.*\/rest)\/.*/i, "$1") + "/info" : null;
  188. try {
  189. const t6 = (await U(s5, { query: { f: "json" }, responseType: "json", signal: this.signal })).data.owningSystemUrl;
  190. if (t6)
  191. return t6;
  192. } catch (n5) {
  193. w(n5);
  194. }
  195. return null;
  196. }
  197. async _findAndLoadRelatedPortalItem(t6) {
  198. try {
  199. return (await t6.fetchRelatedItems({ relationshipType: "Service2Service", direction: "reverse" }, { signal: this.signal })).find((t7) => "Feature Service" === t7.type) || null;
  200. } catch (r6) {
  201. return w(r6), null;
  202. }
  203. }
  204. async _loadFeatureLayerFromPortalItem(t6) {
  205. var _a;
  206. await t6.load({ signal: this.signal });
  207. const r6 = await this._findMatchingAssociatedSublayerUrl((_a = t6.url) != null ? _a : "");
  208. return new Ze({ url: r6, portalItem: t6 }).load({ signal: this.signal });
  209. }
  210. async _loadFromUrl() {
  211. var _a;
  212. const t6 = await this._findMatchingAssociatedSublayerUrl(`${(_a = this._urlParts) == null ? void 0 : _a.root}/FeatureServer`);
  213. return new Ze({ url: t6 }).load({ signal: this.signal });
  214. }
  215. async _findMatchingAssociatedSublayerUrl(t6) {
  216. var _a;
  217. const e9 = t6.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i, "$1"), a3 = { query: { f: "json" }, responseType: "json", authMode: "no-prompt", signal: this.signal }, i2 = (_a = this._urlParts) == null ? void 0 : _a.layerId, s5 = this._fetchRootDocument(), n5 = U(e9, a3), [o2, l5] = await Promise.all([n5, s5]), c3 = l5 && l5.layers, u7 = o2.data && o2.data.layers;
  218. if (!Array.isArray(u7))
  219. throw new Error("expected layers array");
  220. if (Array.isArray(c3))
  221. for (let r6 = 0; r6 < Math.min(c3.length, u7.length); r6++) {
  222. if (c3[r6].id === i2)
  223. return `${e9}/${u7[r6].id}`;
  224. }
  225. else if (null != i2 && i2 < u7.length)
  226. return `${e9}/${u7[i2].id}`;
  227. throw new Error("could not find matching associated sublayer");
  228. }
  229. async _portalItemFromServiceItemId() {
  230. const t6 = (await this._fetchRootDocument()).serviceItemId;
  231. if (!t6)
  232. return null;
  233. const r6 = new x({ id: t6, apiKey: this._apiKey }), e9 = await this._fetchServiceOwningPortalUrl();
  234. r(e9) && (r6.portal = new j({ url: e9 }));
  235. try {
  236. return r6.load({ signal: this.signal });
  237. } catch (s5) {
  238. return w(s5), null;
  239. }
  240. }
  241. };
  242. export {
  243. t4 as t,
  244. ye,
  245. l4 as l
  246. };
  247. //# sourceMappingURL=chunk-F2ZAJBUD.js.map