@epa-wg/custom-element-dist 0.0.32 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.github/workflows/deploy.yml +59 -0
  3. package/.idea/copilot.data.migration.agent.xml +6 -0
  4. package/.idea/copilot.data.migration.ask.xml +6 -0
  5. package/.idea/copilot.data.migration.edit.xml +6 -0
  6. package/.idea/custom-element-dist.iml +2 -0
  7. package/.storybook/main.ts +20 -21
  8. package/.storybook/preview.ts +23 -25
  9. package/README.md +6 -4
  10. package/coverage/block-navigation.js +1 -1
  11. package/coverage/coverage-final.json +8 -18
  12. package/coverage/index.html +45 -30
  13. package/coverage/sorter.js +21 -7
  14. package/coverage/src/custom-element/coverage.svg +1 -1
  15. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  16. package/coverage/src/custom-element/custom-element.js.html +687 -480
  17. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  18. package/coverage/src/custom-element/http-request.js.html +39 -18
  19. package/coverage/src/custom-element/index.html +35 -35
  20. package/coverage/src/custom-element/local-storage.js.html +1 -1
  21. package/coverage/src/custom-element/location-element.js.html +31 -31
  22. package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
  23. package/coverage/src/custom-element/module-url.js.html +20 -20
  24. package/coverage/src/index.html +1 -1
  25. package/coverage/src/{stories/local-storage.test.stories.ts → material/theme/colors.js}/coverage.svg +1 -1
  26. package/coverage/src/material/theme/colors.js.html +217 -0
  27. package/coverage/src/{stories/location-element.test.stories.ts → material/theme}/coverage.svg +1 -1
  28. package/coverage/src/material/theme/index.html +116 -0
  29. package/coverage/src/mocks/handlers.ts.html +1 -1
  30. package/coverage/src/mocks/index.html +1 -1
  31. package/coverage/src/stories/coverage.svg +1 -1
  32. package/coverage/src/stories/{external-template.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
  33. package/coverage/src/stories/frame.canvas.ts.html +175 -0
  34. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  35. package/coverage/src/stories/index.html +14 -179
  36. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  37. package/coverage/src/sum.ts.html +1 -1
  38. package/dist/custom-element-BoYMoUtP.js +619 -0
  39. package/dist/custom-element-BqtjrCRF.cjs +97 -0
  40. package/dist/custom-element-bundle.cjs +1 -1
  41. package/dist/custom-element-bundle.js +3 -3
  42. package/dist/demo/a.html +10 -3
  43. package/dist/demo/a.svg +26 -26
  44. package/dist/demo/attributes.html +153 -0
  45. package/dist/demo/external-templates-sb-6.html +42 -0
  46. package/dist/demo/external-templates-sb-7.html +42 -0
  47. package/dist/demo/html-template.html +5 -4
  48. package/dist/demo/module-url-sb-2.html +46 -0
  49. package/dist/demo/module-url-sb-4.html +48 -0
  50. package/dist/demo/module-url-sb-5.html +53 -0
  51. package/dist/demo/s.xml +3859 -7
  52. package/dist/demo/s.xslt +13 -48
  53. package/dist/demo/s1.xml +3706 -0
  54. package/dist/demo/ss.html +13 -4
  55. package/dist/http-request-DSaowcG1.cjs +1 -0
  56. package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
  57. package/dist/mockServiceWorker.js +31 -8
  58. package/package.json +25 -26
  59. package/public/demo/a.html +10 -3
  60. package/public/demo/a.svg +26 -26
  61. package/public/demo/attributes.html +153 -0
  62. package/public/demo/external-templates-sb-6.html +42 -0
  63. package/public/demo/external-templates-sb-7.html +42 -0
  64. package/public/demo/html-template.html +5 -4
  65. package/public/demo/module-url-sb-2.html +46 -0
  66. package/public/demo/module-url-sb-4.html +48 -0
  67. package/public/demo/module-url-sb-5.html +53 -0
  68. package/public/demo/s.xml +3859 -7
  69. package/public/demo/s.xslt +13 -48
  70. package/public/demo/s1.xml +3706 -0
  71. package/public/demo/ss.html +13 -4
  72. package/public/mockServiceWorker.js +31 -8
  73. package/src/custom-element/custom-element.d.ts +4 -0
  74. package/src/custom-element/custom-element.js +119 -50
  75. package/src/custom-element/demo/a.html +10 -3
  76. package/src/custom-element/demo/a.svg +26 -26
  77. package/src/custom-element/demo/attributes.html +153 -0
  78. package/src/custom-element/demo/html-template.html +5 -4
  79. package/src/custom-element/demo/s.xml +3859 -7
  80. package/src/custom-element/demo/s.xslt +13 -48
  81. package/src/custom-element/demo/s1.xml +3706 -0
  82. package/src/custom-element/demo/ss.html +13 -4
  83. package/src/custom-element/http-request.js +7 -0
  84. package/src/custom-element/ide/web-types-dce.json +1 -1
  85. package/src/custom-element/ide/web-types-xsl.json +1 -1
  86. package/src/custom-element/index.html +1 -1
  87. package/src/material/angular.css +987 -987
  88. package/src/material/components/action.html +262 -0
  89. package/src/material/components/autocomplete.html +167 -239
  90. package/src/material/components/badge.html +239 -0
  91. package/src/material/components/dropdown.html +7 -13
  92. package/src/material/components/icon-link.html +160 -160
  93. package/src/material/components/icon.html +252 -0
  94. package/src/material/components/input.html +569 -362
  95. package/src/material/components/menu.html +235 -234
  96. package/src/material/components.html +157 -121
  97. package/src/material/demo.css +36 -36
  98. package/src/material/index.html +109 -110
  99. package/src/material/material.css +356 -356
  100. package/src/material/theme/Base-Principles.md +339 -0
  101. package/src/material/theme/README.md +298 -18
  102. package/src/material/theme/UI Domain Model in web applications.svg +1 -0
  103. package/src/material/theme/User Semantic Theme tokens.svg +1 -0
  104. package/src/material/theme/action-pending-poc.html +62 -0
  105. package/src/material/theme/actions-color.html +141 -0
  106. package/src/material/theme/colors-light.html +631 -0
  107. package/src/material/theme/colors-native.html +51 -0
  108. package/src/material/theme/colors-poc.html +66 -0
  109. package/src/material/theme/colors.html +297 -0
  110. package/src/material/theme/colors.js +44 -0
  111. package/src/material/theme/consumer-theme.css +745 -0
  112. package/src/material/theme/semantic.css +132 -113
  113. package/src/material/theme/style-bug.html +123 -0
  114. package/src/material/theme/theme-data.css +43 -0
  115. package/src/material/theme/theme-data.xhtml +2926 -0
  116. package/src/material/theme/todo.md +274 -0
  117. package/src/material/theme/tokens/action-colors.png +0 -0
  118. package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
  119. package/src/material/theme/tokens/cem-breakpoints.md +519 -0
  120. package/src/material/theme/tokens/cem-colors.md +715 -0
  121. package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
  122. package/src/material/theme/tokens/cem-coupling.md +372 -0
  123. package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
  124. package/src/material/theme/tokens/cem-dimension.md +625 -0
  125. package/src/material/theme/tokens/cem-layering.md +562 -0
  126. package/src/material/theme/tokens/cem-m3-parity.md +343 -0
  127. package/src/material/theme/tokens/cem-responsive.md +238 -0
  128. package/src/material/theme/tokens/cem-shape.md +691 -0
  129. package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
  130. package/src/material/theme/tokens/cem-stroke.md +480 -0
  131. package/src/material/theme/tokens/cem-timing.md +198 -0
  132. package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
  133. package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
  134. package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
  135. package/src/material/theme/tokens/chips.png +0 -0
  136. package/src/material/theme/tokens/columns-page.png +0 -0
  137. package/src/material/theme/tokens/initials.png +0 -0
  138. package/src/material/theme/tokens/nav-buttons.png +0 -0
  139. package/src/material/theme/tokens/script.png +0 -0
  140. package/src/material/theme/tokens/sufler.png +0 -0
  141. package/src/material/theme/tokens/typography-icons.png +0 -0
  142. package/src/mocks/versions.mock.ts +1 -1
  143. package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
  144. package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
  145. package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
  146. package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
  147. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
  148. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
  149. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
  150. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
  151. package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
  152. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
  153. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
  154. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
  155. package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
  156. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
  157. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
  158. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
  159. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
  160. package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
  161. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
  162. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
  163. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
  164. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
  165. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
  166. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
  167. package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
  168. package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
  169. package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
  170. package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
  171. package/src/stories/attributes.test.stories.ts +83 -17
  172. package/src/stories/dom-merge.test.stories.ts +25 -1
  173. package/src/stories/external-template.test.stories.ts +16 -14
  174. package/src/stories/frame.canvas.ts +31 -0
  175. package/src/stories/module-url.test.stories.ts +29 -61
  176. package/src/stories/xslt-conditionals.test.stories.ts +492 -0
  177. package/src/stories/xslt-if.test.stories.ts +89 -0
  178. package/storybook-static/assets/Color-F6OSRLHC-CzTOSlqB.js +1 -0
  179. package/storybook-static/assets/Configure-7GqRsAoJ.js +165 -0
  180. package/storybook-static/assets/DocsRenderer-CFRXHY34-Duc5rSIm.js +2 -0
  181. package/storybook-static/assets/{attributes.test.stories-D1X6EBrd.js → attributes.test.stories-DYuxF8h1.js} +109 -38
  182. package/storybook-static/assets/{css.test.stories-Cp_g2hE1.js → css.test.stories-LOmvINyb.js} +1 -1
  183. package/storybook-static/assets/custom-element-Bwx7otrT.js +97 -0
  184. package/storybook-static/assets/{dom-merge.test.stories-hbpdCka0.js → dom-merge.test.stories-CEKhWjaS.js} +47 -6
  185. package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
  186. package/storybook-static/assets/entry-preview-docs-CbF8-81D.js +2 -0
  187. package/storybook-static/assets/{external-template.test.stories-BK89h6sk.js → external-template.test.stories-jHu0wsJ-.js} +38 -40
  188. package/storybook-static/assets/{form.test.stories-BfoLe_rw.js → form.test.stories-CUyUnmwP.js} +1 -1
  189. package/storybook-static/assets/frame.canvas-E5n9h6j1.js +1 -0
  190. package/storybook-static/assets/{handlers-yVPwH_Nz.js → handlers-F7GUfMqr.js} +17 -14
  191. package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
  192. package/storybook-static/assets/{http-request.stories-CBFJS2Ws.js → http-request.stories-wyX5-QOv.js} +1 -1
  193. package/storybook-static/assets/iframe-BS_DPWl0.js +199 -0
  194. package/storybook-static/assets/index-CGuyH0k-.js +240 -0
  195. package/storybook-static/assets/index-DB7LLObI.js +1 -0
  196. package/storybook-static/assets/index-DO1nmyvI.js +11 -0
  197. package/storybook-static/assets/index-V1EGs-wm.js +621 -0
  198. package/storybook-static/assets/{local-storage.test.stories-C0Yzy6Am.js → local-storage.test.stories-BxOhsf1k.js} +1 -1
  199. package/storybook-static/assets/{location-element.test.stories-DNFrEu5A.js → location-element.test.stories-DqhvvUoa.js} +1 -1
  200. package/storybook-static/assets/module-url.test.stories-C1gG9G7Y.js +142 -0
  201. package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
  202. package/storybook-static/assets/preview-Bn8igYMp.js +1 -0
  203. package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
  204. package/storybook-static/assets/preview-Cwy1XFu2.js +2 -0
  205. package/storybook-static/assets/preview-D6sehqkw.js +50 -0
  206. package/storybook-static/assets/preview-DfTudP20.js +1 -0
  207. package/storybook-static/assets/{set-url.test.stories-BBfLxv2u.js → set-url.test.stories-BKQNdknJ.js} +1 -1
  208. package/storybook-static/assets/{slice-events.test.stories-HcXF8XQI.js → slice-events.test.stories-ChqULCeA.js} +1 -1
  209. package/storybook-static/assets/{slots.test.stories-i6mnIFM2.js → slots.test.stories-BlyLoCRe.js} +1 -1
  210. package/storybook-static/assets/{version-select.test.stories-BsUFH6Va.js → version-select.test.stories-CPGSh1tR.js} +1 -1
  211. package/storybook-static/assets/xslt-conditionals.test.stories-YC6QPqWZ.js +633 -0
  212. package/storybook-static/assets/xslt-if.test.stories-BRSWy2-x.js +71 -0
  213. package/storybook-static/demo/a.html +10 -3
  214. package/storybook-static/demo/a.svg +26 -26
  215. package/storybook-static/demo/attributes.html +153 -0
  216. package/storybook-static/demo/external-templates-sb-6.html +42 -0
  217. package/storybook-static/demo/external-templates-sb-7.html +42 -0
  218. package/storybook-static/demo/html-template.html +5 -4
  219. package/storybook-static/demo/module-url-sb-2.html +46 -0
  220. package/storybook-static/demo/module-url-sb-4.html +48 -0
  221. package/storybook-static/demo/module-url-sb-5.html +53 -0
  222. package/storybook-static/demo/s.xml +3859 -7
  223. package/storybook-static/demo/s.xslt +13 -48
  224. package/storybook-static/demo/s1.xml +3706 -0
  225. package/storybook-static/demo/ss.html +13 -4
  226. package/storybook-static/iframe.html +2 -2
  227. package/storybook-static/index.html +6 -10
  228. package/storybook-static/index.json +1 -1
  229. package/storybook-static/mockServiceWorker.js +31 -8
  230. package/storybook-static/project.json +1 -1
  231. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  232. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
  233. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +394 -0
  234. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +233 -0
  235. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  236. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  237. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
  238. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  239. package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
  240. package/storybook-static/sb-manager/globals-module-info.js +9 -0
  241. package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
  242. package/storybook-static/sb-manager/runtime.js +4944 -6321
  243. package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +0 -10
  244. package/coverage/src/stories/attributes.test.stories.ts.html +0 -814
  245. package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
  246. package/coverage/src/stories/css.test.stories.ts.html +0 -460
  247. package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
  248. package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
  249. package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
  250. package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
  251. package/coverage/src/stories/form.test.stories.ts.html +0 -661
  252. package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
  253. package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
  254. package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
  255. package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
  256. package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
  257. package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
  258. package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
  259. package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
  260. package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
  261. package/coverage/src/stories/slots.test.stories.ts.html +0 -742
  262. package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
  263. package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
  264. package/dist/custom-element-D2wf_rqP.js +0 -576
  265. package/dist/custom-element-Dtzhbjkc.cjs +0 -97
  266. package/dist/http-request-DPrY7mGh.cjs +0 -1
  267. package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +0 -1
  268. package/storybook-static/assets/Configure-DN6ifayP.js +0 -165
  269. package/storybook-static/assets/DocsRenderer-CFRXHY34-BaVEufDj.js +0 -2
  270. package/storybook-static/assets/custom-element-uuAtIYWS.js +0 -97
  271. package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
  272. package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
  273. package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
  274. package/storybook-static/assets/iframe-CJEL_4Nu.js +0 -2
  275. package/storybook-static/assets/index-BcZLpTeD.js +0 -8
  276. package/storybook-static/assets/index-CxRwF5Or.js +0 -234
  277. package/storybook-static/assets/index-D-8MO0q_.js +0 -1
  278. package/storybook-static/assets/index-D5fBh-7N.js +0 -1
  279. package/storybook-static/assets/index-DM-KBPdl.js +0 -1
  280. package/storybook-static/assets/index-RSFf30w1.js +0 -1
  281. package/storybook-static/assets/index-SnjB5uV8.js +0 -769
  282. package/storybook-static/assets/module-url.test.stories-CXibF5Ta.js +0 -208
  283. package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
  284. package/storybook-static/assets/preview-Bnd0XhaF.js +0 -52
  285. package/storybook-static/assets/preview-CNKoaWES.js +0 -1
  286. package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
  287. package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
  288. package/storybook-static/assets/preview-DJMlNTk8.js +0 -2
  289. package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
  290. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
  291. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
  292. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
  293. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
  294. package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
  295. package/storybook-static/sb-preview/globals.js +0 -33
  296. package/storybook-static/sb-preview/runtime.js +0 -7174
  297. package/test-runner-jest.config.js +0 -15
  298. /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
  299. /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
  300. /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
@@ -0,0 +1,619 @@
1
+ const K = "http://www.w3.org/1999/XSL/Transform", R = "http://www.w3.org/1999/xhtml", ye = "http://exslt.org/common", d = (e, s) => e?.getAttribute?.(s), se = (e) => e.nodeType === 3, ge = (e) => typeof e == "string", le = (e) => e && typeof e.nodeType == "number", L = (e, s) => (e.ownerDocument || e).createTextNode(s), ce = (e) => {
2
+ for (; e.firstChild; ) e.firstChild.remove();
3
+ return e;
4
+ }, F = (e) => (e.getAttributeNames().map((s) => e.removeAttribute(s)), ce(e)), me = (e) => (e?.setAttribute("xmlns:xsl", K), e), ue = (e) => (e?.setAttribute("xmlns:xhtml", R), me(e)), de = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), ne = (e, s) => (Object.keys(s).map((t) => e[t] = s[t]), e), C = (e, s = "", t = document) => {
5
+ const l = (n) => ((o) => (s && o.append(L(t.ownerDocument || t, s)), o))((t.ownerDocument || t).createElement(n));
6
+ if (de(e))
7
+ return l(e);
8
+ const a = l("dce-object");
9
+ return a.setAttribute("dce-object-name", e), a;
10
+ }, ae = (e, s) => {
11
+ const t = e.ownerDocument.createElementNS(e.namespaceURI, s);
12
+ for (let l of e.attributes)
13
+ t.setAttribute(l.name, l.value);
14
+ for (let l of e.childNodes)
15
+ t.append(l.cloneNode(!0));
16
+ return t;
17
+ };
18
+ function U(e) {
19
+ return new DOMParser().parseFromString(e, "application/xml");
20
+ }
21
+ function q(e) {
22
+ return new XMLSerializer().serializeToString(e);
23
+ }
24
+ function B(e, s, t, l) {
25
+ const a = (y) => e.ownerDocument.createElement(y), o = ((y, x, v) => (x.append(v = a(y)), v))(s, e);
26
+ return [...t].forEach((y) => o.append(l(y))), o;
27
+ }
28
+ function Ae(e) {
29
+ return e.slot || (e.setAttribute || (e = C("span", e.textContent.replaceAll(`
30
+ `, ""))), e.setAttribute("slot", "")), e;
31
+ }
32
+ function J(e, s) {
33
+ e.getAttributeNames().forEach((t) => s.includes(t) || e.removeAttribute(t));
34
+ }
35
+ const ie = (e) => [...e].filter((s) => !(s.nodeType === 3 && s.data.trim() === ""));
36
+ function I(e, s, t) {
37
+ const l = typeof e;
38
+ if (l === "string")
39
+ return C(s, e, t);
40
+ if (l === "number")
41
+ return C(s, "" + e, t);
42
+ if (le(e)) {
43
+ const n = C(s);
44
+ return n.append(e), n;
45
+ }
46
+ if (e instanceof Array) {
47
+ const n = C("array", "", t);
48
+ return e.map((o) => n.append(I(o, s, t))), n;
49
+ }
50
+ if (e instanceof FormData) {
51
+ const n = C("form-data", "", t);
52
+ for (const o of e)
53
+ n.append(I(o[1], o[0], t));
54
+ return n;
55
+ }
56
+ const a = C(s, "", t);
57
+ for (let n in e)
58
+ typeof e[n] == "function" || e[n] instanceof Window || le(e[n]) && !(n === "data" || n === "value") || (typeof e[n] != "object" && de(n) ? a.setAttribute(n, e[n]) : a.append(I(e[n], n, t)));
59
+ return a;
60
+ }
61
+ function re(e) {
62
+ if (z(e, "*", (s) => [...s.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
63
+ const l = t.data, a = l.matchAll(/{([^}]*)}/g);
64
+ if (a) {
65
+ let n = 0, o = (x) => L(t, x), y = [];
66
+ if ([...a].forEach((x) => {
67
+ x.index > n && y.push(o(x.input.substring(n, x.index)));
68
+ const v = e.querySelector("value-of").cloneNode();
69
+ v.setAttribute("select", x[1]), y.push(v), n = x.index + x[0].length;
70
+ }), n < l.length && y.push(o(l.substring(n, l.length))), y.length) {
71
+ for (let x of y)
72
+ s.insertBefore(x, t);
73
+ s.removeChild(t);
74
+ }
75
+ }
76
+ })), "all" in e) {
77
+ let s = 1;
78
+ for (let t of e.all)
79
+ t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + s++);
80
+ }
81
+ return e;
82
+ }
83
+ function ve(e, s = "xsl:stylesheet") {
84
+ const t = [], l = {}, a = {};
85
+ if (e.tagName === s || e.documentElement?.tagName === s)
86
+ return re(ne(e, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }));
87
+ const n = U(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${ye}" exclude-result-prefixes="exsl" >
88
+ <xsl:output method="xml"/>
89
+ <xsl:template match="/"><dce-root xmlns="${R}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
90
+ <xsl:template match="*[name()='template']">
91
+ <xsl:apply-templates mode="sanitize" select="*|text()"/>
92
+ </xsl:template>
93
+ <xsl:template match="*">
94
+ <xsl:apply-templates mode="sanitize" select="*|text()"/>
95
+ </xsl:template>
96
+ <xsl:template match="*[name()='svg']|*[name()='math']">
97
+ <xsl:apply-templates mode="sanitize" select="."/>
98
+ </xsl:template>
99
+ <xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
100
+ <xsl:copy>
101
+ <xsl:apply-templates mode="sanitize" select="@*"/>
102
+ <xsl:value-of select="text()"></xsl:value-of>
103
+ </xsl:copy>
104
+ </xsl:template>
105
+ <xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
106
+ <xsl:element name="{local-name()}">
107
+ <xsl:apply-templates mode="sanitize" select="@*"/>
108
+ <xsl:value-of select="text()"></xsl:value-of>
109
+ </xsl:element>
110
+ </xsl:template>
111
+ <xsl:template mode="sanitize" match="*|@*">
112
+ <xsl:copy>
113
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
114
+ </xsl:copy>
115
+ </xsl:template>
116
+ <xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
117
+ <xsl:template mode="sanitize" match="text()">
118
+ <dce-text>
119
+ <xsl:copy/>
120
+ </dce-text>
121
+ </xsl:template>
122
+ <xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
123
+ <xsl:copy>
124
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
125
+ </xsl:copy>
126
+ </xsl:template>
127
+ <xsl:template mode="sanitize" match="xhtml:*">
128
+ <xsl:element name="{local-name()}">
129
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
130
+ </xsl:element>
131
+ </xsl:template>
132
+ <xsl:template mode="sanitize" match="xhtml:input">
133
+ <xsl:element name="{local-name()}">
134
+ <xsl:apply-templates mode="sanitize" select="*[not(name()='slice')]|@*|text()"/>
135
+ </xsl:element>
136
+ <xsl:for-each select="slice">
137
+ <xsl:copy>
138
+ <xsl:attribute name="for" >^</xsl:attribute>
139
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
140
+ </xsl:copy>
141
+ </xsl:for-each>
142
+ </xsl:template>
143
+ </xsl:stylesheet>`), o = new XSLTProcessor(), y = ((i) => {
144
+ z(i, "custom-element", (h) => {
145
+ h.firstElementChild.localName === "template" && ([...h.firstElementChild.content.childNodes].forEach((b) => h.append(b)), h.firstElementChild.remove());
146
+ }), z(i, "script", (h) => h.remove());
147
+ const r = i.content ?? i.firstElementChild?.content ?? i.body ?? i;
148
+ Le.forEach((h) => z(r, h, (b) => De(b, r)));
149
+ const f = i.firstElementChild?.content || i.content, g = (h) => {
150
+ const b = U("<xhtml/>"), T = b.importNode(h, !0);
151
+ return b.replaceChild(T, b.documentElement), T.namespaceURI === R && !d(T, "xmlns") && T.setAttribute("xmlns", R), ue(T);
152
+ };
153
+ if (f) {
154
+ const h = C("div");
155
+ return [...f.childNodes].map((b) => h.append(b.cloneNode(!0))), g(h);
156
+ }
157
+ return g(i.documentElement || i.body || i);
158
+ })(e), x = U(
159
+ `<xsl:stylesheet version="1.0"
160
+ xmlns:xsl="${K}"
161
+ xmlns:xhtml="${R}"
162
+ xmlns:dce="urn:schemas-epa-wg:dce"
163
+ xmlns:exsl="http://exslt.org/common"
164
+ exclude-result-prefixes="exsl"
165
+ >
166
+ <xsl:template match="ignore">
167
+ <xsl:choose>
168
+ <xsl:when test="//attr">{//attr}</xsl:when>
169
+ <xsl:otherwise>{def}</xsl:otherwise>
170
+ </xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
171
+ <xsl:template mode="payload" match="attributes"></xsl:template>
172
+ <xsl:template match="/">
173
+ <xsl:apply-templates mode="payload" select="/datadom/attributes"/>
174
+ </xsl:template>
175
+ <xsl:template name="slot" >
176
+ <xsl:param name="slotname" />
177
+ <xsl:param name="defaultvalue" />
178
+ <xsl:choose>
179
+ <xsl:when test="//payload/*[@slot=$slotname]">
180
+ <xsl:copy-of select="//payload/*[@slot=$slotname]"/>
181
+ </xsl:when>
182
+ <xsl:otherwise>
183
+ <xsl:copy-of select="$defaultvalue"/>
184
+ </xsl:otherwise>
185
+ </xsl:choose>
186
+ </xsl:template>
187
+ <xsl:variable name="js-injected-body">
188
+ <xsl:call-template name="slot" >
189
+ <xsl:with-param name="slotname" select="''"/>
190
+ <xsl:with-param name="defaultvalue"/>
191
+ </xsl:call-template>
192
+ </xsl:variable>
193
+ </xsl:stylesheet>`
194
+ );
195
+ o.importStylesheet(n);
196
+ const v = o.transformToFragment(y, document), u = (i, r) => i.querySelector(r), w = u(x, 'template[mode="payload"]');
197
+ if (!v)
198
+ return console.error("transformation error", { xml: y.outerHTML, xsl: q(n) });
199
+ if (v.firstElementChild.localName !== "dce-root") {
200
+ const i = v.ownerDocument.createElement("dce-root");
201
+ [...v.childNodes].forEach((r) => i.append(r)), v.append(i);
202
+ }
203
+ [...v.querySelectorAll("[test]")].forEach((i) => {
204
+ const r = d(i, "test"), f = r.replace(
205
+ /hasBoolAttribute\((.*?)\)/g,
206
+ (g, h, b, T, M) => {
207
+ const D = h.substring(1);
208
+ return `(not($${D} = 'false') and ($${D} = '' or $${D} = '${D}' or $${D} = 'true' ))`;
209
+ }
210
+ );
211
+ r !== f && i.setAttribute("test", f);
212
+ }), [...v.querySelectorAll("dce-root>attribute")].forEach((i) => {
213
+ J(i, "namespace,name,select");
214
+ const r = ae(i, "xsl:param"), f = d(i, "name");
215
+ if (t.push(f), i.childNodes.length && (l[f] = i.textContent), w.append(r), i.hasAttribute("select")) {
216
+ a[f] = d(i, "select"), J(r, "select,name");
217
+ let g = d(i, "select").split("??"), h;
218
+ if (g?.length > 1) {
219
+ r.removeAttribute("select");
220
+ const b = u(x, 'template[match="ignore"]>choose').cloneNode(!0);
221
+ F(b.firstElementChild).append(L(b, "{" + g[0] + "}")), b.firstElementChild.setAttribute("test", g[0]);
222
+ for (let T = 1; T < g.length - 1; T++) {
223
+ const M = b.firstElementChild.cloneNode(!0);
224
+ F(M).append(L(b, "{" + g[T] + "}")), M.setAttribute("test", g[T]), b.insertBefore(M, b.lastElementChild);
225
+ }
226
+ F(b.lastElementChild).append(L(b, "{" + g[g.length - 1] + "}")), r.append(b), h = b.cloneNode(!0);
227
+ } else
228
+ h = ae(i, "xsl:value-of");
229
+ h.removeAttribute("name"), i.append(h), i.removeAttribute("select");
230
+ } else
231
+ J(r, "name"), r.setAttribute("select", "/datadom/attributes/" + f), l[f] || i.remove();
232
+ }), [...v.querySelectorAll("[value]")].filter((i) => i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((i) => {
233
+ const r = d(i, "value");
234
+ r && i.setAttribute("value", $e(r));
235
+ });
236
+ for (const i of v.childNodes)
237
+ w.append(x.importNode(i, !0));
238
+ [...w.getElementsByTagName("xsl:template")].forEach((i) => w.ownerDocument.documentElement.append(i));
239
+ const O = u(x, 'call-template[name="slot"]'), H = (i) => {
240
+ const r = O.cloneNode(!0), f = d(i, "name");
241
+ f && r.firstElementChild.setAttribute("select", `'${f}'`);
242
+ for (let g of i.childNodes)
243
+ r.lastElementChild.append(g);
244
+ return r;
245
+ };
246
+ z(w, "slot", (i) => i.parentNode.replaceChild(H(i), i));
247
+ const p = re(x);
248
+ return ne(p, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }), p;
249
+ }
250
+ async function Ee(e) {
251
+ return await new Promise((t, l) => {
252
+ const a = new XMLHttpRequest();
253
+ a.open("GET", e), a.responseType = "document", a.onload = () => {
254
+ a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || C("div", a.responseText)) : l(`${a.statusText} - ${e}`);
255
+ }, a.addEventListener("error", (n) => l(n)), a.send();
256
+ });
257
+ }
258
+ function Ne(e, s, t = !1) {
259
+ if (e === s)
260
+ return !0;
261
+ if (typeof e != "object" || e === null || typeof s != "object" || s === null || Object.keys(e).length !== Object.keys(s).length)
262
+ return t;
263
+ for (let l in e)
264
+ if (!(l in s) || !Ne(e[l], s[l]))
265
+ return t;
266
+ return !0;
267
+ }
268
+ const pe = (e) => e.split("|").map((s) => s.trim()).filter((s) => s), we = (e, s) => pe(s).map((t) => {
269
+ let l = e.ownerDocument, a = (n) => (e.append(n), n);
270
+ if (t.includes("/")) {
271
+ const n = [], o = l.evaluate(t, e);
272
+ for (let y; y = o.iterateNext(); )
273
+ n.push(y);
274
+ return n;
275
+ }
276
+ return [...e.childNodes].find((n) => n.localName === t) || a(C(t, "", l));
277
+ }).flat();
278
+ function oe(e, s, t, l) {
279
+ if (!t.sliceProcessed)
280
+ return t.sliceProcessed = 1, we(e, s ?? "").map((a) => {
281
+ const n = e.ownerDocument, o = t.sliceEventSource, y = t.sliceElement, x = () => [...a.childNodes].filter((u) => u.nodeType === 3 || u.localName === "value" || u.localName === "form-data").map((u) => u.remove());
282
+ o.getAttributeNames().map((u) => a.setAttribute(u, d(o, u))), [...a.childNodes].filter((u) => u.localName === "event").map((u) => u.remove()), "validationMessage" in o && a.setAttribute("validation-message", o.validationMessage), t.type === "init" && x(), a.append(I(t, "event", n));
283
+ const v = (o.type === "checkbox" || o.type === "radio") && !o.checked;
284
+ if (y.hasAttribute("slice-value")) {
285
+ o.value === void 0 ? a.removeAttribute("value") : a.setAttribute("value", o.value);
286
+ const u = v ? "" : P(d(y, "slice-value"), a);
287
+ x(), a.append(L(n, u));
288
+ } else {
289
+ if ("elements" in o)
290
+ return x(), a.append(I(new FormData(o), "value", a.ownerDocument)), a;
291
+ const u = v ? "" : o.value ?? d(o, "value");
292
+ if (x(), u == null)
293
+ [...a.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()), a.removeAttribute("value");
294
+ else {
295
+ const w = ge(u) ? L(n, u) : I(u, "value", a.ownerDocument);
296
+ a.append(w), a.setAttribute("value", u);
297
+ }
298
+ }
299
+ return a;
300
+ });
301
+ }
302
+ function z(e, s, t) {
303
+ e.querySelectorAll && [...e.querySelectorAll(s)].forEach(t);
304
+ }
305
+ const Te = async (e, s) => {
306
+ if (!e || !e.trim())
307
+ return [s];
308
+ if (e.startsWith("#"))
309
+ return ((t) => {
310
+ const l = t.querySelectorAll(e);
311
+ return [...l.length ? l : t.getRootNode().querySelectorAll(e)];
312
+ })(s.parentElement);
313
+ try {
314
+ const [t, l] = e.split("#");
315
+ if (e.charAt(0) === ".")
316
+ e = new URL(t, s.closest("[base]")?.getAttribute("base") || location).href;
317
+ else
318
+ try {
319
+ e = import.meta.resolve(t), l && (e += "#" + l);
320
+ } catch (n) {
321
+ console.error(n.message);
322
+ }
323
+ const a = await Ee(e);
324
+ if (s.setAttributeNS("xml", "base", e), l) {
325
+ const n = a.querySelectorAll("#" + l);
326
+ return n.length ? [...n] : (console.error("template not found", e + "#" + l), [s]);
327
+ }
328
+ return [a];
329
+ } catch {
330
+ return [s];
331
+ }
332
+ };
333
+ function fe(e, s) {
334
+ for (let n of e.attributes)
335
+ try {
336
+ const o = n.name;
337
+ if (o.startsWith("xmlns"))
338
+ continue;
339
+ n.namespaceURI ? (!s.hasAttributeNS(n.namespaceURI, o) || s.getAttributeNS(n.namespaceURI, o) !== n.value) && s.setAttributeNS(n.namespaceURI, o, n.value) : (!s.hasAttribute(o) || s.getAttribute(o) !== n.value) && s.setAttribute(n.name, n.value), n.name === "value" && (s.value = n.value);
340
+ } catch (o) {
341
+ console.warn("attribute assignment error", o?.message || o);
342
+ }
343
+ const t = s.dceExportedAttributes, l = s.getAttribute("dce-exported-attributes"), a = l ? new Set(l.split(" ")) : null;
344
+ for (let n of s.getAttributeNames())
345
+ !e.hasAttribute(n) && !t?.has(n) && !a?.has(n) && s.removeAttribute(n);
346
+ }
347
+ function he(e, s = 0) {
348
+ const t = {};
349
+ for (const l of e.childNodes) {
350
+ const a = d(l, "data-dce-id") || l.dceId || 0;
351
+ if (!t[a])
352
+ a ? t[a] = 1 : (t[a] = l.dceId = ++s, l.setAttribute && l.setAttribute("data-dce-id", l.dceId));
353
+ else {
354
+ const n = l.dceId = a + "-" + t[a]++;
355
+ l.setAttribute && l.setAttribute("data-dce-id", n);
356
+ }
357
+ l.childNodes.length && he(l);
358
+ }
359
+ }
360
+ function Se(e, s, t) {
361
+ t = 1 * t;
362
+ for (let l of e.childNodes)
363
+ if ((l.dceId ?? l.getAttribute("data-dce-id") * 1) > t)
364
+ return e.insertBefore(s, l);
365
+ e.append(s);
366
+ }
367
+ function xe(e, s) {
368
+ if (e.firstElementChild?.localName === "dce-root" && s[0]?.localName !== "dce-root")
369
+ return;
370
+ if (!s.length)
371
+ return e.firstElementChild?.localName !== "dce-root" && ce(e);
372
+ const t = {};
373
+ for (let l of e.childNodes)
374
+ t[l.dceId], se(l) ? (l.data.trim(), t[l.dceId || 0] = l) : t[d(l, "data-dce-id") || 0] = l;
375
+ for (let l of [...s]) {
376
+ const a = d(l, "data-dce-id") || l.dceId, n = t[a];
377
+ n ? (se(l) ? n.nodeValue !== l.nodeValue && (n.nodeValue = l.nodeValue) : (fe(l, n), (n.childNodes.length || l.childNodes.length) && xe(n, l.childNodes)), delete t[a]) : Se(e, l, a);
378
+ }
379
+ for (let l of Object.values(t))
380
+ l.localName !== "dce-root" && l.remove();
381
+ }
382
+ function Ce(e, s) {
383
+ return e.hasAttribute(s) || e.setAttribute(s, crypto.randomUUID()), e.getAttribute(s);
384
+ }
385
+ const $e = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${Q(t[3])}}${t[4]}`).join(""), Q = (e) => {
386
+ if (!e.trim())
387
+ return e;
388
+ const s = e.split("??"), t = s.shift(), l = Q(s.join("??"));
389
+ return s.length ? `concat( ${t} , substring( ${l} , (1+string-length( ${l} )) * string-length( ${t} ) ) )` : e;
390
+ }, P = (e, s) => {
391
+ const t = e.split("??");
392
+ if (t.length > 1)
393
+ return P(t[0], s) || P(t[1], s);
394
+ e = Q(e);
395
+ const l = s.ownerDocument.evaluate(e, s);
396
+ switch (l.resultType) {
397
+ case XPathResult.NUMBER_TYPE:
398
+ return l.numberValue;
399
+ case XPathResult.STRING_TYPE:
400
+ return l.stringValue;
401
+ case XPathResult.BOOLEAN_TYPE:
402
+ return l.booleanValue;
403
+ }
404
+ let a = "";
405
+ for (let n; n = l.iterateNext(); )
406
+ a += n.textContent;
407
+ return a;
408
+ }, Le = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), De = (e, s) => {
409
+ const t = C("xsl:" + e.localName);
410
+ for (let a of e.attributes)
411
+ t.setAttribute(a.name, a.value);
412
+ for (; e.firstChild; )
413
+ t.append(e.firstChild);
414
+ const l = e.localName === "if" || e.localName === "choose" ? (() => {
415
+ const a = C("span");
416
+ return a.append(t), a;
417
+ })() : t;
418
+ if (e.parentElement)
419
+ e.parentElement.replaceChild(l, e);
420
+ else {
421
+ const a = e.parentElement || s, n = [...a.childNodes];
422
+ n.forEach((o, y) => {
423
+ o === e && (n[y] = l);
424
+ }), a.replaceChildren(...n);
425
+ }
426
+ };
427
+ class je extends HTMLElement {
428
+ static observedAttributes = ["src", "tag", "hidden"];
429
+ async connectedCallback() {
430
+ this.firstElementChild && this.firstElementChild.localName !== "template" && console.log(`custom-element used without template wrapping content
431
+ `, this.outerHTML);
432
+ const s = await Te(d(this, "src"), this), t = d(this, "tag"), l = t || "dce-" + crypto.randomUUID();
433
+ for (const p of s)
434
+ z(p.templateNode || p.content || p, "style", (i) => {
435
+ const r = i.closest("slot"), f = r ? `slot[name="${r.name}"]` : "";
436
+ i.innerHTML = `${l} ${f}{${i.innerHTML}}`, this.append(i);
437
+ });
438
+ const a = s.map((p) => ve(p)), n = a.map((p, i) => {
439
+ i = new XSLTProcessor();
440
+ try {
441
+ i.importStylesheet(p);
442
+ } catch (r) {
443
+ console.error(r, q(p));
444
+ }
445
+ return i;
446
+ });
447
+ Object.defineProperty(this, "xsltString", { get: () => a.map((p) => q(p)).join(`
448
+ `) });
449
+ const o = this, y = [...this.templateNode.querySelectorAll("[slice]")], x = y.map((p) => d(p, "slice")).filter((p) => !p.includes("/")).filter((p, i, r) => r.indexOf(p) === i).map(pe).flat(), { declaredAttributes: v, hardcodedAttributes: u, exposedAttributes: w } = a[0], ee = /* @__PURE__ */ new Set([...Object.keys(u), ...Object.keys(w)]);
450
+ class O extends HTMLElement {
451
+ static get observedAttributes() {
452
+ return v;
453
+ }
454
+ #e = 0;
455
+ get dceExportedAttributes() {
456
+ return ee;
457
+ }
458
+ connectedCallback() {
459
+ let i = ie(this.childNodes);
460
+ if (this.firstElementChild?.tagName === "TEMPLATE") {
461
+ this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
462
+ const c = this.firstElementChild;
463
+ c.remove(), i = ie(c.content.childNodes);
464
+ for (const E of i)
465
+ if (E.localName === "style") {
466
+ const m = Ce(this, "data-dce-style");
467
+ E.innerHTML = `${l}[data-dce-style="${m}"]{${E.innerHTML}}`, c.insertAdjacentElement("beforebegin", E);
468
+ } else
469
+ E.nodeType === 1 ? c.insertAdjacentElement("beforebegin", E) : E.nodeType === 3 && c.insertAdjacentText("beforebegin", E.data);
470
+ }
471
+ const r = U("<datadom/>").documentElement, f = (c, E = "") => ((m) => (E && m.append(L(r, E)), m))(r.ownerDocument.createElement(c)), g = B(r, "payload", i, Ae);
472
+ me(g), ue(g), this.innerHTML = "";
473
+ const h = B(r, "attributes", this.attributes, (c) => f(c.nodeName, c.value)), b = (c) => this.hasAttribute(c) || [...h.children].find((E) => E.localName === c);
474
+ fe(this, h), Object.keys(u).map((c) => b(c) || h.append(f(c, u[c]))), Object.keys(w).map((c) => b(c) || h.append(f(c))), B(r, "dataset", Object.keys(this.dataset), (c) => f(c, this.dataset[c]));
475
+ const T = B(r, "slice", x, (c) => f(c, "")), M = (c) => P(c, T);
476
+ this.xml = r;
477
+ const D = [], te = () => {
478
+ const c = {};
479
+ for (let E; E = D.pop(); ) {
480
+ const m = d(E.sliceElement, "slice");
481
+ c[m] || (oe(T, m, E), c[m] = E);
482
+ }
483
+ Object.keys(c).length !== 0 && V();
484
+ };
485
+ let W;
486
+ this.onSlice = (c) => {
487
+ D.push(c), W || (W = setTimeout(() => {
488
+ te(), W = 0;
489
+ }, 1));
490
+ };
491
+ const V = this.transform = () => {
492
+ if (this.#e)
493
+ debugger;
494
+ this.#e = 1;
495
+ const c = () => {
496
+ n.map((A, S) => {
497
+ const _ = A.transformToFragment(r.ownerDocument, document);
498
+ return _ || console.error(`XSLT transformation error. xsl:
499
+ `, q(a[S]), `
500
+ xml:
501
+ `, q(r)), _;
502
+ }).map((A) => {
503
+ A && (he(A), xe(this, A.childNodes));
504
+ });
505
+ let N = 0;
506
+ return Object.entries(u).map(([A, S]) => {
507
+ !this.hasAttribute(A) && S !== d(this, A) && (this.setAttribute(A, S), this.#t(A, S), N++);
508
+ }), Object.keys(w).map((A) => {
509
+ let S = d(this.firstElementChild, A);
510
+ S !== d(this, A) && (this.setAttribute(A, S), this.#t(A, S), N++);
511
+ }), N;
512
+ };
513
+ c() && c() && console.warn("model update should not be the result of transform more than once");
514
+ function E(m) {
515
+ let N = m;
516
+ if (m.localName === "slice") {
517
+ const A = d(m, "for");
518
+ if (A || (N = m.parentElement), A === "^")
519
+ do
520
+ N = N.previousElementSibling;
521
+ while (N.localName === "slice");
522
+ else
523
+ N = this.querySelector(A);
524
+ if (!N)
525
+ return console.warn(`can not find selector in "slice for=${A}" `, m.outerHTML);
526
+ d(m, "slice") || m.setAttribute("slice", d(m, "name"));
527
+ }
528
+ return N;
529
+ }
530
+ z(this, "[slice],[slice-event]", (m) => {
531
+ let N = d(m, "slice-event");
532
+ const A = m.hasAttribute("slice-value") || m.hasAttribute("value") || m.value, S = E(m);
533
+ m.dceInitialized || (m.dceInitialized = 1, S.hasAttribute("custom-validity") && (N += " change submit"), [...new Set((N || "change").split(" "))].forEach((_) => S.addEventListener(_, ($) => {
534
+ $.sliceElement = m, $.sliceEventSource = $.currentTarget || $.target, $.sliceProcessed = 0;
535
+ const be = oe(T, d($.sliceElement, "slice"), $);
536
+ z(this, "[custom-validity]", (k) => {
537
+ if (!k.setCustomValidity)
538
+ return;
539
+ const Z = d(k, "custom-validity");
540
+ try {
541
+ const X = Z && P(Z, h);
542
+ k.setCustomValidity(X === !0 ? "" : X === !1 ? "invalid" : X);
543
+ } catch (X) {
544
+ console.error(X, "xPath", Z);
545
+ }
546
+ });
547
+ const Y = d(S, "custom-validity"), j = Y && P(Y, h), G = j === !0 ? "" : j;
548
+ if (Y) {
549
+ if (m.setCustomValidity ? m.setCustomValidity(G) : m.validationMessage = G, be.map((k) => k.setAttribute("validation-message", G)), $.type === "submit")
550
+ return j === !0 ? void 0 : (setTimeout(V, 1), !!j === j ? (j || $.preventDefault(), j) : j ? ($.preventDefault(), !1) : void 0);
551
+ setTimeout(V, 1);
552
+ }
553
+ this.onSlice($);
554
+ })), (!N || N.includes("init")) && (A ? this.onSlice({ type: "init", target: S, sliceElement: m, sliceEventSource: S }) : m.value = M(d(m, "slice"))));
555
+ }), this.#e = 0;
556
+ };
557
+ V(), te();
558
+ }
559
+ #t(i, r) {
560
+ i === "value" && (this.value = r);
561
+ const f = this.xml.querySelector("attributes");
562
+ let g = this.xml.querySelector(`attributes>${i}`);
563
+ g ? F(g).append(L(g, r)) : (g = C(i, r, this.xml), f.append(g)), this.#e || f.setAttribute(i, r), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [i]: r } }));
564
+ }
565
+ attributeChangedCallback(i, r, f) {
566
+ !this.xml || this.#e || (this.#t(i, f), this.transform());
567
+ }
568
+ get dce() {
569
+ return o;
570
+ }
571
+ }
572
+ const H = (p) => {
573
+ window.customElements.get(p) !== O && window.customElements.define(p, O);
574
+ };
575
+ if (t)
576
+ H(t);
577
+ else {
578
+ const p = l;
579
+ this.setAttribute("tag", p), H(p);
580
+ const i = document.createElement(p);
581
+ this.getAttributeNames().forEach((r) => i.setAttribute(r, this.getAttribute(r))), i.append(...[...this.childNodes].filter((r) => r.localName !== "style")), this.append(i);
582
+ }
583
+ }
584
+ get templateNode() {
585
+ return this.firstElementChild?.tagName === "TEMPLATE" ? this.firstElementChild.content : this;
586
+ }
587
+ get dce() {
588
+ return this;
589
+ }
590
+ get xslt() {
591
+ return U(this.xsltString);
592
+ }
593
+ }
594
+ window.customElements.define("custom-element", je);
595
+ export {
596
+ je as C,
597
+ q as a,
598
+ ve as b,
599
+ ae as c,
600
+ Ee as d,
601
+ Ne as e,
602
+ we as f,
603
+ oe as g,
604
+ fe as h,
605
+ he as i,
606
+ Se as j,
607
+ xe as k,
608
+ Ce as l,
609
+ ne as m,
610
+ $e as n,
611
+ I as o,
612
+ Q as p,
613
+ P as q,
614
+ Le as r,
615
+ ie as s,
616
+ re as t,
617
+ De as u,
618
+ U as x
619
+ };