@arcgis/core 4.30.0-next.20240327 → 4.30.0-next.20240329

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{5162ba2975b4b025590e.js → 07f52973ac7e6b8c19d0.js} +1 -1
  4. package/assets/esri/core/workers/chunks/1f21cad3999229ca59c6.js +1 -0
  5. package/assets/esri/core/workers/chunks/{9403e2ee9c97488ce4f0.js → 274a380d488790cf46ae.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{36dfc55dc536b1831918.js → 34ab9b94496cb693ba9a.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{0b1ccc2cfb7a6361eae6.js → 3853f56c71a3f267a859.js} +1 -1
  8. package/assets/esri/core/workers/chunks/3c7dc67876f2cc1ae0be.js +1 -0
  9. package/assets/esri/core/workers/chunks/464c3fb8f07e18a1a8b5.js +1 -0
  10. package/assets/esri/core/workers/chunks/48baa93d160fd2bdba54.js +1 -0
  11. package/assets/esri/core/workers/chunks/{1f79a9bf849134b95bb6.js → 6443e784d4b1df548e3a.js} +1 -1
  12. package/assets/esri/core/workers/chunks/66dceb66e5263f9c4514.js +1 -0
  13. package/assets/esri/core/workers/chunks/{9b70ef60e2e01b087d08.js → 81405b2bfb52dd7668c7.js} +1 -1
  14. package/assets/esri/core/workers/chunks/a660554203dcd51cd762.js +1 -0
  15. package/assets/esri/core/workers/chunks/{f67f61afded4f4e21821.js → adbe7886e10145cdefba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{ed9f1e669045f9031581.js → b7e3c8388af69d652658.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{d11368c47e486fc20860.js → c46a05711c2628060530.js} +1 -1
  18. package/assets/esri/core/workers/chunks/d187b93d67d730621474.js +1 -0
  19. package/assets/esri/core/workers/chunks/d91166498dc6fb804c92.js +1043 -0
  20. package/assets/esri/core/workers/chunks/{f8693321bbd8a93666c7.js → e0f7be00111a042749f2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{eecb0064c5343e88bfde.js → e26102c3ece0ac50f2ab.js} +1 -1
  22. package/assets/esri/core/workers/chunks/e8703f48f0ad7caf2097.js +1 -0
  23. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  24. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  25. package/chunks/lyr3DMain.js +1 -1
  26. package/chunks/lyr3DWorker.js +1 -1
  27. package/core/SetUtils.js +1 -1
  28. package/form/FormTemplate.js +1 -1
  29. package/form/support/formUtils.js +5 -0
  30. package/geometry/support/quantizationUtils.js +1 -1
  31. package/interfaces.d.ts +18 -0
  32. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  33. package/layers/MediaLayer.js +1 -1
  34. package/layers/graphics/dehydratedPoint.js +1 -1
  35. package/layers/mixins/ArcGISMapService.js +1 -1
  36. package/layers/mixins/SublayersOwner.js +1 -1
  37. package/layers/support/MediaElementBase.js +1 -1
  38. package/layers/support/fieldUtils.js +1 -1
  39. package/layers/support/mediaUtils.js +1 -1
  40. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  41. package/package.json +1 -1
  42. package/rest/print.js +1 -1
  43. package/support/revision.js +1 -1
  44. package/symbols/cim/SDFHelper.js +1 -1
  45. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  46. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  47. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  48. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  49. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  50. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  51. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  52. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  53. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  54. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  55. package/views/3d/layers/graphics/pointUtils.js +1 -1
  56. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  57. package/views/3d/state/GoToOperation.js +1 -1
  58. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  59. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  60. package/views/draw/support/Box.js +1 -1
  61. package/views/draw/support/Reshape.js +1 -1
  62. package/views/draw/support/tooltipUtils.js +1 -1
  63. package/views/interactive/sketch/constraintUtils.js +1 -1
  64. package/views/interactive/sketch/constraints.js +1 -1
  65. package/views/interactive/sketch/normalizedPoint.js +1 -1
  66. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  67. package/views/interactive/tooltip/infos/DrawCircleTooltipInfo.js +5 -0
  68. package/views/interactive/tooltip/infos/DrawMeshTooltipInfo.js +5 -0
  69. package/views/interactive/tooltip/infos/DrawPointTooltipInfo.js +5 -0
  70. package/views/interactive/tooltip/infos/DrawPolygonTooltipInfo.js +5 -0
  71. package/views/interactive/tooltip/infos/DrawPolylineTooltipInfo.js +5 -0
  72. package/views/interactive/tooltip/infos/DrawRectangleTooltipInfo.js +5 -0
  73. package/views/interactive/tooltip/infos/ExtentRotateTooltipInfo.js +5 -0
  74. package/views/interactive/tooltip/infos/ExtentScaleTooltipInfo.js +5 -0
  75. package/views/interactive/tooltip/infos/ReshapeEdgeOffsetTooltipInfo.js +5 -0
  76. package/views/interactive/tooltip/infos/SketchTooltipInfo.js +5 -0
  77. package/views/interactive/tooltip/infos/TransformAbsoluteTooltipInfo.js +5 -0
  78. package/views/interactive/tooltip/infos/TransformRotateTooltipInfo.js +5 -0
  79. package/views/interactive/tooltip/infos/TransformScaleTooltipInfo.js +5 -0
  80. package/views/interactive/tooltip/infos/TranslateTooltipInfo.js +5 -0
  81. package/views/interactive/tooltip/infos/TranslateVertexTooltipInfo.js +5 -0
  82. package/views/interactive/tooltip/infos/TranslateVertexXYTooltipInfo.js +5 -0
  83. package/views/interactive/tooltip/infos/TranslateVertexZTooltipInfo.js +5 -0
  84. package/views/interactive/tooltip/infos/TranslateXYTooltipInfo.js +5 -0
  85. package/views/interactive/tooltip/infos/TranslateZTooltipInfo.js +5 -0
  86. package/views/support/geometry3dUtils.js +1 -1
  87. package/views/webgl/Texture.js +1 -1
  88. package/views/webgl/testFloatBufferBlend.js +1 -1
  89. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  90. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  91. package/assets/esri/core/workers/chunks/29ce6bf9fb18adee7e28.js +0 -1
  92. package/assets/esri/core/workers/chunks/4fd7960a0ab8fbd6507d.js +0 -1
  93. package/assets/esri/core/workers/chunks/7a5e8eb8ea826864c7da.js +0 -1
  94. package/assets/esri/core/workers/chunks/a2a308e7a6f4197d7f57.js +0 -1043
  95. package/assets/esri/core/workers/chunks/a7ac2c5e701f44a67aa3.js +0 -1
  96. package/assets/esri/core/workers/chunks/bf22dd73eb2007aa6e76.js +0 -1
  97. package/assets/esri/core/workers/chunks/cd7f4783bbf761ec43d9.js +0 -1
  98. package/assets/esri/core/workers/chunks/fd66fbe2c9d63f1528b3.js +0 -1
  99. package/views/interactive/tooltip/DrawTooltipInfos.js +0 -5
  100. package/views/interactive/tooltip/ExtentTooltipInfos.js +0 -5
  101. package/views/interactive/tooltip/ReshapeTooltipInfos.js +0 -5
  102. package/views/interactive/tooltip/SketchTooltipInfo.js +0 -5
  103. package/views/interactive/tooltip/TransformTooltipInfos.js +0 -5
  104. package/views/interactive/tooltip/TranslateTooltipInfos.js +0 -5
package/PopupTemplate.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"./chunks/tslib.es6.js";import{ClonableMixin as e}from"./core/Clonable.js";import o from"./core/Collection.js";import{JSONSupport as s}from"./core/JSONSupport.js";import{clone as r}from"./core/lang.js";import i from"./core/Logger.js";import{isPromiseLike as n}from"./core/promiseUtils.js";import{property as p}from"./core/accessorSupport/decorators/property.js";import{cast as l}from"./core/accessorSupport/decorators/cast.js";import{reader as a}from"./core/accessorSupport/decorators/reader.js";import{subclass as d}from"./core/accessorSupport/decorators/subclass.js";import{writer as c}from"./core/accessorSupport/decorators/writer.js";import{ensureOneOfType as f}from"./core/accessorSupport/ensureType.js";import{collectFields as m,collectArcadeFieldNames as u}from"./layers/support/fieldUtils.js";import{persistableTypes as h}from"./popup/content.js";import y from"./popup/ExpressionInfo.js";import I from"./popup/FieldInfo.js";import F from"./popup/LayerOptions.js";import _ from"./popup/RelatedRecordsInfo.js";import{types as x}from"./popup/content/support/mediaInfoTypes.js";import g from"./support/actions/ActionBase.js";import w from"./support/actions/ActionButton.js";import A from"./support/actions/ActionToggle.js";import C from"./popup/content/MediaContent.js";import N from"./popup/content/TextContent.js";import j from"./popup/content/AttachmentsContent.js";import S from"./popup/content/FieldsContent.js";import E from"./popup/content/ExpressionContent.js";import O from"./popup/content/RelationshipContent.js";import R from"./popup/content/Content.js";import v from"./popup/content/CustomContent.js";const T="relationships/",b="expression/",J=o.ofType({key:"type",defaultKeyValue:"button",base:g,typeMap:{button:w,toggle:A}}),L={base:R,key:"type",typeMap:{media:C,custom:v,text:N,attachments:j,fields:S,expression:E,relationship:O}},B=new Set(["attachments","fields","media","text","expression","relationship"]);let M=class extends(e(s)){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map((t=>f(L,t))):"string"==typeof t||"function"==typeof t||t instanceof HTMLElement||n(t)?t:(i.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e.description,e.mediaInfos,o):this._readPopupInfo(e)}writeContent(t,e,o,s){"string"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter((t=>B.has(t.type))).map((t=>t?.toJSON(s))),e.popupElements.forEach((t=>{"attachments"===t.type?this._writeAttachmentContent(e):"media"===t.type?this._writeMediaContent(t,e):"text"===t.type?this._writeTextContent(t,e):"relationship"===t.type&&this._writeRelationshipContent(t,e)}))):e.description=t}writeFieldInfos(t,e,o,s){const{content:r}=this,i=Array.isArray(r)?r:null;if(t){const o=i?i.filter((t=>"fields"===t.type)):[],r=o.length&&o.every((t=>t.fieldInfos?.length));e.fieldInfos=t.filter(Boolean).map((t=>{const e=t.toJSON(s);return r&&(e.visible=!1),e}))}if(i)for(const n of i)"fields"===n.type&&this._writeFieldsContent(n,e)}writeLayerOptions(t,e,o,s){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(s)}writeTitle(t,e){e.title=t||""}async collectRequiredFields(t,e){const o=this.expressionInfos||[];await this._collectExpressionInfoFields(t,e,[...o,...this._getContentExpressionInfos(this.content,o)]),m(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const e=new Set;return await this.collectRequiredFields(e,t),[...e].sort()}_writeFieldsContent(t,e){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const o=r(t.fieldInfos);Array.isArray(e.fieldInfos)?o.forEach((t=>{const o=e.fieldInfos.find((e=>e.fieldName.toLowerCase()===t.fieldName.toLowerCase()));o?o.visible=!0:e.fieldInfos.push(t)})):e.fieldInfos=o}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,e){const o=t.orderByFields?.map((e=>this._toFieldOrderJSON(e,t.relationshipId)))||[],s=[...e.relatedRecordsInfo?.orderByFields||[],...o];e.relatedRecordsInfo={showRelatedRecords:!0,...s?.length&&{orderByFields:s}}}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=r(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements(t,e,o){const s={description:!1,mediaInfos:!1};return o.map((o=>"media"===o.type?(o.mediaInfos||!e||s.mediaInfos||(o.mediaInfos=e,s.mediaInfos=!0),C.fromJSON(o)):"text"===o.type?(o.text||!t||s.description||(o.text=t,s.description=!0),N.fromJSON(o)):"attachments"===o.type?j.fromJSON(o):"fields"===o.type?S.fromJSON(o):"expression"===o.type?E.fromJSON(o):"relationship"===o.type?O.fromJSON(o):void 0)).filter(Boolean)}_toRelationshipContent(t){const{field:e,order:o}=t;if(!e?.startsWith(T))return null;const s=e.replace(T,"").split("/");if(2!==s.length)return null;const r=parseInt(s[0],10),i=s[1];return"number"==typeof r&&i?O.fromJSON({relationshipId:r,orderByFields:[{field:i,order:o}]}):null}_toFieldOrderJSON(t,e){const{order:o,field:s}=t;return{field:`${T}${e}/${s}`,order:o}}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o,relatedRecordsInfo:s={showRelatedRecords:!1}}){const r=[];t?r.push(new N({text:t})):r.push(new S),Array.isArray(e)&&e.length&&r.push(C.fromJSON({mediaInfos:e})),o&&r.push(j.fromJSON({displayType:"auto"}));const{showRelatedRecords:i,orderByFields:n}=s;return i&&n?.length&&n.forEach((t=>{const e=this._toRelationshipContent(t);e&&r.push(e)})),r.length?r:t}_getContentElementFields(t){const e=t?.type;if("attachments"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if("custom"===e)return t.outFields||[];if("fields"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if("media"===e){const e=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...e.reduce(((t,e)=>[...t,...this._getMediaInfoFields(e)]),[])]}return"text"===e?this._extractFieldNames(t.text):[]}_getMediaInfoFields(t){const{caption:e,title:o,value:s}=t,r=s||{},{fields:i,normalizeField:n,tooltipField:p,sourceURL:l,linkURL:a}=r,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(l),...this._extractFieldNames(a),...i??[]];return n&&d.push(n),p&&d.push(p),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce(((t,e)=>[...t,..."expression"===e.type&&e.expressionInfo?[e.expressionInfo]:[]]),e):[]}_getContentFields(t){return"string"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce(((t,e)=>[...t,...this._getContentElementFields(e)]),[]):[]}async _collectExpressionInfoFields(t,e,o){o&&await Promise.all(o.map((o=>u(t,e,o.expression))))}_getFieldInfoFields(t){return t?t.filter((t=>void 0===t.visible||!!t.visible)).map((t=>t.fieldName)).filter((t=>!t.startsWith(T)&&!t.startsWith(b))):[]}_getActionsFields(t){return t?t.toArray().reduce(((t,e)=>[...t,...this._getActionFields(e)]),[]):[]}_getActionFields(t){const{className:e,title:o,type:s}=t,r="button"===s||"toggle"===s?t.image:"";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(r)]}_getTitleFields(t){return"string"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){if(!t||"string"!=typeof t)return[];const e=/{[^}]*}/g,o=t.match(e);if(!o)return[];const s=/\{(\w+):.+\}/,r=o.filter((t=>!(0===t.indexOf(`{${T}`)||0===t.indexOf(`{${b}`)))).map((t=>t.replace(s,"{$1}")));return r?r.map((t=>t.slice(1,-1))):[]}};t([p({type:J})],M.prototype,"actions",void 0),t([p()],M.prototype,"content",void 0),t([l("content")],M.prototype,"castContent",null),t([a("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],M.prototype,"readContent",null),t([c("content",{popupElements:{type:o.ofType(h)},showAttachments:{type:Boolean},mediaInfos:{type:o.ofType(x)},description:{type:String},relatedRecordsInfo:{type:_}})],M.prototype,"writeContent",null),t([p({type:[y],json:{write:!0}})],M.prototype,"expressionInfos",void 0),t([p({type:[I]})],M.prototype,"fieldInfos",void 0),t([c("fieldInfos")],M.prototype,"writeFieldInfos",null),t([p({type:F})],M.prototype,"layerOptions",void 0),t([c("layerOptions")],M.prototype,"writeLayerOptions",null),t([p({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],M.prototype,"lastEditInfoEnabled",void 0),t([p()],M.prototype,"outFields",void 0),t([p()],M.prototype,"overwriteActions",void 0),t([p()],M.prototype,"returnGeometry",void 0),t([p({json:{type:String}})],M.prototype,"title",void 0),t([c("title")],M.prototype,"writeTitle",null),M=t([d("esri.PopupTemplate")],M);const P=M;export{P as default};
5
+ import{_ as t}from"./chunks/tslib.es6.js";import{ClonableMixin as e}from"./core/Clonable.js";import o from"./core/Collection.js";import{JSONSupport as s}from"./core/JSONSupport.js";import{clone as r}from"./core/lang.js";import i from"./core/Logger.js";import{isPromiseLike as n}from"./core/promiseUtils.js";import{property as p}from"./core/accessorSupport/decorators/property.js";import{cast as l}from"./core/accessorSupport/decorators/cast.js";import{reader as a}from"./core/accessorSupport/decorators/reader.js";import{subclass as d}from"./core/accessorSupport/decorators/subclass.js";import{writer as c}from"./core/accessorSupport/decorators/writer.js";import{ensureOneOfType as f}from"./core/accessorSupport/ensureType.js";import{collectFields as m,collectArcadeFieldNames as u,extractFieldNames as h}from"./layers/support/fieldUtils.js";import{persistableTypes as y}from"./popup/content.js";import I from"./popup/ExpressionInfo.js";import F from"./popup/FieldInfo.js";import _ from"./popup/LayerOptions.js";import x from"./popup/RelatedRecordsInfo.js";import{types as g}from"./popup/content/support/mediaInfoTypes.js";import w from"./support/actions/ActionBase.js";import A from"./support/actions/ActionButton.js";import C from"./support/actions/ActionToggle.js";import N from"./popup/content/MediaContent.js";import j from"./popup/content/TextContent.js";import S from"./popup/content/AttachmentsContent.js";import E from"./popup/content/FieldsContent.js";import O from"./popup/content/ExpressionContent.js";import R from"./popup/content/RelationshipContent.js";import v from"./popup/content/Content.js";import T from"./popup/content/CustomContent.js";const b="relationships/",J="expression/",L=o.ofType({key:"type",defaultKeyValue:"button",base:w,typeMap:{button:A,toggle:C}}),B={base:v,key:"type",typeMap:{media:N,custom:T,text:j,attachments:S,fields:E,expression:O,relationship:R}},M=new Set(["attachments","fields","media","text","expression","relationship"]);let P=class extends(e(s)){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map((t=>f(B,t))):"string"==typeof t||"function"==typeof t||t instanceof HTMLElement||n(t)?t:(i.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e.description,e.mediaInfos,o):this._readPopupInfo(e)}writeContent(t,e,o,s){"string"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter((t=>M.has(t.type))).map((t=>t?.toJSON(s))),e.popupElements.forEach((t=>{"attachments"===t.type?this._writeAttachmentContent(e):"media"===t.type?this._writeMediaContent(t,e):"text"===t.type?this._writeTextContent(t,e):"relationship"===t.type&&this._writeRelationshipContent(t,e)}))):e.description=t}writeFieldInfos(t,e,o,s){const{content:r}=this,i=Array.isArray(r)?r:null;if(t){const o=i?i.filter((t=>"fields"===t.type)):[],r=o.length&&o.every((t=>t.fieldInfos?.length));e.fieldInfos=t.filter(Boolean).map((t=>{const e=t.toJSON(s);return r&&(e.visible=!1),e}))}if(i)for(const n of i)"fields"===n.type&&this._writeFieldsContent(n,e)}writeLayerOptions(t,e,o,s){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(s)}writeTitle(t,e){e.title=t||""}async collectRequiredFields(t,e){const o=this.expressionInfos||[];await this._collectExpressionInfoFields(t,e,[...o,...this._getContentExpressionInfos(this.content,o)]),m(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const e=new Set;return await this.collectRequiredFields(e,t),[...e].sort()}_writeFieldsContent(t,e){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const o=r(t.fieldInfos);Array.isArray(e.fieldInfos)?o.forEach((t=>{const o=e.fieldInfos.find((e=>e.fieldName.toLowerCase()===t.fieldName.toLowerCase()));o?o.visible=!0:e.fieldInfos.push(t)})):e.fieldInfos=o}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,e){const o=t.orderByFields?.map((e=>this._toFieldOrderJSON(e,t.relationshipId)))||[],s=[...e.relatedRecordsInfo?.orderByFields||[],...o];e.relatedRecordsInfo={showRelatedRecords:!0,...s?.length&&{orderByFields:s}}}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=r(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements(t,e,o){const s={description:!1,mediaInfos:!1};return o.map((o=>"media"===o.type?(o.mediaInfos||!e||s.mediaInfos||(o.mediaInfos=e,s.mediaInfos=!0),N.fromJSON(o)):"text"===o.type?(o.text||!t||s.description||(o.text=t,s.description=!0),j.fromJSON(o)):"attachments"===o.type?S.fromJSON(o):"fields"===o.type?E.fromJSON(o):"expression"===o.type?O.fromJSON(o):"relationship"===o.type?R.fromJSON(o):void 0)).filter(Boolean)}_toRelationshipContent(t){const{field:e,order:o}=t;if(!e?.startsWith(b))return null;const s=e.replace(b,"").split("/");if(2!==s.length)return null;const r=parseInt(s[0],10),i=s[1];return"number"==typeof r&&i?R.fromJSON({relationshipId:r,orderByFields:[{field:i,order:o}]}):null}_toFieldOrderJSON(t,e){const{order:o,field:s}=t;return{field:`${b}${e}/${s}`,order:o}}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o,relatedRecordsInfo:s={showRelatedRecords:!1}}){const r=[];t?r.push(new j({text:t})):r.push(new E),Array.isArray(e)&&e.length&&r.push(N.fromJSON({mediaInfos:e})),o&&r.push(S.fromJSON({displayType:"auto"}));const{showRelatedRecords:i,orderByFields:n}=s;return i&&n?.length&&n.forEach((t=>{const e=this._toRelationshipContent(t);e&&r.push(e)})),r.length?r:t}_getContentElementFields(t){const e=t?.type;if("attachments"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if("custom"===e)return t.outFields||[];if("fields"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if("media"===e){const e=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...e.reduce(((t,e)=>[...t,...this._getMediaInfoFields(e)]),[])]}return"text"===e?this._extractFieldNames(t.text):[]}_getMediaInfoFields(t){const{caption:e,title:o,value:s}=t,r=s||{},{fields:i,normalizeField:n,tooltipField:p,sourceURL:l,linkURL:a}=r,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(l),...this._extractFieldNames(a),...i??[]];return n&&d.push(n),p&&d.push(p),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce(((t,e)=>[...t,..."expression"===e.type&&e.expressionInfo?[e.expressionInfo]:[]]),e):[]}_getContentFields(t){return"string"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce(((t,e)=>[...t,...this._getContentElementFields(e)]),[]):[]}async _collectExpressionInfoFields(t,e,o){o&&await Promise.all(o.map((o=>u(t,e,o.expression))))}_getFieldInfoFields(t){return t?t.filter((t=>void 0===t.visible||!!t.visible)).map((t=>t.fieldName)).filter((t=>!t.startsWith(b)&&!t.startsWith(J))):[]}_getActionsFields(t){return t?t.toArray().reduce(((t,e)=>[...t,...this._getActionFields(e)]),[]):[]}_getActionFields(t){const{className:e,title:o,type:s}=t,r="button"===s||"toggle"===s?t.image:"";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(r)]}_getTitleFields(t){return"string"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){return h(t).filter((t=>!(0===t.indexOf(b)||0===t.indexOf(J))))}};t([p({type:L})],P.prototype,"actions",void 0),t([p()],P.prototype,"content",void 0),t([l("content")],P.prototype,"castContent",null),t([a("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],P.prototype,"readContent",null),t([c("content",{popupElements:{type:o.ofType(y)},showAttachments:{type:Boolean},mediaInfos:{type:o.ofType(g)},description:{type:String},relatedRecordsInfo:{type:x}})],P.prototype,"writeContent",null),t([p({type:[I],json:{write:!0}})],P.prototype,"expressionInfos",void 0),t([p({type:[F]})],P.prototype,"fieldInfos",void 0),t([c("fieldInfos")],P.prototype,"writeFieldInfos",null),t([p({type:_})],P.prototype,"layerOptions",void 0),t([c("layerOptions")],P.prototype,"writeLayerOptions",null),t([p({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],P.prototype,"lastEditInfoEnabled",void 0),t([p()],P.prototype,"outFields",void 0),t([p()],P.prototype,"overwriteActions",void 0),t([p()],P.prototype,"returnGeometry",void 0),t([p({json:{type:String}})],P.prototype,"title",void 0),t([c("title")],P.prototype,"writeTitle",null),P=t([d("esri.PopupTemplate")],P);const k=P;export{k as default};