SceneLayer-TEB5XGYY.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. import {
  2. w as w2
  3. } from "./chunk-BVMSF6QA.js";
  4. import {
  5. l as l5,
  6. t as t6
  7. } from "./chunk-Z25OS74A.js";
  8. import {
  9. l as l4,
  10. m as m4,
  11. s as s3,
  12. u as u3
  13. } from "./chunk-M7HZTZK5.js";
  14. import {
  15. A,
  16. K
  17. } from "./chunk-C62PEMUB.js";
  18. import "./chunk-5ZZSM3DU.js";
  19. import "./chunk-BQ7UE3XL.js";
  20. import "./chunk-UILPRJKY.js";
  21. import "./chunk-6NQ3AA2U.js";
  22. import "./chunk-524XACB7.js";
  23. import "./chunk-XKHC7KKF.js";
  24. import {
  25. p2 as p3,
  26. r as r4,
  27. t as t5
  28. } from "./chunk-HGDNY7J3.js";
  29. import "./chunk-GD5TMIPM.js";
  30. import {
  31. l as l3
  32. } from "./chunk-ZRX5UNQH.js";
  33. import "./chunk-VEAEIBHK.js";
  34. import "./chunk-6SASJ6IM.js";
  35. import "./chunk-3OHML7FO.js";
  36. import "./chunk-JGOAMEPM.js";
  37. import "./chunk-Z64YKYHD.js";
  38. import "./chunk-2VFJVI2I.js";
  39. import {
  40. t as t3
  41. } from "./chunk-F37AVPUF.js";
  42. import "./chunk-FUEX356Y.js";
  43. import {
  44. An,
  45. Wn
  46. } from "./chunk-DH2OBAUC.js";
  47. import "./chunk-TNLRDNTC.js";
  48. import "./chunk-OSNKP4CI.js";
  49. import "./chunk-435DJNTD.js";
  50. import "./chunk-T3EUPDKL.js";
  51. import "./chunk-QY775BFA.js";
  52. import "./chunk-2SJEIKRW.js";
  53. import "./chunk-PHRSJJ3U.js";
  54. import {
  55. p as p4
  56. } from "./chunk-VVBOYBFX.js";
  57. import "./chunk-S7R5EXHN.js";
  58. import {
  59. i as i2
  60. } from "./chunk-FMKGHOGD.js";
  61. import {
  62. p as p2
  63. } from "./chunk-6URTNEGN.js";
  64. import "./chunk-KN7TOKVN.js";
  65. import {
  66. j as j3
  67. } from "./chunk-RQJNTZAL.js";
  68. import "./chunk-QTOOFNRV.js";
  69. import "./chunk-7O56JPWQ.js";
  70. import "./chunk-6B2LQBKM.js";
  71. import {
  72. d as d4
  73. } from "./chunk-MFI6BALW.js";
  74. import {
  75. n as n2
  76. } from "./chunk-CIG5OHC7.js";
  77. import "./chunk-FUD7XO3N.js";
  78. import "./chunk-6EU7GFUT.js";
  79. import "./chunk-MFUAILAT.js";
  80. import "./chunk-HZJYXMI6.js";
  81. import "./chunk-27P5ZSC7.js";
  82. import "./chunk-UPD4MTCL.js";
  83. import "./chunk-GRBROWI6.js";
  84. import "./chunk-5NKYXKIA.js";
  85. import "./chunk-MPWGHCZG.js";
  86. import "./chunk-FTI5VP6T.js";
  87. import "./chunk-RZFGRBD7.js";
  88. import {
  89. B
  90. } from "./chunk-PUSPZYFZ.js";
  91. import "./chunk-EN7YGJWG.js";
  92. import "./chunk-VBNMTM7L.js";
  93. import "./chunk-3D3QEPRE.js";
  94. import "./chunk-JFNNSBWL.js";
  95. import {
  96. b
  97. } from "./chunk-UD63WBG3.js";
  98. import "./chunk-X7DBH4KK.js";
  99. import "./chunk-LY74KTXV.js";
  100. import "./chunk-EWE6EXPY.js";
  101. import "./chunk-KUXNUNAI.js";
  102. import {
  103. d as d2
  104. } from "./chunk-KMAHKQ2G.js";
  105. import "./chunk-522WBHUO.js";
  106. import "./chunk-WNCU6BFU.js";
  107. import "./chunk-PIGRDDRG.js";
  108. import "./chunk-BJHM4JNS.js";
  109. import "./chunk-F6A2QQ26.js";
  110. import "./chunk-XLV7RUSE.js";
  111. import "./chunk-NTUXR253.js";
  112. import "./chunk-EOSZHC5H.js";
  113. import "./chunk-C43UE3Z5.js";
  114. import "./chunk-H2KDMZTR.js";
  115. import "./chunk-RMX2AZ4P.js";
  116. import {
  117. u as u2
  118. } from "./chunk-NE3ESGA6.js";
  119. import {
  120. U,
  121. a,
  122. j as j2
  123. } from "./chunk-YIS6BAC3.js";
  124. import "./chunk-7XXXCK2A.js";
  125. import "./chunk-7ZIDBK7B.js";
  126. import {
  127. v as v2
  128. } from "./chunk-KHA63LLS.js";
  129. import {
  130. c as c2
  131. } from "./chunk-FGKNEJKJ.js";
  132. import {
  133. c,
  134. d as d3,
  135. l as l2,
  136. m as m3,
  137. p
  138. } from "./chunk-PSV473TI.js";
  139. import {
  140. O
  141. } from "./chunk-I3OBGWNS.js";
  142. import "./chunk-FONIFA5N.js";
  143. import "./chunk-EG5OI4V4.js";
  144. import {
  145. i
  146. } from "./chunk-65BYCSII.js";
  147. import {
  148. c as c3
  149. } from "./chunk-WZQZRKNH.js";
  150. import "./chunk-LRDX4TO7.js";
  151. import {
  152. r as r3
  153. } from "./chunk-6A4U74YA.js";
  154. import "./chunk-CYI7KFYB.js";
  155. import "./chunk-5LXROFTA.js";
  156. import "./chunk-GJXW4HL5.js";
  157. import "./chunk-WJW5DUN6.js";
  158. import {
  159. t as t4
  160. } from "./chunk-W72F6AS3.js";
  161. import "./chunk-PJ7ZQ4VD.js";
  162. import "./chunk-WDLTDV2L.js";
  163. import "./chunk-TERAW6FT.js";
  164. import "./chunk-N2663GRX.js";
  165. import "./chunk-O4FY3ITT.js";
  166. import "./chunk-WEMIK25H.js";
  167. import {
  168. b as b2
  169. } from "./chunk-4DDBH2K5.js";
  170. import "./chunk-7N4X6GF3.js";
  171. import "./chunk-JXW4QTJA.js";
  172. import "./chunk-UXF37FQ4.js";
  173. import "./chunk-ZOEK6QHJ.js";
  174. import "./chunk-XNLG7T2T.js";
  175. import "./chunk-IR4PV7VK.js";
  176. import "./chunk-2Z6LERTI.js";
  177. import {
  178. v2 as v
  179. } from "./chunk-OWVBLVP3.js";
  180. import "./chunk-AFZ7XSEW.js";
  181. import "./chunk-EGZW6HC3.js";
  182. import "./chunk-4NKD334K.js";
  183. import "./chunk-65K7LC56.js";
  184. import "./chunk-ATPLLI5W.js";
  185. import "./chunk-WJ3OEUD3.js";
  186. import "./chunk-MXB2XLKV.js";
  187. import "./chunk-XH7RUGVZ.js";
  188. import "./chunk-TBBTRX4O.js";
  189. import "./chunk-YBSUITLL.js";
  190. import {
  191. j
  192. } from "./chunk-ALDCDSPV.js";
  193. import "./chunk-DT6EAZQ5.js";
  194. import "./chunk-HNOZUNJ4.js";
  195. import {
  196. U as U2
  197. } from "./chunk-VNFRAYHO.js";
  198. import "./chunk-R5IG2D6H.js";
  199. import {
  200. G
  201. } from "./chunk-VBRY5KJM.js";
  202. import "./chunk-PDKDCAAD.js";
  203. import {
  204. o
  205. } from "./chunk-ECW2QABR.js";
  206. import "./chunk-GCDJLKH4.js";
  207. import "./chunk-MRJEICT6.js";
  208. import {
  209. d,
  210. e,
  211. e2,
  212. l3 as l,
  213. n2 as n,
  214. r2,
  215. t as t2,
  216. u2 as u
  217. } from "./chunk-Y3WMVFTW.js";
  218. import "./chunk-SAS7RONY.js";
  219. import "./chunk-WSRBH7BF.js";
  220. import "./chunk-IHXECKQQ.js";
  221. import {
  222. g,
  223. w
  224. } from "./chunk-ULGDPLM2.js";
  225. import {
  226. s,
  227. s3 as s2
  228. } from "./chunk-EMJ4ZSM2.js";
  229. import {
  230. m as m2
  231. } from "./chunk-IKP3YN53.js";
  232. import {
  233. m,
  234. r,
  235. t
  236. } from "./chunk-GZT4BVFP.js";
  237. import "./chunk-A5ICIBVI.js";
  238. // node_modules/@arcgis/core/layers/support/RangeInfo.js
  239. var s4 = class extends l {
  240. constructor() {
  241. super(...arguments), this.name = null, this.field = null, this.currentRangeExtent = null, this.fullRangeExtent = null, this.type = "rangeInfo";
  242. }
  243. };
  244. e([d({ type: String, json: { read: true, write: true } })], s4.prototype, "name", void 0), e([d({ type: String, json: { read: true, write: true } })], s4.prototype, "field", void 0), e([d({ type: [Number], json: { read: true, write: true } })], s4.prototype, "currentRangeExtent", void 0), e([d({ type: [Number], json: { read: true, write: true } })], s4.prototype, "fullRangeExtent", void 0), e([d({ type: ["rangeInfo"], readOnly: true, json: { read: false, write: true } })], s4.prototype, "type", void 0), s4 = e([n("esri.layers.support.RangeInfo")], s4);
  245. // node_modules/@arcgis/core/layers/support/PolygonCollection.js
  246. var c4;
  247. var p5 = c4 = class extends u(j.ofType(v)) {
  248. constructor(e3) {
  249. super(e3);
  250. }
  251. clone() {
  252. return new c4(this.items.map((e3) => e3.clone()));
  253. }
  254. write(e3, r5) {
  255. return this.toJSON(r5);
  256. }
  257. toJSON(e3) {
  258. const r5 = e3?.layer?.spatialReference;
  259. return r5 ? this.toArray().map((t7) => {
  260. if (!r5.equals(t7.spatialReference)) {
  261. if (!An(t7.spatialReference, r5))
  262. return e3 && e3.messages && e3.messages.push(new t2("scenefilter:unsupported", "Scene filters with incompatible spatial references are not supported", { modification: this, spatialReference: e3.layer.spatialReference, context: e3 })), null;
  263. const s6 = new v();
  264. Wn(t7, s6, r5), t7 = s6;
  265. }
  266. const s5 = t7.toJSON(e3);
  267. return delete s5.spatialReference, s5;
  268. }).filter((e4) => e4 != null) : (e3?.messages && e3.messages.push(new t2("scenefilter:unsupported", "Writing Scene filters without context layer is not supported", { modification: this, spatialReference: e3.layer.spatialReference, context: e3 })), this.toArray().map((r6) => r6.toJSON(e3)));
  269. }
  270. static fromJSON(e3, r5) {
  271. const t7 = new c4();
  272. return e3.forEach((e4) => t7.add(v.fromJSON(e4, r5))), t7;
  273. }
  274. };
  275. p5 = c4 = e([n("esri.layers.support.PolygonCollection")], p5);
  276. var l6 = p5;
  277. // node_modules/@arcgis/core/layers/support/SceneFilter.js
  278. var g2;
  279. var f = g2 = class extends l {
  280. constructor(e3) {
  281. super(e3), this.spatialRelationship = "disjoint", this.geometries = new l6(), this._geometriesSource = null, this._handles = new u2();
  282. }
  283. initialize() {
  284. this._handles.add(a(() => this.geometries, "after-changes", () => this.geometries = this.geometries, U));
  285. }
  286. destroy() {
  287. this._handles.destroy();
  288. }
  289. readGeometries(e3, o2, r5) {
  290. this._geometriesSource = { url: i(e3, r5), context: r5 };
  291. }
  292. async loadGeometries(e3, r5) {
  293. if (t(this._geometriesSource))
  294. return;
  295. const { url: s5, context: t7 } = this._geometriesSource, p6 = await U2(s5, { responseType: "json", signal: m(r5, "signal") }), n3 = e3.toJSON(), c5 = p6.data.map((e4) => ({ ...e4, spatialReference: n3 }));
  296. this.geometries = l6.fromJSON(c5, t7), this._geometriesSource = null;
  297. }
  298. clone() {
  299. return new g2({ geometries: m2(this.geometries), spatialRelationship: this.spatialRelationship });
  300. }
  301. };
  302. e([d({ type: ["disjoint", "contains"], nonNullable: true, json: { write: true } })], f.prototype, "spatialRelationship", void 0), e([d({ type: l6, nonNullable: true, json: { write: true } }), w2({ origins: ["web-scene", "portal-item"], type: "resource", prefix: "geometries" })], f.prototype, "geometries", void 0), e([o(["web-scene", "portal-item"], "geometries")], f.prototype, "readGeometries", null), f = g2 = e([n("esri.layers.support.SceneFilter")], f);
  303. var j4 = f;
  304. // node_modules/@arcgis/core/layers/SceneLayer.js
  305. var X = ["3DObject", "Point"];
  306. var Y = s.getLogger("esri.layers.SceneLayer");
  307. var ee = l3();
  308. var te = class extends A(p2(c2(v2(t4(O(i2(b2))))))) {
  309. constructor(...e3) {
  310. super(...e3), this.featureReduction = null, this.rangeInfos = null, this.operationalLayerType = "ArcGISSceneServiceLayer", this.type = "scene", this.fields = null, this.floorInfo = null, this.outFields = null, this.nodePages = null, this.materialDefinitions = null, this.textureSetDefinitions = null, this.geometryDefinitions = null, this.serviceUpdateTimeStamp = null, this.excludeObjectIds = new j(), this.definitionExpression = null, this.filter = null, this.path = null, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.priority = null, this.semantic = null, this.cachedDrawingInfo = { color: false }, this.popupEnabled = true, this.popupTemplate = null, this.objectIdField = null, this.globalIdField = null, this._fieldUsageInfo = {}, this.screenSizePerspectiveEnabled = true;
  311. }
  312. normalizeCtorArgs(e3, t7) {
  313. return typeof e3 == "string" ? { url: e3, ...t7 } : e3;
  314. }
  315. getField(e3) {
  316. return this.fieldsIndex.get(e3);
  317. }
  318. getFieldDomain(e3, t7) {
  319. const r5 = this.getFeatureType(t7?.feature)?.domains?.[e3];
  320. return r5 && r5.type !== "inherited" ? r5 : this.getField(e3)?.domain ?? null;
  321. }
  322. getFeatureType(e3) {
  323. return e3 && r(this.associatedLayer) ? this.associatedLayer.getFeatureType(e3) : null;
  324. }
  325. get types() {
  326. return r(this.associatedLayer) ? this.associatedLayer.types : [];
  327. }
  328. get typeIdField() {
  329. return r(this.associatedLayer) ? this.associatedLayer.typeIdField : null;
  330. }
  331. get formTemplate() {
  332. return r(this.associatedLayer) ? this.associatedLayer.formTemplate : null;
  333. }
  334. get fieldsIndex() {
  335. return new d2(this.fields);
  336. }
  337. readNodePages(e3, t7, r5) {
  338. return t7.layerType === "Point" && (e3 = t7.pointNodePages), e3 == null || typeof e3 != "object" ? null : s3.fromJSON(e3, r5);
  339. }
  340. set elevationInfo(e3) {
  341. this._set("elevationInfo", e3), this.loaded && this._validateElevationInfo();
  342. }
  343. get geometryType() {
  344. return ie[this.profile] || "mesh";
  345. }
  346. set renderer(e3) {
  347. c3(e3, this.fieldsIndex), this._set("renderer", e3);
  348. }
  349. readCachedDrawingInfo(e3) {
  350. return e3 != null && typeof e3 == "object" || (e3 = {}), e3.color == null && (e3.color = false), e3;
  351. }
  352. get capabilities() {
  353. const e3 = r(this.associatedLayer) && this.associatedLayer.capabilities ? this.associatedLayer.capabilities : t6, { query: t7, editing: { supportsGlobalId: r5, supportsRollbackOnFailure: i3, supportsUploadWithItemId: s5, supportsReturnServiceEditsInSourceSpatialReference: o2 }, data: { supportsZ: a2, supportsM: p6, isVersioned: l7, supportsAttachment: d5 }, operations: { supportsEditing: y, supportsUpdate: u4, supportsQuery: c5, supportsQueryAttachments: f2 } } = e3, h = e3.operations.supportsChangeTracking;
  354. return { query: t7, editing: { supportsGlobalId: r5, supportsReturnServiceEditsInSourceSpatialReference: o2, supportsRollbackOnFailure: i3, supportsGeometryUpdate: false, supportsUploadWithItemId: s5 }, data: { supportsAttachment: d5, supportsZ: a2, supportsM: p6, isVersioned: l7 }, operations: { supportsQuery: c5, supportsQueryAttachments: f2, supportsEditing: y && h, supportsAdd: false, supportsDelete: false, supportsUpdate: u4 && h } };
  355. }
  356. get editingEnabled() {
  357. return this._isOverridden("editingEnabled") ? this._get("editingEnabled") : this.userHasEditingPrivileges;
  358. }
  359. set editingEnabled(e3) {
  360. e3 != null ? this._override("editingEnabled", e3) : this._clearOverride("editingEnabled");
  361. }
  362. get defaultPopupTemplate() {
  363. return r(this.associatedLayer) || this.attributeStorageInfo ? this.createPopupTemplate() : null;
  364. }
  365. readObjectIdField(e3, t7) {
  366. return !e3 && t7.fields && t7.fields.some((t8) => (t8.type === "esriFieldTypeOID" && (e3 = t8.name), !!e3)), e3 || void 0;
  367. }
  368. readGlobalIdField(e3, t7) {
  369. return !e3 && t7.fields && t7.fields.some((t8) => (t8.type === "esriFieldTypeGlobalID" && (e3 = t8.name), !!e3)), e3 || void 0;
  370. }
  371. get displayField() {
  372. return r(this.associatedLayer) ? this.associatedLayer.displayField : null;
  373. }
  374. readProfile(e3, t7) {
  375. const r5 = t7.store.profile;
  376. return r5 != null && re[r5] ? re[r5] : (Y.error("Unknown or missing profile", { profile: r5, layer: this }), "mesh-pyramids");
  377. }
  378. load(e3) {
  379. const t7 = r(e3) ? e3.signal : null, r5 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e3).catch(w).then(() => this._fetchService(t7)).then(() => Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages, t7), this._setAssociatedFeatureLayer(t7), r(this.filter) ? this.filter.loadGeometries(this.spatialReference) : null])).then(() => this._validateElevationInfo()).then(() => this._applyAssociatedLayerOverrides()).then(() => this._populateFieldUsageInfo()).then(() => t3(this, { origin: "service" }, t7)).then(() => c3(this.renderer, this.fieldsIndex)).then(() => this.finishLoadEditablePortalLayer(e3));
  380. return this.addResolvingPromise(r5), Promise.resolve(this);
  381. }
  382. async beforeSave() {
  383. r(this.filter) && await this.load();
  384. }
  385. createQuery() {
  386. const e3 = new b();
  387. return this.geometryType !== "mesh" && (e3.returnGeometry = true, e3.returnZ = true), e3.where = this.definitionExpression || "1=1", e3.sqlFormat = "standard", e3;
  388. }
  389. queryExtent(e3, t7) {
  390. return this._getAssociatedLayerForQuery().then((r5) => r5.queryExtent(e3 || this.createQuery(), t7));
  391. }
  392. queryFeatureCount(e3, t7) {
  393. return this._getAssociatedLayerForQuery().then((r5) => r5.queryFeatureCount(e3 || this.createQuery(), t7));
  394. }
  395. queryFeatures(e3, t7) {
  396. return this._getAssociatedLayerForQuery().then((r5) => r5.queryFeatures(e3 || this.createQuery(), t7)).then((e4) => {
  397. if (e4?.features)
  398. for (const t8 of e4.features)
  399. t8.layer = this, t8.sourceLayer = this;
  400. return e4;
  401. });
  402. }
  403. queryObjectIds(e3, t7) {
  404. return this._getAssociatedLayerForQuery().then((r5) => r5.queryObjectIds(e3 || this.createQuery(), t7));
  405. }
  406. queryAttachments(e3, t7) {
  407. return this._getAssociatedLayerForQuery().then((r5) => r5.queryAttachments(e3, t7));
  408. }
  409. getFieldUsageInfo(e3) {
  410. const t7 = { supportsLabelingInfo: false, supportsRenderer: false, supportsPopupTemplate: false, supportsLayerQuery: false };
  411. return this.loaded ? this._fieldUsageInfo[e3] || t7 : (Y.error("#getFieldUsageInfo()", "Unavailable until layer is loaded"), t7);
  412. }
  413. createPopupTemplate(e3) {
  414. return d4(this, e3);
  415. }
  416. _getAssociatedLayerForQuery() {
  417. const e3 = this.associatedLayer;
  418. return r(e3) && e3.loaded ? Promise.resolve(e3) : this._loadAssociatedLayerForQuery();
  419. }
  420. async _loadAssociatedLayerForQuery() {
  421. if (await this.load(), t(this.associatedLayer))
  422. throw new s2("scenelayer:query-not-available", "SceneLayer queries are not available without an associated feature layer", { layer: this });
  423. try {
  424. await this.associatedLayer.load();
  425. } catch (e3) {
  426. throw new s2("scenelayer:query-not-available", "SceneLayer associated feature layer could not be loaded", { layer: this, error: e3 });
  427. }
  428. return this.associatedLayer;
  429. }
  430. hasCachedStatistics(e3) {
  431. return this.statisticsInfo != null && this.statisticsInfo.some((t7) => t7.name === e3);
  432. }
  433. async queryCachedStatistics(e3, t7) {
  434. if (await this.load(t7), !this.statisticsInfo)
  435. throw new s2("scenelayer:no-cached-statistics", "Cached statistics are not available for this layer");
  436. const r5 = this.fieldsIndex.get(e3);
  437. if (!r5)
  438. throw new s2("scenelayer:field-unexisting", `Field '${e3}' does not exist on the layer`);
  439. for (const s5 of this.statisticsInfo)
  440. if (s5.name === r5.name) {
  441. const e4 = G(this.parsedUrl.path, s5.href);
  442. return U2(e4, { query: { f: "json", token: this.apiKey }, responseType: "json", signal: t7 ? t7.signal : null }).then((e5) => e5.data);
  443. }
  444. throw new s2("scenelayer:no-cached-statistics", "Cached statistics for this attribute are not available");
  445. }
  446. async saveAs(e3, t7) {
  447. return this._debouncedSaveOperations(K.SAVE_AS, { ...t7, getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "scene" }, e3);
  448. }
  449. async save() {
  450. const e3 = { getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "scene" };
  451. return this._debouncedSaveOperations(K.SAVE, e3);
  452. }
  453. async applyEdits(e3, t7) {
  454. const r5 = await import("./editingSupport-KL4E3VVF.js");
  455. if (await this.load(), t(this.associatedLayer))
  456. throw new s2(`${this.type}-layer:not-editable`, "Service is not editable");
  457. return await this.associatedLayer.load(), r5.applyEdits(this, this.associatedLayer.source, e3, t7);
  458. }
  459. on(e3, t7) {
  460. return super.on(e3, t7);
  461. }
  462. validateLayer(e3) {
  463. if (e3.layerType && !X.includes(e3.layerType))
  464. throw new s2("scenelayer:layer-type-not-supported", "SceneLayer does not support this layer type", { layerType: e3.layerType });
  465. if (isNaN(this.version.major) || isNaN(this.version.minor))
  466. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "1.x, 2.x" });
  467. if (this.version.major > 2)
  468. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "1.x, 2.x" });
  469. function t7(e4, t8) {
  470. let r5 = false, i3 = false;
  471. if (e4 == null)
  472. r5 = true, i3 = true;
  473. else {
  474. const s5 = t8 && t8.isGeographic;
  475. switch (e4) {
  476. case "east-north-up":
  477. case "earth-centered":
  478. r5 = true, i3 = s5;
  479. break;
  480. case "vertex-reference-frame":
  481. r5 = true, i3 = !s5;
  482. break;
  483. default:
  484. r5 = false;
  485. }
  486. }
  487. if (!r5)
  488. throw new s2("scenelayer:unsupported-normal-reference-frame", "Normal reference frame is invalid.");
  489. if (!i3)
  490. throw new s2("scenelayer:incompatible-normal-reference-frame", "Normal reference frame is incompatible with layer spatial reference.");
  491. }
  492. t7(this.normalReferenceFrame, this.spatialReference);
  493. }
  494. _getTypeKeywords() {
  495. const e3 = [];
  496. if (this.profile === "points")
  497. e3.push("Point");
  498. else {
  499. if (this.profile !== "mesh-pyramids")
  500. throw new s2("scenelayer:unknown-profile", "SceneLayer:save() encountered an unknown SceneLayer profile: " + this.profile);
  501. e3.push("3DObject");
  502. }
  503. return e3;
  504. }
  505. _populateFieldUsageInfo() {
  506. if (this._fieldUsageInfo = {}, this.fields)
  507. for (const e3 of this.fields) {
  508. const t7 = !(!this.attributeStorageInfo || !this.attributeStorageInfo.some((t8) => t8.name === e3.name)), r5 = !!(r(this.associatedLayer) && this.associatedLayer.fields && this.associatedLayer.fields.some((t8) => t8 && e3.name === t8.name)), i3 = { supportsLabelingInfo: t7, supportsRenderer: t7, supportsPopupTemplate: t7 || r5, supportsLayerQuery: r5 };
  509. this._fieldUsageInfo[e3.name] = i3;
  510. }
  511. }
  512. _applyAssociatedLayerOverrides() {
  513. this._applyAssociatedLayerFieldsOverrides(), this._applyAssociatedLayerPopupOverrides();
  514. }
  515. _applyAssociatedLayerFieldsOverrides() {
  516. if (t(this.associatedLayer) || !this.associatedLayer.fields)
  517. return;
  518. let e3 = null;
  519. for (const t7 of this.associatedLayer.fields) {
  520. const r5 = this.getField(t7.name);
  521. r5 ? (!r5.domain && t7.domain && (r5.domain = t7.domain.clone()), r5.editable = t7.editable, r5.nullable = t7.nullable, r5.length = t7.length) : (e3 || (e3 = this.fields ? this.fields.slice() : []), e3.push(t7.clone()));
  522. }
  523. e3 && this._set("fields", e3);
  524. }
  525. _applyAssociatedLayerPopupOverrides() {
  526. if (t(this.associatedLayer))
  527. return;
  528. const e3 = ["popupTemplate", "popupEnabled"], t7 = e2(this);
  529. for (let r5 = 0; r5 < e3.length; r5++) {
  530. const i3 = e3[r5], s5 = this.originIdOf(i3), o2 = this.associatedLayer.originIdOf(i3);
  531. s5 < o2 && (o2 === r2.SERVICE || o2 === r2.PORTAL_ITEM) && t7.setAtOrigin(i3, this.associatedLayer[i3], o2);
  532. }
  533. }
  534. async _setAssociatedFeatureLayer(e3) {
  535. if (!["mesh-pyramids", "points"].includes(this.profile))
  536. return;
  537. const t7 = new l5(this.parsedUrl, this.portalItem, this.apiKey, e3);
  538. try {
  539. this.associatedLayer = await t7.fetch();
  540. } catch (r5) {
  541. g(r5) || this._logWarningOnPopupEnabled();
  542. }
  543. }
  544. async _logWarningOnPopupEnabled() {
  545. await j2(() => this.popupEnabled && this.popupTemplate != null);
  546. const e3 = `this SceneLayer: ${this.title}`;
  547. this.attributeStorageInfo == null ? Y.warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e3}`) : Y.info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e3}`);
  548. }
  549. _validateElevationInfo() {
  550. const e3 = this.elevationInfo;
  551. e3 && (this.profile === "mesh-pyramids" && e3.mode === "relative-to-scene" && Y.warn(".elevationInfo=", "Mesh scene layers don't support relative-to-scene elevation mode"), e3.featureExpressionInfo && e3.featureExpressionInfo.expression !== "0" && Y.warn(".elevationInfo=", "Scene layers do not support featureExpressionInfo"));
  552. }
  553. };
  554. e([d({ types: { key: "type", base: t5, typeMap: { selection: p3 } }, json: { origins: { "web-scene": { name: "layerDefinition.featureReduction", write: true }, "portal-item": { name: "layerDefinition.featureReduction", write: true } } } })], te.prototype, "featureReduction", void 0), e([d({ type: [s4], json: { read: false, origins: { "web-scene": { name: "layerDefinition.rangeInfos", write: true }, "portal-item": { name: "layerDefinition.rangeInfos", write: true } } } })], te.prototype, "rangeInfos", void 0), e([d({ json: { read: false } })], te.prototype, "associatedLayer", void 0), e([d({ type: ["show", "hide"] })], te.prototype, "listMode", void 0), e([d({ type: ["ArcGISSceneServiceLayer"] })], te.prototype, "operationalLayerType", void 0), e([d({ json: { read: false }, readOnly: true })], te.prototype, "type", void 0), e([d({ ...ee.fields, readOnly: true, json: { read: false, origins: { service: { read: true } } } })], te.prototype, "fields", void 0), e([d()], te.prototype, "types", null), e([d()], te.prototype, "typeIdField", null), e([d()], te.prototype, "formTemplate", null), e([d({ readOnly: true })], te.prototype, "fieldsIndex", null), e([d({ type: p4, json: { read: { source: "layerDefinition.floorInfo" }, write: { target: "layerDefinition.floorInfo" } } })], te.prototype, "floorInfo", void 0), e([d(ee.outFields)], te.prototype, "outFields", void 0), e([d({ type: s3, readOnly: true, json: { read: false } })], te.prototype, "nodePages", void 0), e([o("service", "nodePages", ["nodePages", "pointNodePages"])], te.prototype, "readNodePages", null), e([d({ type: [l4], readOnly: true })], te.prototype, "materialDefinitions", void 0), e([d({ type: [u3], readOnly: true })], te.prototype, "textureSetDefinitions", void 0), e([d({ type: [m4], readOnly: true })], te.prototype, "geometryDefinitions", void 0), e([d({ readOnly: true })], te.prototype, "serviceUpdateTimeStamp", void 0), e([d({ readOnly: true })], te.prototype, "attributeStorageInfo", void 0), e([d({ readOnly: true })], te.prototype, "statisticsInfo", void 0), e([d({ type: j.ofType(Number), nonNullable: true, json: { origins: { service: { read: false, write: false } }, name: "layerDefinition.excludeObjectIds", write: { enabled: true } } })], te.prototype, "excludeObjectIds", void 0), e([d({ type: String, json: { origins: { service: { read: false, write: false } }, name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], te.prototype, "definitionExpression", void 0), e([d({ type: j4, json: { name: "layerDefinition.polygonFilter", write: true } })], te.prototype, "filter", void 0), e([d({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], te.prototype, "path", void 0), e([d(d3)], te.prototype, "elevationInfo", null), e([d({ type: String })], te.prototype, "geometryType", null), e([d(m3)], te.prototype, "labelsVisible", void 0), e([d({ type: [j3], json: { origins: { service: { name: "drawingInfo.labelingInfo", read: { reader: r4 }, write: false } }, name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: r4 }, write: true } })], te.prototype, "labelingInfo", void 0), e([d(c)], te.prototype, "legendEnabled", void 0), e([d({ type: Number, json: { origins: { "web-document": { default: 1, write: { enabled: true, target: { opacity: { type: Number }, "layerDefinition.drawingInfo.transparency": { type: Number } } }, read: { source: ["opacity", "layerDefinition.drawingInfo.transparency"], reader(e3, t7) {
  555. if (typeof e3 == "number" && e3 >= 0 && e3 <= 1)
  556. return e3;
  557. const r5 = t7.layerDefinition?.drawingInfo?.transparency;
  558. return r5 !== void 0 ? r3(r5) : void 0;
  559. } } }, "portal-item": { write: true }, service: { read: false } } } })], te.prototype, "opacity", void 0), e([d({ type: ["Low", "High"], readOnly: true, json: { read: false, origins: { service: { read: true } } } })], te.prototype, "priority", void 0), e([d({ type: ["Labels"], readOnly: true, json: { read: false, origins: { service: { read: true } } } })], te.prototype, "semantic", void 0), e([d({ types: n2, json: { origins: { service: { read: { source: "drawingInfo.renderer" } } }, name: "layerDefinition.drawingInfo.renderer", write: true }, value: null })], te.prototype, "renderer", null), e([d({ json: { read: false } })], te.prototype, "cachedDrawingInfo", void 0), e([o("service", "cachedDrawingInfo")], te.prototype, "readCachedDrawingInfo", null), e([d({ readOnly: true, json: { read: false } })], te.prototype, "capabilities", null), e([d({ type: Boolean, json: { read: false } })], te.prototype, "editingEnabled", null), e([d(p)], te.prototype, "popupEnabled", void 0), e([d({ type: B, json: { name: "popupInfo", write: true } })], te.prototype, "popupTemplate", void 0), e([d({ readOnly: true, json: { read: false } })], te.prototype, "defaultPopupTemplate", null), e([d({ type: String, json: { read: false } })], te.prototype, "objectIdField", void 0), e([o("service", "objectIdField", ["objectIdField", "fields"])], te.prototype, "readObjectIdField", null), e([d({ type: String, json: { read: false } })], te.prototype, "globalIdField", void 0), e([o("service", "globalIdField", ["globalIdField", "fields"])], te.prototype, "readGlobalIdField", null), e([d({ readOnly: true, type: String, json: { read: false } })], te.prototype, "displayField", null), e([d({ type: String, json: { read: false } })], te.prototype, "profile", void 0), e([o("service", "profile", ["store.profile"])], te.prototype, "readProfile", null), e([d({ readOnly: true, type: String, json: { origins: { service: { read: { source: "store.normalReferenceFrame" } } }, read: false } })], te.prototype, "normalReferenceFrame", void 0), e([d(l2)], te.prototype, "screenSizePerspectiveEnabled", void 0), te = e([n("esri.layers.SceneLayer")], te);
  560. var re = { "mesh-pyramids": "mesh-pyramids", meshpyramids: "mesh-pyramids", "features-meshes": "mesh-pyramids", points: "points", "features-points": "points", lines: "lines", "features-lines": "lines", polygons: "polygons", "features-polygons": "polygons" };
  561. var ie = { "mesh-pyramids": "mesh", points: "point", lines: "polyline", polygons: "polygon" };
  562. var se = te;
  563. export {
  564. se as default
  565. };
  566. //# sourceMappingURL=SceneLayer-TEB5XGYY.js.map