@arcgis/core 5.2.0-next.136 → 5.2.0-next.138
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.
- package/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
- package/assets/components/assets/icon/blockHeightShort16.json +1 -0
- package/assets/components/assets/icon/blockHeightShort24.json +1 -0
- package/assets/components/assets/icon/blockHeightShort32.json +1 -0
- package/assets/components/assets/icon/blockHeightTall16.json +1 -0
- package/assets/components/assets/icon/blockHeightTall24.json +1 -0
- package/assets/components/assets/icon/blockHeightTall32.json +1 -0
- package/assets/components/assets/icon/cursorCircle16.json +1 -0
- package/assets/components/assets/icon/cursorCircle24.json +1 -0
- package/assets/components/assets/icon/cursorCircle32.json +1 -0
- package/assets/components/assets/icon/dictionary16.json +1 -0
- package/assets/components/assets/icon/dictionary24.json +1 -0
- package/assets/components/assets/icon/dictionary32.json +1 -0
- package/assets/components/assets/icon/jobDependency16.json +1 -0
- package/assets/components/assets/icon/jobDependency24.json +1 -0
- package/assets/components/assets/icon/jobDependency32.json +1 -0
- package/assets/components/assets/icon/referenceChip16.json +1 -0
- package/assets/components/assets/icon/referenceChip24.json +1 -0
- package/assets/components/assets/icon/referenceChip32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
- package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
- package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
- package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
- package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
- package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
- package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
- package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
- package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
- package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{06da3409992bb1fa85b0.js → 5e90c1b49f2b7e21d05a.js} +39 -31
- package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +1 -0
- package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
- package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
- package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
- package/assets/esri/core/workers/chunks/{62298dba3f6cbdc3f4ae.js → 879b2f0ff1977bca9376.js} +1 -1
- package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
- package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
- package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
- package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
- package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
- package/assets/esri/core/workers/chunks/a05790444115e4cf1bcc.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
- package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
- package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
- package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Component.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/FocusArea.glsl.js +8 -10
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +3 -3
- package/chunks/LineMarker.glsl.js +35 -42
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/Path.glsl.js +2 -2
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +51 -57
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.d.ts +12 -0
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/ellipseUtils.js +2 -0
- package/interfaces.d.ts +15 -18
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/list/LayerItemCollection.d.ts +1 -0
- package/layers/list/types.d.ts +5 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/support/TimeSeriesCalculation.d.ts +1 -1
- package/layers/support/TimeSeriesCalculation.js +1 -1
- package/layers/support/dataSeriesUtils.d.ts +10 -0
- package/layers/support/timeSeriesUtils.js +17 -6
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/networks/UtilityNetwork.d.ts +15 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +14 -1
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +4 -10
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/actions.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/renderers/support/RenderingInfo.js +1 -1
- package/renderers/support/renderingInfoUtils.js +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +16 -20
- package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.d.ts +7 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
- package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
- package/smartMapping/statistics/types.d.ts +50 -0
- package/support/tests/serviceMockDependencies.js +1 -1
- package/support/tests/setupServiceMocksMesh.js +1 -1
- package/symbols/cim/CIMPlacements.js +1 -1
- package/symbols/cim/callouts/calloutAnalysisUtils.js +1 -1
- package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
- package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
- package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
- package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/labelingUtils.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
- package/views/2d/layers/features/schema/TimeSchema.js +2 -0
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
- package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +16 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +5 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SelectionManager.d.ts +3 -3
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/SketchLayerView.d.ts +34 -0
- package/views/layers/SketchLayerView.js +2 -0
- package/views/layers/types.d.ts +3 -2
- package/views/selection/types.d.ts +15 -4
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
- package/widgets/Bookmarks/types.d.ts +2 -0
- package/widgets/Editor/EditorViewModel.d.ts +31 -30
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/types.d.ts +44 -0
- package/widgets/Editor.d.ts +30 -27
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +6 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Histogram/types.d.ts +10 -2
- package/widgets/HistogramRangeSlider/types.d.ts +4 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
- package/widgets/Legend/LegendViewModel.d.ts +2 -0
- package/widgets/Legend/styles/card/CardView.d.ts +2 -0
- package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
- package/widgets/Legend.d.ts +3 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/support/VideoFeatureCache.js +2 -0
- package/widgets/OrientedImageryViewer/types.d.ts +9 -0
- package/widgets/OrientedImageryViewer.d.ts +7 -0
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +9 -2
- package/widgets/Sketch/SketchViewModel.d.ts +32 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +27 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/types.d.ts +58 -13
- package/widgets/Slider.d.ts +6 -0
- package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/types.d.ts +30 -7
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder/types.d.ts +28 -0
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +16 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
- package/assets/esri/core/workers/chunks/078dcd17f46403d44b24.js +0 -1
- package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
- package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
- package/assets/esri/core/workers/chunks/152fe3d6ad7aebbd23d1.js +0 -1
- package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
- package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
- package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
- package/assets/esri/core/workers/chunks/3ef367c9b7bf1588307d.js +0 -1
- package/assets/esri/core/workers/chunks/5f4feca26102088ea565.js +0 -1
- package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
- package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
- package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
- package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
- package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
- package/assets/esri/core/workers/chunks/bb51cf52b8ea8283f4f8.js +0 -1
- package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
- package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
- package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
- package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
- package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
- package/support/revision.js +0 -2
- /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
package/widgets/Editor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n,deprecatedFunction as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as a,abortMaybe as o,mappedFind as s}from"../core/maybe.js";import{watch as c,initial as l,on as u,when as d,syncAndInitial as ee}from"../core/reactiveUtils.js";import{property as f,subclass as te}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as ne}from"../core/support/UpdatingHandles.js";import p from"../views/interactive/sketch/SketchLabelOptions.js";import m from"../views/interactive/sketch/SketchTooltipOptions.js";import h from"../views/interactive/sketch/SketchValueOptions.js";import g from"../views/interactive/snapping/SnappingOptions.js";import _ from"./Attachments.js";import v from"./BatchAttributeForm.js";import y from"./FeatureForm.js";import re from"./FeatureTemplates.js";import ie from"./Spinner.js";import ae from"./Widget.js";import oe from"./BatchAttributeForm/VisibleElements.js";import{isNextOrLegacyUpdateWorkflow as b,isNextOrLegacyUpdateFeaturesWorkflow as se,isNextOrLegacyUpdateFeatureWorkflow as ce}from"./Editor/compatibilityAdapters.js";import{css as x}from"./Editor/css.js";import S from"./Editor/EditorViewModel.js";import{isModelUpload as C}from"./Editor/modelUploadUtils.js";import w from"./Editor/VisibleElements.js";import{findEditorItemForLayer as T,isBatchAttributeFormViewModel as E}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as D,CreateFeaturesPanelContent as O}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as k,FeatureList as A}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as j,FooterActions as M}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as N,Notice as P}from"./Editor/components/Notices.js";import{loadPanelContentComponents as F,PanelContent as I,PanelContentSection as L,PanelContentMessage as R}from"./Editor/components/PanelContent.js";import{PanelToolbar as z,loadPanelToolbarComponents as B}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as V,Prompt as H}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as le,UpdateFeaturePanelContent as U}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as W,UploadDetails as ue}from"./Editor/components/UploadDetails.js";import de from"./Sketch/CreateToolVisibilityMap.js";import fe from"./Sketch/SelectionToolVisibilityMap.js";import pe from"./Sketch/VisibleElements.js";import{loadCalciteComponents as me}from"./support/componentsUtils.js";import{globalCss as G}from"./support/globalCss.js";import{incrementHeadingLevel as K,Heading as q}from"./support/Heading.js";import{renderItem as he}from"./support/ItemList.js";import{connectDelayedLoading as J}from"./support/loaderUtils.js";import ge from"./support/SelectionList.js";import _e from"./support/SelectionToolbar.js";import{messageBundle as Y,vmEvent as ve,tsx as X}from"./support/widget.js";import{isLayerItem as Z}from"./support/SelectionList/selectionListUtils.js";import ye from"./support/SelectionList/VisibleElements.js";import be from"./support/SelectionToolbar/VisibleElements.js";const Q=Symbol(`sketch-setup-handles`);let $=class extends ae{constructor(e,r){super(e,r),this._batchAttributeForm=new v({suppressDeprecationWarning:!0,visibleElements:new oe({loadingIndicator:!1})}),this._featureForm=new y({suppressDeprecationWarning:!0}),this._sketchToolbar=null,this._attachments=new _({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1},suppressDeprecationWarning:!0}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new re({suppressDeprecationWarning:!0,enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?X(`calcite-icon`,{class:x.templateItemContentEnd,icon:`upload-to`,key:`upload-icon`}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText=``,this._prompt=null,this._spinner=new ie,this._loading=!1,this._disallowSave=!1,this._selectionList=new ge({displayMode:`layer`,itemActionConfigs:this._selectionListItemActionConfigs,itemUnavailableFunction:({item:e})=>!T(this.editorItems,e.layer)?.editable,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new ye({header:!1})}),this._selectionToolbar=new _e({visibleElements:new be({chip:!1})}),this._updatingHandles=new ne,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=null,this.visibleElements=new w,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?X(`div`,{class:x.sketchContainer,key:`editor-sketch-container`},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>X(`calcite-icon`,{icon:`cursor`,slot:`content-start`}),this.EditorPanel=({heading:e,key:t,selected:n},...r)=>{let{visibleElements:i}=this;return X(`calcite-flow-item`,{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:n,onCalciteFlowItemBack:this._onBack},i.settingsMenu?X(z,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...r)},this._showConfirmationPrompt=e=>this._showPromptAndWait(this.messages[e]),this._showDiscardEditsPrompt=()=>{let{messages:e,activeWorkflow:t}=this,n={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return t?.type===`create-features`&&C(t.data.creationInfo)?this._showPromptAndWait(t.data.upload?.state===`success`?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):t?.type===`update`&&t.formViewModel?.activeAssociationsInput?this._showPromptAndWait({...n,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(n)},this._showGenericCancelPrompt=()=>{let{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onMerge=()=>{let{activeWorkflow:e}=this.viewModel;if(b(e)){let t=e.activeWorkflow;se(t)&&e.startMergingFeatures(t.viewGraphics,{initialFeatures:t.data.initialFeatures})}},this._onSplit=()=>{let{activeWorkflow:e}=this.viewModel;if(b(e)){let t=e.activeWorkflow;if(ce(t)){let n=t.viewGraphic;n&&e.startSplittingFeature(n,{initialFeature:t.data.edits.initialFeature??n})}}},this._onDelete=()=>{let e=this.viewModel.activeFeatureCount,n=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:n.deleteWarningTitle,message:n.deleteWarningMessage,context:`danger`,actions:{primary:{label:t(n.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:n.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{let{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:`danger`,actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{let{activeWorkflow:e}=this.viewModel;e&&(e.type===`create-features`||e.type===`update`&&e.activeWorkflow?.type===`create-features`?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{let{activeWorkflow:e}=this.viewModel;e&&(e.type===`create-features`?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{let{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:`danger`,actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{let e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&(t.type===`create-features`?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:`warning`,actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})},this.viewModel=e?.viewModel||new S({useLegacyCreateTools:e?.useLegacyCreateTools??e?.view?.type===`3d`,formSystem:e?.formSystem??`legacy`}),this.announceDeprecation=()=>{n(i.getLogger(this),`Editor`,`arcgis-editor`,{version:`5.0`})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this._batchAttributeForm.showPrompt=this._showPrompt,this._batchAttributeForm.clearPrompt=this._clearPrompt,this.addHandles([c(()=>K(this.headingLevel),e=>{this._batchAttributeForm.headingLevel=e,this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},l),u(()=>this.viewModel.activeWorkflow,`cancel-request`,({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),d(()=>this.viewModel.formViewModel,e=>{E(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},ee),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.consumePromise(this._initializeAssociationItemList(e))},l),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),c(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,n,r,i,a])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=n,this._spinner.viewModel=r,this._selectionList.viewModel=i,this._selectionToolbar.viewModel=a,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt,e.showConfirmationPrompt=this._showConfirmationPrompt},l),c(()=>this.view,(e,t)=>{let n=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,n),e?.ui.add(this._spinner,{key:n,position:`manual`}),this._associationItemList&&(this._associationItemList.view=e)},l),c(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(e.attachments&&this._attachments.set(e.attachments),e.batchAttributeForm&&this._batchAttributeForm.set(e.batchAttributeForm),e.featureForm&&this._featureForm.set(e.featureForm),e.featureTemplates&&this._featureTemplates.set(e.featureTemplates),e.selectionToolbar&&this._selectionToolbar.set(e.selectionToolbar),e.sketch&&this.viewModel.sketchViewModel?.set(e.sketch))},l),d(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),d(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),d(()=>this.viewModel?.failures,e=>{let{messages:n}=this,[{error:r,retry:i,cancel:a}]=e;this._showPrompt({title:n.errorWarningTitle,message:t(n.errorWarningMessageTemplate,{errorMessage:r.message}),context:`warning`,actions:{primary:{label:n.retry,action:()=>{i(),this._clearPrompt()}},secondary:{label:n.ignore,action:()=>{a(),this._clearPrompt()}}}})}),c(()=>this.viewModel?.state,e=>{switch(e){case`awaiting-feature-to-update`:case`ready`:case`disabled`:this._filterText=``,this._featureTemplates.filterText=``}}),c(()=>this.viewModel.formDisabled,e=>{this._batchAttributeForm.readOnly=e,this._featureForm.disabled=e}),c(()=>this.visibleElements.sketch,()=>this._setupSketch(),l),c(()=>this.visibleElements.zoomToButton,e=>this._selectionList.visibleElements.zoomToButton=e,l),J({getLoading:()=>{let{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}}),J({getLoading:()=>!this.viewModel.activeLeafWorkflow?.allowSave,setEffectiveLoading:e=>{this._disallowSave=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=a(this._sketchToolbar),this._sketchImportAbortController=o(this._sketchImportAbortController)}loadDependencies(){return Promise.all([me({flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`)}),D(),k(),j(),N(),F(),B(),V(),le(),W()])}get _hasInvalidBatchSelection(){return this._hasSelectionWithUneditableFeatures||this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||this._selectionList.visibleFeatureCount===0}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _hasSelectionWithUneditableFeatures(){let e=this.editorItems;return this._selectionList.visibleFeatureItems.some(t=>!T(e,t.layer))}get _deleteButtonCommonInfo(){return{appearance:`outline`,kind:`danger`}}get _selectionCountExceedsMaximum(){let e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:n,filterText:r,visibleFeatureCount:i}=this._selectionList;return r!=null&&r!==``?i>e:t?t.total>e:n>e}get _selectionListItemActionConfigs(){let{messages:e,visibleElements:t}=this,n=t?.mergeButton??!0;return[{label:e?.batchEditing?.editThisFeature,icon:`edit-attributes`,type:`feature`,hidden:({item:e})=>!T(this.editorItems,e.layer)?.editable,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`update`)},{label:e?.batchEditing.editTheseFeatures,icon:`edit-attributes`,type:`layer`,hidden:({item:e})=>!T(this.editorItems,e.layer)?.editable,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`update`)},{label:e?.batchEditing.mergeTheseFeatures,icon:`merge`,type:`layer`,hidden:n?({item:e})=>{if(!Z(e))return!0;let t=T(this.editorItems,e.layer);return!t||!t.editable||!t.supportsMergeFeaturesWorkflow||e.visibleTotal<2}:!0,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`merge`)}]}get _visibleSelectionCount(){let{activeLayerItem:e,effectiveCount:t,filterText:n,visibleFeatureCount:r}=this._selectionList;return n!=null&&n!==``?r:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get editorItems(){return this.viewModel.editorItems}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return`pencil`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get useLegacyCreateTools(){return this.viewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this.viewModel.useLegacyCreateTools=e}get formSystem(){return this.viewModel.formSystem}set formSystem(e){this.viewModel.formSystem=e}get isUsingLegacyCreateTools(){return this.viewModel.isUsingLegacyCreateTools}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}activateSelectionTool(e){return this.viewModel.activateSelectionTool(e)}cancelSelectionTool(){this.viewModel.cancelSelectionTool()}startCreateFeaturesWorkflowAtFeatureTypeSelection(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startMergeFeaturesWorkflow(e,t={}){return this.viewModel.startMergeFeaturesWorkflow(e,t)}startSplitFeatureWorkflow(e,t={}){return this.viewModel.startSplitFeatureWorkflow(e,t)}async startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}startUpdateWorkflowWithActiveSelection(){return this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return r(i.getLogger(this),`Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.`,{version:`4.33`,replacement:`Editor.deleteFeatures`,warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){let{visibleElements:e,viewModel:t}=this,n=this.classes(x.base,G.widget,G.panel);if(!t)return X(`div`,{class:n,key:`empty`});let{pageStack:r}=t,i=r.length-1,a=r.map((e,t)=>this._renderPage(e,t===i));return X(`div`,{class:n,key:`base`,ondragover:this._handleDragAndDrop,ondrop:this._handleDragAndDrop},e.flow?X(`calcite-flow`,{inert:!!this._prompt,key:`flow`},a):a,this._prompt?X(H,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){let n={selected:t};switch(e){case`disabled`:break;case`ready`:return this._renderReady(n);case`viewing-selection-list`:return this._renderSelectionListPage(n);case`awaiting-feature-creation-info`:return this._renderAwaitingFeatureCreationInfo(n);case`creating-features-upload-details`:return this._renderUploadDetails(n);case`creating-features`:return this._renderCreatingFeatures(n);case`editing-existing-feature`:case`editing-features`:case`editing-attributes`:case`choosing-key-feature`:return this._renderUpdateFeature(n);case`awaiting-update-feature-candidate`:return this._renderFeatureList(n);case`adding-attachment`:return this._renderAttachmentAdding(n);case`editing-attachment`:return this._renderAttachmentEditing(n);case`viewing-associated-layers`:case`viewing-associated-features`:return this._renderViewAssociatedLayers(n);case`add-association-select-layer`:case`add-association-select-feature`:return this._renderSelectFeature(n);case`add-association-create-association`:return this._renderAddAssociation(n);case`drawing-splitter-geometry`:return this._renderDrawingSplitGeometry(n);case`reviewing-features`:return this._renderReviewingSplitFeatures(n)}return X(`div`,{key:`empty-page`})}_renderAwaitingFeatureCreationInfo(e){let{EditorPanel:t,messages:n}=this;return X(t,{heading:n.selectTemplate,key:`templates-panel`,...e},X(I,{key:`feature-templates`},X(L,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){let{EditorPanel:t,activeWorkflow:n,messages:r}=this;if(n?.type!==`create-features`)return null;let i=n.data.upload;return i?X(t,{heading:r.createFeatures,key:`upload-details-panel`,...e},X(ue,{helpMessage:this._helpMessage,messages:r,upload:i})):null}_renderCreatingFeatures(e){let{EditorPanel:t,activeWorkflow:n,messages:r,messagesCommon:i,headingLevel:a,viewModel:o}=this;if(!n)return null;let s=n.type===`create-features`&&n.numPendingFeatures>0||n.type===`update`&&n?.activeWorkflow?.type===`create-features`&&n.activeWorkflow?.numPendingFeatures>0;return X(t,{heading:r.createFeatures,key:`create-features-panel`,...e},s?X(U,{disallowSave:this._disallowSave,editorViewModel:o,formWidget:this._batchAttributeForm,headingLevel:a,messages:r,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):X(O,{helpMessage:this._helpMessage,noticeMessage:this._noticeMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this,o=a.activeFeatureCount>1?n.multiFeature.editPanelTitle:n.singleFeature.editPanelTitle;return X(t,{heading:o,key:`update-feature-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onMerge:this._onMerge,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){let{EditorPanel:t}=this;return X(t,{heading:this.messages.splitFeature,key:`draw-split-geometry-panel`,...e},X(O,{helpMessage:this._helpMessage,noticeMessage:this._noticeMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this;return X(t,{heading:n.splitFeature,key:`review-split-features-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,visibleElements:this.visibleElements,onSave:this._onSave}))}_getAssociationTypeTitle(e){let{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;let{messagesFeature:n}=this;switch(e.type){case`attachment`:return n.associationsAttachments;case`connectivity`:return n.associationsConnectivity;case`structure`:return n.associationsStructure;case`content`:return n.associationsContents;case`container`:return n.associationsContainer}}_getAddAssociationTypeTitle(e){let{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;let n=t.associations;switch(e.type){case`attachment`:return n.addAttachment;case`connectivity`:return n.addConnectivity;case`structure`:return n.addStructure;case`content`:return n.addContent;case`container`:return n.addContainer}}async _initializeAssociationItemList(e){let t=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js`)).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js`)).default,t=new e;return this._associationSettings=t,t}_renderViewAssociatedLayers(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this,o=a.formViewModel?.activeAssociationType,s=this._getAssociationTypeTitle(o);return X(t,{heading:s,key:`viewing-associated-layers-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){let{_associationItemList:t,EditorPanel:n,viewModel:r,messagesCommon:i}=this,a=r.utilityNetworkAssociationAddAssociationViewModel,o=this._getAddAssociationTypeTitle(a?.associationType),s=a?.state!==`ready`||this.viewModel.formDisabled;return t?X(n,{heading:o,key:`add-association-select-feature`,...e},X(I,{key:`select-feature`},X(L,null,t.render())),X(M,{buttons:[t.filterOptionsVisible?{appearance:`solid`,label:i.apply,disabled:s,onClick:()=>t.applyFilterOptions(),type:`button`}:void 0,{appearance:`outline`,label:i.cancel,disabled:s,onClick:()=>{r.activeWorkflow?.type===`update`&&(a?.reset(),r.activeWorkflow.cancelActiveWorkflow())},type:`button`}]})):X(n,{heading:o,key:`add-association-select-feature`,...e})}async _setUpAssociationSettings(){let{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),n=e.utilityNetworkAssociationAddAssociationViewModel,r=e.activeWorkflow?.type===`update`?e.activeWorkflow:null,i=r?r.activeWorkflow:null,a=i?.type===`add-association`?i.sourceFeatureItem:null,o=n?.selectedFeature,s=n?.association,c=n?.utilityNetwork;a&&o&&s&&c&&(t.sourceFeature=a,t.targetFeature=o,t.association=s,t.utilityNetwork=c)}_renderAddAssociation(e){let{_associationSettings:t,EditorPanel:n,viewModel:r,messagesCommon:i}=this;if(!t)return null;let a=r.utilityNetworkAssociationAddAssociationViewModel,o=this._getAddAssociationTypeTitle(a?.associationType),s=a?.state!==`ready`;return X(n,{heading:o,key:`add-association`,...e},X(I,{key:`add-association-content`},X(L,null,t.render())),X(M,{buttons:[{label:i.add,disabled:s||!a.canAddAssociation,onClick:()=>this._onSave(),type:`button`},{appearance:`outline`,label:i.cancel,disabled:s,onClick:()=>{r.activeWorkflow?.type===`update`&&r.activeWorkflow.cancelActiveWorkflow()},type:`button`}]}))}_renderCustomTemplateGroupContent(e){let{messages:t,viewModel:n}=this,r=s(e.group.items,e=>n.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return r?X(P,{kind:`warning`,message:r}):null}_renderAttachmentAdding(e){let{EditorPanel:t,_attachments:n,messages:r,messagesCommon:i}=this;return X(t,{heading:r.addAttachment,key:`attachment-adding-panel`,...e},X(I,{key:`attachments`},this._renderAttachments()),X(M,{buttons:[{label:n.submitting?i.cancel:i.add,disabled:n.submitting||!n.selectedFile,onClick:this._onAttachmentAdd,type:`button`}]}))}_renderSelectionListPage(e){let{_hasSelectionFromMultipleLayers:n,_hasInvalidBatchSelection:r,_selectionCountExceedsMaximum:i,_selectionList:a,_visibleSelectionCount:o,messages:s,EditorPanel:c}=this,{batchUpdateActions:l}=this.visibleElements,{maxVisibleFeatureCountPerLayer:u}=a;return X(c,{heading:s.widgetLabel,key:`selection-list-panel`,...e},this.visibleElements.selectionToolbar?X(`div`,{class:x.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,X(I,{key:`selection-list`},X(L,null,this._renderSelectionList())),X(M,{buttons:[l?{label:t(s.batchEditing.editCount,{count:o}),disabled:r,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:`button`}:void 0],notice:l&&n?{text:s.batchEditing.selectOneLayer,icon:`information`}:l&&i?{text:t(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:u}),icon:`information`}:void 0}))}_renderAttachmentEditing(e){let{EditorPanel:t,_attachments:n,activeWorkflow:r,messages:i,messagesCommon:a}=this;return r?X(t,{heading:i.editAttachment,key:`attachment-editing-panel`,...e},X(I,{key:`attachments`},this._renderAttachments()),r.shouldAllowAttachmentEditing?X(M,{buttons:[{label:a.update,disabled:n.submitting||!n.selectedFile,onClick:this._onAttachmentUpdate,type:`button`},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:n.submitting,label:a.delete,type:`button`}]}):void 0):null}_renderReady(e){let{EditorPanel:t,messages:n,visibleElements:r}=this,i=this._helpMessage;return X(t,{heading:n.widgetLabel,key:`landing-panel`,...e},X(I,{key:`landing-content`},this.editorItems.length?[r.editFeaturesSection?X(L,{key:`edit-actions`},this._renderUpdateActions()):null,r.createFeaturesSection&&this.viewModel.canCreateVisible?X(L,{key:`create-actions`},this._renderCreateActions()):null]:X(R,{key:`no-content`},n.noEditableLayers)),i?X(`div`,{class:x.helpMessage,key:`footer-actions`,slot:`footer`},i):void 0)}_handleDragAndDrop(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`)}get _helpMessage(){return this.getHelpMessageString(this.activeWorkflow?.helpMessage)}get _noticeMessage(){return this.getHelpMessageString(this.activeWorkflow?.noticeMessage)}_renderUpdateActions(){let{messages:e,messagesCommon:t,viewModel:n}=this,r={id:`select`,label:t.select};return X(`div`,{class:x.updateActions,key:`update-actions`},X(q,{level:K(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar?X(`div`,{class:x.selectionToolbarContainer},this._renderSelectionToolbar()):X(`calcite-list`,{class:x.updateActionsList,label:e.editFeaturesList,selectionAppearance:`border`,selectionMode:`single`},he({disabled:!n.canUpdateVisible,grouped:!1,item:r,selectedItem:n.activeWorkflow?.stepId===`awaiting-feature-to-update`?r:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return X(`div`,{key:`create-actions`},X(q,{level:K(this.headingLevel)},this.messages.createFeatures),X(`div`,{class:x.featureTemplatesContainer,key:`templates`},this._renderFeatureTemplates()))}_renderFeatureList(e){let{EditorPanel:n,viewModel:r}=this,{activeWorkflow:i}=r;if(i?.type!==`update`)return null;let a=i.data.candidates,o=t(this.messages.multipleFeaturesTemplate,{total:a.length});return X(n,{heading:o,key:`feature-list`,...e},X(A,{editorItems:this.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:i,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>r.selectFeature(e,t),onZoomTo:e=>r.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:n,noLabel:r}){let i=Promise.withResolvers(),{view:a}=this,o=a?.focused;return this._showPrompt({title:e,message:t,context:`danger`,actions:{primary:{label:n,action:()=>i.resolve(!0)},secondary:{label:r,action:()=>i.resolve(!1)}}}),i.promise.finally(()=>{this._clearPrompt(),o&&a?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e,t){await this.viewModel.onSelectionListMenuItemSelect(e,t)}async _setupSketch(){if(!this.visibleElements.sketch){this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=a(this._sketchToolbar),this.removeHandles(Q);return}if(this._sketchImportAbortController)return;let e=new AbortController;this._sketchImportAbortController=e;let t=await import(`./Sketch.js`);if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:`docked`,contextualToolLocation:`inline-end`,scale:`s`,suppressDeprecationWarning:!0,visibleElements:new pe({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,singlePluginBackButton:!1,createTools:new de({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new fe({"lasso-selection":!1,"rectangle-selection":!1}),geometrySimplificationActivityIndicator:!1})}),this.addHandles([c(()=>{let e=this.viewModel.activeLeafWorkflow;return e&&`availableCreateTools`in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},l),c(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},l),d(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},l),d(()=>this.viewModel.sketchViewModel?.pluginManager,e=>{e.sketch=this._sketchToolbar},l)],Q)}finally{this._sketchImportAbortController=null}}getHelpMessageString(e){let{messages:t,view:n}=this;return e?t[n?.type===`3d`?`helpMessages3d`:`helpMessages2d`]?.[e]:void 0}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([f()],$.prototype,`_batchAttributeForm`,void 0),e([f()],$.prototype,`_featureForm`,void 0),e([f()],$.prototype,`_sketchToolbar`,void 0),e([f()],$.prototype,`_attachments`,void 0),e([f()],$.prototype,`_associationItemList`,void 0),e([f()],$.prototype,`_associationSettings`,void 0),e([f()],$.prototype,`_featureTemplates`,void 0),e([f()],$.prototype,`_filterText`,void 0),e([f()],$.prototype,`_hasInvalidBatchSelection`,null),e([f()],$.prototype,`_hasSelectionFromMultipleLayers`,null),e([f()],$.prototype,`_hasSelectionWithUneditableFeatures`,null),e([f()],$.prototype,`_prompt`,void 0),e([f()],$.prototype,`_spinner`,void 0),e([f()],$.prototype,`_deleteButtonCommonInfo`,null),e([f()],$.prototype,`_loading`,void 0),e([f()],$.prototype,`_disallowSave`,void 0),e([f()],$.prototype,`_selectionCountExceedsMaximum`,null),e([f()],$.prototype,`_selectionList`,void 0),e([f()],$.prototype,`_selectionListItemActionConfigs`,null),e([f()],$.prototype,`_selectionToolbar`,void 0),e([f()],$.prototype,`_visibleSelectionCount`,null),e([f({readOnly:!0})],$.prototype,`activeWorkflow`,null),e([f()],$.prototype,`editorItems`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`headingLevel`,void 0),e([f()],$.prototype,`hideTemplatesForInactiveLayers`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`label`,null),e([f({type:p})],$.prototype,`labelOptions`,null),e([f()],$.prototype,`layerInfos`,null),e([f(),Y(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messages`,void 0),e([f(),Y(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([f(),Y(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],$.prototype,`messagesTemplates`,void 0),e([f(),Y(`esri/widgets/Feature/t9n/Feature`)],$.prototype,`messagesFeature`,void 0),e([f()],$.prototype,`selectionManager`,null),e([f({type:g})],$.prototype,`snappingOptions`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f({type:m})],$.prototype,`tooltipOptions`,null),e([f()],$.prototype,`supportingWidgetDefaults`,void 0),e([f({type:h,nonNullable:!0})],$.prototype,`valueOptions`,null),e([f({value:!1})],$.prototype,`useLegacyCreateTools`,null),e([f()],$.prototype,`formSystem`,null),e([f()],$.prototype,`isUsingLegacyCreateTools`,null),e([f()],$.prototype,`view`,null),e([f({type:S}),ve([`sketch-create`,`sketch-delete`,`sketch-update`,`workflow-cancel`,`workflow-commit`])],$.prototype,`viewModel`,void 0),e([f({type:w,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f()],$.prototype,`_helpMessage`,null),e([f()],$.prototype,`_noticeMessage`,null),$=e([te(`esri.widgets.Editor`)],$);const xe=$;export{xe as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n,deprecatedFunction as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as a,abortMaybe as o,mappedFind as s}from"../core/maybe.js";import{watch as c,initial as l,on as u,when as d,syncAndInitial as ee}from"../core/reactiveUtils.js";import{property as f,subclass as te}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as ne}from"../core/support/UpdatingHandles.js";import p from"../views/interactive/sketch/SketchLabelOptions.js";import m from"../views/interactive/sketch/SketchTooltipOptions.js";import h from"../views/interactive/sketch/SketchValueOptions.js";import g from"../views/interactive/snapping/SnappingOptions.js";import _ from"./Attachments.js";import v from"./BatchAttributeForm.js";import y from"./FeatureForm.js";import re from"./FeatureTemplates.js";import ie from"./Spinner.js";import ae from"./Widget.js";import oe from"./BatchAttributeForm/VisibleElements.js";import{isNextOrLegacyUpdateWorkflow as b,isNextOrLegacyUpdateFeaturesWorkflow as se,isNextOrLegacyUpdateFeatureWorkflow as ce}from"./Editor/compatibilityAdapters.js";import{css as x}from"./Editor/css.js";import S from"./Editor/EditorViewModel.js";import{isModelUpload as C}from"./Editor/modelUploadUtils.js";import w from"./Editor/VisibleElements.js";import{findEditorItemForLayer as T,isBatchAttributeFormViewModel as E}from"./Editor/workflowUtils.js";import{loadCreateFeaturesPanelContentComponents as D,CreateFeaturesPanelContent as O}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as k,FeatureList as A}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as j,FooterActions as M}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as N,Notice as P}from"./Editor/components/Notices.js";import{loadPanelContentComponents as F,PanelContent as I,PanelContentSection as L,PanelContentMessage as R}from"./Editor/components/PanelContent.js";import{PanelToolbar as z,loadPanelToolbarComponents as B}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as V,Prompt as H}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as le,UpdateFeaturePanelContent as U}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as W,UploadDetails as ue}from"./Editor/components/UploadDetails.js";import de from"./Sketch/CreateToolVisibilityMap.js";import fe from"./Sketch/SelectionToolVisibilityMap.js";import pe from"./Sketch/VisibleElements.js";import{loadCalciteComponents as me}from"./support/componentsUtils.js";import{globalCss as G}from"./support/globalCss.js";import{incrementHeadingLevel as K,Heading as q}from"./support/Heading.js";import{renderItem as he}from"./support/ItemList.js";import{connectDelayedLoading as J}from"./support/loaderUtils.js";import ge from"./support/SelectionList.js";import _e from"./support/SelectionToolbar.js";import{messageBundle as Y,vmEvent as ve,tsx as X}from"./support/widget.js";import{isLayerItem as Z}from"./support/SelectionList/selectionListUtils.js";import ye from"./support/SelectionList/VisibleElements.js";import be from"./support/SelectionToolbar/VisibleElements.js";const Q=Symbol(`sketch-setup-handles`);let $=class extends ae{constructor(e,r){super(e,r),this._batchAttributeForm=new v({suppressDeprecationWarning:!0,visibleElements:new oe({loadingIndicator:!1})}),this._featureForm=new y({suppressDeprecationWarning:!0}),this._sketchToolbar=null,this._attachments=new _({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1},suppressDeprecationWarning:!0}),this._associationItemList=null,this._associationSettings=null,this._featureTemplates=new re({suppressDeprecationWarning:!0,enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?X(`calcite-icon`,{class:x.templateItemContentEnd,icon:`upload-to`,key:`upload-icon`}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText=``,this._prompt=null,this._spinner=new ie,this._loading=!1,this._disallowSave=!1,this._selectionList=new ge({displayMode:`layer`,itemActionConfigs:this._selectionListItemActionConfigs,itemUnavailableFunction:({item:e})=>!T(this.editorItems,e.layer)?.editable,onListItemSelect:({item:e})=>this._onSelectionListItemSelect(e),visibleElements:new ye({header:!1})}),this._selectionToolbar=new _e({visibleElements:new be({chip:!1})}),this._updatingHandles=new ne,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=null,this.visibleElements=new w,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSelectionList=()=>this._selectionList.render(),this._renderSelectionToolbar=()=>this._selectionToolbar.render(),this._renderSketch=()=>this._sketchToolbar?X(`div`,{class:x.sketchContainer,key:`editor-sketch-container`},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>X(`calcite-icon`,{icon:`cursor`,slot:`content-start`}),this.EditorPanel=({heading:e,key:t,selected:n},...r)=>{let{visibleElements:i}=this;return X(`calcite-flow-item`,{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:n,onCalciteFlowItemBack:this._onBack},i.settingsMenu?X(z,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...r)},this._showConfirmationPrompt=e=>this._showPromptAndWait(this.messages[e]),this._showDiscardEditsPrompt=()=>{let{messages:e,activeWorkflow:t}=this,n={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return t?.type===`create-features`&&C(t.data.creationInfo)?this._showPromptAndWait(t.data.upload?.state===`success`?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):t?.type===`update`&&t.formViewModel?.activeAssociationsInput?this._showPromptAndWait({...n,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(n)},this._showGenericCancelPrompt=()=>{let{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onMerge=()=>{let{activeWorkflow:e}=this.viewModel;if(b(e)){let t=e.activeWorkflow;se(t)&&e.startMergingFeatures(t.viewGraphics,{initialFeatures:t.data.initialFeatures})}},this._onSplit=()=>{let{activeWorkflow:e}=this.viewModel;if(b(e)){let t=e.activeWorkflow;if(ce(t)){let n=t.viewGraphic;n&&e.startSplittingFeature(n,{initialFeature:t.data.edits.initialFeature??n})}}},this._onDelete=()=>{let e=this.viewModel.activeFeatureCount,n=e>1?this.messages.multiFeature:this.messages.singleFeature;this._showPrompt({title:n.deleteWarningTitle,message:n.deleteWarningMessage,context:`danger`,actions:{primary:{label:t(n.delete,{count:e}),action:()=>{this.deleteFeatures(),this._clearPrompt()}},secondary:{label:n.keep,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{let{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:`danger`,actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{let{activeWorkflow:e}=this.viewModel;e&&(e.type===`create-features`||e.type===`update`&&e.activeWorkflow?.type===`create-features`?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then(()=>e.back()))},this._onAttachmentUpdate=()=>{let{activeWorkflow:e}=this.viewModel;e&&(e.type===`create-features`?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then(()=>e.back()))},this._onAttachmentDelete=()=>{let{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:`danger`,actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{let e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&(t.type===`create-features`?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:`warning`,actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})},this.viewModel=e?.viewModel||new S({useLegacyCreateTools:e?.useLegacyCreateTools??e?.view?.type===`3d`,formSystem:e?.formSystem??`legacy`}),this.announceDeprecation=()=>{n(i.getLogger(this),`Editor`,`arcgis-editor`,{version:`5.0`})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this._batchAttributeForm.showPrompt=this._showPrompt,this._batchAttributeForm.clearPrompt=this._clearPrompt,this.addHandles([c(()=>K(this.headingLevel),e=>{this._batchAttributeForm.headingLevel=e,this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e},l),u(()=>this.viewModel.activeWorkflow,`cancel-request`,({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then(t=>t?e.allow():e.deny())}),d(()=>this.viewModel.formViewModel,e=>{E(e)?this._batchAttributeForm.viewModel=e:this._featureForm.viewModel=e},ee),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel,e=>{this._associationItemList?this._associationItemList.viewModel=e:this._updatingHandles.consumePromise(this._initializeAssociationItemList(e))},l),d(()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association,()=>{this._setUpAssociationSettings()}),c(()=>[this.viewModel,this.viewModel?.attachmentsViewModel,this.viewModel?.featureTemplatesViewModel,this.viewModel?.spinnerViewModel,this.viewModel?.selectionListViewModel,this.viewModel?.selectionToolbarViewModel],([e,t,n,r,i,a])=>{this._attachments.viewModel=t,this._featureTemplates.viewModel=n,this._spinner.viewModel=r,this._selectionList.viewModel=i,this._selectionToolbar.viewModel=a,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt,e.showConfirmationPrompt=this._showConfirmationPrompt},l),c(()=>this.view,(e,t)=>{let n=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,n),e?.ui.add(this._spinner,{key:n,position:`manual`}),this._associationItemList&&(this._associationItemList.view=e)},l),c(()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel],([e])=>{e&&(e.attachments&&this._attachments.set(e.attachments),e.batchAttributeForm&&this._batchAttributeForm.set(e.batchAttributeForm),e.featureForm&&this._featureForm.set(e.featureForm),e.featureTemplates&&this._featureTemplates.set(e.featureTemplates),e.selectionToolbar&&this._selectionToolbar.set(e.selectionToolbar),e.sketch&&this.viewModel.sketchViewModel?.set(e.sketch))},l),d(()=>this._attachments?.error,e=>this._onAttachmentsError(e)),d(()=>this._selectionListItemActionConfigs,()=>{this._selectionList.itemActionConfigs=this._selectionListItemActionConfigs}),d(()=>this.viewModel?.failures,e=>{let{messages:n}=this,[{error:r,retry:i,cancel:a}]=e;this._showPrompt({title:n.errorWarningTitle,message:t(n.errorWarningMessageTemplate,{errorMessage:r.message}),context:`warning`,actions:{primary:{label:n.retry,action:()=>{i(),this._clearPrompt()}},secondary:{label:n.ignore,action:()=>{a(),this._clearPrompt()}}}})}),c(()=>this.viewModel?.state,e=>{switch(e){case`awaiting-feature-to-update`:case`ready`:case`disabled`:this._filterText=``,this._featureTemplates.filterText=``}}),c(()=>this.viewModel.formDisabled,e=>{this._batchAttributeForm.readOnly=e,this._featureForm.disabled=e}),c(()=>this.visibleElements.sketch,()=>this._setupSketch(),l),c(()=>this.visibleElements.zoomToButton,e=>this._selectionList.visibleElements.zoomToButton=e,l),J({getLoading:()=>{let{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting||this._updatingHandles.updating},setEffectiveLoading:e=>{this._loading=e}}),J({getLoading:()=>!this.viewModel.activeLeafWorkflow?.allowSave,setEffectiveLoading:e=>{this._disallowSave=e}})])}destroy(){this._associationItemList?.destroy(),this._associationSettings?.destroy(),this._selectionList.destroy(),this._selectionToolbar.destroy(),this._attachments.destroy(),this._batchAttributeForm.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._spinner.destroy(),this._sketchToolbar=a(this._sketchToolbar),this._sketchImportAbortController=o(this._sketchImportAbortController)}loadDependencies(){return Promise.all([me({flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`)}),D(),k(),j(),N(),F(),B(),V(),le(),W()])}get _hasInvalidBatchSelection(){return this._hasSelectionWithUneditableFeatures||this._hasSelectionFromMultipleLayers||this._selectionCountExceedsMaximum||this._selectionList.visibleFeatureCount===0}get _hasSelectionFromMultipleLayers(){return this._selectionList.visibleLayerCount>1}get _hasSelectionWithUneditableFeatures(){let e=this.editorItems;return this._selectionList.visibleFeatureItems.some(t=>!T(e,t.layer))}get _deleteButtonCommonInfo(){return{appearance:`outline`,kind:`danger`}}get _selectionCountExceedsMaximum(){let e=this._batchAttributeForm.maximumFeatureCount,{activeLayerItem:t,effectiveCount:n,filterText:r,visibleFeatureCount:i}=this._selectionList;return r!=null&&r!==``?i>e:t?t.total>e:n>e}get _selectionListItemActionConfigs(){let{messages:e,visibleElements:t}=this,n=t?.mergeButton??!0;return[{label:e?.batchEditing?.editThisFeature,icon:`edit-attributes`,type:`feature`,hidden:({item:e})=>!T(this.editorItems,e.layer)?.editable,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`update`)},{label:e?.batchEditing.editTheseFeatures,icon:`edit-attributes`,type:`layer`,hidden:({item:e})=>!T(this.editorItems,e.layer)?.editable,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`update`)},{label:e?.batchEditing.mergeTheseFeatures,icon:`merge`,type:`layer`,hidden:n?({item:e})=>{if(!Z(e))return!0;let t=T(this.editorItems,e.layer);return!t||!t.editable||!t.supportsMergeFeaturesWorkflow||e.visibleTotal<2}:!0,callback:({item:e})=>this._onSelectionListMenuItemSelect(e,`merge`)}]}get _visibleSelectionCount(){let{activeLayerItem:e,effectiveCount:t,filterText:n,visibleFeatureCount:r}=this._selectionList;return n!=null&&n!==``?r:e?e.total:t}get activeWorkflow(){return this.viewModel.activeWorkflow}get editorItems(){return this.viewModel.editorItems}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return`pencil`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get useViewOptions(){return this.viewModel.useViewOptions}set useViewOptions(e){this.viewModel.useViewOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get useLegacyCreateTools(){return this.viewModel.useLegacyCreateTools}set useLegacyCreateTools(e){this.viewModel.useLegacyCreateTools=e}get formSystem(){return this.viewModel.formSystem}set formSystem(e){this.viewModel.formSystem=e}get isUsingLegacyCreateTools(){return this.viewModel.isUsingLegacyCreateTools}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}activateSelectionTool(e){return this.viewModel.activateSelectionTool(e)}cancelSelectionTool(){this.viewModel.cancelSelectionTool()}startCreateFeaturesWorkflowAtFeatureTypeSelection(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection(e)}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startMergeFeaturesWorkflow(e,t={}){return this.viewModel.startMergeFeaturesWorkflow(e,t)}startSplitFeatureWorkflow(e,t={}){return this.viewModel.startSplitFeatureWorkflow(e,t)}async startUpdateFeaturesWorkflow(e){return this.viewModel.startUpdateFeaturesWorkflow(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}startUpdateWorkflowWithActiveSelection(){return this.viewModel.startUpdateWorkflowWithActiveSelection()}deleteFeatureFromWorkflow(){return r(i.getLogger(this),`Editor.deleteFeatureFromWorkflow is deprecated. Use Editor.deleteFeatures instead.`,{version:`4.33`,replacement:`Editor.deleteFeatures`,warnOnce:!0}),this.deleteFeatures()}async deleteFeatures(){await this.viewModel.deleteFeatures()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){let{visibleElements:e,viewModel:t}=this,n=this.classes(x.base,G.widget,G.panel);if(!t)return X(`div`,{class:n,key:`empty`});let{pageStack:r}=t,i=r.length-1,a=r.map((e,t)=>this._renderPage(e,t===i));return X(`div`,{class:n,key:`base`,ondragover:this._handleDragAndDrop,ondrop:this._handleDragAndDrop},e.flow?X(`calcite-flow`,{inert:!!this._prompt,key:`flow`},a):a,this._prompt?X(H,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){let n={selected:t};switch(e){case`disabled`:break;case`ready`:return this._renderReady(n);case`viewing-selection-list`:return this._renderSelectionListPage(n);case`awaiting-feature-creation-info`:return this._renderAwaitingFeatureCreationInfo(n);case`creating-features-upload-details`:return this._renderUploadDetails(n);case`creating-features`:return this._renderCreatingFeatures(n);case`editing-existing-feature`:case`editing-features`:case`editing-attributes`:case`choosing-key-feature`:return this._renderUpdateFeature(n);case`awaiting-update-feature-candidate`:return this._renderFeatureList(n);case`adding-attachment`:return this._renderAttachmentAdding(n);case`editing-attachment`:return this._renderAttachmentEditing(n);case`viewing-associated-layers`:case`viewing-associated-features`:return this._renderViewAssociatedLayers(n);case`add-association-select-layer`:case`add-association-select-feature`:return this._renderSelectFeature(n);case`add-association-create-association`:return this._renderAddAssociation(n);case`drawing-splitter-geometry`:return this._renderDrawingSplitGeometry(n);case`reviewing-features`:return this._renderReviewingSplitFeatures(n)}return X(`div`,{key:`empty-page`})}_renderAwaitingFeatureCreationInfo(e){let{EditorPanel:t,messages:n}=this;return X(t,{heading:n.selectTemplate,key:`templates-panel`,...e},X(I,{key:`feature-templates`},X(L,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){let{EditorPanel:t,activeWorkflow:n,messages:r}=this;if(n?.type!==`create-features`)return null;let i=n.data.upload;return i?X(t,{heading:r.createFeatures,key:`upload-details-panel`,...e},X(ue,{helpMessage:this._helpMessage,messages:r,upload:i})):null}_renderCreatingFeatures(e){let{EditorPanel:t,activeWorkflow:n,messages:r,messagesCommon:i,headingLevel:a,viewModel:o}=this;if(!n)return null;let s=n.type===`create-features`&&n.numPendingFeatures>0||n.type===`update`&&n?.activeWorkflow?.type===`create-features`&&n.activeWorkflow?.numPendingFeatures>0;return X(t,{heading:r.createFeatures,key:`create-features-panel`,...e},s?X(U,{disallowSave:this._disallowSave,editorViewModel:o,formWidget:this._batchAttributeForm,headingLevel:a,messages:r,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):X(O,{helpMessage:this._helpMessage,noticeMessage:this._noticeMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this,o=a.activeFeatureCount>1?n.multiFeature.editPanelTitle:n.singleFeature.editPanelTitle;return X(t,{heading:o,key:`update-feature-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onMerge:this._onMerge,onSave:this._onSave,onSplit:this._onSplit}))}_renderDrawingSplitGeometry(e){let{EditorPanel:t}=this;return X(t,{heading:this.messages.splitFeature,key:`draw-split-geometry-panel`,...e},X(O,{helpMessage:this._helpMessage,noticeMessage:this._noticeMessage,renderSketchToolbar:this._renderSketch}))}_renderReviewingSplitFeatures(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this;return X(t,{heading:n.splitFeature,key:`review-split-features-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,visibleElements:this.visibleElements,onSave:this._onSave}))}_getAssociationTypeTitle(e){let{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;if(e.title)return e.title;let{messagesFeature:n}=this;switch(e.type){case`attachment`:return n.associationsAttachments;case`connectivity`:return n.associationsConnectivity;case`structure`:return n.associationsStructure;case`content`:return n.associationsContents;case`container`:return n.associationsContainer}}_getAddAssociationTypeTitle(e){let{messages:t}=this;if(!e)return t.singleFeature.editPanelTitle;let n=t.associations;switch(e.type){case`attachment`:return n.addAttachment;case`connectivity`:return n.addConnectivity;case`structure`:return n.addStructure;case`content`:return n.addContent;case`container`:return n.addContainer}}async _initializeAssociationItemList(e){let t=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js`)).default;this._associationItemList=new t({view:this.view,viewModel:e})}async _initializeAssociationSettings(){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js`)).default,t=new e;return this._associationSettings=t,t}_renderViewAssociatedLayers(e){let{EditorPanel:t,messages:n,messagesCommon:r,headingLevel:i,viewModel:a}=this,o=a.formViewModel?.activeAssociationType,s=this._getAssociationTypeTitle(o);return X(t,{heading:s,key:`viewing-associated-layers-panel`,...e},X(U,{disallowSave:this._disallowSave,editorViewModel:a,formWidget:this._batchAttributeForm,headingLevel:i,messages:n,messagesCommon:r,renderAttachments:this._renderAttachments,renderFeatureForm:this._featureForm?.render,renderSketchToolbar:this._renderSketch,visibleElements:this.visibleElements,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){let{_associationItemList:t,EditorPanel:n,viewModel:r,messagesCommon:i}=this,a=r.utilityNetworkAssociationAddAssociationViewModel,o=this._getAddAssociationTypeTitle(a?.associationType),s=a?.state!==`ready`||this.viewModel.formDisabled;return t?X(n,{heading:o,key:`add-association-select-feature`,...e},X(I,{key:`select-feature`},X(L,null,t.render())),X(M,{buttons:[t.filterOptionsVisible?{appearance:`solid`,label:i.apply,disabled:s,onClick:()=>t.applyFilterOptions(),type:`button`}:void 0,{appearance:`outline`,label:i.cancel,disabled:s,onClick:()=>{r.activeWorkflow?.type===`update`&&(a?.reset(),r.activeWorkflow.cancelActiveWorkflow())},type:`button`}]})):X(n,{heading:o,key:`add-association-select-feature`,...e})}async _setUpAssociationSettings(){let{viewModel:e}=this,t=this._associationSettings??await this._updatingHandles.addPromise(this._initializeAssociationSettings()),n=e.utilityNetworkAssociationAddAssociationViewModel,r=e.activeWorkflow?.type===`update`?e.activeWorkflow:null,i=r?r.activeWorkflow:null,a=i?.type===`add-association`?i.sourceFeatureItem:null,o=n?.selectedFeature,s=n?.association,c=n?.utilityNetwork;a&&o&&s&&c&&(t.sourceFeature=a,t.targetFeature=o,t.association=s,t.utilityNetwork=c)}_renderAddAssociation(e){let{_associationSettings:t,EditorPanel:n,viewModel:r,messagesCommon:i}=this;if(!t)return null;let a=r.utilityNetworkAssociationAddAssociationViewModel,o=this._getAddAssociationTypeTitle(a?.associationType),s=a?.state!==`ready`;return X(n,{heading:o,key:`add-association`,...e},X(I,{key:`add-association-content`},X(L,null,t.render())),X(M,{buttons:[{label:i.add,disabled:s||!a.canAddAssociation,onClick:()=>this._onSave(),type:`button`},{appearance:`outline`,label:i.cancel,disabled:s,onClick:()=>{r.activeWorkflow?.type===`update`&&r.activeWorkflow.cancelActiveWorkflow()},type:`button`}]}))}_renderCustomTemplateGroupContent(e){let{messages:t,viewModel:n}=this,r=s(e.group.items,e=>n.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0);return r?X(P,{kind:`warning`,message:r}):null}_renderAttachmentAdding(e){let{EditorPanel:t,_attachments:n,messages:r,messagesCommon:i}=this;return X(t,{heading:r.addAttachment,key:`attachment-adding-panel`,...e},X(I,{key:`attachments`},this._renderAttachments()),X(M,{buttons:[{label:n.submitting?i.cancel:i.add,disabled:n.submitting||!n.selectedFile,onClick:this._onAttachmentAdd,type:`button`}]}))}_renderSelectionListPage(e){let{_hasSelectionFromMultipleLayers:n,_hasInvalidBatchSelection:r,_selectionCountExceedsMaximum:i,_selectionList:a,_visibleSelectionCount:o,messages:s,EditorPanel:c}=this,{batchUpdateActions:l}=this.visibleElements,{maxVisibleFeatureCountPerLayer:u}=a;return X(c,{heading:s.widgetLabel,key:`selection-list-panel`,...e},this.visibleElements.selectionToolbar?X(`div`,{class:x.selectionToolbarContainer},this._renderSelectionToolbar()):void 0,X(I,{key:`selection-list`},X(L,null,this._renderSelectionList())),X(M,{buttons:[l?{label:t(s.batchEditing.editCount,{count:o}),disabled:r,onClick:()=>this.startUpdateWorkflowWithActiveSelection(),type:`button`}:void 0],notice:l&&n?{text:s.batchEditing.selectOneLayer,icon:`information`}:l&&i?{text:t(this.messages.multiFeature.formFailedToLoadTooManyFeatures,{num:u}),icon:`information`}:void 0}))}_renderAttachmentEditing(e){let{EditorPanel:t,_attachments:n,activeWorkflow:r,messages:i,messagesCommon:a}=this;return r?X(t,{heading:i.editAttachment,key:`attachment-editing-panel`,...e},X(I,{key:`attachments`},this._renderAttachments()),r.shouldAllowAttachmentEditing?X(M,{buttons:[{label:a.update,disabled:n.submitting||!n.selectedFile,onClick:this._onAttachmentUpdate,type:`button`},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:n.submitting,label:a.delete,type:`button`}]}):void 0):null}_renderReady(e){let{EditorPanel:t,messages:n,visibleElements:r}=this,i=this._helpMessage;return X(t,{heading:n.widgetLabel,key:`landing-panel`,...e},X(I,{key:`landing-content`},this.editorItems.length?[r.editFeaturesSection?X(L,{key:`edit-actions`},this._renderUpdateActions()):null,r.createFeaturesSection&&this.viewModel.canCreateVisible?X(L,{key:`create-actions`},this._renderCreateActions()):null]:X(R,{key:`no-content`},n.noEditableLayers)),i?X(`div`,{class:x.helpMessage,key:`footer-actions`,slot:`footer`},i):void 0)}_handleDragAndDrop(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`)}get _helpMessage(){return this.getHelpMessageString(this.activeWorkflow?.helpMessage)}get _noticeMessage(){return this.getHelpMessageString(this.activeWorkflow?.noticeMessage)}_renderUpdateActions(){let{messages:e,messagesCommon:t,viewModel:n}=this,r={id:`select`,label:t.select};return X(`div`,{class:x.updateActions,key:`update-actions`},X(q,{level:K(this.headingLevel)},e.editFeatures),this.visibleElements.selectionToolbar?X(`div`,{class:x.selectionToolbarContainer},this._renderSelectionToolbar()):X(`calcite-list`,{class:x.updateActionsList,label:e.editFeaturesList,selectionAppearance:`border`,selectionMode:`single`},he({disabled:!n.canUpdateVisible,grouped:!1,item:r,selectedItem:n.activeWorkflow?.stepId===`awaiting-feature-to-update`?r:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return X(`div`,{key:`create-actions`},X(q,{level:K(this.headingLevel)},this.messages.createFeatures),X(`div`,{class:x.featureTemplatesContainer,key:`templates`},this._renderFeatureTemplates()))}_renderFeatureList(e){let{EditorPanel:n,viewModel:r}=this,{activeWorkflow:i}=r;if(i?.type!==`update`)return null;let a=i.data.candidates,o=t(this.messages.multipleFeaturesTemplate,{total:a.length});return X(n,{heading:o,key:`feature-list`,...e},X(A,{editorItems:this.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:i,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>r.selectFeature(e,t),onZoomTo:e=>r.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:n,noLabel:r}){let i=Promise.withResolvers(),{view:a}=this,o=a?.focused;return this._showPrompt({title:e,message:t,context:`danger`,actions:{primary:{label:n,action:()=>i.resolve(!0)},secondary:{label:r,action:()=>i.resolve(!1)}}}),i.promise.finally(()=>{this._clearPrompt(),o&&a?.focus()})}async _onSelectionListItemSelect(e){await this.viewModel.onSelectionListItemSelect(e)}async _onSelectionListMenuItemSelect(e,t){await this.viewModel.onSelectionListMenuItemSelect(e,t)}async _setupSketch(){if(!this.visibleElements.sketch){this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=a(this._sketchToolbar),this.removeHandles(Q);return}if(this._sketchImportAbortController)return;let e=new AbortController;this._sketchImportAbortController=e;let t=await import(`./Sketch.js`);if(!e.signal.aborted)try{this._sketchToolbar=new t.default({toolbarKind:`docked`,contextualToolLocation:`inline-end`,scale:`s`,suppressDeprecationWarning:!0,visibleElements:new pe({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,singlePluginBackButton:!1,createTools:new de({freehandPolygon:!0,freehandPolyline:!0}),selectionTools:new fe({"lasso-selection":!1,"rectangle-selection":!1}),geometrySimplificationActivityIndicator:!1})}),this.addHandles([c(()=>{let e=this.viewModel.activeLeafWorkflow;return e&&`availableCreateTools`in e?e.availableCreateTools:null},e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)},l),c(()=>this.visibleElements.undoRedoButtons,e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)},l),d(()=>this.viewModel?.sketchViewModel,e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)},l),d(()=>this.viewModel.sketchViewModel?.pluginManager,e=>{e.sketch=this._sketchToolbar},l)],Q)}finally{this._sketchImportAbortController=null}}getHelpMessageString(e){let{messages:t,view:n}=this;return e?t[n?.type===`3d`?`helpMessages3d`:`helpMessages2d`]?.[e]:void 0}get test(){return{sketch:this._sketchToolbar,showPrompt:this._showPromptAndWait.bind(this)}}};e([f()],$.prototype,`_batchAttributeForm`,void 0),e([f()],$.prototype,`_featureForm`,void 0),e([f()],$.prototype,`_sketchToolbar`,void 0),e([f()],$.prototype,`_attachments`,void 0),e([f()],$.prototype,`_associationItemList`,void 0),e([f()],$.prototype,`_associationSettings`,void 0),e([f()],$.prototype,`_featureTemplates`,void 0),e([f()],$.prototype,`_filterText`,void 0),e([f()],$.prototype,`_hasInvalidBatchSelection`,null),e([f()],$.prototype,`_hasSelectionFromMultipleLayers`,null),e([f()],$.prototype,`_hasSelectionWithUneditableFeatures`,null),e([f()],$.prototype,`_prompt`,void 0),e([f()],$.prototype,`_spinner`,void 0),e([f()],$.prototype,`_deleteButtonCommonInfo`,null),e([f()],$.prototype,`_loading`,void 0),e([f()],$.prototype,`_disallowSave`,void 0),e([f()],$.prototype,`_selectionCountExceedsMaximum`,null),e([f()],$.prototype,`_selectionList`,void 0),e([f()],$.prototype,`_selectionListItemActionConfigs`,null),e([f()],$.prototype,`_selectionToolbar`,void 0),e([f()],$.prototype,`_visibleSelectionCount`,null),e([f({readOnly:!0})],$.prototype,`activeWorkflow`,null),e([f()],$.prototype,`editorItems`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`headingLevel`,void 0),e([f()],$.prototype,`hideTemplatesForInactiveLayers`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`label`,null),e([f({type:p})],$.prototype,`labelOptions`,null),e([f()],$.prototype,`layerInfos`,null),e([f(),Y(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messages`,void 0),e([f(),Y(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([f(),Y(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],$.prototype,`messagesTemplates`,void 0),e([f(),Y(`esri/widgets/Feature/t9n/Feature`)],$.prototype,`messagesFeature`,void 0),e([f()],$.prototype,`selectionManager`,null),e([f({type:g})],$.prototype,`snappingOptions`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f({type:m})],$.prototype,`tooltipOptions`,null),e([f()],$.prototype,`useViewOptions`,null),e([f()],$.prototype,`supportingWidgetDefaults`,void 0),e([f({type:h,nonNullable:!0})],$.prototype,`valueOptions`,null),e([f({value:!1})],$.prototype,`useLegacyCreateTools`,null),e([f()],$.prototype,`formSystem`,null),e([f()],$.prototype,`isUsingLegacyCreateTools`,null),e([f()],$.prototype,`view`,null),e([f({type:S}),ve([`sketch-create`,`sketch-delete`,`sketch-update`,`workflow-cancel`,`workflow-commit`])],$.prototype,`viewModel`,void 0),e([f({type:w,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f()],$.prototype,`_helpMessage`,null),e([f()],$.prototype,`_noticeMessage`,null),$=e([te(`esri.widgets.Editor`)],$);const xe=$;export{xe as default};
|
|
@@ -500,7 +500,7 @@ export default class FeatureTableViewModel extends GridViewModel {
|
|
|
500
500
|
*
|
|
501
501
|
* @internal
|
|
502
502
|
*/
|
|
503
|
-
get effectiveTimeExtent(): TimeExtent |
|
|
503
|
+
get effectiveTimeExtent(): TimeExtent | undefined;
|
|
504
504
|
/**
|
|
505
505
|
* The 'effective' where clause used by data queries.
|
|
506
506
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as n,fetchMessageBundle as r}from"../../intl.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Collection.js";import{referenceSetter as o}from"../../core/collectionUtils.js";import s from"../../core/Error.js";import c from"../../core/Logger.js";import{debounce as l,ignoreAbortErrors as u}from"../../core/promiseUtils.js";import{watch as d,initial as f,on as p,syncAndInitial as m}from"../../core/reactiveUtils.js";import{throttle as h}from"../../core/throttle.js";import{property as g,subclass as _}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as v}from"../../editing/fieldUtils.js";import{geometryTypes as y}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as b}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as x,isSubtypeGroupLayer as S}from"../../layers/support/layerUtils.js";import{createFieldInfos as C}from"../../support/popupUtils.js";import w from"../../tables/AttributeTableTemplate.js";import{syncAttributeTableTemplateWithColumns as T}from"../../tables/support/templateUtils.js";import E from"../../time/TimeExtent.js";import{isSelectableLayerWithObjectIds as D}from"../../views/support/selectionUtils.js";import O from"./ActionColumn.js";import k from"./AttachmentsColumn.js";import A from"./FieldColumn.js";import j from"./RelationshipColumn.js";import M from"./Grid/Column.js";import N from"./Grid/Grid.js";import P from"./Grid/GridViewModel.js";import F from"./Grid/GroupColumn.js";import I from"./support/AttachmentsColumnTemplate.js";import L from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as R,isFieldColumn as z,isRelationshipColumn as B}from"./support/columnUtils.js";import{downloadAttachmentInfo as V,exportToCSV as H}from"./support/exportUtils.js";import U from"./support/FeatureStore.js";import W from"./support/FieldColumnTemplate.js";import G from"./support/RelationshipColumnTemplate.js";import K from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as q,isIFeatureTableSupportedLayerWithRelationships as J,findRelatedLayerInSources as ee,findRelationship as te,uniqueColumnNames as Y,hasColumnForField as ne,findField as X,isIFeatureTableSupportedLayerWithAttachments as re,getRelationshipIdsToShow as ie}from"./support/tableUtils.js";import{goTo as ae}from"../support/goToUtils.js";import{messageBundle as Z}from"../support/widget.js";const Q=`80px`;let $=class extends P{constructor(e){super(e),this._refreshDebounced=l(()=>this._refresh()),this._syncTemplateThrottled=h(()=>this._syncAttributeTableTemplate()),this.attachmentsViewOptions=new L,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new a,this.dataProvider=async(e,t)=>{let{layer:n,store:r}=this;if(!t)return;if(!n||!r){t&&t([]);return}try{await n.load()}catch{return}let{objectIds:i}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||i.length===1&&i.items[0]===-1){t([]);return}if(r.state!==`loaded`&&r.state!==`loading`)try{await r.load()}catch{return}let a=this.paginationEnabled?this.pageIndex:e.page;try{let n=await r.queryPage({...e,pageIndex:a});t?.(n)}catch{return}},this.grid=null,this.layers=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new a,this.relationshipColumnConfigs=null,this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set(`store`,new U),this._set(`grid`,new N({viewModel:this}))}initialize(){let e=async()=>{this.messages=await r(`esri/widgets/FeatureTable/t9n/FeatureTable`),this.messagesCommon=await r(`esri/t9n/common`),this.messagesUnits=await r(`esri/core/t9n/Units`),this.messagesURIUtils=await r(`esri/widgets/support/t9n/uriUtils`)};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),d(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{let e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},f),d(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),d(()=>this.layer,async(e,t)=>{let n=this.grid;n&&(n.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad().catch(()=>{}):e.load().catch(()=>{})),this.syncViewSelection&&this._syncSelection(),t&&this.attachmentsViewOptions.objectId!=null&&(this.attachmentsViewOptions.objectId=null)}),d(()=>this.layer?.loaded,e=>{e&&this._onLayerLoad().catch(()=>{})}),d(()=>this.store.state,e=>{e===`loaded`&&(this.scrollToTop(),this.refreshCellContent())}),d(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),d(()=>this.editingEnabled,()=>this.refreshCellContent()),d(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),d(()=>[this.effectiveTimeExtent,this.effectiveWhere],()=>{this.store.state===`loaded`&&this.reset().catch(()=>{})}),p(()=>this.layer,`refresh`,e=>this._onLayerRefresh(e)),p(()=>this.grid,[`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`],({index:e,item:t,native:n,path:r,type:i})=>{let a=t?.feature,o=a?.getObjectId(),s=i===`cell-keydown`&&n&&n instanceof KeyboardEvent&&n.key===`Enter`;this.emit(i,{feature:a,index:e,native:n,type:i,fieldName:r??void 0,objectId:o}),(s||i===`cell-click`)&&this._onCellInteraction(o)}),d(()=>this.actionColumnConfig,e=>{let{actionColumn:t,columns:n}=this;t?e?t.set(e):n.remove(t):e&&n.length&&n.add(this._generateActionColumn(),e.frozenToEnd===!1?this._getIndexOfFirstFrozenToEndColumn():void 0)}),d(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),p(()=>this.objectIds,`change`,()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),d(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),d(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),d(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),d(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),d(()=>this.state,e=>{e===`disabled`&&this.relatedTables.length&&this.drainRelatedTables()}),p(()=>this.tableParent?.highlightIds,`change`,({added:e})=>{let{relationshipConfig:t}=this,n=e[0];if(n==null||!t)return;let{relatedLayer:r,relationshipId:i}=t;this.relationshipConfig={objectId:n,relatedLayer:r,relationshipId:i}}),p(()=>this.tableParent,`cell-click`,async e=>{let{objectId:t}=e;this.tableController&&this.hasPendingEdits?await this.tableController.discardPendingEdits(void 0,!0).then(e=>e&&this._syncTableParentSelection(t)):this._syncTableParentSelection(t)}),d(()=>this.attachmentsViewOptions.objectId,(e,t)=>{if(e==null){this.hideAttachmentsView();return}t??this.showAttachmentsView({objectId:e})}),d(()=>[this.layerFieldConfigurations,this.pendingEditsCount],()=>this.refreshCellContent()),p(()=>this.highlightIds,`change`,e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this.defaultSelectionManager.clear()}),d(()=>this.effectiveSelectionManager,()=>this._syncSelection(),m),p(()=>this.effectiveSelectionManager,`selection-change`,()=>this._syncSelection(),m)])}destroy(){this._drainColumns(),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return b(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _subtypes(){return x(this.layer)}get actionColumn(){return super.actionColumn}get activeFilters(){let{filterGeometry:e,objectIds:t,filterBySelectionEnabled:n,highlightIds:r}=this,i=new a;return e&&i.push({type:`geometry`,geometry:e}),n?i.push({type:`selection`,objectIds:r.toArray()}):t.length&&i.push({type:`objectId`,objectIds:t.toArray()}),i}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>R(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get autoSaveEnabled(){return this.store.autoSaveEnabled}set autoSaveEnabled(e){this.store.autoSaveEnabled=e}get cachedPageCount(){return this.store.cachedPageCount}get canAddRelatedFeature(){return this.store.canAddRelatedFeature}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}get defaultSelectionManager(){return this.store.defaultSelectionManager}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSelectionManager(){return this.store.effectiveSelectionManager}get effectiveMultipleSelectionEnabled(){return super.effectiveMultipleSelectionEnabled}get effectiveSize(){return super.effectiveSize}get effectiveTimeExtent(){return this.store.effectiveTimeExtent}get effectiveWhere(){return this.store.effectiveWhere}get fieldColumns(){return this.allColumns.filter(e=>z(e))}get filterByViewExtent(){return this.store.filterByViewExtent}set filterByViewExtent(e){this.store.filterByViewExtent=e}get filterByLayerScaleRange(){return this.store.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.store.filterByLayerScaleRange=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get(`filterBySelectionEnabled`)}set filterBySelectionEnabled(e){let{objectIds:t}=this,n=t.length;e?(n&&(t.removeAll(),this._logWarning(`Selection filter has been applied with an objectID filter. Object ID filter has been removed.`)),this.filterGeometry&&this._logWarning(`Selection filter has been applied with a geometry filter. Results may appear inconsistent`),this._syncObjectIdsWithStore(this.highlightIds.toArray())):n||this._syncObjectIdsWithStore(null),this._set(`filterBySelectionEnabled`,e)}get groupColumns(){return super.groupColumns}get hasContingentValues(){return this.relatedTableHasContingentValues||this.store.hasContingentValues}get hasInvalidPendingEdits(){return this.relatedTableHasInvalidPendingEdits||this.store.hasInvalidPendingEdits}get hasPendingEdits(){return this.relatedTableHasPendingEdits||this.store.hasPendingEdits}get hiddenFields(){return this._get(`hiddenFields`)??new a}set hiddenFields(e){this._set(`hiddenFields`,o(e,this._get(`hiddenFields`),a))}get highlightEnabled(){return this.store.highlightEnabled}set highlightEnabled(e){this.store.highlightEnabled=e}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get(`layer`)}set layer(e){this.drainRelatedTables(),this._set(`layer`,e)}get layerFieldConfigurations(){let e=this.layer;return q(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get maxSize(){return super.maxSize}set maxSize(e){super.maxSize=e}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get paginationEnabled(){return super.paginationEnabled}set paginationEnabled(e){super.paginationEnabled=e}get pendingEditsCount(){return this.store.pendingEditsCount}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relatedTableHasContingentValues(){return!!this.relatedTable?.hasContingentValues}get relatedTableHasInvalidPendingEdits(){return!!this.relatedTable?.hasInvalidPendingEdits}get relatedTableHasPendingEdits(){return!!this.relatedTable?.hasPendingEdits}get relationship(){return this.store.relationship}get relationshipColumns(){return this.allColumns.filter(e=>B(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){let{layer:e,layers:t,relationships:n,tableController:r}=this,i=this.store.relationshipInfos;if(i.length||!J(e)||!n?.length)return i;let a=[],o=r?.layers||t||[];return n.forEach(t=>{let n=ee(e,o,t);n&&(n.load().catch(()=>{}),a.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),a}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get selectionManager(){return this.store.selectionManager}set selectionManager(e){this.store.selectionManager=e}get selectionSource(){return`table`}set selectionSource(e){this.syncViewSelection=e===`view`,this._overrideIfSome(`selectionSource`,e)}get showAllRelatedTables(){return this._get(`showAllRelatedTables`)}set showAllRelatedTables(e){let{relatedTable:t}=this;this._set(`showAllRelatedTables`,e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){let{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){let{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get syncViewSelection(){return this.store.syncViewSelection}set syncViewSelection(e){this.store.syncViewSelection=e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get viewTimeEnabled(){return this.store.viewTimeEnabled}set viewTimeEnabled(e){this.store.viewTimeEnabled=e}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){let{attachmentsViewOptions:n,store:r}=this,i=n.objectId===e;await r.addAttachment(e,t).catch(e=>{i&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),n.error=e.error)}),i&&!n.error&&(n.onEditComplete(),n.attachmentInfos=await r.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}addPendingEdits(e){this.store.addPendingEdits(e)}collapseRelatedTable(e,t){let{relatedLayer:n,objectId:r,relationshipId:i}=t,{objectIdField:o}=n,s=te(n,i),c=n.displayField||s?.keyField||o;e.set({highlightIds:new a([r]),multipleSelectionEnabledOverride:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,c,i)});let l=e.hiddenFields;l.includes(Y.action)||l.add(Y.action),l.includes(Y.attachments)||l.add(Y.attachments),e.scrollLeft()}async deleteAttachments(e,t){let{attachmentsViewOptions:n,store:r}=this,i=n.objectId===e;await r.deleteAttachments(e,t).catch(e=>{i&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),n.error=e.error)}),i&&!n.error&&(n.onEditComplete(),n.attachmentInfos=await r.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteSelection(){let e=this.highlightIds.toArray();if(!e?.length)return;let{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),n=t.filter(e=>!e.error).map(e=>e.objectId);n.length&&(this.highlightIds.removeMany(n),await this.refresh())}async discardPendingEdits(e){return this.relatedTable&&this.relatedTableHasPendingEdits?this.relatedTable.discardPendingEdits(e):(this.store.discardPendingEdits(e),!0)}async downloadAttachmentById(e,t){let n=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await V(n)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabledOverride:null,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([Y.action,Y.attachments])}drainRelatedTablesAboveIndex(e){let{relatedTables:t}=this,n=t.slice(e+1);t.removeMany(n).forEach(e=>e.destroy());let r=t.at(-1);r&&(r.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(r):this._hideAllRelatedTables(r))}async exportSelectionToCSV(e){let{highlightIds:t,layer:n,outFields:r}=this;if(!n||!t.length){this._logWarning(`Export failed.`);return}await H({layer:n,objectIds:t.toArray(),outFields:r,includeGeometry:e})}getCachedFeaturesByPageIndex(e){return this.store.getCachedFeaturesByPageIndex(e)}getFeatureStoreItemByObjectId(e){return this.store.getItemByObjectId(e)}async getFeatureTitle(e,t){return this.store.getFeatureTitle(e,t)}getFeatureTitleSync(e){let t=this.layer;if(!t)return`${e}`;let n=`${t.objectIdField}: ${e}`;return e==null?n:this.store.featureTitleMap.get(e)??n}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){return this.getFeatureStoreItemByObjectId(e)?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(e==null||!Number.isInteger(e)){this._logWarning(`Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.`);return}let{pageCount:t}=this;(e>=t||e===-1)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabledOverride:null,tableTemplateOverride:null}),this.hiddenFields.remove(Y.action)}nextPage(){let e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){let e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),u(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await this.grid?.reset()}async savePendingEdits(){if(this.relatedTableHasPendingEdits&&!this.relatedTableHasInvalidPendingEdits){await this.relatedTable?.savePendingEdits();return}this.hasPendingEdits&&!this.relatedTable&&(await this.store.savePendingEdits(),await this.refresh())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){let t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning(`Row not found. Associated data may not be loaded yet.`)}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){let{attachmentId:e,form:t,objectId:n}=this.attachmentsViewOptions;n!=null&&t&&(e==null?await this.addAttachment(n,t):await this.updateAttachment(n,e,t))}async showAttachmentsView({objectId:e}){let{attachmentsViewOptions:t,hiddenFields:n,layer:r}=this;if(!this.attachmentsEnabled||!r){this._logWarning(`The 'attachmentsEnabled' property is currently false.`);return}await r.load();let i=this._getDefaultLayerDisplayField(r),o=await this.store.getAttachmentsByObjectId(e,!0),s=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:o,mode:o.length?`list`:`file`,objectId:e}),this.set({highlightIds:new a([e]),multipleSelectionEnabledOverride:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)}),n.includes(Y.action)||n.add(Y.action),s!=null&&this.scrollToIndex(s)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}syncSelectionSources(){this.store.syncSelectionSources()}async updateAttachment(e,t,n){let{attachmentsViewOptions:r,store:i}=this,a=r.objectId===e;await i.updateAttachment(e,t,n).catch(e=>{a&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),r.error=e.error)}),a&&!r.error&&(r.onEditComplete(),r.attachmentInfos=await i.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){let{layer:e,view:t}=this,n=this.highlightIds.toArray();if(!e||!t||!n.length)return;let r=e.createQuery();r.objectIds=n,r.returnGeometry=!0;let i=await e.queryFeatures(r);try{await ae(t,i.features)}catch(e){e.name!==`AbortError`&&console.error(e)}}_syncAttributeTableTemplate(e=!1){let{_effectiveAttributeTableTemplate:t,layer:n,tableTemplateOverride:r,syncTemplateOnChangesEnabled:i}=this;if(!n||!t||!i&&!e||r||this.tableParent||this.relatedTable||this.attachmentsViewOptions.objectId!==null)return;let a=JSON.stringify(t.toJSON());T(t,this.columns.toArray(),this.activeSortOrders),t===n.attributeTableTemplate&&JSON.stringify(t.toJSON())!==a&&(n.attributeTableTemplate=t.clone())}async _refresh(){await super.refresh();let e=this.highlightIds.toArray();e.length&&(await this.store.verifyFeaturesByObjectId(e)).forEach((t,n)=>{t||this.highlightIds.remove(e[n])}),this.refreshPageCache();let t=this.attachmentsViewOptions;t?.objectId!=null&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){let{layer:e,pageSize:t}=this;if(!e)return;e.parent&&S(e.parent)&&await e.parent.loadAll();let n=e.capabilities.query?.maxRecordCount,r=n&&n<t,i=r?n:t;r&&(this._logWarning(`The value for 'pageSize' has been adjusted due to the provided layer's max record count.`),this.pageSize=i),this.grid?.set(`pageSize`,i),this.store.load().catch(()=>{}),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();let{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t,layer:n}=this,r=e?.columnTemplates;if(!n)return;let i=this._generateColumnsFromColumnTemplates(n,r)??this._generateColumnsFromAttributeTableTemplate(n,t)??this._generateDefaultFieldColumns(n);i.length&&(this.attachmentsEnabled&&!i.some(e=>R(e))&&i.push(this._generateDefaultAttachmentsColumn(n)),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!i.some(e=>B(e))&&i.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&i.push(this._generateActionColumn()),i.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(i))}_generateColumnsFromAttributeTableTemplate(e,t){if(!t)return null;let{elements:n,orderByFields:r}=t,a=C(e),o=[];o.push(...this._generateColumnsFromAttributeTableElements(e,n,r));let s=a.map(t=>{if(!t.fieldName||ne(t.fieldName,o))return null;let{fieldName:n}=t,i=X(e,n);return i?this._generateDefaultFieldColumn(e,i,{hidden:!0,orderByFields:r}):(this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`),null)}).filter(i);return o.push(...s),this.attachmentsEnabled&&re(e)&&!o.some(e=>R(e))&&o.push(this._generateDefaultAttachmentsColumn(e,{hidden:!0})),this.relatedRecordsEnabled&&J(e)&&e.relationships?.forEach(({id:e},t)=>{let n=this.relationshipInfos.find(t=>t.relationshipId===e);n&&!o.some(t=>B(t)&&t.relationshipId===e)&&o.push(this._generateDefaultRelationshipColumn({hidden:!0,info:n,index:t}))}),o.length?o:null}_generateColumnsFromAttributeTableElements(e,t,n){return t?.map((t,r)=>{switch(t.type){case`field`:return this._createFieldColumnFromElement({layer:e,element:t,orderByFields:n});case`group`:return this._createGroupColumnFromElement({layer:e,element:t,orderByFields:n});case`attachment`:return this._createAttachmentColumnFromElement({layer:e,element:t,index:r});case`relationship`:return this._createRelationshipColumnFromElement({element:t,index:r})}}).filter(e=>!!e)??[]}_createFieldColumnFromElement(e){let{layer:t,element:n,orderByFields:r}=e,{fieldName:i}=n;if(i==null)return this._logTemplateWarning(`A valid 'fieldName' must be provided.`),null;let a=X(t,i);if(!a)return this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`),null;let{description:o,label:s}=n,c=r?.findIndex(({field:e})=>e&&e===i)??-1,l=c>-1?r?.at(c)?.order:void 0,u=c>-1?c:void 0,{grid:d,messages:f,messagesCommon:p,messagesURIUtils:m,store:h,view:g}=this;return new A({description:o,direction:l,field:a,fieldName:i,grid:d,initialSortPriority:u,label:s,layer:t,messages:f,messagesCommon:p,messagesURIUtils:m,store:h,view:g,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){let{layer:t,element:n,orderByFields:r}=e,{description:i,label:a}=n;if(!a)return this._logTemplateWarning(`Group columns require a label.`),null;if(!n.elements.length)return this._logTemplateWarning(`Group columns require child columns.`),null;let{grid:o,messages:s,messagesCommon:c,messagesURIUtils:l,store:u}=this;return new F({columns:this._generateColumnsFromAttributeTableElements(t,n.elements,r),description:i,grid:o,label:a,messages:s,messagesCommon:c,messagesURIUtils:l,store:u})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled){this._logTemplateWarning(`The 'attachmentsEnabled' property is currently false.`);return}let{layer:t,element:n,index:r}=e,{description:i,label:a}=n,{grid:o,messages:s,messagesCommon:c,messagesURIUtils:l,store:u}=this;return new k({description:i,fieldName:`${Y.attachments}-${r}`,grid:o,label:a,layer:t,messages:s,messagesCommon:c,messagesURIUtils:l,store:u,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled){this._logTemplateWarning(`Relationship columns require related records to be enabled on the table.`);return}let{element:t,index:n}=e,{description:r,label:i,relationshipId:a}=t,o=this.relationshipInfos.find(e=>e.relationshipId===a);if(!o)return this._logTemplateWarning(`Unable to find valid related layer target based on the provided relationship id.`),null;let{grid:s,messages:c,messagesCommon:l,messagesURIUtils:u,store:d}=this;return new j({description:r,fieldName:`${Y.relationship}-${a}-${n}`,grid:s,label:i,messages:c,messagesCommon:l,messagesURIUtils:u,relationshipId:a,store:d,layer:o.relatedLayer,relatedLayer:o.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e,t){let{grid:n,messages:r,messagesCommon:i,messagesURIUtils:a,store:o,view:s}=this;if(!t?.length)return null;let c=[];return t.forEach((t,l)=>{let{autoWidth:u,description:d,direction:f,flexGrow:p,fieldName:m,formatFunction:h,frozen:g,frozenToEnd:_,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,menuConfig:w,resizable:T,sortable:E,textAlign:D,textWrap:O,timeZone:k,type:j,width:N}=t;if(!j){this._logTemplateWarning(`Property 'type' is missing from the provided template.`);return}if(g&&_){this._logTemplateWarning(`Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.`);return}let P=t.visible===!1;if(j===`group`){if(!t.columnTemplates?.length){this._logTemplateWarning(`Group columns must contain column templates.`);return}if(!t.label){this._logTemplateWarning(`Group columns require a label.`);return}let o=this._generateColumnsFromColumnTemplates(e,t.columnTemplates),s=P||this._isFieldHidden(t.label);c.push(new F({autoWidth:u,columns:o,description:d,flexGrow:p,frozen:g,frozenToEnd:_,grid:n,hidden:s,icon:v,iconText:y,invalid:x,label:S,labelTooltipText:C,menuConfig:w,messages:r,messagesCommon:i,messagesURIUtils:a,resizable:T,textAlign:D,textWrap:O,timeZone:k,width:N}))}else if(j===`attachment`){if(!this.attachmentsEnabled){this._logTemplateWarning(`Attachment columns require attachments to be enabled on the table.`);return}c.push(this._generateAttachmentsColumnFromTemplate(e,t,l))}else if(j===`relationship`){if(!this.relatedRecordsEnabled){this._logTemplateWarning(`Relationship columns require related records to be enabled on the table.`);return}let{relationshipId:e}=t;if(e==null){this._logTemplateWarning(`Property 'relationshipId' is missing from the provided template.`);return}let n=this.relationshipInfos.find(t=>t.relationshipId===e);if(!n){this._logTemplateWarning(`Unable to find valid related layer target based on the provided relationship id.`);return}c.push(this._generateRelationshipColumnFromTemplate(n,t,l))}else if(!m){this._logTemplateWarning(`Value for 'fieldName' property was missing from the provided template.`);return}let I=P||this._isFieldHidden(m);if(j===`column`)c.push(new M({autoWidth:u,description:d,direction:f,fieldName:m,flexGrow:p,formatFunction:h,frozen:g,frozenToEnd:_,grid:n,hidden:I,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,menuConfig:w,messages:r,messagesCommon:i,messagesURIUtils:a,resizable:T,sortable:E,store:o,textAlign:D,textWrap:O,timeZone:k,width:N}));else if(j===`field`){let l=X(e,t.fieldName);if(!l){this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`);return}let{editable:m,required:j}=t;c.push(new A({autoWidth:u,description:d,direction:f,editable:m,field:l,fieldName:l.name,flexGrow:p,formatFunction:h,frozen:g,frozenToEnd:_,grid:n,hidden:I,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,layer:e,messages:r,messagesCommon:i,messagesURIUtils:a,menuConfig:w,required:j,resizable:T,sortable:E,store:o,template:t,textAlign:D,textWrap:O,timeZone:k,width:N,view:s,onShowPromptCallback:this._onShowPromptCallback}))}}),c.length?c:null}_generateDefaultFieldColumns(e){return e.fields?.map(t=>this._generateDefaultFieldColumn(e,t)).filter(i)??[]}_generateDefaultFieldColumn(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s,view:c}=this;if(!t.visible||t.type===`geometry`)return null;let l=n?.orderByFields,u=t.name,d=l?.findIndex(({field:e})=>e&&e===u)??-1,f=d>-1?l?.at(d)?.order:void 0,p=d>-1?d:void 0;return new A({direction:f,field:t,fieldName:u,grid:r,hidden:n?.hidden||this._isFieldHidden(u),initialSortPriority:p,layer:e,messages:i,messagesCommon:a,messagesURIUtils:o,store:s,view:c,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s}=this,{attachmentsViewEnabled:c,autoWidth:l,description:u,flexGrow:d,fieldName:f,formatFunction:p,frozen:m,frozenToEnd:h,icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,resizable:S,textAlign:C,textWrap:w,thumbnailAppearance:T,thumbnailCount:E,thumbnailIconScale:D,thumbnailsEnabled:O,timeZone:A,width:j}=t;return new k({attachmentsViewEnabled:c,autoWidth:l,description:u,fieldName:`${Y.attachments}-${n}`,flexGrow:d,formatFunction:p,frozen:m,frozenToEnd:h,grid:r,hidden:t.visible===!1||this._isFieldHidden(y)||this._isFieldHidden(f),icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,layer:e,menuConfig:x,messages:i,messagesCommon:a,messagesURIUtils:o,resizable:S,store:s,textAlign:C,textWrap:w,thumbnailAppearance:T,thumbnailCount:E,thumbnailIconScale:D,thumbnailsEnabled:O,timeZone:A,width:j,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e,t){let{grid:n,messages:r,messagesCommon:i,messagesURIUtils:a,store:o}=this,s=Y.attachments;return new k({fieldName:s,grid:n,hidden:t?.hidden||this._isFieldHidden(s),layer:e,messages:r,messagesCommon:i,messagesURIUtils:a,store:o,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s}=this,{autoWidth:c,collapsed:l,description:u,flexGrow:d,fieldName:f,formatFunction:p,frozen:m,frozenToEnd:h,icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,relationshipId:S,resizable:C,textAlign:w,textWrap:T,timeZone:E,width:D}=t;return new j({autoWidth:c,collapsed:l,description:u,fieldName:`${Y.relationship}-${S}-${n}`,flexGrow:d,formatFunction:p,frozen:m,frozenToEnd:h,grid:r,hidden:t.visible===!1||this._isFieldHidden(y)||this._isFieldHidden(f),icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,messages:i,messagesCommon:a,messagesURIUtils:o,relationshipId:S,resizable:C,store:s,textAlign:w,textWrap:T,timeZone:E,width:D,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){let{relationshipInfos:e,relationshipColumnConfigs:t}=this,n=[];return e?.length&&(t?t.forEach((t,r)=>{let{relationshipId:i}=t,a=e.find(e=>e.relationshipId===i);a&&n.push(this._generateDefaultRelationshipColumn({config:t,index:r,info:a}))}):e.forEach((e,t)=>n.push(this._generateDefaultRelationshipColumn({index:t,info:e})))),n}_generateDefaultRelationshipColumn(e){let{config:t,hidden:n,index:r,info:i}=e,{grid:a,messages:o,messagesCommon:s,messagesURIUtils:c,store:l}=this,{relationshipId:u}=i;return new j({...t,fieldName:`${Y.relationship}-${u}-${r}`,grid:a,hidden:!!n,messages:o,messagesCommon:s,messagesURIUtils:c,layer:i.relatedLayer,relatedLayer:i.layer,relationshipId:u,store:l,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){let e=this.actionColumnConfig,t=e?.frozen===!0?!1:e?.frozenToEnd??!0;return new O({hidden:this._isFieldHidden(Y.action),store:this.store,...e,frozenToEnd:t})}_isFieldHidden(e){let t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_syncSelection(){let{layer:e}=this;D(e)?this.highlightIds.items=this.effectiveSelectionManager.getSelection(e)??[]:this.highlightIds.removeAll()}_addToSelection(e){let t=this.layer;D(t)&&this.effectiveSelectionManager.add(t,e)}_removeFromSelection(e){let t=this.layer;D(t)&&this.effectiveSelectionManager.remove(t,e)}async _onHighlightIdsChange(e){let{added:t,removed:n}=e,{attachmentsViewOptions:r}=this;if(this._removeFromSelection(n),this._addToSelection(t),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),r.objectId!=null){let e=this.highlightIds.at(0);if(e!=null){let t=await this.store.getAttachmentsByObjectId(e,!0);r.set({attachmentInfos:t,objectId:e,mode:t.length?`list`:`file`}),this.getFeatureTitle(e)}}}_syncTableParentSelection(e){let{tableParent:t}=this;t&&e!=null&&t.highlightIds.add(e)}_onShowRelatedTable(e){let{highlightIds:t}=this,{objectId:n}=e;if(t.removeAll(),t.add(n),this.showRelatedTableCallback){this.showRelatedTableCallback(e);return}this.emit(`show-related-table`,e)}_onObjectIdsChange(){let e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning(`Object ID filter was applied while a selection filter was applied. Selection filter has been removed.`)),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){let t=e.layer;if(!t)return;let n=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,n)});let r=e.hiddenFields;r.includes(Y.action)||r.add(Y.action),r.includes(Y.attachments)||r.add(Y.attachments)}_hideAllRelatedTables(e){let{layer:t,relationship:n}=e;if(t&&n?.id!=null){if(e.attachmentsViewOptions.objectId!=null){let n=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabledOverride:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(n)})}else e.set({multipleSelectionEnabledOverride:null,relationshipColumnConfigs:ie(t,n.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([Y.action,Y.attachments])}}_getTableTemplateForRelatedTableView(e,t,n){return new K({columnTemplates:[new W({fieldName:t,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([r,i])=>({selected:r===t,label:i||r,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,r,n)}}))},resizable:!1}),new G({autoWidth:!1,collapsed:!0,flexGrow:0,label:``,resizable:!1,relationshipId:n,width:Q})]})}_getTableTemplateForShowAllTablesView(e,t){let n=[new W({fieldName:t,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([n,r])=>({selected:n===t,label:r||n,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,n)}}))},resizable:!1})];return e.attachmentsViewOptions.objectId!=null&&n.push(new I({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:``,resizable:!1,thumbnailsEnabled:!1,width:Q})),new K({columnTemplates:n})}async _onShowPromptCallback(e){let{column:t,objectId:n,oldValue:r,value:i}=e,{_subtypes:a,layer:o}=this;if(!o||!a.length){t.cancel();return}let s=a.find(e=>e.code===i);if(!s){t.cancel();return}let c=Promise.withResolvers(),l=this._createSubtypeEditPrompt(r,s,c),u=!!o.parent&&this.autoSaveEnabled;try{this.showPrompt(l);let e=await c.promise,r=[{fieldName:t.fieldName,value:i}];switch(e){case`update-fields`:for(let[e,t]of Object.entries(s.defaultValues))t!=null&&r.push({fieldName:e,value:t});await t.updateItems({objectId:n,updates:r}),u&&this.refresh();break;case`keep-existing`:await t.updateItems({objectId:n,updates:r}),u&&this.refresh();break;case`undo`:t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,r){let{_subtypes:i,messages:a,messagesCommon:o}=this,s=i.find(t=>t.code===e)?.name??`${e}`,c=`update-fields`,l=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}];return{context:`info`,title:a.subtypes.changeWarningTitle,message:n(a.subtypes.changeWarning,{originalType:s,newType:t.name}),radios:l,defaultRadioSelection:`update-fields`,onRadioSelection:e=>{c=e},actions:{primary:{label:o.apply,action:()=>r.resolve(c),type:`positive`},secondary:{label:o.cancel,type:`neutral`,action:()=>r.resolve(`undo`)}},cancel:()=>r.reject()}}_onShowAttachments({objectId:e}){this.hasPendingEdits||(this.attachmentsViewOptions.objectId=e)}_getTableTemplateForAttachmentsView(e){return new K({columnTemplates:[new W({fieldName:e,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,n])=>({selected:t===e,label:n||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new I({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:``,resizable:!1,thumbnailsEnabled:!1,width:Q})]})}_extractFieldColumnInfosFromTableTemplate(e){let{layer:t,tableTemplate:n}=e??this;return n?n.columnTemplates.filter(({type:e})=>e===`field`||e===`column`).map(({fieldName:e,label:n})=>{if(n!=null&&n!==``)return[e,n];let r=t?.fieldsIndex.get(e);return[e,r&&v(r,t)]}):t?.fields.map(e=>[e.name,v(e,t)])??[]}_getDefaultLayerDisplayField(e){let{displayField:t,objectIdField:n}=e;return t&&t.trim()!==``?t:n||(e.fields.length?e.fields[0].name:``)}_getIndexOfFirstFrozenToEndColumn(){let e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?c.getLogger(this).warnOnce(e):c.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){e!=null&&this.attachmentsViewOptions.objectId!=null&&this.highlightIds.add(e)}};e([g()],$.prototype,`_defaultHiddenFields`,null),e([g()],$.prototype,`_effectiveTableTemplate`,null),e([g()],$.prototype,`_effectiveAttributeTableTemplate`,null),e([g()],$.prototype,`_subtypes`,null),e([g()],$.prototype,`activeFilters`,null),e([g({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([g()],$.prototype,`allRelatedTablesVisible`,null),e([g()],$.prototype,`attachmentsColumns`,null),e([g()],$.prototype,`attachmentsEnabled`,null),e([g()],$.prototype,`attachmentsViewOptions`,void 0),e([g({type:w})],$.prototype,`attributeTableTemplate`,void 0),e([g()],$.prototype,`autoRefreshEnabled`,void 0),e([g()],$.prototype,`autoSaveEnabled`,null),e([g()],$.prototype,`cachedPageCount`,null),e([g()],$.prototype,`canAddRelatedFeature`,null),e([g()],$.prototype,`clearPrompt`,null),e([g({readOnly:!0})],$.prototype,`columns`,void 0),e([g()],$.prototype,`dataProvider`,void 0),e([g()],$.prototype,`defaultSelectionManager`,null),e([g()],$.prototype,`definitionExpression`,null),e([g()],$.prototype,`effectiveSelectionManager`,null),e([g()],$.prototype,`effectiveTimeExtent`,null),e([g()],$.prototype,`effectiveWhere`,null),e([g()],$.prototype,`fieldColumns`,null),e([g()],$.prototype,`filterByViewExtent`,null),e([g()],$.prototype,`filterByLayerScaleRange`,null),e([g({types:y})],$.prototype,`filterGeometry`,null),e([g()],$.prototype,`filterBySelectionEnabled`,null),e([g({readOnly:!0})],$.prototype,`grid`,void 0),e([g()],$.prototype,`hasContingentValues`,null),e([g()],$.prototype,`hasInvalidPendingEdits`,null),e([g()],$.prototype,`hasPendingEdits`,null),e([g()],$.prototype,`hiddenFields`,null),e([g()],$.prototype,`highlightEnabled`,null),e([g()],$.prototype,`initialSize`,null),e([g()],$.prototype,`isQueryingOrSyncing`,null),e([g()],$.prototype,`isSyncingAttachments`,null),e([g()],$.prototype,`layer`,null),e([g()],$.prototype,`layers`,void 0),e([g()],$.prototype,`layerFieldConfigurations`,null),e([g()],$.prototype,`layerView`,null),e([g()],$.prototype,`menuConfig`,void 0),e([g()],$.prototype,`messages`,void 0),e([g(),Z(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([g(),Z(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,void 0),e([g(),Z(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,void 0),e([g()],$.prototype,`outFields`,null),e([g()],$.prototype,`pendingEditsCount`,null),e([g()],$.prototype,`prompt`,void 0),e([g()],$.prototype,`relatedRecordsEnabled`,null),e([g()],$.prototype,`relatedTable`,null),e([g()],$.prototype,`relatedTableHasContingentValues`,null),e([g()],$.prototype,`relatedTables`,void 0),e([g()],$.prototype,`relationship`,null),e([g()],$.prototype,`relationshipColumnConfigs`,void 0),e([g()],$.prototype,`relationshipColumns`,null),e([g()],$.prototype,`relationshipConfig`,null),e([g()],$.prototype,`relationshipInfos`,null),e([g()],$.prototype,`relationships`,null),e([g()],$.prototype,`returnGeometryEnabled`,null),e([g()],$.prototype,`returnMEnabled`,null),e([g()],$.prototype,`returnZEnabled`,null),e([g()],$.prototype,`selectionManager`,null),e([g()],$.prototype,`selectionSource`,null),e([g()],$.prototype,`showAllRelatedTables`,null),e([g()],$.prototype,`showPrompt`,null),e([g()],$.prototype,`showRelatedTableCallback`,void 0),e([g({readOnly:!0,type:U})],$.prototype,`store`,void 0),e([g()],$.prototype,`supportsAttachments`,null),e([g()],$.prototype,`supportsAddAttachments`,null),e([g()],$.prototype,`supportsDeleteAttachments`,null),e([g()],$.prototype,`supportsResizeAttachments`,null),e([g()],$.prototype,`supportsUpdateAttachments`,null),e([g()],$.prototype,`syncTemplateOnChangesEnabled`,void 0),e([g()],$.prototype,`syncViewSelection`,null),e([g()],$.prototype,`tableController`,void 0),e([g()],$.prototype,`tableParent`,void 0),e([g({type:K})],$.prototype,`tableTemplate`,void 0),e([g()],$.prototype,`tableTemplateOverride`,void 0),e([g({type:E})],$.prototype,`timeExtent`,null),e([g()],$.prototype,`timeZone`,null),e([g()],$.prototype,`view`,null),e([g()],$.prototype,`viewTimeEnabled`,null),$=e([_(`esri.widgets.FeatureTable.FeatureTableViewModel`)],$);const oe=$;export{oe as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as n,fetchMessageBundle as r}from"../../intl.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Collection.js";import{referenceSetter as o}from"../../core/collectionUtils.js";import s from"../../core/Error.js";import c from"../../core/Logger.js";import{debounce as l,ignoreAbortErrors as u}from"../../core/promiseUtils.js";import{watch as d,initial as f,on as p,syncAndInitial as m}from"../../core/reactiveUtils.js";import{throttle as h}from"../../core/throttle.js";import{property as g,subclass as _}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as v}from"../../editing/fieldUtils.js";import{geometryTypes as y}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as b}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as x,isSubtypeGroupLayer as S}from"../../layers/support/layerUtils.js";import{createFieldInfos as C}from"../../support/popupUtils.js";import w from"../../tables/AttributeTableTemplate.js";import{syncAttributeTableTemplateWithColumns as T}from"../../tables/support/templateUtils.js";import E from"../../time/TimeExtent.js";import{isSelectableLayerWithObjectIds as D}from"../../views/support/selectionUtils.js";import O from"./ActionColumn.js";import k from"./AttachmentsColumn.js";import A from"./FieldColumn.js";import j from"./RelationshipColumn.js";import M from"./Grid/Column.js";import N from"./Grid/Grid.js";import P from"./Grid/GridViewModel.js";import F from"./Grid/GroupColumn.js";import I from"./support/AttachmentsColumnTemplate.js";import L from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as R,isFieldColumn as z,isRelationshipColumn as B}from"./support/columnUtils.js";import{downloadAttachmentInfo as V,exportToCSV as H}from"./support/exportUtils.js";import U from"./support/FeatureStore.js";import W from"./support/FieldColumnTemplate.js";import G from"./support/RelationshipColumnTemplate.js";import K from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as q,isIFeatureTableSupportedLayerWithRelationships as J,findRelatedLayerInSources as ee,findRelationship as te,uniqueColumnNames as Y,hasColumnForField as ne,findField as X,isIFeatureTableSupportedLayerWithAttachments as re,getRelationshipIdsToShow as ie}from"./support/tableUtils.js";import{goTo as ae}from"../support/goToUtils.js";import{messageBundle as Z}from"../support/widget.js";const Q=`80px`;let $=class extends P{constructor(e){super(e),this._refreshDebounced=l(()=>this._refresh()),this._syncTemplateThrottled=h(()=>this._syncAttributeTableTemplate()),this.attachmentsViewOptions=new L,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new a,this.dataProvider=async(e,t)=>{let{layer:n,store:r}=this;if(!t)return;if(!n||!r){t&&t([]);return}try{await n.load()}catch{return}let{objectIds:i}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||i.length===1&&i.items[0]===-1){t([]);return}if(r.state!==`loaded`&&r.state!==`loading`)try{await r.load()}catch{return}let a=this.paginationEnabled?this.pageIndex:e.page;try{let n=await r.queryPage({...e,pageIndex:a});t?.(n)}catch{return}},this.grid=null,this.layers=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new a,this.relationshipColumnConfigs=null,this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set(`store`,new U),this._set(`grid`,new N({viewModel:this}))}initialize(){let e=async()=>{this.messages=await r(`esri/widgets/FeatureTable/t9n/FeatureTable`),this.messagesCommon=await r(`esri/t9n/common`),this.messagesUnits=await r(`esri/core/t9n/Units`),this.messagesURIUtils=await r(`esri/widgets/support/t9n/uriUtils`)};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),d(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{let e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},f),d(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),d(()=>this.layer,async(e,t)=>{let n=this.grid;n&&(n.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad().catch(()=>{}):e.load().catch(()=>{})),this.syncViewSelection&&this._syncSelection(),t&&this.attachmentsViewOptions.objectId!=null&&(this.attachmentsViewOptions.objectId=null)}),d(()=>this.layer?.loaded,e=>{e&&this._onLayerLoad().catch(()=>{})}),d(()=>this.store.state,e=>{e===`loaded`&&(this.scrollToTop(),this.refreshCellContent())}),d(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),d(()=>this.editingEnabled,()=>this.refreshCellContent()),d(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),d(()=>this.effectiveWhere,()=>{this.store.state===`loaded`&&this.reset().catch(()=>{})}),d(()=>this.effectiveTimeExtent,()=>void this.refresh()),p(()=>this.layer,`refresh`,e=>this._onLayerRefresh(e)),p(()=>this.grid,[`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`],({index:e,item:t,native:n,path:r,type:i})=>{let a=t?.feature,o=a?.getObjectId(),s=i===`cell-keydown`&&n&&n instanceof KeyboardEvent&&n.key===`Enter`;this.emit(i,{feature:a,index:e,native:n,type:i,fieldName:r??void 0,objectId:o}),(s||i===`cell-click`)&&this._onCellInteraction(o)}),d(()=>this.actionColumnConfig,e=>{let{actionColumn:t,columns:n}=this;t?e?t.set(e):n.remove(t):e&&n.length&&n.add(this._generateActionColumn(),e.frozenToEnd===!1?this._getIndexOfFirstFrozenToEndColumn():void 0)}),d(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),p(()=>this.objectIds,`change`,()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),d(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),d(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),d(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),d(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),d(()=>this.state,e=>{e===`disabled`&&this.relatedTables.length&&this.drainRelatedTables()}),p(()=>this.tableParent?.highlightIds,`change`,({added:e})=>{let{relationshipConfig:t}=this,n=e[0];if(n==null||!t)return;let{relatedLayer:r,relationshipId:i}=t;this.relationshipConfig={objectId:n,relatedLayer:r,relationshipId:i}}),p(()=>this.tableParent,`cell-click`,async e=>{let{objectId:t}=e;this.tableController&&this.hasPendingEdits?await this.tableController.discardPendingEdits(void 0,!0).then(e=>e&&this._syncTableParentSelection(t)):this._syncTableParentSelection(t)}),d(()=>this.attachmentsViewOptions.objectId,(e,t)=>{if(e==null){this.hideAttachmentsView();return}t??this.showAttachmentsView({objectId:e})}),d(()=>[this.layerFieldConfigurations,this.pendingEditsCount],()=>this.refreshCellContent()),p(()=>this.highlightIds,`change`,e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this.defaultSelectionManager.clear()}),d(()=>this.effectiveSelectionManager,()=>this._syncSelection(),m),p(()=>this.effectiveSelectionManager,`selection-change`,()=>this._syncSelection(),m)])}destroy(){this._drainColumns(),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return b(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _subtypes(){return x(this.layer)}get actionColumn(){return super.actionColumn}get activeFilters(){let{filterGeometry:e,objectIds:t,filterBySelectionEnabled:n,highlightIds:r}=this,i=new a;return e&&i.push({type:`geometry`,geometry:e}),n?i.push({type:`selection`,objectIds:r.toArray()}):t.length&&i.push({type:`objectId`,objectIds:t.toArray()}),i}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>R(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get autoSaveEnabled(){return this.store.autoSaveEnabled}set autoSaveEnabled(e){this.store.autoSaveEnabled=e}get cachedPageCount(){return this.store.cachedPageCount}get canAddRelatedFeature(){return this.store.canAddRelatedFeature}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}get defaultSelectionManager(){return this.store.defaultSelectionManager}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSelectionManager(){return this.store.effectiveSelectionManager}get effectiveMultipleSelectionEnabled(){return super.effectiveMultipleSelectionEnabled}get effectiveSize(){return super.effectiveSize}get effectiveTimeExtent(){return this.store.effectiveTimeExtent}get effectiveWhere(){return this.store.effectiveWhere}get fieldColumns(){return this.allColumns.filter(e=>z(e))}get filterByViewExtent(){return this.store.filterByViewExtent}set filterByViewExtent(e){this.store.filterByViewExtent=e}get filterByLayerScaleRange(){return this.store.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.store.filterByLayerScaleRange=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get(`filterBySelectionEnabled`)}set filterBySelectionEnabled(e){let{objectIds:t}=this,n=t.length;e?(n&&(t.removeAll(),this._logWarning(`Selection filter has been applied with an objectID filter. Object ID filter has been removed.`)),this.filterGeometry&&this._logWarning(`Selection filter has been applied with a geometry filter. Results may appear inconsistent`),this._syncObjectIdsWithStore(this.highlightIds.toArray())):n||this._syncObjectIdsWithStore(null),this._set(`filterBySelectionEnabled`,e)}get groupColumns(){return super.groupColumns}get hasContingentValues(){return this.relatedTableHasContingentValues||this.store.hasContingentValues}get hasInvalidPendingEdits(){return this.relatedTableHasInvalidPendingEdits||this.store.hasInvalidPendingEdits}get hasPendingEdits(){return this.relatedTableHasPendingEdits||this.store.hasPendingEdits}get hiddenFields(){return this._get(`hiddenFields`)??new a}set hiddenFields(e){this._set(`hiddenFields`,o(e,this._get(`hiddenFields`),a))}get highlightEnabled(){return this.store.highlightEnabled}set highlightEnabled(e){this.store.highlightEnabled=e}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get(`layer`)}set layer(e){this.drainRelatedTables(),this._set(`layer`,e)}get layerFieldConfigurations(){let e=this.layer;return q(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get maxSize(){return super.maxSize}set maxSize(e){super.maxSize=e}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get paginationEnabled(){return super.paginationEnabled}set paginationEnabled(e){super.paginationEnabled=e}get pendingEditsCount(){return this.store.pendingEditsCount}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relatedTableHasContingentValues(){return!!this.relatedTable?.hasContingentValues}get relatedTableHasInvalidPendingEdits(){return!!this.relatedTable?.hasInvalidPendingEdits}get relatedTableHasPendingEdits(){return!!this.relatedTable?.hasPendingEdits}get relationship(){return this.store.relationship}get relationshipColumns(){return this.allColumns.filter(e=>B(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){let{layer:e,layers:t,relationships:n,tableController:r}=this,i=this.store.relationshipInfos;if(i.length||!J(e)||!n?.length)return i;let a=[],o=r?.layers||t||[];return n.forEach(t=>{let n=ee(e,o,t);n&&(n.load().catch(()=>{}),a.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),a}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get selectionManager(){return this.store.selectionManager}set selectionManager(e){this.store.selectionManager=e}get selectionSource(){return`table`}set selectionSource(e){this.syncViewSelection=e===`view`,this._overrideIfSome(`selectionSource`,e)}get showAllRelatedTables(){return this._get(`showAllRelatedTables`)}set showAllRelatedTables(e){let{relatedTable:t}=this;this._set(`showAllRelatedTables`,e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){let{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){let{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get syncViewSelection(){return this.store.syncViewSelection}set syncViewSelection(e){this.store.syncViewSelection=e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get viewTimeEnabled(){return this.store.viewTimeEnabled}set viewTimeEnabled(e){this.store.viewTimeEnabled=e}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){let{attachmentsViewOptions:n,store:r}=this,i=n.objectId===e;await r.addAttachment(e,t).catch(e=>{i&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),n.error=e.error)}),i&&!n.error&&(n.onEditComplete(),n.attachmentInfos=await r.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}addPendingEdits(e){this.store.addPendingEdits(e)}collapseRelatedTable(e,t){let{relatedLayer:n,objectId:r,relationshipId:i}=t,{objectIdField:o}=n,s=te(n,i),c=n.displayField||s?.keyField||o;e.set({highlightIds:new a([r]),multipleSelectionEnabledOverride:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,c,i)});let l=e.hiddenFields;l.includes(Y.action)||l.add(Y.action),l.includes(Y.attachments)||l.add(Y.attachments),e.scrollLeft()}async deleteAttachments(e,t){let{attachmentsViewOptions:n,store:r}=this,i=n.objectId===e;await r.deleteAttachments(e,t).catch(e=>{i&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),n.error=e.error)}),i&&!n.error&&(n.onEditComplete(),n.attachmentInfos=await r.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteSelection(){let e=this.highlightIds.toArray();if(!e?.length)return;let{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),n=t.filter(e=>!e.error).map(e=>e.objectId);n.length&&(this.highlightIds.removeMany(n),await this.refresh())}async discardPendingEdits(e){return this.relatedTable&&this.relatedTableHasPendingEdits?this.relatedTable.discardPendingEdits(e):(this.store.discardPendingEdits(e),!0)}async downloadAttachmentById(e,t){let n=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await V(n)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabledOverride:null,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([Y.action,Y.attachments])}drainRelatedTablesAboveIndex(e){let{relatedTables:t}=this,n=t.slice(e+1);t.removeMany(n).forEach(e=>e.destroy());let r=t.at(-1);r&&(r.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(r):this._hideAllRelatedTables(r))}async exportSelectionToCSV(e){let{highlightIds:t,layer:n,outFields:r}=this;if(!n||!t.length){this._logWarning(`Export failed.`);return}await H({layer:n,objectIds:t.toArray(),outFields:r,includeGeometry:e})}getCachedFeaturesByPageIndex(e){return this.store.getCachedFeaturesByPageIndex(e)}getFeatureStoreItemByObjectId(e){return this.store.getItemByObjectId(e)}async getFeatureTitle(e,t){return this.store.getFeatureTitle(e,t)}getFeatureTitleSync(e){let t=this.layer;if(!t)return`${e}`;let n=`${t.objectIdField}: ${e}`;return e==null?n:this.store.featureTitleMap.get(e)??n}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){return this.getFeatureStoreItemByObjectId(e)?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(e==null||!Number.isInteger(e)){this._logWarning(`Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.`);return}let{pageCount:t}=this;(e>=t||e===-1)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabledOverride:null,tableTemplateOverride:null}),this.hiddenFields.remove(Y.action)}nextPage(){let e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){let e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),u(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await this.grid?.reset()}async savePendingEdits(){if(this.relatedTableHasPendingEdits&&!this.relatedTableHasInvalidPendingEdits){await this.relatedTable?.savePendingEdits();return}this.hasPendingEdits&&!this.relatedTable&&(await this.store.savePendingEdits(),await this.refresh())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){let t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning(`Row not found. Associated data may not be loaded yet.`)}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){let{attachmentId:e,form:t,objectId:n}=this.attachmentsViewOptions;n!=null&&t&&(e==null?await this.addAttachment(n,t):await this.updateAttachment(n,e,t))}async showAttachmentsView({objectId:e}){let{attachmentsViewOptions:t,hiddenFields:n,layer:r}=this;if(!this.attachmentsEnabled||!r){this._logWarning(`The 'attachmentsEnabled' property is currently false.`);return}await r.load();let i=this._getDefaultLayerDisplayField(r),o=await this.store.getAttachmentsByObjectId(e,!0),s=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:o,mode:o.length?`list`:`file`,objectId:e}),this.set({highlightIds:new a([e]),multipleSelectionEnabledOverride:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)}),n.includes(Y.action)||n.add(Y.action),s!=null&&this.scrollToIndex(s)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}syncSelectionSources(){this.store.syncSelectionSources()}async updateAttachment(e,t,n){let{attachmentsViewOptions:r,store:i}=this,a=r.objectId===e;await i.updateAttachment(e,t,n).catch(e=>{a&&e&&typeof e==`object`&&`error`in e&&e.error instanceof s&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),r.error=e.error)}),a&&!r.error&&(r.onEditComplete(),r.attachmentInfos=await i.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){let{layer:e,view:t}=this,n=this.highlightIds.toArray();if(!e||!t||!n.length)return;let r=e.createQuery();r.objectIds=n,r.returnGeometry=!0;let i=await e.queryFeatures(r);try{await ae(t,i.features)}catch(e){e.name!==`AbortError`&&console.error(e)}}_syncAttributeTableTemplate(e=!1){let{_effectiveAttributeTableTemplate:t,layer:n,tableTemplateOverride:r,syncTemplateOnChangesEnabled:i}=this;if(!n||!t||!i&&!e||r||this.tableParent||this.relatedTable||this.attachmentsViewOptions.objectId!==null)return;let a=JSON.stringify(t.toJSON());T(t,this.columns.toArray(),this.activeSortOrders),t===n.attributeTableTemplate&&JSON.stringify(t.toJSON())!==a&&(n.attributeTableTemplate=t.clone())}async _refresh(){await super.refresh();let e=this.highlightIds.toArray();e.length&&(await this.store.verifyFeaturesByObjectId(e)).forEach((t,n)=>{t||this.highlightIds.remove(e[n])}),this.refreshPageCache();let t=this.attachmentsViewOptions;t?.objectId!=null&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){let{layer:e,pageSize:t}=this;if(!e)return;e.parent&&S(e.parent)&&await e.parent.loadAll();let n=e.capabilities.query?.maxRecordCount,r=n&&n<t,i=r?n:t;r&&(this._logWarning(`The value for 'pageSize' has been adjusted due to the provided layer's max record count.`),this.pageSize=i),this.grid?.set(`pageSize`,i),this.store.load().catch(()=>{}),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();let{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t,layer:n}=this,r=e?.columnTemplates;if(!n)return;let i=this._generateColumnsFromColumnTemplates(n,r)??this._generateColumnsFromAttributeTableTemplate(n,t)??this._generateDefaultFieldColumns(n);i.length&&(this.attachmentsEnabled&&!i.some(e=>R(e))&&i.push(this._generateDefaultAttachmentsColumn(n)),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!i.some(e=>B(e))&&i.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&i.push(this._generateActionColumn()),i.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(i))}_generateColumnsFromAttributeTableTemplate(e,t){if(!t)return null;let{elements:n,orderByFields:r}=t,a=C(e),o=[];o.push(...this._generateColumnsFromAttributeTableElements(e,n,r));let s=a.map(t=>{if(!t.fieldName||ne(t.fieldName,o))return null;let{fieldName:n}=t,i=X(e,n);return i?this._generateDefaultFieldColumn(e,i,{hidden:!0,orderByFields:r}):(this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`),null)}).filter(i);return o.push(...s),this.attachmentsEnabled&&re(e)&&!o.some(e=>R(e))&&o.push(this._generateDefaultAttachmentsColumn(e,{hidden:!0})),this.relatedRecordsEnabled&&J(e)&&e.relationships?.forEach(({id:e},t)=>{let n=this.relationshipInfos.find(t=>t.relationshipId===e);n&&!o.some(t=>B(t)&&t.relationshipId===e)&&o.push(this._generateDefaultRelationshipColumn({hidden:!0,info:n,index:t}))}),o.length?o:null}_generateColumnsFromAttributeTableElements(e,t,n){return t?.map((t,r)=>{switch(t.type){case`field`:return this._createFieldColumnFromElement({layer:e,element:t,orderByFields:n});case`group`:return this._createGroupColumnFromElement({layer:e,element:t,orderByFields:n});case`attachment`:return this._createAttachmentColumnFromElement({layer:e,element:t,index:r});case`relationship`:return this._createRelationshipColumnFromElement({element:t,index:r})}}).filter(e=>!!e)??[]}_createFieldColumnFromElement(e){let{layer:t,element:n,orderByFields:r}=e,{fieldName:i}=n;if(i==null)return this._logTemplateWarning(`A valid 'fieldName' must be provided.`),null;let a=X(t,i);if(!a)return this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`),null;let{description:o,label:s}=n,c=r?.findIndex(({field:e})=>e&&e===i)??-1,l=c>-1?r?.at(c)?.order:void 0,u=c>-1?c:void 0,{grid:d,messages:f,messagesCommon:p,messagesURIUtils:m,store:h,view:g}=this;return new A({description:o,direction:l,field:a,fieldName:i,grid:d,initialSortPriority:u,label:s,layer:t,messages:f,messagesCommon:p,messagesURIUtils:m,store:h,view:g,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){let{layer:t,element:n,orderByFields:r}=e,{description:i,label:a}=n;if(!a)return this._logTemplateWarning(`Group columns require a label.`),null;if(!n.elements.length)return this._logTemplateWarning(`Group columns require child columns.`),null;let{grid:o,messages:s,messagesCommon:c,messagesURIUtils:l,store:u}=this;return new F({columns:this._generateColumnsFromAttributeTableElements(t,n.elements,r),description:i,grid:o,label:a,messages:s,messagesCommon:c,messagesURIUtils:l,store:u})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled){this._logTemplateWarning(`The 'attachmentsEnabled' property is currently false.`);return}let{layer:t,element:n,index:r}=e,{description:i,label:a}=n,{grid:o,messages:s,messagesCommon:c,messagesURIUtils:l,store:u}=this;return new k({description:i,fieldName:`${Y.attachments}-${r}`,grid:o,label:a,layer:t,messages:s,messagesCommon:c,messagesURIUtils:l,store:u,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled){this._logTemplateWarning(`Relationship columns require related records to be enabled on the table.`);return}let{element:t,index:n}=e,{description:r,label:i,relationshipId:a}=t,o=this.relationshipInfos.find(e=>e.relationshipId===a);if(!o)return this._logTemplateWarning(`Unable to find valid related layer target based on the provided relationship id.`),null;let{grid:s,messages:c,messagesCommon:l,messagesURIUtils:u,store:d}=this;return new j({description:r,fieldName:`${Y.relationship}-${a}-${n}`,grid:s,label:i,messages:c,messagesCommon:l,messagesURIUtils:u,relationshipId:a,store:d,layer:o.relatedLayer,relatedLayer:o.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e,t){let{grid:n,messages:r,messagesCommon:i,messagesURIUtils:a,store:o,view:s}=this;if(!t?.length)return null;let c=[];return t.forEach((t,l)=>{let{autoWidth:u,description:d,direction:f,flexGrow:p,fieldName:m,formatFunction:h,frozen:g,frozenToEnd:_,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,menuConfig:w,resizable:T,sortable:E,textAlign:D,textWrap:O,timeZone:k,type:j,width:N}=t;if(!j){this._logTemplateWarning(`Property 'type' is missing from the provided template.`);return}if(g&&_){this._logTemplateWarning(`Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.`);return}let P=t.visible===!1;if(j===`group`){if(!t.columnTemplates?.length){this._logTemplateWarning(`Group columns must contain column templates.`);return}if(!t.label){this._logTemplateWarning(`Group columns require a label.`);return}let o=this._generateColumnsFromColumnTemplates(e,t.columnTemplates),s=P||this._isFieldHidden(t.label);c.push(new F({autoWidth:u,columns:o,description:d,flexGrow:p,frozen:g,frozenToEnd:_,grid:n,hidden:s,icon:v,iconText:y,invalid:x,label:S,labelTooltipText:C,menuConfig:w,messages:r,messagesCommon:i,messagesURIUtils:a,resizable:T,textAlign:D,textWrap:O,timeZone:k,width:N}))}else if(j===`attachment`){if(!this.attachmentsEnabled){this._logTemplateWarning(`Attachment columns require attachments to be enabled on the table.`);return}c.push(this._generateAttachmentsColumnFromTemplate(e,t,l))}else if(j===`relationship`){if(!this.relatedRecordsEnabled){this._logTemplateWarning(`Relationship columns require related records to be enabled on the table.`);return}let{relationshipId:e}=t;if(e==null){this._logTemplateWarning(`Property 'relationshipId' is missing from the provided template.`);return}let n=this.relationshipInfos.find(t=>t.relationshipId===e);if(!n){this._logTemplateWarning(`Unable to find valid related layer target based on the provided relationship id.`);return}c.push(this._generateRelationshipColumnFromTemplate(n,t,l))}else if(!m){this._logTemplateWarning(`Value for 'fieldName' property was missing from the provided template.`);return}let I=P||this._isFieldHidden(m);if(j===`column`)c.push(new M({autoWidth:u,description:d,direction:f,fieldName:m,flexGrow:p,formatFunction:h,frozen:g,frozenToEnd:_,grid:n,hidden:I,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,menuConfig:w,messages:r,messagesCommon:i,messagesURIUtils:a,resizable:T,sortable:E,store:o,textAlign:D,textWrap:O,timeZone:k,width:N}));else if(j===`field`){let l=X(e,t.fieldName);if(!l){this._logTemplateWarning(`A valid 'field' could not be found for the provided template.`);return}let{editable:m,required:j}=t;c.push(new A({autoWidth:u,description:d,direction:f,editable:m,field:l,fieldName:l.name,flexGrow:p,formatFunction:h,frozen:g,frozenToEnd:_,grid:n,hidden:I,icon:v,iconText:y,initialSortPriority:b,invalid:x,label:S,labelTooltipText:C,layer:e,messages:r,messagesCommon:i,messagesURIUtils:a,menuConfig:w,required:j,resizable:T,sortable:E,store:o,template:t,textAlign:D,textWrap:O,timeZone:k,width:N,view:s,onShowPromptCallback:this._onShowPromptCallback}))}}),c.length?c:null}_generateDefaultFieldColumns(e){return e.fields?.map(t=>this._generateDefaultFieldColumn(e,t)).filter(i)??[]}_generateDefaultFieldColumn(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s,view:c}=this;if(!t.visible||t.type===`geometry`)return null;let l=n?.orderByFields,u=t.name,d=l?.findIndex(({field:e})=>e&&e===u)??-1,f=d>-1?l?.at(d)?.order:void 0,p=d>-1?d:void 0;return new A({direction:f,field:t,fieldName:u,grid:r,hidden:n?.hidden||this._isFieldHidden(u),initialSortPriority:p,layer:e,messages:i,messagesCommon:a,messagesURIUtils:o,store:s,view:c,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s}=this,{attachmentsViewEnabled:c,autoWidth:l,description:u,flexGrow:d,fieldName:f,formatFunction:p,frozen:m,frozenToEnd:h,icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,resizable:S,textAlign:C,textWrap:w,thumbnailAppearance:T,thumbnailCount:E,thumbnailIconScale:D,thumbnailsEnabled:O,timeZone:A,width:j}=t;return new k({attachmentsViewEnabled:c,autoWidth:l,description:u,fieldName:`${Y.attachments}-${n}`,flexGrow:d,formatFunction:p,frozen:m,frozenToEnd:h,grid:r,hidden:t.visible===!1||this._isFieldHidden(y)||this._isFieldHidden(f),icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,layer:e,menuConfig:x,messages:i,messagesCommon:a,messagesURIUtils:o,resizable:S,store:s,textAlign:C,textWrap:w,thumbnailAppearance:T,thumbnailCount:E,thumbnailIconScale:D,thumbnailsEnabled:O,timeZone:A,width:j,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e,t){let{grid:n,messages:r,messagesCommon:i,messagesURIUtils:a,store:o}=this,s=Y.attachments;return new k({fieldName:s,grid:n,hidden:t?.hidden||this._isFieldHidden(s),layer:e,messages:r,messagesCommon:i,messagesURIUtils:a,store:o,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,n){let{grid:r,messages:i,messagesCommon:a,messagesURIUtils:o,store:s}=this,{autoWidth:c,collapsed:l,description:u,flexGrow:d,fieldName:f,formatFunction:p,frozen:m,frozenToEnd:h,icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,relationshipId:S,resizable:C,textAlign:w,textWrap:T,timeZone:E,width:D}=t;return new j({autoWidth:c,collapsed:l,description:u,fieldName:`${Y.relationship}-${S}-${n}`,flexGrow:d,formatFunction:p,frozen:m,frozenToEnd:h,grid:r,hidden:t.visible===!1||this._isFieldHidden(y)||this._isFieldHidden(f),icon:g,iconText:_,invalid:v,label:y,labelTooltipText:b,menuConfig:x,messages:i,messagesCommon:a,messagesURIUtils:o,relationshipId:S,resizable:C,store:s,textAlign:w,textWrap:T,timeZone:E,width:D,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){let{relationshipInfos:e,relationshipColumnConfigs:t}=this,n=[];return e?.length&&(t?t.forEach((t,r)=>{let{relationshipId:i}=t,a=e.find(e=>e.relationshipId===i);a&&n.push(this._generateDefaultRelationshipColumn({config:t,index:r,info:a}))}):e.forEach((e,t)=>n.push(this._generateDefaultRelationshipColumn({index:t,info:e})))),n}_generateDefaultRelationshipColumn(e){let{config:t,hidden:n,index:r,info:i}=e,{grid:a,messages:o,messagesCommon:s,messagesURIUtils:c,store:l}=this,{relationshipId:u}=i;return new j({...t,fieldName:`${Y.relationship}-${u}-${r}`,grid:a,hidden:!!n,messages:o,messagesCommon:s,messagesURIUtils:c,layer:i.relatedLayer,relatedLayer:i.layer,relationshipId:u,store:l,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){let e=this.actionColumnConfig,t=e?.frozen===!0?!1:e?.frozenToEnd??!0;return new O({hidden:this._isFieldHidden(Y.action),store:this.store,...e,frozenToEnd:t})}_isFieldHidden(e){let t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_syncSelection(){let{layer:e}=this;D(e)?this.highlightIds.items=this.effectiveSelectionManager.getSelection(e)??[]:this.highlightIds.removeAll()}_addToSelection(e){let t=this.layer;D(t)&&this.effectiveSelectionManager.add(t,e)}_removeFromSelection(e){let t=this.layer;D(t)&&this.effectiveSelectionManager.remove(t,e)}async _onHighlightIdsChange(e){let{added:t,removed:n}=e,{attachmentsViewOptions:r}=this;if(this._removeFromSelection(n),this._addToSelection(t),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),r.objectId!=null){let e=this.highlightIds.at(0);if(e!=null){let t=await this.store.getAttachmentsByObjectId(e,!0);r.set({attachmentInfos:t,objectId:e,mode:t.length?`list`:`file`}),this.getFeatureTitle(e)}}}_syncTableParentSelection(e){let{tableParent:t}=this;t&&e!=null&&t.highlightIds.add(e)}_onShowRelatedTable(e){let{highlightIds:t}=this,{objectId:n}=e;if(t.removeAll(),t.add(n),this.showRelatedTableCallback){this.showRelatedTableCallback(e);return}this.emit(`show-related-table`,e)}_onObjectIdsChange(){let e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning(`Object ID filter was applied while a selection filter was applied. Selection filter has been removed.`)),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){let t=e.layer;if(!t)return;let n=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,n)});let r=e.hiddenFields;r.includes(Y.action)||r.add(Y.action),r.includes(Y.attachments)||r.add(Y.attachments)}_hideAllRelatedTables(e){let{layer:t,relationship:n}=e;if(t&&n?.id!=null){if(e.attachmentsViewOptions.objectId!=null){let n=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabledOverride:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(n)})}else e.set({multipleSelectionEnabledOverride:null,relationshipColumnConfigs:ie(t,n.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([Y.action,Y.attachments])}}_getTableTemplateForRelatedTableView(e,t,n){return new K({columnTemplates:[new W({fieldName:t,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([r,i])=>({selected:r===t,label:i||r,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,r,n)}}))},resizable:!1}),new G({autoWidth:!1,collapsed:!0,flexGrow:0,label:``,resizable:!1,relationshipId:n,width:Q})]})}_getTableTemplateForShowAllTablesView(e,t){let n=[new W({fieldName:t,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([n,r])=>({selected:n===t,label:r||n,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,n)}}))},resizable:!1})];return e.attachmentsViewOptions.objectId!=null&&n.push(new I({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:``,resizable:!1,thumbnailsEnabled:!1,width:Q})),new K({columnTemplates:n})}async _onShowPromptCallback(e){let{column:t,objectId:n,oldValue:r,value:i}=e,{_subtypes:a,layer:o}=this;if(!o||!a.length){t.cancel();return}let s=a.find(e=>e.code===i);if(!s){t.cancel();return}let c=Promise.withResolvers(),l=this._createSubtypeEditPrompt(r,s,c),u=!!o.parent&&this.autoSaveEnabled;try{this.showPrompt(l);let e=await c.promise,r=[{fieldName:t.fieldName,value:i}];switch(e){case`update-fields`:for(let[e,t]of Object.entries(s.defaultValues))t!=null&&r.push({fieldName:e,value:t});await t.updateItems({objectId:n,updates:r}),u&&this.refresh();break;case`keep-existing`:await t.updateItems({objectId:n,updates:r}),u&&this.refresh();break;case`undo`:t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,r){let{_subtypes:i,messages:a,messagesCommon:o}=this,s=i.find(t=>t.code===e)?.name??`${e}`,c=`update-fields`,l=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}];return{context:`info`,title:a.subtypes.changeWarningTitle,message:n(a.subtypes.changeWarning,{originalType:s,newType:t.name}),radios:l,defaultRadioSelection:`update-fields`,onRadioSelection:e=>{c=e},actions:{primary:{label:o.apply,action:()=>r.resolve(c),type:`positive`},secondary:{label:o.cancel,type:`neutral`,action:()=>r.resolve(`undo`)}},cancel:()=>r.reject()}}_onShowAttachments({objectId:e}){this.hasPendingEdits||(this.attachmentsViewOptions.objectId=e)}_getTableTemplateForAttachmentsView(e){return new K({columnTemplates:[new W({fieldName:e,editable:!1,menuConfig:{selectionMode:`single`,icon:`chevron-down`,items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,n])=>({selected:t===e,label:n||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new I({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:``,resizable:!1,thumbnailsEnabled:!1,width:Q})]})}_extractFieldColumnInfosFromTableTemplate(e){let{layer:t,tableTemplate:n}=e??this;return n?n.columnTemplates.filter(({type:e})=>e===`field`||e===`column`).map(({fieldName:e,label:n})=>{if(n!=null&&n!==``)return[e,n];let r=t?.fieldsIndex.get(e);return[e,r&&v(r,t)]}):t?.fields.map(e=>[e.name,v(e,t)])??[]}_getDefaultLayerDisplayField(e){let{displayField:t,objectIdField:n}=e;return t&&t.trim()!==``?t:n||(e.fields.length?e.fields[0].name:``)}_getIndexOfFirstFrozenToEndColumn(){let e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?c.getLogger(this).warnOnce(e):c.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){e!=null&&this.attachmentsViewOptions.objectId!=null&&this.highlightIds.add(e)}};e([g()],$.prototype,`_defaultHiddenFields`,null),e([g()],$.prototype,`_effectiveTableTemplate`,null),e([g()],$.prototype,`_effectiveAttributeTableTemplate`,null),e([g()],$.prototype,`_subtypes`,null),e([g()],$.prototype,`activeFilters`,null),e([g({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([g()],$.prototype,`allRelatedTablesVisible`,null),e([g()],$.prototype,`attachmentsColumns`,null),e([g()],$.prototype,`attachmentsEnabled`,null),e([g()],$.prototype,`attachmentsViewOptions`,void 0),e([g({type:w})],$.prototype,`attributeTableTemplate`,void 0),e([g()],$.prototype,`autoRefreshEnabled`,void 0),e([g()],$.prototype,`autoSaveEnabled`,null),e([g()],$.prototype,`cachedPageCount`,null),e([g()],$.prototype,`canAddRelatedFeature`,null),e([g()],$.prototype,`clearPrompt`,null),e([g({readOnly:!0})],$.prototype,`columns`,void 0),e([g()],$.prototype,`dataProvider`,void 0),e([g()],$.prototype,`defaultSelectionManager`,null),e([g()],$.prototype,`definitionExpression`,null),e([g()],$.prototype,`effectiveSelectionManager`,null),e([g()],$.prototype,`effectiveTimeExtent`,null),e([g()],$.prototype,`effectiveWhere`,null),e([g()],$.prototype,`fieldColumns`,null),e([g()],$.prototype,`filterByViewExtent`,null),e([g()],$.prototype,`filterByLayerScaleRange`,null),e([g({types:y})],$.prototype,`filterGeometry`,null),e([g()],$.prototype,`filterBySelectionEnabled`,null),e([g({readOnly:!0})],$.prototype,`grid`,void 0),e([g()],$.prototype,`hasContingentValues`,null),e([g()],$.prototype,`hasInvalidPendingEdits`,null),e([g()],$.prototype,`hasPendingEdits`,null),e([g()],$.prototype,`hiddenFields`,null),e([g()],$.prototype,`highlightEnabled`,null),e([g()],$.prototype,`initialSize`,null),e([g()],$.prototype,`isQueryingOrSyncing`,null),e([g()],$.prototype,`isSyncingAttachments`,null),e([g()],$.prototype,`layer`,null),e([g()],$.prototype,`layers`,void 0),e([g()],$.prototype,`layerFieldConfigurations`,null),e([g()],$.prototype,`layerView`,null),e([g()],$.prototype,`menuConfig`,void 0),e([g()],$.prototype,`messages`,void 0),e([g(),Z(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([g(),Z(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,void 0),e([g(),Z(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,void 0),e([g()],$.prototype,`outFields`,null),e([g()],$.prototype,`pendingEditsCount`,null),e([g()],$.prototype,`prompt`,void 0),e([g()],$.prototype,`relatedRecordsEnabled`,null),e([g()],$.prototype,`relatedTable`,null),e([g()],$.prototype,`relatedTableHasContingentValues`,null),e([g()],$.prototype,`relatedTables`,void 0),e([g()],$.prototype,`relationship`,null),e([g()],$.prototype,`relationshipColumnConfigs`,void 0),e([g()],$.prototype,`relationshipColumns`,null),e([g()],$.prototype,`relationshipConfig`,null),e([g()],$.prototype,`relationshipInfos`,null),e([g()],$.prototype,`relationships`,null),e([g()],$.prototype,`returnGeometryEnabled`,null),e([g()],$.prototype,`returnMEnabled`,null),e([g()],$.prototype,`returnZEnabled`,null),e([g()],$.prototype,`selectionManager`,null),e([g()],$.prototype,`selectionSource`,null),e([g()],$.prototype,`showAllRelatedTables`,null),e([g()],$.prototype,`showPrompt`,null),e([g()],$.prototype,`showRelatedTableCallback`,void 0),e([g({readOnly:!0,type:U})],$.prototype,`store`,void 0),e([g()],$.prototype,`supportsAttachments`,null),e([g()],$.prototype,`supportsAddAttachments`,null),e([g()],$.prototype,`supportsDeleteAttachments`,null),e([g()],$.prototype,`supportsResizeAttachments`,null),e([g()],$.prototype,`supportsUpdateAttachments`,null),e([g()],$.prototype,`syncTemplateOnChangesEnabled`,void 0),e([g()],$.prototype,`syncViewSelection`,null),e([g()],$.prototype,`tableController`,void 0),e([g()],$.prototype,`tableParent`,void 0),e([g({type:K})],$.prototype,`tableTemplate`,void 0),e([g()],$.prototype,`tableTemplateOverride`,void 0),e([g({type:E})],$.prototype,`timeExtent`,null),e([g()],$.prototype,`timeZone`,null),e([g()],$.prototype,`view`,null),e([g()],$.prototype,`viewTimeEnabled`,null),$=e([_(`esri.widgets.FeatureTable.FeatureTableViewModel`)],$);const oe=$;export{oe as default};
|
|
@@ -110,7 +110,7 @@ export default class FeatureStore extends Accessor {
|
|
|
110
110
|
*
|
|
111
111
|
* @internal
|
|
112
112
|
*/
|
|
113
|
-
get effectiveTimeExtent(): TimeExtent |
|
|
113
|
+
get effectiveTimeExtent(): TimeExtent | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* The 'effective' where clause used by data queries.
|
|
116
116
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{equals as r,isSome as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import s from"../../../core/Error.js";import{clone as c}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as u}from"../../../core/MapUtils.js";import{removeMaybe as d,abortMaybe as f}from"../../../core/maybe.js";import{debounce as p,ignoreAbortErrors as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import g from"../../../core/ReactiveMap.js";import{watch as _,when as v,syncAndInitial as y,sync as b}from"../../../core/reactiveUtils.js";import{property as x,subclass as S}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as C}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as w,isSubtypeGroupLayer as T,isSubtypeSublayer as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as D}from"../../../layers/support/timeSupport.js";import O from"../../../rest/support/AttachmentQuery.js";import k from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as M}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as N}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as P,isSelectableLayer as F}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as I,isIFeatureTableSupportedLayerWithAttachmentsEditing as L,isIFeatureTableSupportedLayerWithEditing as R,isIFeatureTableSupportedLayerWithRelationships as z,isPageIndexValid as B,findRelatedLayer as V}from"./tableUtils.js";import{ContingentValuesManager as H}from"../../support/ContingentValuesManager.js";let U=class extends n{constructor(e){super(e),this._attachmentsOperationQueue=new o,this._contingentValuesManager=new H,this._defaultOutFields=[`*`],this._editOperationQueue=new o,this.featureTitleMap=new g,this._loaded=!1,this._loadController=null,this._loadDebounced=p(()=>this._load()),this._loadError=!1,this._objectIdCache=new o,this._pendingEditsCache=new g,this._queryOperationInfos=new g,this._refreshDebounced=p(()=>this._refresh()),this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new o,this.filterByViewExtent=!1,this.filterByLayerScaleRange=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new g,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.viewTimeEnabled=!1,this.where=null}initialize(){this.addHandles([_(()=>[this._visibleAtCurrentScale,this.effectiveTimeExtent,this.effectiveWhere,this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ],()=>this._reset()),_(()=>this.orderByFields,()=>this._clearCaches(),{equals:r}),v(()=>this.attachmentsEnabled,()=>this._reset()),v(()=>this.relatedRecordsEnabled,()=>this._reset()),_(()=>this._layerWithContingentValues,e=>{let t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),_(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,n])=>{n&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},y),_(()=>this.maxSize,(e,t)=>{t===0&&this._reset()}),_(()=>[this.layer,this.view],()=>this.syncSelectionSources(),y),_(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,y),_(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;let t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);m(this.view?.addUpdatingPromise(t)??t)},b)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController)}get _capabilities(){let{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){let{layer:e}=this;return!e||!this._capabilities||!this.attachmentsEnabled||!this.supportsAttachments||!I(e)?null:e}get _layerWithAttachmentsEditing(){let{_layerWithAttachments:e}=this;return!e||!L(e)||!this.supportsEditing?null:e}get _layerWithContingentValues(){let{layer:e}=this;return w(e)||T(e)?e:null}get _layerWithEditing(){let e=this.layer;return R(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){let e=this.layer;return z(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){let e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(let n of e.keys()){let r=e.get(n),i=this._getFeatureWithPendingEdits(n,r);for(let e of r.changes.keys())if(this._contingentValuesManager.getViolationForField(t,i,e))return!0}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){let{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){let{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){let{layer:e}=this;return T(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!!(this._relatedLayerSupportsQuery&&this._relatedLayerSupportsQueryRelated)}get _shouldFilterByLayerScaleRange(){return!!(this.view&&this.filterByLayerScaleRange)}get _visibleAtCurrentScale(){return!!(this._shouldFilterByLayerScaleRange&&this.layerView?.visibleAtCurrentScale)}get cachedPageCount(){return this.pageCache.size}get canAddRelatedFeature(){let{state:e,relationship:t,supportsAdd:n,supportsEditing:r}=this;if(e!==`loaded`||!t||!n||!r)return!1;let{cardinality:i,role:a}=t,o=this.size>0;return!(i===`one-to-one`&&o||i===`one-to-many`&&a===`origin`&&o)}get effectiveOutFields(){let{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;let n=[];t.forEach(t=>{let r=e.fieldsIndex.normalizeFieldName(t);r&&n.push(r)});let{objectIdField:r}=e,i=e.fieldsIndex.normalizeFieldName(r)??r;return i&&!n.includes(i)&&n.unshift(i),n}get effectiveSelectionManager(){let{layer:e,view:t}=this;return e&&this.syncViewSelection&&P(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){let{_size:e,maxSize:t}=this;return t==null?e:Math.min(t,e)}get effectiveTimeExtent(){let{layer:e,timeExtent:t,view:n,viewTimeEnabled:r}=this;return t||!e?t:!n||!r?e.timeExtent??void 0:D({datesInUnknownTimezone:e.datesInUnknownTimezone??void 0,timeExtent:e.timeExtent,timeInfo:e.timeInfo,timeOffset:e.timeOffset,useViewTime:e.useViewTime},n.timeExtent,this._get(`effectiveTimeExtent`))??void 0}get effectiveWhere(){let{layer:e,where:t}=this;return t!=null&&t!==``?t:E(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||`1=1`}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){let e=this.layerView;return N(e)?e:null}get isQuerying(){return this._queryOperationInfos.size>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new o({items:[...this.pageCache.values()].flat()})}get layerView(){let{layer:e,view:t}=this;if(!e||!t)return null;let n=e.type===`sublayer`||E(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===n)}get orderByFields(){let{_sortedFieldNames:e,layer:t,sortOrders:n}=this,r=n.filter(({fieldName:t,direction:n},r)=>e.indexOf(t)===r&&n!=null).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!r.length&&!t.objectIdField&&t.fields?.length){let e=t.fields.find(e=>e.name);if(e){let n=t.fieldsIndex.normalizeFieldName(e.name);n&&r.push(`${n} ASC`)}}return r}get pageCount(){let{effectiveSize:e,pageSize:t}=this;return e===0||t===0?1:Math.ceil(e/t)}get pageIndex(){return this._get(`pageIndex`)||0}set pageIndex(e){let{pageCount:t}=this;B(e,t)&&this._set(`pageIndex`,e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){let{relationshipConfig:e}=this;return e?.relationshipId==null?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){let{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:n,view:r}=this,i=[];return!t||!e?.loaded||!r?.map||!n?.length||n.forEach(t=>{let n=V(e,r,t);n&&(n.load().catch(()=>{}),i.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),i}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){let{layer:e,_loaded:t,_loadError:n}=this;return!e||e.destroyed?`disabled`:n||e.loadError?`error`:this._loadController?`loading`:e.loadStatus===`loaded`&&t?`loaded`:`ready`}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsAttachments(){let{_capabilities:e}=this;return!!(e?.data?.supportsAttachment&&e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){let{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){let{_capabilities:e}=this;return!!(this.supportsAttachments&&e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsAddAttachments)return{};let r=await this._queueAttachmentsOperation(e,()=>n.addAttachment(this._createBaseGraphic(n,e),t));return this._ensureArrayContent(r)}addPendingEdits(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)}async deleteAttachments(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsUpdateAttachments||!t.length)return[];let r=await this._queueAttachmentsOperation(e,()=>n.deleteAttachments(this._createBaseGraphic(n,e),t));return this._ensureArray(r)}async deleteRowsByObjectId(e){let{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new s(`store:delete-error`,`Delete is not supported.`);let n=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i),r=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:n}));return e.forEach(e=>{this.featureTitleMap.delete(e),this._discardPendingEdit({objectId:e})}),r}discardPendingEdits(e){if(e?.length){e.forEach(e=>this._discardPendingEdit(e));return}for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n&&(n.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;let n=this._layerWithContingentValues,r=this._pendingEditsCache.get(e);if(!n||!r)return!1;let i=this._getFeatureWithPendingEdits(e,r),a=this._contingentValuesManager;return t?!!a.getViolationForField(n,i,t):!!a.getAllViolations(n,i)}itemHasPendingEdits(e,t){let n=this._pendingEditsCache.get(e);return n?!t||n.changes.has(t):!1}async getAttachmentsByObjectId(e,t){let n=this.getItemByObjectId(e)?.attachments??[];return!n.length&&t?(await this._queryAttachments([e]))[e]??[]:n}getCachedFeaturesByPageIndex(e){return this.pageCache.get(e)}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,n=!1){let{layer:r}=this,i=this.featureTitleMap.get(e),a=`${e}`;if(!r)return i||a;if(i&&!n)return i;if(!(`getFeatureTitle`in r)||!r.getFeatureTitle)return a;let o=this.getItemByObjectId(e)?.feature;o||=new t({attributes:{[r.objectIdField]:e},origin:r.graphicOrigin});let s=await r.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return s?(this.featureTitleMap.set(e,s),s):a}getItemByObjectId(e){for(let t of this.pageCache.values())for(let n of t)if(n.objectId===e)return n}getItemIndexByObjectId(e){let{pageCache:t,pageSize:n}=this,r=t.entries(),i=-1;for(let[t,a]of r)if(a.some((r,a)=>{let o=r.objectId===e;return o&&(i=t*n+a),o}),i>-1)break;return i}async load(){await m(this._loadDebounced())}async queryPage(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`||!this.supportsQuery||this.size===0||this.maxSize===0)return[];let{pageIndex:r}=e;if(!B(r,this.pageCount))return[];let i=e.pageSize??this.pageSize,a=r*i,o=a+i;return await m(this._query({layer:t,start:a,num:o,pageIndex:r,pageSize:i}))??[]}async refresh(){await m(this._refreshDebounced())}reset(){this._reset()}async savePendingEdits(){let e=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),!this._canSavePendingEdits){this._logError(`store:update-error`,`An error occurred. Unable to save pending edits.`);return}let t=[];for(let[e]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n?.feature&&t.push(n.feature)}(await this._update(e,t,!0)).updateFeatureResults.find(e=>e.error)&&this.discardPendingEdits(),this._clearOptionsAndViolations()}syncSelectionSources(){let{defaultSelectionManager:e,layer:t,view:n}=this;e.view=n,e.sources.removeAll(),F(t)&&(e.sources.items=[t])}async updateAttachment(e,t,n){let{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments)return{};let i=await this._queueAttachmentsOperation(e,()=>r.updateAttachment(this._createBaseGraphic(r,e),t,n));return this._ensureArrayContent(i)}async updateItem(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.hasContingentValues){let t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),n=this.itemHasPendingEdits(e.objectId);if(n||t){let t=this._layerWithContingentValues,r=this.getItemByObjectId(e.objectId)?.feature?.clone();if(r){let i=this._contingentValuesManager.getAllViolations(t,r);if(e.updates.forEach(({fieldName:e,value:n})=>{let i=t.getField(e);i&&(r.attributes[i.name]=n)}),this._contingentValuesManager.validateContingencyConstraints(t,r).length||i.length||n){this._stashPendingEdits(t,[e]),this._contingentValuesManager.resetOptionsForLayer(t);return}}}}if(!this.autoSaveEnabled){this._stashPendingEdits(t,[e]);return}let{_sortedFieldNames:n}=this,r=e.updates.map(({fieldName:e})=>e),i=this._prepareEditsForUpdate([e]);!(await this._update(t,i)).updateFeatureResults.find(e=>e.error)&&r.some(e=>n.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`)return[];let{objectIdField:r}=t,i=await this._queryFeaturesByObjectId(e);return e.map(e=>i.some(t=>e===(t.getObjectId()??t.attributes[r])))}async _load(){let{layer:e}=this;if(this._reset(),!e)return;let t=new AbortController;this._loadController=t;try{if(await e.load(),e.parent&&T(e.parent)&&await e.parent.loadAll(),await e.when(),t.signal.aborted)return;let n=this.initialSize;if(this.initialSize=null,this._shouldFilterByLayerScaleRange&&(this._visibleAtCurrentScale||(n=0)),await m(this._refresh(t,n)),t.signal.aborted){this._loadController=null;return}this._loaded=!0,this._loadController=null}catch(e){throw this._reset(),this._loadError=!0,this._logError(`store:load-error`,`An error occurred.`),e}}async _refresh(e,t){this._clearCaches();let n=e?.signal,r=await this._getSize(n,t),i=await this._queryAllObjectIds(n);n?.aborted||(this._size=r,this._objectIdCache.removeAll(),i?.length&&this._objectIdCache.addMany(i),this._syncPendingEdits())}async _queryAllObjectIds(e){return this.supportsPagination?void 0:await this._queryObjectIds(e)}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,n){let r=new t({attributes:{[e.objectIdField]:n}});return this._subtypeField&&this._subtypeCode!=null&&(r.attributes[this._subtypeField]=this._subtypeCode),r}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForFeatures(e,t){return e.map(e=>e.getObjectId()??e.attributes[t.objectIdField])}_getObjectIdsForPage(e,t){let n=this._objectIdCache.toArray();return n.length>=e+t?n.slice(e,e+t):n.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,n=!1){n?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this.featureTitleMap.clear(),this._loadController=f(this._loadController),this._queryOperationInfos.forEach(e=>e.controller.abort()),this._queryOperationInfos.clear(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController),this._loaded=!1,this._loadError=!1,this._size=0}async _getSize(e,t){return this.maxSize===0?0:t??await this._queryCount(e)}async _queryFeaturesByObjectId(e){let{layer:t}=this;if(!t||!this.supportsQuery)throw new s(`store:query-error`,`Layer does not support query operation.`);let{effectiveTimeExtent:n,effectiveWhere:r,orderByFields:i,supportsCacheHint:a,supportsOrderBy:o}=this,c=t.createQuery();return c.where=r,c.timeExtent=n,c.returnGeometry=!1,c.objectIds=e.length?e:void 0,c.outFields=[t.objectIdField],o&&(c.orderByFields=i),a&&(c.cacheHint=!0),(await t.queryFeatures(c)).features}async _syncTemporaryHighlight(e,t){let{highlightEnabled:n,highlightableLayerView:r}=this;r&&n&&e!=null&&(h(t),this._temporaryHighlight={id:e,handle:r.highlight(e,{name:M})})}_ensureLayerAndUpdateSupport(){let e=this._layerWithEditing;if(!e||!this.supportsUpdate)throw new s(`store:update-error`,`Update is not supported.`);return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:n})=>{let r=this.getItemByObjectId(t)?.feature;if(!r)throw new s(`store:update-error`,`Feature with provided 'objectId' not found.`);let i=r.clone(),a=u(this._pendingEditsCache,t,()=>({originalFeature:i,changes:new g}));n.forEach(({fieldName:t,value:n})=>{let i=e.getField(t);i?(a.changes.set(i.name,n),r.attributes[i.name]=n):this._logWarning(`store:pending-edit-unknown-field`,`The provided field does not belong to this layer.`)}),a.changes.size>0&&this._pendingEditsCache.set(t,a)})}_syncPendingEdits(){for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e)?.feature;if(n){let e=n.clone();for(let[e,r]of t.changes)n.attributes[e]=r;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let n=this.getItemByObjectId(e)?.feature;if(!n){n=t.originalFeature.clone();for(let[e,r]of t.changes)n.attributes[e]=r}return n}_discardPendingEdit({objectId:e,fieldName:t}){let n=this._pendingEditsCache.get(e);if(!n){this._logWarning(`store:pending-edit-not-found`,`Could not find a pending edit with the given information`);return}let r=this.getItemByObjectId(e);t?(r&&(r.feature.attributes[t]=n.originalFeature.attributes[t]),n.changes.delete(t),n.changes.size===0&&this._pendingEditsCache.delete(e)):(r&&(r.feature=n.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){let{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}_prepareEditsForUpdate(e){let n=[];return e.forEach(({objectId:e,updates:r})=>{let i=this.getItemByObjectId(e)?.feature;if(!i)return;let a=c(i.attributes);r.forEach(({fieldName:e,value:t})=>a[e]=t),n.push(new t({attributes:a,sourceLayer:i.sourceLayer}))}),n}_update(e,t,n=!1){let r=e.applyEdits({updateFeatures:t}).then(n=>{let{updateFeatureResults:r}=n,i=r.find(e=>!!e.error);if(i)throw i.error;return t.forEach(t=>{let n=t.getObjectId()??t.attributes[e.objectIdField],r=this.getItemByObjectId(n)?.feature;r&&(r.attributes=t.attributes),this.featureTitleMap.has(n)&&this.getFeatureTitle(n,!0)}),n});return this._queueEditOperation(()=>r,n)}_createFeatureStoreItems(e){let{attachments:t,features:n,layer:r,relatedRecords:i}=e,a=r.objectIdField;return n.map(e=>{let n=e.getObjectId()??e.attributes[a],o=[];!e.layer&&!e.sourceLayer&&(e.layer=r,e.sourceLayer=r);let s=this._pendingEditsCache.get(n);if(s){let t=e.clone(),n=s.changes;for(let[t,r]of n)e.attributes[t]=r;s.originalFeature=t}return i.forEach((e,t)=>{o.push({relationshipId:t,count:e[n]??0})}),{objectId:n,feature:e,attachments:t[n]??null,relatedRecords:o}})}async _query(e){let{pageIndex:t,refresh:n}=e;n===!0&&await this._refresh();let r=this.pageCache.get(t);if(r)return r;let i=this._queryOperationInfos.get(t);if(i)return i.task.promise;let a=new AbortController,o=await this._queryPage(e,a);return a.signal.aborted||this.pageCache.set(t,o),o}_queryAttachments(e,t){let{_layerWithAttachments:n,effectiveWhere:r}=this;return n?e.some(e=>typeof e!=`number`)?Promise.reject(new s(`invalid-object-id`,`Only numeric object ids are valid to query attachments`)):n.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0}),{signal:t}):Promise.resolve({})}async _queryCount(e){let{_relatedLayerSupportsCacheHint:t,layer:n,relationshipConfig:r,supportsCacheHint:i}=this;if(!n)return 0;if(r&&this._canUseRelatedLayer){let{objectId:n,relatedLayer:i,relationshipId:a}=r;return(await i.queryRelatedFeaturesCount(new k({cacheHint:t,relationshipId:a,objectIds:[n]}),{signal:e}))[n]??0}let{effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:s,objectIds:c}=this,l=n.createQuery();return l.geometry=s,l.returnGeometry=!1,l.where=o,l.timeExtent=a,l.objectIds=c?.length?c:void 0,i&&(l.cacheHint=!0),n.queryFeatureCount(l,{signal:e})}async _queryFeatures(e,t){let{relationshipConfig:n}=this;if(n&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,n);let{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:a,effectiveTimeExtent:o,effectiveWhere:s,filterGeometry:c,objectIds:l,orderByFields:u,pageSize:d,returnGeometry:f,supportsCacheHint:p,supportsOrderBy:m,supportsPagination:h}=this,{layer:g,start:_}=e,v=l?.length,y=g.createQuery();return y.returnGeometry=f,y.outFields=a,y.returnM=r,y.returnZ=i,h?(y.start=_,y.num=d,y.where=s,y.timeExtent=o,y.objectIds=v?l:void 0):y.objectIds=v?l:this._getObjectIdsForPage(_,d??0),m&&(y.orderByFields=u),c&&(y.geometry=c),p&&(y.cacheHint=!0),(await g.queryFeatures(y,{signal:t})).features}_queryObjectIds(e){let{effectiveTimeExtent:t,effectiveWhere:n,filterGeometry:r,layer:i,objectIds:a,orderByFields:o,supportsCacheHint:s,supportsOrderBy:c}=this;if(!i)return Promise.resolve([]);let l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=n,l.timeExtent=t,l.objectIds=a?.length?a:void 0,c&&(l.orderByFields=o),s&&(l.cacheHint=!0),i.queryObjectIds(l,{signal:e})}async _queryPage(e,t){return this._queueQueryOperation(e.pageIndex,{controller:t,task:a(async()=>this._queryPageData(e,t))})}async _queryPageData(e,t){let{layer:n}=e,{signal:r}=t,i=await this._queryFeatures(e,r);if(r.aborted)return[];let a=this._getObjectIdsForFeatures(i,n),[o,s]=await Promise.all([this._queryAttachments(a,r),this._queryRelatedCounts(a,r)]);return t.signal.aborted?[]:this._createFeatureStoreItems({layer:n,features:i,attachments:o,relatedRecords:s})||[]}async _queryRelatedCounts(e,t){let{_layerWithRelationships:n,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,a=new Map;return!n||!e?.length||!r.length||await Promise.allSettled(r.map(async r=>{let o=await n.queryRelatedFeaturesCount(new k({cacheHint:i,relationshipId:r,objectIds:e}),{signal:t});a.set(r,o)})),a}async _queryRelatedFeatures(e,t){let{_defaultOutFields:n,_effectiveReturnM:r,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:s,supportsCacheHint:c}=this,{layer:l,start:u}=e,{objectId:d,relatedLayer:f,relationshipId:p}=t,m=l.createQuery(),h=new k({cacheHint:c,num:o,objectIds:[d],orderByFields:a,outFields:n,relationshipId:p,returnGeometry:s,returnM:r,returnZ:i,start:u,where:m.where??void 0});return(await f.queryRelatedFeatures(h))[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async n=>{this._attachmentsOperationQueue.remove(t);let r=this._ensureArray(n),i=r.some(e=>e.error),a=this.getItemByObjectId(e);return a&&(!i||r.length>1)&&(a.attachments=(await this._queryAttachments([e]))[e]),n}).catch(async n=>{this._logError(`store:attachment-error`,`An error occurred.`);let r={error:n,retry:()=>{this.failures.remove(r),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._attachmentsOperationQueue.remove(t),n})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(n=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),n)).catch(t=>{this._logError(`store:edit-error`,`An error occurred.`);let n={error:t,retry:()=>{this.failures.remove(n),this._queueEditOperation(e)},cancel:()=>this.failures.remove(n)};throw this.failures.add(n),this._editOperationQueue.remove(e),t})}async _queueQueryOperation(e,t){this._queryOperationInfos.set(e,t);let n=await t.task.promise;return this._queryOperationInfos.delete(e),n}};e([x()],U.prototype,`_attachmentsOperationQueue`,void 0),e([x({readOnly:!0})],U.prototype,`_capabilities`,null),e([x()],U.prototype,`_canSavePendingEdits`,null),e([x()],U.prototype,`_contingentValuesManager`,void 0),e([x()],U.prototype,`_defaultOutFields`,void 0),e([x()],U.prototype,`_editOperationQueue`,void 0),e([x()],U.prototype,`_effectiveReturnZ`,null),e([x()],U.prototype,`_effectiveReturnM`,null),e([x()],U.prototype,`featureTitleMap`,void 0),e([x({readOnly:!0})],U.prototype,`_layerWithAttachments`,null),e([x({readOnly:!0})],U.prototype,`_layerWithAttachmentsEditing`,null),e([x()],U.prototype,`_layerWithContingentValues`,null),e([x({readOnly:!0})],U.prototype,`_layerWithEditing`,null),e([x({readOnly:!0})],U.prototype,`_layerWithRelationships`,null),e([x()],U.prototype,`_loaded`,void 0),e([x()],U.prototype,`_loadController`,void 0),e([x()],U.prototype,`_loadError`,void 0),e([x()],U.prototype,`_objectIdCache`,void 0),e([x()],U.prototype,`_pendingEditsCache`,void 0),e([x()],U.prototype,`_pendingEditsAreInvalid`,null),e([x()],U.prototype,`_queryOperationInfos`,void 0),e([x({readOnly:!0})],U.prototype,`_relatedLayer`,null),e([x({readOnly:!0})],U.prototype,`_relatedLayerCapabilities`,null),e([x({readOnly:!0})],U.prototype,`_relatedLayerSupportsCacheHint`,null),e([x()],U.prototype,`_relatedLayerSupportsQuery`,null),e([x()],U.prototype,`_relatedLayerSupportsQueryRelated`,null),e([x()],U.prototype,`_size`,void 0),e([x()],U.prototype,`_sortedFieldNames`,null),e([x()],U.prototype,`_subtypeCode`,null),e([x()],U.prototype,`_subtypeField`,null),e([x()],U.prototype,`_canUseRelatedLayer`,null),e([x()],U.prototype,`_shouldFilterByLayerScaleRange`,null),e([x()],U.prototype,`_visibleAtCurrentScale`,null),e([x()],U.prototype,`attachmentsEnabled`,void 0),e([x()],U.prototype,`autoSaveEnabled`,void 0),e([x()],U.prototype,`cachedPageCount`,null),e([x()],U.prototype,`canAddRelatedFeature`,null),e([x()],U.prototype,`defaultSelectionManager`,void 0),e([x()],U.prototype,`editingEnabled`,void 0),e([x()],U.prototype,`effectiveOutFields`,null),e([x()],U.prototype,`effectiveSelectionManager`,null),e([x()],U.prototype,`effectiveSize`,null),e([x()],U.prototype,`effectiveTimeExtent`,null),e([x()],U.prototype,`effectiveWhere`,null),e([x({readOnly:!0})],U.prototype,`failures`,void 0),e([x()],U.prototype,`fieldsWithContingentValues`,null),e([x()],U.prototype,`filterByViewExtent`,void 0),e([x()],U.prototype,`filterByLayerScaleRange`,void 0),e([x({types:C})],U.prototype,`filterGeometry`,void 0),e([x()],U.prototype,`hasContingentValues`,null),e([x()],U.prototype,`hasInvalidPendingEdits`,null),e([x()],U.prototype,`hasPendingEdits`,null),e([x()],U.prototype,`highlightEnabled`,void 0),e([x()],U.prototype,`highlightableLayerView`,null),e([x()],U.prototype,`initialSize`,void 0),e([x({readOnly:!0})],U.prototype,`isQuerying`,null),e([x({readOnly:!0})],U.prototype,`isSyncing`,null),e([x({readOnly:!0})],U.prototype,`isSyncingAttachmentEdits`,null),e([x({readOnly:!0})],U.prototype,`isSyncingFeatureEdits`,null),e([x({readOnly:!0})],U.prototype,`itemCache`,null),e([x()],U.prototype,`layer`,void 0),e([x()],U.prototype,`layerView`,null),e([x()],U.prototype,`maxSize`,void 0),e([x()],U.prototype,`objectIds`,void 0),e([x()],U.prototype,`orderByFields`,null),e([x()],U.prototype,`outFields`,void 0),e([x({readOnly:!0})],U.prototype,`pageCache`,void 0),e([x()],U.prototype,`pageCount`,null),e([x()],U.prototype,`pageIndex`,null),e([x()],U.prototype,`pageSize`,void 0),e([x()],U.prototype,`paginationEnabled`,void 0),e([x()],U.prototype,`pendingEditsCount`,null),e([x()],U.prototype,`relationship`,null),e([x()],U.prototype,`relationshipConfig`,void 0),e([x()],U.prototype,`relationshipIds`,null),e([x()],U.prototype,`relationshipInfos`,null),e([x()],U.prototype,`relationships`,null),e([x()],U.prototype,`relatedRecordsEnabled`,void 0),e([x()],U.prototype,`returnGeometry`,void 0),e([x()],U.prototype,`returnZ`,void 0),e([x()],U.prototype,`returnM`,void 0),e([x()],U.prototype,`selectionManager`,void 0),e([x({readOnly:!0})],U.prototype,`size`,null),e([x()],U.prototype,`sortOrders`,void 0),e([x({readOnly:!0})],U.prototype,`state`,null),e([x()],U.prototype,`supportsAdd`,null),e([x()],U.prototype,`supportsAddAttachments`,null),e([x()],U.prototype,`supportsAttachments`,null),e([x()],U.prototype,`supportsCacheHint`,null),e([x()],U.prototype,`supportsCacheHintQueryRelated`,null),e([x()],U.prototype,`supportsDelete`,null),e([x()],U.prototype,`supportsEditing`,null),e([x()],U.prototype,`supportsM`,null),e([x()],U.prototype,`supportsOrderBy`,null),e([x()],U.prototype,`supportsPagination`,null),e([x()],U.prototype,`supportsQuery`,null),e([x()],U.prototype,`supportsQueryRelated`,null),e([x()],U.prototype,`supportsResizeAttachments`,null),e([x()],U.prototype,`supportsUpdate`,null),e([x()],U.prototype,`supportsUpdateAttachments`,null),e([x()],U.prototype,`supportsZ`,null),e([x()],U.prototype,`syncViewSelection`,void 0),e([x()],U.prototype,`temporaryHighlightId`,void 0),e([x({type:A})],U.prototype,`timeExtent`,void 0),e([x()],U.prototype,`timeZone`,void 0),e([x()],U.prototype,`view`,void 0),e([x()],U.prototype,`viewTimeEnabled`,void 0),e([x()],U.prototype,`where`,void 0),U=e([S(`esri.widgets.FeatureTable.support.FeatureStore`)],U);const W=U;export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{equals as r,isSome as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import s from"../../../core/Error.js";import{clone as c}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as u}from"../../../core/MapUtils.js";import{removeMaybe as d,abortMaybe as f}from"../../../core/maybe.js";import{debounce as p,ignoreAbortErrors as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import g from"../../../core/ReactiveMap.js";import{watch as _,when as v,syncAndInitial as y,sync as b}from"../../../core/reactiveUtils.js";import{property as x,subclass as S}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as C}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as w,isSubtypeGroupLayer as T,isSubtypeSublayer as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as D}from"../../../layers/support/timeSupport.js";import O from"../../../rest/support/AttachmentQuery.js";import k from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as M}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as N}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as P,isSelectableLayer as F}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as I,isIFeatureTableSupportedLayerWithAttachmentsEditing as L,isIFeatureTableSupportedLayerWithEditing as R,isIFeatureTableSupportedLayerWithRelationships as z,isPageIndexValid as B,findRelatedLayer as V}from"./tableUtils.js";import{ContingentValuesManager as H}from"../../support/ContingentValuesManager.js";let U=class extends n{constructor(e){super(e),this._attachmentsOperationQueue=new o,this._contingentValuesManager=new H,this._defaultOutFields=[`*`],this._editOperationQueue=new o,this.featureTitleMap=new g,this._loaded=!1,this._loadController=null,this._loadDebounced=p(()=>this._load()),this._loadError=!1,this._objectIdCache=new o,this._pendingEditsCache=new g,this._queryOperationInfos=new g,this._refreshDebounced=p(()=>this._refresh()),this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new o,this.filterByViewExtent=!1,this.filterByLayerScaleRange=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new g,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.viewTimeEnabled=!1,this.where=null}initialize(){this.addHandles([_(()=>[this._visibleAtCurrentScale,this.effectiveTimeExtent,this.effectiveWhere,this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ],()=>this._reset()),_(()=>this.orderByFields,()=>this._clearCaches(),{equals:r}),v(()=>this.attachmentsEnabled,()=>this._reset()),v(()=>this.relatedRecordsEnabled,()=>this._reset()),_(()=>this._layerWithContingentValues,e=>{let t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),_(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,n])=>{n&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},y),_(()=>this.maxSize,(e,t)=>{t===0&&this._reset()}),_(()=>[this.layer,this.view],()=>this.syncSelectionSources(),y),_(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,y),_(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;let t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);m(this.view?.addUpdatingPromise(t)??t)},b)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController)}get _capabilities(){let{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){let{layer:e}=this;return!e||!this._capabilities||!this.attachmentsEnabled||!this.supportsAttachments||!I(e)?null:e}get _layerWithAttachmentsEditing(){let{_layerWithAttachments:e}=this;return!e||!L(e)||!this.supportsEditing?null:e}get _layerWithContingentValues(){let{layer:e}=this;return w(e)||T(e)?e:null}get _layerWithEditing(){let e=this.layer;return R(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){let e=this.layer;return z(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){let e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(let n of e.keys()){let r=e.get(n),i=this._getFeatureWithPendingEdits(n,r);for(let e of r.changes.keys())if(this._contingentValuesManager.getViolationForField(t,i,e))return!0}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){let{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){let{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){let{layer:e}=this;return T(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!!(this._relatedLayerSupportsQuery&&this._relatedLayerSupportsQueryRelated)}get _shouldFilterByLayerScaleRange(){return!!(this.view&&this.filterByLayerScaleRange)}get _visibleAtCurrentScale(){return!!(this._shouldFilterByLayerScaleRange&&this.layerView?.visibleAtCurrentScale)}get cachedPageCount(){return this.pageCache.size}get canAddRelatedFeature(){let{state:e,relationship:t,supportsAdd:n,supportsEditing:r}=this;if(e!==`loaded`||!t||!n||!r)return!1;let{cardinality:i,role:a}=t,o=this.size>0;return!(i===`one-to-one`&&o||i===`one-to-many`&&a===`origin`&&o)}get effectiveOutFields(){let{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;let n=[];t.forEach(t=>{let r=e.fieldsIndex.normalizeFieldName(t);r&&n.push(r)});let{objectIdField:r}=e,i=e.fieldsIndex.normalizeFieldName(r)??r;return i&&!n.includes(i)&&n.unshift(i),n}get effectiveSelectionManager(){let{layer:e,view:t}=this;return e&&this.syncViewSelection&&P(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){let{_size:e,maxSize:t}=this;return t==null?e:Math.min(t,e)}get effectiveTimeExtent(){let{layer:e,timeExtent:t,view:n,viewTimeEnabled:r}=this;return t||!e?t??void 0:!n||!r?e.timeExtent??void 0:D({datesInUnknownTimezone:e.datesInUnknownTimezone??void 0,timeExtent:e.timeExtent,timeInfo:e.timeInfo,timeOffset:e.timeOffset,useViewTime:e.useViewTime},n.timeExtent,this._get(`effectiveTimeExtent`))??void 0}get effectiveWhere(){let{layer:e,where:t}=this;return t!=null&&t!==``?t:E(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||`1=1`}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){let e=this.layerView;return N(e)?e:null}get isQuerying(){return this._queryOperationInfos.size>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new o({items:[...this.pageCache.values()].flat()})}get layerView(){let{layer:e,view:t}=this;if(!e||!t)return null;let n=e.type===`sublayer`||E(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===n)}get orderByFields(){let{_sortedFieldNames:e,layer:t,sortOrders:n}=this,r=n.filter(({fieldName:t,direction:n},r)=>e.indexOf(t)===r&&n!=null).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!r.length&&!t.objectIdField&&t.fields?.length){let e=t.fields.find(e=>e.name);if(e){let n=t.fieldsIndex.normalizeFieldName(e.name);n&&r.push(`${n} ASC`)}}return r}get pageCount(){let{effectiveSize:e,pageSize:t}=this;return e===0||t===0?1:Math.ceil(e/t)}get pageIndex(){return this._get(`pageIndex`)||0}set pageIndex(e){let{pageCount:t}=this;B(e,t)&&this._set(`pageIndex`,e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){let{relationshipConfig:e}=this;return e?.relationshipId==null?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){let{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:n,view:r}=this,i=[];return!t||!e?.loaded||!r?.map||!n?.length||n.forEach(t=>{let n=V(e,r,t);n&&(n.load().catch(()=>{}),i.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),i}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){let{layer:e,_loaded:t,_loadError:n}=this;return!e||e.destroyed?`disabled`:n||e.loadError?`error`:this._loadController?`loading`:e.loadStatus===`loaded`&&t?`loaded`:`ready`}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsAttachments(){let{_capabilities:e}=this;return!!(e?.data?.supportsAttachment&&e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){let{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){let{_capabilities:e}=this;return!!(this.supportsAttachments&&e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsAddAttachments)return{};let r=await this._queueAttachmentsOperation(e,()=>n.addAttachment(this._createBaseGraphic(n,e),t));return this._ensureArrayContent(r)}addPendingEdits(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)}async deleteAttachments(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsUpdateAttachments||!t.length)return[];let r=await this._queueAttachmentsOperation(e,()=>n.deleteAttachments(this._createBaseGraphic(n,e),t));return this._ensureArray(r)}async deleteRowsByObjectId(e){let{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new s(`store:delete-error`,`Delete is not supported.`);let n=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i),r=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:n}));return e.forEach(e=>{this.featureTitleMap.delete(e),this._discardPendingEdit({objectId:e})}),r}discardPendingEdits(e){if(e?.length){e.forEach(e=>this._discardPendingEdit(e));return}for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n&&(n.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;let n=this._layerWithContingentValues,r=this._pendingEditsCache.get(e);if(!n||!r)return!1;let i=this._getFeatureWithPendingEdits(e,r),a=this._contingentValuesManager;return t?!!a.getViolationForField(n,i,t):!!a.getAllViolations(n,i)}itemHasPendingEdits(e,t){let n=this._pendingEditsCache.get(e);return n?!t||n.changes.has(t):!1}async getAttachmentsByObjectId(e,t){let n=this.getItemByObjectId(e)?.attachments??[];return!n.length&&t?(await this._queryAttachments([e]))[e]??[]:n}getCachedFeaturesByPageIndex(e){return this.pageCache.get(e)}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,n=!1){let{layer:r}=this,i=this.featureTitleMap.get(e),a=`${e}`;if(!r)return i||a;if(i&&!n)return i;if(!(`getFeatureTitle`in r)||!r.getFeatureTitle)return a;let o=this.getItemByObjectId(e)?.feature;o||=new t({attributes:{[r.objectIdField]:e},origin:r.graphicOrigin});let s=await r.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return s?(this.featureTitleMap.set(e,s),s):a}getItemByObjectId(e){for(let t of this.pageCache.values())for(let n of t)if(n.objectId===e)return n}getItemIndexByObjectId(e){let{pageCache:t,pageSize:n}=this,r=t.entries(),i=-1;for(let[t,a]of r)if(a.some((r,a)=>{let o=r.objectId===e;return o&&(i=t*n+a),o}),i>-1)break;return i}async load(){await m(this._loadDebounced())}async queryPage(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`||!this.supportsQuery||this.size===0||this.maxSize===0)return[];let{pageIndex:r}=e;if(!B(r,this.pageCount))return[];let i=e.pageSize??this.pageSize,a=r*i,o=a+i;return await m(this._query({layer:t,start:a,num:o,pageIndex:r,pageSize:i}))??[]}async refresh(){await m(this._refreshDebounced())}reset(){this._reset()}async savePendingEdits(){let e=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),!this._canSavePendingEdits){this._logError(`store:update-error`,`An error occurred. Unable to save pending edits.`);return}let t=[];for(let[e]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n?.feature&&t.push(n.feature)}(await this._update(e,t,!0)).updateFeatureResults.find(e=>e.error)&&this.discardPendingEdits(),this._clearOptionsAndViolations()}syncSelectionSources(){let{defaultSelectionManager:e,layer:t,view:n}=this;e.view=n,e.sources.removeAll(),F(t)&&(e.sources.items=[t])}async updateAttachment(e,t,n){let{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments)return{};let i=await this._queueAttachmentsOperation(e,()=>r.updateAttachment(this._createBaseGraphic(r,e),t,n));return this._ensureArrayContent(i)}async updateItem(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.hasContingentValues){let t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),n=this.itemHasPendingEdits(e.objectId);if(n||t){let t=this._layerWithContingentValues,r=this.getItemByObjectId(e.objectId)?.feature?.clone();if(r){let i=this._contingentValuesManager.getAllViolations(t,r);if(e.updates.forEach(({fieldName:e,value:n})=>{let i=t.getField(e);i&&(r.attributes[i.name]=n)}),this._contingentValuesManager.validateContingencyConstraints(t,r).length||i.length||n){this._stashPendingEdits(t,[e]),this._contingentValuesManager.resetOptionsForLayer(t);return}}}}if(!this.autoSaveEnabled){this._stashPendingEdits(t,[e]);return}let{_sortedFieldNames:n}=this,r=e.updates.map(({fieldName:e})=>e),i=this._prepareEditsForUpdate([e]);!(await this._update(t,i)).updateFeatureResults.find(e=>e.error)&&r.some(e=>n.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`)return[];let{objectIdField:r}=t,i=await this._queryFeaturesByObjectId(e);return e.map(e=>i.some(t=>e===(t.getObjectId()??t.attributes[r])))}async _load(){let{layer:e}=this;if(this._reset(),!e)return;let t=new AbortController;this._loadController=t;try{if(await e.load(),e.parent&&T(e.parent)&&await e.parent.loadAll(),await e.when(),t.signal.aborted)return;let n=this.initialSize;if(this.initialSize=null,this._shouldFilterByLayerScaleRange&&(this._visibleAtCurrentScale||(n=0)),await m(this._refresh(t,n)),t.signal.aborted){this._loadController=null;return}this._loaded=!0,this._loadController=null}catch(e){throw this._reset(),this._loadError=!0,this._logError(`store:load-error`,`An error occurred.`),e}}async _refresh(e,t){this._clearCaches();let n=e?.signal,r=await this._getSize(n,t),i=await this._queryAllObjectIds(n);n?.aborted||(this._size=r,this._objectIdCache.removeAll(),i?.length&&this._objectIdCache.addMany(i),this._syncPendingEdits())}async _queryAllObjectIds(e){return this.supportsPagination?void 0:await this._queryObjectIds(e)}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,n){let r=new t({attributes:{[e.objectIdField]:n}});return this._subtypeField&&this._subtypeCode!=null&&(r.attributes[this._subtypeField]=this._subtypeCode),r}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForFeatures(e,t){return e.map(e=>e.getObjectId()??e.attributes[t.objectIdField])}_getObjectIdsForPage(e,t){let n=this._objectIdCache.toArray();return n.length>=e+t?n.slice(e,e+t):n.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,n=!1){n?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this.featureTitleMap.clear(),this._loadController=f(this._loadController),this._queryOperationInfos.forEach(e=>e.controller.abort()),this._queryOperationInfos.clear(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController),this._loaded=!1,this._loadError=!1,this._size=0}async _getSize(e,t){return this.maxSize===0?0:t??await this._queryCount(e)}async _queryFeaturesByObjectId(e){let{layer:t}=this;if(!t||!this.supportsQuery)throw new s(`store:query-error`,`Layer does not support query operation.`);let{effectiveTimeExtent:n,effectiveWhere:r,orderByFields:i,supportsCacheHint:a,supportsOrderBy:o}=this,c=t.createQuery();return c.where=r,c.timeExtent=n,c.returnGeometry=!1,c.objectIds=e.length?e:void 0,c.outFields=[t.objectIdField],o&&(c.orderByFields=i),a&&(c.cacheHint=!0),(await t.queryFeatures(c)).features}async _syncTemporaryHighlight(e,t){let{highlightEnabled:n,highlightableLayerView:r}=this;r&&n&&e!=null&&(h(t),this._temporaryHighlight={id:e,handle:r.highlight(e,{name:M})})}_ensureLayerAndUpdateSupport(){let e=this._layerWithEditing;if(!e||!this.supportsUpdate)throw new s(`store:update-error`,`Update is not supported.`);return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:n})=>{let r=this.getItemByObjectId(t)?.feature;if(!r)throw new s(`store:update-error`,`Feature with provided 'objectId' not found.`);let i=r.clone(),a=u(this._pendingEditsCache,t,()=>({originalFeature:i,changes:new g}));n.forEach(({fieldName:t,value:n})=>{let i=e.getField(t);i?(a.changes.set(i.name,n),r.attributes[i.name]=n):this._logWarning(`store:pending-edit-unknown-field`,`The provided field does not belong to this layer.`)}),a.changes.size>0&&this._pendingEditsCache.set(t,a)})}_syncPendingEdits(){for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e)?.feature;if(n){let e=n.clone();for(let[e,r]of t.changes)n.attributes[e]=r;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let n=this.getItemByObjectId(e)?.feature;if(!n){n=t.originalFeature.clone();for(let[e,r]of t.changes)n.attributes[e]=r}return n}_discardPendingEdit({objectId:e,fieldName:t}){let n=this._pendingEditsCache.get(e);if(!n){this._logWarning(`store:pending-edit-not-found`,`Could not find a pending edit with the given information`);return}let r=this.getItemByObjectId(e);t?(r&&(r.feature.attributes[t]=n.originalFeature.attributes[t]),n.changes.delete(t),n.changes.size===0&&this._pendingEditsCache.delete(e)):(r&&(r.feature=n.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){let{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}_prepareEditsForUpdate(e){let n=[];return e.forEach(({objectId:e,updates:r})=>{let i=this.getItemByObjectId(e)?.feature;if(!i)return;let a=c(i.attributes);r.forEach(({fieldName:e,value:t})=>a[e]=t),n.push(new t({attributes:a,sourceLayer:i.sourceLayer}))}),n}_update(e,t,n=!1){let r=e.applyEdits({updateFeatures:t}).then(n=>{let{updateFeatureResults:r}=n,i=r.find(e=>!!e.error);if(i)throw i.error;return t.forEach(t=>{let n=t.getObjectId()??t.attributes[e.objectIdField],r=this.getItemByObjectId(n)?.feature;r&&(r.attributes=t.attributes),this.featureTitleMap.has(n)&&this.getFeatureTitle(n,!0)}),n});return this._queueEditOperation(()=>r,n)}_createFeatureStoreItems(e){let{attachments:t,features:n,layer:r,relatedRecords:i}=e,a=r.objectIdField;return n.map(e=>{let n=e.getObjectId()??e.attributes[a],o=[];!e.layer&&!e.sourceLayer&&(e.layer=r,e.sourceLayer=r);let s=this._pendingEditsCache.get(n);if(s){let t=e.clone(),n=s.changes;for(let[t,r]of n)e.attributes[t]=r;s.originalFeature=t}return i.forEach((e,t)=>{o.push({relationshipId:t,count:e[n]??0})}),{objectId:n,feature:e,attachments:t[n]??null,relatedRecords:o}})}async _query(e){let{pageIndex:t,refresh:n}=e;n===!0&&await this._refresh();let r=this.pageCache.get(t);if(r)return r;let i=this._queryOperationInfos.get(t);if(i)return i.task.promise;let a=new AbortController,o=await this._queryPage(e,a);return a.signal.aborted||this.pageCache.set(t,o),o}_queryAttachments(e,t){let{_layerWithAttachments:n,effectiveWhere:r}=this;return n?e.some(e=>typeof e!=`number`)?Promise.reject(new s(`invalid-object-id`,`Only numeric object ids are valid to query attachments`)):n.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0}),{signal:t}):Promise.resolve({})}async _queryCount(e){let{_relatedLayerSupportsCacheHint:t,layer:n,relationshipConfig:r,supportsCacheHint:i}=this;if(!n)return 0;if(r&&this._canUseRelatedLayer){let{objectId:n,relatedLayer:i,relationshipId:a}=r;return(await i.queryRelatedFeaturesCount(new k({cacheHint:t,relationshipId:a,objectIds:[n]}),{signal:e}))[n]??0}let{effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:s,objectIds:c}=this,l=n.createQuery();return l.geometry=s,l.returnGeometry=!1,l.where=o,l.timeExtent=a,l.objectIds=c?.length?c:void 0,i&&(l.cacheHint=!0),n.queryFeatureCount(l,{signal:e})}async _queryFeatures(e,t){let{relationshipConfig:n}=this;if(n&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,n);let{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:a,effectiveTimeExtent:o,effectiveWhere:s,filterGeometry:c,objectIds:l,orderByFields:u,pageSize:d,returnGeometry:f,supportsCacheHint:p,supportsOrderBy:m,supportsPagination:h}=this,{layer:g,start:_}=e,v=l?.length,y=g.createQuery();return y.returnGeometry=f,y.outFields=a,y.returnM=r,y.returnZ=i,h?(y.start=_,y.num=d,y.where=s,y.timeExtent=o,y.objectIds=v?l:void 0):y.objectIds=v?l:this._getObjectIdsForPage(_,d??0),m&&(y.orderByFields=u),c&&(y.geometry=c),p&&(y.cacheHint=!0),(await g.queryFeatures(y,{signal:t})).features}_queryObjectIds(e){let{effectiveTimeExtent:t,effectiveWhere:n,filterGeometry:r,layer:i,objectIds:a,orderByFields:o,supportsCacheHint:s,supportsOrderBy:c}=this;if(!i)return Promise.resolve([]);let l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=n,l.timeExtent=t,l.objectIds=a?.length?a:void 0,c&&(l.orderByFields=o),s&&(l.cacheHint=!0),i.queryObjectIds(l,{signal:e})}async _queryPage(e,t){return this._queueQueryOperation(e.pageIndex,{controller:t,task:a(async()=>this._queryPageData(e,t))})}async _queryPageData(e,t){let{layer:n}=e,{signal:r}=t,i=await this._queryFeatures(e,r);if(r.aborted)return[];let a=this._getObjectIdsForFeatures(i,n),[o,s]=await Promise.all([this._queryAttachments(a,r),this._queryRelatedCounts(a,r)]);return t.signal.aborted?[]:this._createFeatureStoreItems({layer:n,features:i,attachments:o,relatedRecords:s})||[]}async _queryRelatedCounts(e,t){let{_layerWithRelationships:n,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,a=new Map;return!n||!e?.length||!r.length||await Promise.allSettled(r.map(async r=>{let o=await n.queryRelatedFeaturesCount(new k({cacheHint:i,relationshipId:r,objectIds:e}),{signal:t});a.set(r,o)})),a}async _queryRelatedFeatures(e,t){let{_defaultOutFields:n,_effectiveReturnM:r,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:s,supportsCacheHint:c}=this,{layer:l,start:u}=e,{objectId:d,relatedLayer:f,relationshipId:p}=t,m=l.createQuery(),h=new k({cacheHint:c,num:o,objectIds:[d],orderByFields:a,outFields:n,relationshipId:p,returnGeometry:s,returnM:r,returnZ:i,start:u,where:m.where??void 0});return(await f.queryRelatedFeatures(h))[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async n=>{this._attachmentsOperationQueue.remove(t);let r=this._ensureArray(n),i=r.some(e=>e.error),a=this.getItemByObjectId(e);return a&&(!i||r.length>1)&&(a.attachments=(await this._queryAttachments([e]))[e]),n}).catch(async n=>{this._logError(`store:attachment-error`,`An error occurred.`);let r={error:n,retry:()=>{this.failures.remove(r),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._attachmentsOperationQueue.remove(t),n})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(n=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),n)).catch(t=>{this._logError(`store:edit-error`,`An error occurred.`);let n={error:t,retry:()=>{this.failures.remove(n),this._queueEditOperation(e)},cancel:()=>this.failures.remove(n)};throw this.failures.add(n),this._editOperationQueue.remove(e),t})}async _queueQueryOperation(e,t){this._queryOperationInfos.set(e,t);let n=await t.task.promise;return this._queryOperationInfos.delete(e),n}};e([x()],U.prototype,`_attachmentsOperationQueue`,void 0),e([x({readOnly:!0})],U.prototype,`_capabilities`,null),e([x()],U.prototype,`_canSavePendingEdits`,null),e([x()],U.prototype,`_contingentValuesManager`,void 0),e([x()],U.prototype,`_defaultOutFields`,void 0),e([x()],U.prototype,`_editOperationQueue`,void 0),e([x()],U.prototype,`_effectiveReturnZ`,null),e([x()],U.prototype,`_effectiveReturnM`,null),e([x()],U.prototype,`featureTitleMap`,void 0),e([x({readOnly:!0})],U.prototype,`_layerWithAttachments`,null),e([x({readOnly:!0})],U.prototype,`_layerWithAttachmentsEditing`,null),e([x()],U.prototype,`_layerWithContingentValues`,null),e([x({readOnly:!0})],U.prototype,`_layerWithEditing`,null),e([x({readOnly:!0})],U.prototype,`_layerWithRelationships`,null),e([x()],U.prototype,`_loaded`,void 0),e([x()],U.prototype,`_loadController`,void 0),e([x()],U.prototype,`_loadError`,void 0),e([x()],U.prototype,`_objectIdCache`,void 0),e([x()],U.prototype,`_pendingEditsCache`,void 0),e([x()],U.prototype,`_pendingEditsAreInvalid`,null),e([x()],U.prototype,`_queryOperationInfos`,void 0),e([x({readOnly:!0})],U.prototype,`_relatedLayer`,null),e([x({readOnly:!0})],U.prototype,`_relatedLayerCapabilities`,null),e([x({readOnly:!0})],U.prototype,`_relatedLayerSupportsCacheHint`,null),e([x()],U.prototype,`_relatedLayerSupportsQuery`,null),e([x()],U.prototype,`_relatedLayerSupportsQueryRelated`,null),e([x()],U.prototype,`_size`,void 0),e([x()],U.prototype,`_sortedFieldNames`,null),e([x()],U.prototype,`_subtypeCode`,null),e([x()],U.prototype,`_subtypeField`,null),e([x()],U.prototype,`_canUseRelatedLayer`,null),e([x()],U.prototype,`_shouldFilterByLayerScaleRange`,null),e([x()],U.prototype,`_visibleAtCurrentScale`,null),e([x()],U.prototype,`attachmentsEnabled`,void 0),e([x()],U.prototype,`autoSaveEnabled`,void 0),e([x()],U.prototype,`cachedPageCount`,null),e([x()],U.prototype,`canAddRelatedFeature`,null),e([x()],U.prototype,`defaultSelectionManager`,void 0),e([x()],U.prototype,`editingEnabled`,void 0),e([x()],U.prototype,`effectiveOutFields`,null),e([x()],U.prototype,`effectiveSelectionManager`,null),e([x()],U.prototype,`effectiveSize`,null),e([x()],U.prototype,`effectiveTimeExtent`,null),e([x()],U.prototype,`effectiveWhere`,null),e([x({readOnly:!0})],U.prototype,`failures`,void 0),e([x()],U.prototype,`fieldsWithContingentValues`,null),e([x()],U.prototype,`filterByViewExtent`,void 0),e([x()],U.prototype,`filterByLayerScaleRange`,void 0),e([x({types:C})],U.prototype,`filterGeometry`,void 0),e([x()],U.prototype,`hasContingentValues`,null),e([x()],U.prototype,`hasInvalidPendingEdits`,null),e([x()],U.prototype,`hasPendingEdits`,null),e([x()],U.prototype,`highlightEnabled`,void 0),e([x()],U.prototype,`highlightableLayerView`,null),e([x()],U.prototype,`initialSize`,void 0),e([x({readOnly:!0})],U.prototype,`isQuerying`,null),e([x({readOnly:!0})],U.prototype,`isSyncing`,null),e([x({readOnly:!0})],U.prototype,`isSyncingAttachmentEdits`,null),e([x({readOnly:!0})],U.prototype,`isSyncingFeatureEdits`,null),e([x({readOnly:!0})],U.prototype,`itemCache`,null),e([x()],U.prototype,`layer`,void 0),e([x()],U.prototype,`layerView`,null),e([x()],U.prototype,`maxSize`,void 0),e([x()],U.prototype,`objectIds`,void 0),e([x()],U.prototype,`orderByFields`,null),e([x()],U.prototype,`outFields`,void 0),e([x({readOnly:!0})],U.prototype,`pageCache`,void 0),e([x()],U.prototype,`pageCount`,null),e([x()],U.prototype,`pageIndex`,null),e([x()],U.prototype,`pageSize`,void 0),e([x()],U.prototype,`paginationEnabled`,void 0),e([x()],U.prototype,`pendingEditsCount`,null),e([x()],U.prototype,`relationship`,null),e([x()],U.prototype,`relationshipConfig`,void 0),e([x()],U.prototype,`relationshipIds`,null),e([x()],U.prototype,`relationshipInfos`,null),e([x()],U.prototype,`relationships`,null),e([x()],U.prototype,`relatedRecordsEnabled`,void 0),e([x()],U.prototype,`returnGeometry`,void 0),e([x()],U.prototype,`returnZ`,void 0),e([x()],U.prototype,`returnM`,void 0),e([x()],U.prototype,`selectionManager`,void 0),e([x({readOnly:!0})],U.prototype,`size`,null),e([x()],U.prototype,`sortOrders`,void 0),e([x({readOnly:!0})],U.prototype,`state`,null),e([x()],U.prototype,`supportsAdd`,null),e([x()],U.prototype,`supportsAddAttachments`,null),e([x()],U.prototype,`supportsAttachments`,null),e([x()],U.prototype,`supportsCacheHint`,null),e([x()],U.prototype,`supportsCacheHintQueryRelated`,null),e([x()],U.prototype,`supportsDelete`,null),e([x()],U.prototype,`supportsEditing`,null),e([x()],U.prototype,`supportsM`,null),e([x()],U.prototype,`supportsOrderBy`,null),e([x()],U.prototype,`supportsPagination`,null),e([x()],U.prototype,`supportsQuery`,null),e([x()],U.prototype,`supportsQueryRelated`,null),e([x()],U.prototype,`supportsResizeAttachments`,null),e([x()],U.prototype,`supportsUpdate`,null),e([x()],U.prototype,`supportsUpdateAttachments`,null),e([x()],U.prototype,`supportsZ`,null),e([x()],U.prototype,`syncViewSelection`,void 0),e([x()],U.prototype,`temporaryHighlightId`,void 0),e([x({type:A})],U.prototype,`timeExtent`,void 0),e([x()],U.prototype,`timeZone`,void 0),e([x()],U.prototype,`view`,void 0),e([x()],U.prototype,`viewTimeEnabled`,void 0),e([x()],U.prototype,`where`,void 0),U=e([S(`esri.widgets.FeatureTable.support.FeatureStore`)],U);const W=U;export{W as default};
|
|
@@ -992,6 +992,12 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
|
|
|
992
992
|
* @since 5.0
|
|
993
993
|
*/
|
|
994
994
|
get effectiveTable(): FeatureTable;
|
|
995
|
+
/**
|
|
996
|
+
* The 'effective' [TimeExtent](https://developers.arcgis.com/javascript/latest/references/core/time/TimeExtent/) used to filter and display data.
|
|
997
|
+
*
|
|
998
|
+
* @internal
|
|
999
|
+
*/
|
|
1000
|
+
get effectiveTimeExtent(): TimeExtent | undefined;
|
|
995
1001
|
/**
|
|
996
1002
|
* A flattened array of all [field columns](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/FieldColumn/) within the table, including nested columns.
|
|
997
1003
|
*
|