@globalpayments/vega-sandbox-app 0.1.0-alpha.8 → 0.1.0-alpha.9

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 (133) hide show
  1. package/dist/assets/{action-color-accessibility-validator-ce55cb07-DL_8a0XP.js → action-color-accessibility-validator-ce55cb07-Dg6gtg2z.js} +1 -1
  2. package/dist/assets/{aria-attributes-value-mapper-2c632641-BfDQ8fHo.js → aria-attributes-value-mapper-2c632641-NCJSLFe7.js} +1 -1
  3. package/dist/assets/{aria-dialog-focusable-trap-slimmer-9eae86c6-DUlnSNzj.js → aria-dialog-focusable-trap-slimmer-9eae86c6-DhbqZc0l.js} +1 -1
  4. package/dist/assets/{array-7888f339-CwtVR39P.js → array-7888f339-Bw63bZyT.js} +1 -1
  5. package/dist/assets/{auto-run-when-re-render-task-queue-slimmer.abstract-27820d4c-CSj3jCXu.js → auto-run-when-re-render-task-queue-slimmer.abstract-27820d4c-BomruzlI.js} +1 -1
  6. package/dist/assets/{brand-switch-state-controller-slimmer-9ca03c81-DcMw_Ejf.js → brand-switch-state-controller-slimmer-9ca03c81-BedvbRey.js} +1 -1
  7. package/dist/assets/{check-box-required-rule-cb0aa339-Dy09N2gf.js → check-box-required-rule-cb0aa339-Bxxg2SnR.js} +1 -1
  8. package/dist/assets/{child-nodes-event-prevent-slimmer-96c14f5a-CmMo-06P.js → child-nodes-event-prevent-slimmer-96c14f5a-CX6nhcE3.js} +1 -1
  9. package/dist/assets/{child-nodes-notify-observer-slimmer-499a3aa7-Dmi4OR63.js → child-nodes-notify-observer-slimmer-499a3aa7-XpvuJjjt.js} +1 -1
  10. package/dist/assets/{component-7d906393-OYky_Eqf.js → component-7d906393-D_sHVFWv.js} +1 -1
  11. package/dist/assets/{component-global-style-slimmer-ac703085-DWxlFEh8.js → component-global-style-slimmer-ac703085-U0oRXBb2.js} +1 -1
  12. package/dist/assets/{component-usage-runtime-metrics-4b1afd04-BtGz-7cK.js → component-usage-runtime-metrics-4b1afd04-ButSL791.js} +2 -2
  13. package/dist/assets/{component-value-history-controller-slimmer.abstract-b1ee1b8e-C7xcwQQY.js → component-value-history-controller-slimmer.abstract-b1ee1b8e-D9EY5RWD.js} +1 -1
  14. package/dist/assets/{dark-mode-state-controller-slimmer-778dd929-BIoEDIR_.js → dark-mode-state-controller-slimmer-778dd929-CHLx-xop.js} +1 -1
  15. package/dist/assets/{date-required-rule-e06115f8-CsjBjwcs.js → date-required-rule-e06115f8-iro6py2-.js} +1 -1
  16. package/dist/assets/{deprecated-property-slimmer-ea34fa7b-TfiRhGvE.js → deprecated-property-slimmer-ea34fa7b-C5XbQrTe.js} +1 -1
  17. package/dist/assets/{design-token-4e682056-oiQz8Y-t.js → design-token-4e682056-DVFcX2g7.js} +1 -1
  18. package/dist/assets/{drop-file-accept-filter-slimmer-ad759e4a-BpXVRsyy.js → drop-file-accept-filter-slimmer-ad759e4a-C4NTtWzW.js} +1 -1
  19. package/dist/assets/{element-appender-slimmer-a4485ef6-BlYx99UA.js → element-appender-slimmer-a4485ef6-Cp_QPX8o.js} +1 -1
  20. package/dist/assets/{event-emit-slimmer-db4a82e0-C8rk3747.js → event-emit-slimmer-db4a82e0-DcKzQxGQ.js} +1 -1
  21. package/dist/assets/{file-uploader-required-rule-96952e1a-_yw1Q5p3.js → file-uploader-required-rule-96952e1a-DvxmRHqv.js} +1 -1
  22. package/dist/assets/{form-field-controller-slimmer-a1c7b28c-DzSVvL6B.js → form-field-controller-slimmer-a1c7b28c-CMjnRSYR.js} +1 -1
  23. package/dist/assets/{image-annotation-action-4c77d314-BoEOejHd.js → image-annotation-action-4c77d314-CrZEfIWN.js} +1 -1
  24. package/dist/assets/{index-bkDaCMH8.js → index-xErL25ZZ.js} +43 -43
  25. package/dist/assets/{inject-keyboard-manager-e8ddb78d-CIndtDKe.js → inject-keyboard-manager-e8ddb78d-CSEMcxY0.js} +1 -1
  26. package/dist/assets/{input-phone-number-required-rule-be6a5572-DkGQ6eeo.js → input-phone-number-required-rule-be6a5572-jjnY0Xye.js} +1 -1
  27. package/dist/assets/{input-range-required-rule-3ad74776-BGB-5ZR0.js → input-range-required-rule-3ad74776-86iqbb7t.js} +1 -1
  28. package/dist/assets/{keyboard-manager-ec18721b-CM8IOZif.js → keyboard-manager-ec18721b-CUR9jfcZ.js} +1 -1
  29. package/dist/assets/{keyboard-manager-slimmer-531ddb0e-Bj8XlAe8.js → keyboard-manager-slimmer-531ddb0e-BFlOtog-.js} +1 -1
  30. package/dist/assets/{legend-input-processor-3b2de4b7-CHG4Tijc.js → legend-input-processor-3b2de4b7-BnEddB3h.js} +1 -1
  31. package/dist/assets/{min-number-rule-2f1cfbf9-Egdgwv07.js → min-number-rule-2f1cfbf9-hjqNcBA4.js} +1 -1
  32. package/dist/assets/{min-string-length-rule-c31c89f4-dRlFUvXE.js → min-string-length-rule-c31c89f4-15T_oszX.js} +1 -1
  33. package/dist/assets/{month-view-generator-afd78ff8-CrNzOIkV.js → month-view-generator-afd78ff8-kqhi3sDb.js} +1 -1
  34. package/dist/assets/{mutation-observer-filters-1a054fb0-BWWLXWLE.js → mutation-observer-filters-1a054fb0-bfmjnP_b.js} +1 -1
  35. package/dist/assets/{mutation-observer-slimmer-58ebc13c-C22plZKJ.js → mutation-observer-slimmer-58ebc13c-C8NHwhLF.js} +1 -1
  36. package/dist/assets/public-rules-5fce32a5-B1L7emm4.js +1 -0
  37. package/dist/assets/{required-field-rule-897fe8d1-Cf7Va5ZW.js → required-field-rule-897fe8d1-CTp6WGag.js} +1 -1
  38. package/dist/assets/{responsive-format-facade-299e6304-Dvd6Sloj.js → responsive-format-facade-299e6304-Da4ugpqp.js} +1 -1
  39. package/dist/assets/{rich-text-editor-required-rule-3047bab0-6xABrfQw.js → rich-text-editor-required-rule-3047bab0-BgzpjUFj.js} +1 -1
  40. package/dist/assets/{state-border-formatter-da52b626-Cd9qsDJ2.js → state-border-formatter-da52b626-vl0hMghR.js} +1 -1
  41. package/dist/assets/{string-format-strategy.abstract-a45b5ff7-C7XLfbgg.js → string-format-strategy.abstract-a45b5ff7-rIE4BbVD.js} +1 -1
  42. package/dist/assets/{string-input-formatter-slimmer-4a032fed-Ba7rbWQh.js → string-input-formatter-slimmer-4a032fed-DECixz57.js} +1 -1
  43. package/dist/assets/{string-mask-strategy-37e53e48-Ba5uJ-iR.js → string-mask-strategy-37e53e48-DaPkfOE9.js} +1 -1
  44. package/dist/assets/{style-formatter-3d5ddfb1-BGrhoizI.js → style-formatter-3d5ddfb1-DBw7Y5t6.js} +1 -1
  45. package/dist/assets/{sub-state-notify-slimmer-0f72ce74-Pa5o8LWj.js → sub-state-notify-slimmer-0f72ce74-BoHQo4kF.js} +1 -1
  46. package/dist/assets/{sub-state-observer-slimmer-64532d94-CGnxgW0e.js → sub-state-observer-slimmer-64532d94-CCXNpyc0.js} +1 -1
  47. package/dist/assets/{time-required-rule-355b73d2-CIgwkF1y.js → time-required-rule-355b73d2-DMgiL2tR.js} +1 -1
  48. package/dist/assets/{toggle-switch-required-rule-b3cf4302-FocBHQ5X.js → toggle-switch-required-rule-b3cf4302-6mVvWfPZ.js} +1 -1
  49. package/dist/assets/{translation-slimmer-3ea56354-BqFLtEoo.js → translation-slimmer-3ea56354-CNmNMuwE.js} +1 -1
  50. package/dist/assets/{vega-accordion.entry-DpxzwGN3.js → vega-accordion.entry-DMpns5oI.js} +1 -1
  51. package/dist/assets/{vega-app-footer.entry-BW2y8J2I.js → vega-app-footer.entry-DjoBFv36.js} +1 -1
  52. package/dist/assets/{vega-app-header-button.entry-BPqOHiDI.js → vega-app-header-button.entry-BQuR0F2A.js} +1 -1
  53. package/dist/assets/{vega-backdrop.entry-beUuxTO7.js → vega-backdrop.entry-B7uEZE4H.js} +1 -1
  54. package/dist/assets/{vega-banner.entry-BtJhd6A9.js → vega-banner.entry-DV3xOpGa.js} +1 -1
  55. package/dist/assets/{vega-bar-chart.entry-C46eB8y-.js → vega-bar-chart.entry-Dikiebqv.js} +1 -1
  56. package/dist/assets/{vega-box.entry-CfUv8wiD.js → vega-box.entry-CtIHvefH.js} +1 -1
  57. package/dist/assets/{vega-brand-logo.entry-C4fqjx3k.js → vega-brand-logo.entry-DBjkOhV0.js} +1 -1
  58. package/dist/assets/{vega-breadcrumb.entry-BxDxqSfZ.js → vega-breadcrumb.entry-DtgIcE1j.js} +1 -1
  59. package/dist/assets/{vega-button-circle.entry-C-fn-4Sa.js → vega-button-circle.entry-CcSiGIXI.js} +1 -1
  60. package/dist/assets/{vega-button-group_2.entry-BuJCs56v.js → vega-button-group_2.entry-DlrVHULk.js} +1 -1
  61. package/dist/assets/{vega-button-link.entry-CxczJQiL.js → vega-button-link.entry-D35am6iQ.js} +1 -1
  62. package/dist/assets/{vega-button.entry-ImQF3EYL.js → vega-button.entry-QadE2RbA.js} +1 -1
  63. package/dist/assets/{vega-calendar_5.entry-D4n6Ygfo.js → vega-calendar_5.entry-Cr2PnGz-.js} +1 -1
  64. package/dist/assets/{vega-card.entry-DcanLej6.js → vega-card.entry-DAgb-075.js} +1 -1
  65. package/dist/assets/{vega-carousel.entry-BkHaV6_k.js → vega-carousel.entry-Bnfae3Uq.js} +1 -1
  66. package/dist/assets/{vega-checkbox_2.entry-CuFeR2sF.js → vega-checkbox_2.entry-D3LOjc-R.js} +1 -1
  67. package/dist/assets/{vega-chip.entry-BF-2y0W4.js → vega-chip.entry-22lPZWNt.js} +1 -1
  68. package/dist/assets/{vega-code-block.entry-azcyss3c.js → vega-code-block.entry-Ds4A0Bzv.js} +1 -1
  69. package/dist/assets/{vega-color-picker.entry-B_2sXmIL.js → vega-color-picker.entry-DhSk1aN7.js} +1 -1
  70. package/dist/assets/{vega-color-swatch-picker.entry-8bbYkV_F.js → vega-color-swatch-picker.entry-BKJg6HNA.js} +1 -1
  71. package/dist/assets/{vega-color-swatch.entry-CdKA9n9b.js → vega-color-swatch.entry-nMrL4e75.js} +1 -1
  72. package/dist/assets/{vega-combo-box.entry-Dr-IzVoZ.js → vega-combo-box.entry-B_daKiXX.js} +1 -1
  73. package/dist/assets/{vega-counter-badge.entry-DVe1q7dC.js → vega-counter-badge.entry-DQTcLDvQ.js} +1 -1
  74. package/dist/assets/{vega-date-picker_2.entry-DJsmcNfL.js → vega-date-picker_2.entry-B2bqUPHx.js} +1 -1
  75. package/dist/assets/{vega-dialog_2.entry-DZj_NfXU.js → vega-dialog_2.entry-IxNDsQ-W.js} +1 -1
  76. package/dist/assets/{vega-divider.entry-DVyUTwjA.js → vega-divider.entry-BmTRmZH2.js} +1 -1
  77. package/dist/assets/{vega-dropdown_5.entry-DpezE-_a.js → vega-dropdown_5.entry-BzX8hG1i.js} +1 -1
  78. package/dist/assets/{vega-field-error.entry-CAXlNnrz.js → vega-field-error.entry-DOdbi7Ym.js} +1 -1
  79. package/dist/assets/{vega-field-label.entry-BBVykbS9.js → vega-field-label.entry-D5ZnsmFb.js} +1 -1
  80. package/dist/assets/{vega-file-uploader.entry-BVHD41Ec.js → vega-file-uploader.entry-BqV21fS7.js} +1 -1
  81. package/dist/assets/{vega-flag-icon.entry-BQ3mZboW.js → vega-flag-icon.entry-D0g9mBDS.js} +1 -1
  82. package/dist/assets/{vega-flex.entry-BhcLrCda.js → vega-flex.entry-R8OwfQjW.js} +1 -1
  83. package/dist/assets/{vega-font.entry-BRVnWkA6.js → vega-font.entry-D5HW310m.js} +1 -1
  84. package/dist/assets/{vega-form.entry-DRwjavqP.js → vega-form.entry-Cwmtackd.js} +1 -1
  85. package/dist/assets/{vega-grid.entry-DByu5ux-.js → vega-grid.entry-D3MsiezG.js} +1 -1
  86. package/dist/assets/{vega-hint.entry-Ck5WS808.js → vega-hint.entry-2FXLrS4H.js} +1 -1
  87. package/dist/assets/{vega-icon.entry-CXPfS6mS.js → vega-icon.entry-B38Nmbcl.js} +1 -1
  88. package/dist/assets/{vega-image-uploader.entry-DI4hA-Va.js → vega-image-uploader.entry-DRS9ke3o.js} +1 -1
  89. package/dist/assets/{vega-input-credit-card.entry-B7Fs0UHf.js → vega-input-credit-card.entry-BGFkPMAB.js} +1 -1
  90. package/dist/assets/{vega-input-numeric.entry-ymiAwmTJ.js → vega-input-numeric.entry-Bb408Y0W.js} +1 -1
  91. package/dist/assets/{vega-input-passcode.entry-L9s4TOhs.js → vega-input-passcode.entry-DRS9VIxn.js} +1 -1
  92. package/dist/assets/{vega-input-phone-number.entry-Lq6WloM8.js → vega-input-phone-number.entry-B6h8Wlu9.js} +1 -1
  93. package/dist/assets/{vega-input-range.entry-DWzH5tab.js → vega-input-range.entry-O-fcR7wO.js} +1 -1
  94. package/dist/assets/{vega-input-select.entry-BuPOnCyc.js → vega-input-select.entry-Lf1_3i3H.js} +1 -1
  95. package/dist/assets/{vega-input.entry-DUXrSDUT.js → vega-input.entry-CKq35CEj.js} +1 -1
  96. package/dist/assets/{vega-item-toggle.entry-D0t0rI3b.js → vega-item-toggle.entry-BhV9kdIk.js} +1 -1
  97. package/dist/assets/{vega-left-nav_5.entry-CDHKy-aw.js → vega-left-nav_5.entry-BxbtzGuU.js} +1 -1
  98. package/dist/assets/{vega-line-chart.entry-WkFvJi-a.js → vega-line-chart.entry-BZxsqrjH.js} +1 -1
  99. package/dist/assets/{vega-loader-wrapper_2.entry-B3Wmn0m9.js → vega-loader-wrapper_2.entry-Ct1Lf26h.js} +1 -1
  100. package/dist/assets/{vega-page-notification_2.entry-vWzHtpLx.js → vega-page-notification_2.entry-B45Gn1ek.js} +1 -1
  101. package/dist/assets/{vega-pagination-page-selector-mobile.entry-CDEUDqNM.js → vega-pagination-page-selector-mobile.entry-Df4rTj8l.js} +1 -1
  102. package/dist/assets/{vega-pagination-page-size-selector-mobile.entry-c5zgdlZ8.js → vega-pagination-page-size-selector-mobile.entry-Ccv1ZLPc.js} +1 -1
  103. package/dist/assets/{vega-pagination.entry-JQuhQ4YX.js → vega-pagination.entry-Bv0s7U1Q.js} +1 -1
  104. package/dist/assets/{vega-pie-chart.entry-DSz5WxqK.js → vega-pie-chart.entry-boepEoxM.js} +1 -1
  105. package/dist/assets/{vega-popover_2.entry-CiRr79hh.js → vega-popover_2.entry-9PF5bDR5.js} +1 -1
  106. package/dist/assets/{vega-progress-tracker_2.entry-QKpMoPlS.js → vega-progress-tracker_2.entry-0dBni2Qm.js} +1 -1
  107. package/dist/assets/{vega-radio_2.entry-DXCuXPQi.js → vega-radio_2.entry-DtMvwoHw.js} +1 -1
  108. package/dist/assets/{vega-rich-text-content.entry-BP-8XXCP.js → vega-rich-text-content.entry-B1XH66st.js} +1 -1
  109. package/dist/assets/{vega-rich-text-editor_4.entry-C8N4a-x-.js → vega-rich-text-editor_4.entry-CrifrF6Q.js} +1 -1
  110. package/dist/assets/{vega-rich-text-find-replace-panel.entry-CdsA5VnE.js → vega-rich-text-find-replace-panel.entry-CF_S8oei.js} +1 -1
  111. package/dist/assets/{vega-rich-text-special-characters-panel.entry-DYcTmyY_.js → vega-rich-text-special-characters-panel.entry-Jlz0cq5X.js} +1 -1
  112. package/dist/assets/{vega-rich-text-table-properties_3.entry-CXWxwEpx.js → vega-rich-text-table-properties_3.entry-BS7-S74j.js} +1 -1
  113. package/dist/assets/{vega-section-title.entry-DgwllO2h.js → vega-section-title.entry-u8BfDv-c.js} +1 -1
  114. package/dist/assets/{vega-segment-control.entry-BHTyoM8e.js → vega-segment-control.entry-CX2NbowF.js} +1 -1
  115. package/dist/assets/{vega-selection-chip_2.entry-DR-uVwCe.js → vega-selection-chip_2.entry-D39uxrEI.js} +1 -1
  116. package/dist/assets/{vega-selection-tile_2.entry-BuqLLyYi.js → vega-selection-tile_2.entry-DWt1YUI8.js} +1 -1
  117. package/dist/assets/{vega-sidenav_3.entry-BzbhDiYo.js → vega-sidenav_3.entry-Cio0oBXo.js} +1 -1
  118. package/dist/assets/{vega-signature-capture.entry-CHAg9TM8.js → vega-signature-capture.entry-YKsuhDNx.js} +1 -1
  119. package/dist/assets/{vega-skeleton.entry-BhVW6-n2.js → vega-skeleton.entry-9jFYD6vV.js} +1 -1
  120. package/dist/assets/{vega-slot-container.entry-Bt5xPj5v.js → vega-slot-container.entry-yoQCWBFm.js} +1 -1
  121. package/dist/assets/{vega-stepper.entry-BGRvuzE3.js → vega-stepper.entry-5q-3lVTq.js} +1 -1
  122. package/dist/assets/{vega-tab-group_2.entry-BbWX5iVA.js → vega-tab-group_2.entry-SClbs0iO.js} +1 -1
  123. package/dist/assets/{vega-table_11.entry-BQmRhEhM.js → vega-table_11.entry-BrH5IwYq.js} +1 -1
  124. package/dist/assets/{vega-text.entry-Dv2O8VrK.js → vega-text.entry-Bs3dmhxf.js} +1 -1
  125. package/dist/assets/{vega-textarea.entry-D8BtSs-j.js → vega-textarea.entry-C-icpuEF.js} +1 -1
  126. package/dist/assets/{vega-time-picker_2.entry-D_-CuNzy.js → vega-time-picker_2.entry-DUFKlWHn.js} +1 -1
  127. package/dist/assets/{vega-toggle-switch.entry-bkGXHmvk.js → vega-toggle-switch.entry-Blu-ZDit.js} +1 -1
  128. package/dist/assets/{vega-tooltip_2.entry-sR1cy5lP.js → vega-tooltip_2.entry-D42XH0Kt.js} +1 -1
  129. package/dist/assets/{wait-for-component-did-render-0c237cb8-Dnh7z4h9.js → wait-for-component-did-render-0c237cb8-qNk4yaxX.js} +1 -1
  130. package/dist/assets/{y-axis-input-processor-c6b2a914-DlFjVTu4.js → y-axis-input-processor-c6b2a914-DYyBKEhy.js} +1 -1
  131. package/dist/index.html +1 -1
  132. package/package.json +1 -1
  133. package/dist/assets/public-rules-5fce32a5-0zVqM_9t.js +0 -1
@@ -1 +1 @@
1
- import{f7 as et,f8 as rt}from"./index-bkDaCMH8.js";const nt=/^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Y=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,j=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.?\d*)\s*\)$/i;function G(e){return nt.test(e)}function ot(e){if(G(e))return!0;const t=e.match(Y);if(t)return I(+t[1],+t[2],+t[3]);const r=e.match(j);return r?I(+r[1],+r[2],+r[3])&&+r[4]>=0&&+r[4]<=1:!1}function I(e,t,r){return e>=0&&e<=255&&t>=0&&t<=255&&r>=0&&r<=255}const it=.03928,at=.0031308,z=12.92,J=.055,Q=1.055,Z=2.4,st=.2126,ct=.7152,dt=.0722,$=.05,k=255;function C(e){return e<=it?e/z:((e+J)/Q)**Z}function bt(e){return e<=at?z*e:Q*e**(1/Z)-J}function U(e){const t=C(e.r/k),r=C(e.g/k),n=C(e.b/k);return st*t+ct*r+dt*n}function _(e,t){const r=U(e),n=U(t),o=Math.max(r,n),a=Math.min(r,n);return(o+$)/(a+$)}function u(e,t,r){return{r:Math.round(e.r*t+r.r*(1-t)),g:Math.round(e.g*t+r.g*(1-t)),b:Math.round(e.b*t+r.b*(1-t))}}function V(e){const t=r=>r.toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function pt(e){if(!G(e))throw new Error(`Invalid hex color: "${e}". Expected 3- or 6-digit hex with optional leading #.`);const t=e.replace(/^#/,""),r=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t;return{r:parseInt(r.substring(0,2),16),g:parseInt(r.substring(2,4),16),b:parseInt(r.substring(4,6),16)}}function gt(e){if(G(e))return pt(e);const t=e.match(Y);if(t&&I(+t[1],+t[2],+t[3]))return{r:+t[1],g:+t[2],b:+t[3]};const r=e.match(j);if(r&&I(+r[1],+r[2],+r[3]))return{r:+r[1],g:+r[2],b:+r[3]};throw new Error(`Invalid color: "${e}". Expected hex, rgb(), or rgba() format.`)}function D(e,t){const r=Math.round(t*100)/100;return`${e.r} ${e.g} ${e.b} / ${r}`}function P(e){const t=e.match(/^\s*(\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\d.]+)\s*$/);return t?{rgb:{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)},a:parseFloat(t[4])}:null}function X(e){const t=C(e.r/k),r=C(e.g/k),n=C(e.b/k),o=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),i=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return{L:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i}}function lt(e){const t=e.L+.3963377774*e.a+.2158037573*e.b,r=e.L-.1055613458*e.a-.0638541728*e.b,n=e.L-.0894841775*e.a-1.291485548*e.b,o=t**3,a=r**3,i=n**3,s=4.0767416621*o-3.3077115913*a+.2309699292*i,c=-1.2684380046*o+2.6097574011*a-.3413193965*i,y=-.0041960863*o-.7034186147*a+1.707614701*i,g=f=>Math.max(0,Math.min(k,Math.round(bt(f)*k)));return{r:g(s),g:g(c),b:g(y)}}function ht(e){return{L:e.L,C:Math.sqrt(e.a*e.a+e.b*e.b),h:Math.atan2(e.b,e.a)*180/Math.PI}}function ut(e){const t=e.h*Math.PI/180;return{L:e.L,a:e.C*Math.cos(t),b:e.C*Math.sin(t)}}function yt(e,t){const r=e.L-t.L,n=e.a-t.a,o=e.b-t.b;return Math.sqrt(r*r+n*n+o*o)}const F={r:252,g:252,b:252};function mt(e,t){return e.a<1?u(e.rgb,e.a,t):e.rgb}const B=4.5,tt=3;class H{}class ft extends H{constructor(){super(...arguments),this.requiredRatio=B}computeFgBg(t,r){const n=t.a<1?u(t.rgb,t.a,F):t.rgb;return{fg:mt(r,n),bg:n}}}class xt extends H{constructor(){super(...arguments),this.requiredRatio=B}computeFgBg(t,r){const n=r.a<1?u(r.rgb,r.a,F):r.rgb;return{fg:t.a<1?u(t.rgb,t.a,n):t.rgb,bg:n}}}class Nt extends H{constructor(){super(...arguments),this.requiredRatio=tt}computeFgBg(t,r,n){const o=r.a<1?u(r.rgb,r.a,F):r.rgb;let a=o;return n&&t.a<1&&(a=n.a<1?u(n.rgb,n.a,F):n.rgb),{fg:t.a<1?u(t.rgb,t.a,a):t.rgb,bg:o}}}const kt={"bg-text":new ft,"text-bg":new xt,"non-text-contrast":new Nt},Wt=["text-on-action","text-primary","text-secondary","text-inverted-primary","text-inverted-secondary","bg-primary","bg-page","bg-secondary","bg-tertiary","bg-quaternary","bg-action-secondary","bg-action-tertiary","bg-action-tertiary-hover","bg-tile","bg-tile-hover","bg-tile-selected","bg-tile-selected-hover","bg-transparent","bg-danger","bg-divider-secondary","bg-table-row-hover","bg-toggle-switch","bg-status-error","bg-status-info","bg-status-success","bg-status-warning","bg-table-header","bg-segment-control","bg-action-tertiary-active","bg-chip-active","bg-chip-hover","bg-segment-hover","bg-toggle-switch-hover","bg-danger-tertiary-active","bg-danger-tertiary-hover"];function vt(e){const t=e.split(",").map(i=>parseFloat(i.trim()));if(t.length<4||t.some(isNaN))throw new Error(`Malformed token value: "${e}". Expected "r, g, b, a" format.`);const[r,n,o,a]=t;return{rgb:{r,g:n,b:o},a}}function St(e){const t={};for(const r of Wt){const n=e[r];if(n===void 0)throw new Error(`buildFixedPairedSurfaces: missing required design token "${r}" in the supplied map.`);t[r]=vt(n)}return Object.freeze(t)}function R(e,t,r){const n=t.get(e);if(n){const o=P(n);if(o)return{rgb:o.rgb,a:o.a}}return r[e]}function K(e,t){return e.a<1?u(e.rgb,e.a,t):e.rgb}function O(e){return e==="non-text-contrast"?tt:B}function At(e,t,r){const n=t.get(e.tokenName);if(!n)return null;const o=P(n);if(!o)return null;const a=R(e.pairedWith,t,r);if(!a)return null;const i=e.compositedOn?R(e.compositedOn,t,r):void 0,s=kt[e.type],{fg:c,bg:y}=s.computeFgBg(o,a,i),g=Math.round(_(c,y)*100)/100;return{fg:c,bg:y,contrastRatio:g}}class p{constructor(t){this.fixedSurfaces=t;const r=t["bg-primary"];if(!r)throw new Error('ColorSearchEngine: fixedSurfaces is missing required key "bg-primary".');this.lightBgPrimary=r.rgb}searchClosestFeasibleInOklch(t,r,n=!0){const o=X(t),{L:a,C:i,h:s}=ht(o),c=d=>{const b=lt(ut(d));if(r(b))return{rgb:b,deltaE:yt(o,X(b))}},f=n?(d,b)=>{const x=c({L:a,C:d,h:b});if(x)return x;let m;const L=c({L:0,C:d,h:b});if(L){m=L;let S=0,E=a;for(let M=0;M<p.SUGGESTION_SEARCH_ITERATIONS;M++){const A=(S+E)/2,T=c({L:A,C:d,h:b});T?(S=A,m=T):E=A}}const v=c({L:1,C:d,h:b});if(v){let S=v,E=a,M=1;for(let A=0;A<p.SUGGESTION_SEARCH_ITERATIONS;A++){const T=(E+M)/2,q=c({L:T,C:d,h:b});q?(M=T,S=q):E=T}(!m||S.deltaE<m.deltaE)&&(m=S)}return m}:(d,b)=>{let x;for(let m=0;m<=p.L_SCAN_STEPS;m++){const L=m/p.L_SCAN_STEPS,v=c({L,C:d,h:b});v&&(!x||v.deltaE<x.deltaE)&&(x=v)}return x};let h,l=1/0;const W=d=>{d&&d.deltaE<l&&(l=d.deltaE,h=d.rgb)};if(i<p.ACHROMATIC_CHROMA_EPSILON)return W(f(0,0)),h;for(const d of p.SUGGESTION_HUE_OFFSETS_DEG){const b=s+d;for(const x of p.SUGGESTION_CHROMA_SCALES){const m=Math.max(0,i*x);W(f(m,b))}}return h}findMinimumAlphaForContrast(t,r,n,o,a){const i=R(n.pairedWith,a,this.fixedSurfaces);if(!i)return;const s=this.lightBgPrimary,c=this.fixedSurfaces,y=h=>{if(n.type==="bg-text"){const b=h<1?u(t,h,s):t;return _(K(i,b),b)}const l=i.a<1?u(i.rgb,i.a,s):i.rgb;let W=l;if(n.compositedOn){const b=R(n.compositedOn,a,c);b&&(W=b.a<1?u(b.rgb,b.a,s):b.rgb)}const d=h<1?u(t,h,W):t;return _(d,l)};if(y(1)<o)return;let g=r,f=1;for(let h=0;h<p.ALPHA_ASCENT_ITERATIONS;h++){const l=(g+f)/2;y(l)>=o?f=l:g=l}return Math.min(1,Math.ceil(f*100)/100)}findRgbPatchForContrastAll(t,r,n){const o=[];for(const i of r){const s=R(i.pairedWith,n,this.fixedSurfaces);if(!s)continue;const c=s.a<1?u(s.rgb,s.a,this.lightBgPrimary):s.rgb;o.push({bg:c,threshold:O(i.type),type:i.type,paired:s})}if(o.length===0)return;const a=i=>o.every(s=>s.type==="bg-text"?_(K(s.paired,i),i)>=s.threshold:_(i,s.bg)>=s.threshold);return this.searchClosestFeasibleInOklch(t,a,!1)}}p.SUGGESTION_SEARCH_ITERATIONS=10;p.SUGGESTION_HUE_OFFSETS_DEG=[-5,-2.5,0,2.5,5];p.SUGGESTION_CHROMA_SCALES=[.6,.8,1,1.2,1.4];p.ACHROMATIC_CHROMA_EPSILON=.001;p.L_SCAN_STEPS=100;p.ALPHA_ASCENT_ITERATIONS=7;const w=[{tokenName:"bg-action",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-active",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action-active",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-focus",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-hover",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action-hover",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-link-active",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-secondary",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-link-hover",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-secondary",type:"bg-text"},{tokenName:"bg-date-picker-range",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-selected",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-table-selected-row",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-chip-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-chip-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-segment-control",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-segment-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-selected",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-toggle-switch",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-toggle-switch-hover",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-action-hover",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-table-header",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-table-selected-row",type:"non-text-contrast"},{tokenName:"border-color-divider-secondary",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-table-selected-row",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-input-field-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field-hover",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-tile-selected",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider-secondary",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider-secondary",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-input-field",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-date-picker-range",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-tile-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-action-secondary",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-date-picker-range",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-active",pairedWith:"bg-action-secondary-active",type:"non-text-contrast"},{tokenName:"border-secondary-btn-active",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-tile-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-focus",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-tile-selected",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-tile-selected-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected-focus",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-tile-selected-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected-hover",pairedWith:"bg-tile-selected-hover",type:"non-text-contrast"},{tokenName:"ring-input-focus",pairedWith:"bg-action",type:"non-text-contrast",compositedOn:"bg-primary"},{tokenName:"ring-input-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"text-link",pairedWith:"bg-action-secondary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-tertiary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link-focus",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link-visited",pairedWith:"bg-action-secondary",type:"text-bg"},{tokenName:"text-link-visited",pairedWith:"bg-primary",type:"text-bg"}];class N{constructor(t){this.fixabilityCache=null,this.deps=t,this.fixedSurfaces=St(t.fixedSurfaceTokens),this.search=new p(this.fixedSurfaces)}buildTokenMap(t){const r=this.deps.generateOverrideThemes(t),n=new Map;for(const o of r)o.value&&n.set(o.name,o.value);return n}validate(t){if(!N.isValidActionColor(t))return{isAccessible:!1,details:[],invalidInput:!0,contrastCapPatches:{}};const r=this.buildTokenMap(t),n=this.collectFailures(r),o=this.computeContrastCapPatches(t),a={isAccessible:n.length===0,details:n,contrastCapPatches:o},i=t.actionColor;return i&&(a.suggestedActionColor=a.isAccessible?i:this.findSuggestedActionColor(t,i)),a}computeContrastCapPatches(t){const r={};if(!t.actionColor||!N.isValidActionColor(t))return r;const n=this.buildTokenMap(t),o=new Map,a=new Set;for(const i of w){const s=o.get(i.tokenName);s?s.push(i):o.set(i.tokenName,[i]),this.getFixabilityRecord(i).fixable||a.add(i.tokenName)}for(const i of a){const s=n.get(i);if(!s)continue;const c=P(s);if(!c)continue;const y=o.get(i);let g,f=!0;for(const l of y){const W=O(l.type),d=this.search.findMinimumAlphaForContrast(c.rgb,c.a,l,W,n);if(d===void 0){f=!1;break}(g===void 0||d>g)&&(g=d)}if(f&&g!==void 0){const l=D(c.rgb,g);if(this.verifyCandidateSatisfiesAll(i,l,y,n)){r[i]=l;continue}}const h=this.search.findRgbPatchForContrastAll(c.rgb,y,n);h!==void 0&&(r[i]=D(h,1))}return r}computeTokenContrast(t,r){return At(t,r,this.fixedSurfaces)}resolvePairedSurface(t,r){return R(t,r,this.fixedSurfaces)}getFixabilityRecord(t){var r;return this.fixabilityCache||(this.fixabilityCache=this.buildFixabilityCache()),(r=this.fixabilityCache.get(N.fixabilityCacheKey(t)))!==null&&r!==void 0?r:{fixable:!0,maxContrast:1/0}}collectFailures(t,r=!1){const n=[];for(const o of w){if(!this.getFixabilityRecord(o).fixable)continue;const a=this.computeTokenContrast(o,t);if(!a)continue;const i=O(o.type);if(!(a.contrastRatio>=i)&&(n.push({tokenName:o.tokenName,contrastRatio:a.contrastRatio,requiredRatio:i}),r))return n}return n}isAccessible(t){return this.collectFailures(t,!0).length===0}static isValidActionColor(t){return!t.actionColor||ot(t.actionColor)}withActionColor(t,r){return Object.assign(Object.assign({},t),{actionColor:r})}static fixabilityCacheKey(t){var r;return`${t.tokenName}|${t.pairedWith}|${(r=t.compositedOn)!==null&&r!==void 0?r:""}`}buildFixabilityCache(){const t=new Map,r={},n=N.FIXABILITY_PROBE_COLORS.map(o=>this.buildTokenMap(this.withActionColor(r,o)));for(const o of w){let a=0;for(const s of n){const c=this.computeTokenContrast(o,s);c&&c.contrastRatio>a&&(a=c.contrastRatio)}const i=O(o.type);t.set(N.fixabilityCacheKey(o),{fixable:a>=i,maxContrast:Math.round(a*100)/100})}return t}findSuggestedActionColor(t,r){const n=this.search.searchClosestFeasibleInOklch(gt(r),o=>this.isAccessible(this.buildTokenMap(this.withActionColor(t,V(o)))));return n===void 0?void 0:V(n)}verifyCandidateSatisfiesAll(t,r,n,o){const a=new Map(o);a.set(t,r);for(const i of n){const s=O(i.type),c=this.computeTokenContrast(i,a);if(!c||c.contrastRatio<s)return!1}return!0}}N.FIXABILITY_PROBE_COLORS=["#000000","#808080","#ffffff"];const Ct=new N({fixedSurfaceTokens:et,generateOverrideThemes:e=>rt.generateOverrideThemes(e)});export{Ct as vegaAccessibilityValidator};
1
+ import{f7 as et,f8 as rt}from"./index-xErL25ZZ.js";const nt=/^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Y=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,j=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.?\d*)\s*\)$/i;function G(e){return nt.test(e)}function ot(e){if(G(e))return!0;const t=e.match(Y);if(t)return I(+t[1],+t[2],+t[3]);const r=e.match(j);return r?I(+r[1],+r[2],+r[3])&&+r[4]>=0&&+r[4]<=1:!1}function I(e,t,r){return e>=0&&e<=255&&t>=0&&t<=255&&r>=0&&r<=255}const it=.03928,at=.0031308,z=12.92,J=.055,Q=1.055,Z=2.4,st=.2126,ct=.7152,dt=.0722,$=.05,k=255;function C(e){return e<=it?e/z:((e+J)/Q)**Z}function bt(e){return e<=at?z*e:Q*e**(1/Z)-J}function U(e){const t=C(e.r/k),r=C(e.g/k),n=C(e.b/k);return st*t+ct*r+dt*n}function _(e,t){const r=U(e),n=U(t),o=Math.max(r,n),a=Math.min(r,n);return(o+$)/(a+$)}function u(e,t,r){return{r:Math.round(e.r*t+r.r*(1-t)),g:Math.round(e.g*t+r.g*(1-t)),b:Math.round(e.b*t+r.b*(1-t))}}function V(e){const t=r=>r.toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function pt(e){if(!G(e))throw new Error(`Invalid hex color: "${e}". Expected 3- or 6-digit hex with optional leading #.`);const t=e.replace(/^#/,""),r=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t;return{r:parseInt(r.substring(0,2),16),g:parseInt(r.substring(2,4),16),b:parseInt(r.substring(4,6),16)}}function gt(e){if(G(e))return pt(e);const t=e.match(Y);if(t&&I(+t[1],+t[2],+t[3]))return{r:+t[1],g:+t[2],b:+t[3]};const r=e.match(j);if(r&&I(+r[1],+r[2],+r[3]))return{r:+r[1],g:+r[2],b:+r[3]};throw new Error(`Invalid color: "${e}". Expected hex, rgb(), or rgba() format.`)}function D(e,t){const r=Math.round(t*100)/100;return`${e.r} ${e.g} ${e.b} / ${r}`}function P(e){const t=e.match(/^\s*(\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\d.]+)\s*$/);return t?{rgb:{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)},a:parseFloat(t[4])}:null}function X(e){const t=C(e.r/k),r=C(e.g/k),n=C(e.b/k),o=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),a=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),i=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return{L:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i}}function lt(e){const t=e.L+.3963377774*e.a+.2158037573*e.b,r=e.L-.1055613458*e.a-.0638541728*e.b,n=e.L-.0894841775*e.a-1.291485548*e.b,o=t**3,a=r**3,i=n**3,s=4.0767416621*o-3.3077115913*a+.2309699292*i,c=-1.2684380046*o+2.6097574011*a-.3413193965*i,y=-.0041960863*o-.7034186147*a+1.707614701*i,g=f=>Math.max(0,Math.min(k,Math.round(bt(f)*k)));return{r:g(s),g:g(c),b:g(y)}}function ht(e){return{L:e.L,C:Math.sqrt(e.a*e.a+e.b*e.b),h:Math.atan2(e.b,e.a)*180/Math.PI}}function ut(e){const t=e.h*Math.PI/180;return{L:e.L,a:e.C*Math.cos(t),b:e.C*Math.sin(t)}}function yt(e,t){const r=e.L-t.L,n=e.a-t.a,o=e.b-t.b;return Math.sqrt(r*r+n*n+o*o)}const F={r:252,g:252,b:252};function mt(e,t){return e.a<1?u(e.rgb,e.a,t):e.rgb}const B=4.5,tt=3;class H{}class ft extends H{constructor(){super(...arguments),this.requiredRatio=B}computeFgBg(t,r){const n=t.a<1?u(t.rgb,t.a,F):t.rgb;return{fg:mt(r,n),bg:n}}}class xt extends H{constructor(){super(...arguments),this.requiredRatio=B}computeFgBg(t,r){const n=r.a<1?u(r.rgb,r.a,F):r.rgb;return{fg:t.a<1?u(t.rgb,t.a,n):t.rgb,bg:n}}}class Nt extends H{constructor(){super(...arguments),this.requiredRatio=tt}computeFgBg(t,r,n){const o=r.a<1?u(r.rgb,r.a,F):r.rgb;let a=o;return n&&t.a<1&&(a=n.a<1?u(n.rgb,n.a,F):n.rgb),{fg:t.a<1?u(t.rgb,t.a,a):t.rgb,bg:o}}}const kt={"bg-text":new ft,"text-bg":new xt,"non-text-contrast":new Nt},Wt=["text-on-action","text-primary","text-secondary","text-inverted-primary","text-inverted-secondary","bg-primary","bg-page","bg-secondary","bg-tertiary","bg-quaternary","bg-action-secondary","bg-action-tertiary","bg-action-tertiary-hover","bg-tile","bg-tile-hover","bg-tile-selected","bg-tile-selected-hover","bg-transparent","bg-danger","bg-divider-secondary","bg-table-row-hover","bg-toggle-switch","bg-status-error","bg-status-info","bg-status-success","bg-status-warning","bg-table-header","bg-segment-control","bg-action-tertiary-active","bg-chip-active","bg-chip-hover","bg-segment-hover","bg-toggle-switch-hover","bg-danger-tertiary-active","bg-danger-tertiary-hover"];function vt(e){const t=e.split(",").map(i=>parseFloat(i.trim()));if(t.length<4||t.some(isNaN))throw new Error(`Malformed token value: "${e}". Expected "r, g, b, a" format.`);const[r,n,o,a]=t;return{rgb:{r,g:n,b:o},a}}function St(e){const t={};for(const r of Wt){const n=e[r];if(n===void 0)throw new Error(`buildFixedPairedSurfaces: missing required design token "${r}" in the supplied map.`);t[r]=vt(n)}return Object.freeze(t)}function R(e,t,r){const n=t.get(e);if(n){const o=P(n);if(o)return{rgb:o.rgb,a:o.a}}return r[e]}function K(e,t){return e.a<1?u(e.rgb,e.a,t):e.rgb}function O(e){return e==="non-text-contrast"?tt:B}function At(e,t,r){const n=t.get(e.tokenName);if(!n)return null;const o=P(n);if(!o)return null;const a=R(e.pairedWith,t,r);if(!a)return null;const i=e.compositedOn?R(e.compositedOn,t,r):void 0,s=kt[e.type],{fg:c,bg:y}=s.computeFgBg(o,a,i),g=Math.round(_(c,y)*100)/100;return{fg:c,bg:y,contrastRatio:g}}class p{constructor(t){this.fixedSurfaces=t;const r=t["bg-primary"];if(!r)throw new Error('ColorSearchEngine: fixedSurfaces is missing required key "bg-primary".');this.lightBgPrimary=r.rgb}searchClosestFeasibleInOklch(t,r,n=!0){const o=X(t),{L:a,C:i,h:s}=ht(o),c=d=>{const b=lt(ut(d));if(r(b))return{rgb:b,deltaE:yt(o,X(b))}},f=n?(d,b)=>{const x=c({L:a,C:d,h:b});if(x)return x;let m;const L=c({L:0,C:d,h:b});if(L){m=L;let S=0,E=a;for(let M=0;M<p.SUGGESTION_SEARCH_ITERATIONS;M++){const A=(S+E)/2,T=c({L:A,C:d,h:b});T?(S=A,m=T):E=A}}const v=c({L:1,C:d,h:b});if(v){let S=v,E=a,M=1;for(let A=0;A<p.SUGGESTION_SEARCH_ITERATIONS;A++){const T=(E+M)/2,q=c({L:T,C:d,h:b});q?(M=T,S=q):E=T}(!m||S.deltaE<m.deltaE)&&(m=S)}return m}:(d,b)=>{let x;for(let m=0;m<=p.L_SCAN_STEPS;m++){const L=m/p.L_SCAN_STEPS,v=c({L,C:d,h:b});v&&(!x||v.deltaE<x.deltaE)&&(x=v)}return x};let h,l=1/0;const W=d=>{d&&d.deltaE<l&&(l=d.deltaE,h=d.rgb)};if(i<p.ACHROMATIC_CHROMA_EPSILON)return W(f(0,0)),h;for(const d of p.SUGGESTION_HUE_OFFSETS_DEG){const b=s+d;for(const x of p.SUGGESTION_CHROMA_SCALES){const m=Math.max(0,i*x);W(f(m,b))}}return h}findMinimumAlphaForContrast(t,r,n,o,a){const i=R(n.pairedWith,a,this.fixedSurfaces);if(!i)return;const s=this.lightBgPrimary,c=this.fixedSurfaces,y=h=>{if(n.type==="bg-text"){const b=h<1?u(t,h,s):t;return _(K(i,b),b)}const l=i.a<1?u(i.rgb,i.a,s):i.rgb;let W=l;if(n.compositedOn){const b=R(n.compositedOn,a,c);b&&(W=b.a<1?u(b.rgb,b.a,s):b.rgb)}const d=h<1?u(t,h,W):t;return _(d,l)};if(y(1)<o)return;let g=r,f=1;for(let h=0;h<p.ALPHA_ASCENT_ITERATIONS;h++){const l=(g+f)/2;y(l)>=o?f=l:g=l}return Math.min(1,Math.ceil(f*100)/100)}findRgbPatchForContrastAll(t,r,n){const o=[];for(const i of r){const s=R(i.pairedWith,n,this.fixedSurfaces);if(!s)continue;const c=s.a<1?u(s.rgb,s.a,this.lightBgPrimary):s.rgb;o.push({bg:c,threshold:O(i.type),type:i.type,paired:s})}if(o.length===0)return;const a=i=>o.every(s=>s.type==="bg-text"?_(K(s.paired,i),i)>=s.threshold:_(i,s.bg)>=s.threshold);return this.searchClosestFeasibleInOklch(t,a,!1)}}p.SUGGESTION_SEARCH_ITERATIONS=10;p.SUGGESTION_HUE_OFFSETS_DEG=[-5,-2.5,0,2.5,5];p.SUGGESTION_CHROMA_SCALES=[.6,.8,1,1.2,1.4];p.ACHROMATIC_CHROMA_EPSILON=.001;p.L_SCAN_STEPS=100;p.ALPHA_ASCENT_ITERATIONS=7;const w=[{tokenName:"bg-action",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-active",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action-active",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-focus",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-hover",pairedWith:"text-inverted-primary",type:"bg-text"},{tokenName:"bg-action-hover",pairedWith:"text-on-action",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-link-active",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-action-secondary-active",pairedWith:"text-secondary",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-link-hover",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-action-secondary-hover",pairedWith:"text-secondary",type:"bg-text"},{tokenName:"bg-date-picker-range",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-selected",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-table-selected-row",pairedWith:"text-primary",type:"bg-text"},{tokenName:"bg-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-action-tertiary-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-chip-active",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-chip-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-segment-control",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-segment-hover",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-selected",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-toggle-switch",type:"non-text-contrast"},{tokenName:"border-color-action",pairedWith:"bg-toggle-switch-hover",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-action-active",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-action-hover",pairedWith:"bg-action-tertiary",type:"non-text-contrast"},{tokenName:"border-color-action-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-table-header",type:"non-text-contrast"},{tokenName:"border-color-divider",pairedWith:"bg-table-selected-row",type:"non-text-contrast"},{tokenName:"border-color-divider-secondary",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-table-selected-row",type:"non-text-contrast"},{tokenName:"border-color-input-field",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-input-field-focus",pairedWith:"bg-tertiary",type:"non-text-contrast"},{tokenName:"border-color-input-field-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-color-input-field-hover",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-color-tile-selected",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider-secondary",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-divider-secondary",pairedWith:"bg-secondary",type:"non-text-contrast"},{tokenName:"border-input-field",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-input-field-focus",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-date-picker-range",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-input-field-hover",pairedWith:"bg-tile-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-action-secondary",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-date-picker-range",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-active",pairedWith:"bg-action-secondary-active",type:"non-text-contrast"},{tokenName:"border-secondary-btn-active",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-action-secondary-hover",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-secondary-btn-hover",pairedWith:"bg-quaternary",type:"non-text-contrast"},{tokenName:"border-tile-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-focus",pairedWith:"bg-tile",type:"non-text-contrast"},{tokenName:"border-tile-selected",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-tile-selected-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected-focus",pairedWith:"bg-tile-selected",type:"non-text-contrast"},{tokenName:"border-tile-selected-hover",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"border-tile-selected-hover",pairedWith:"bg-tile-selected-hover",type:"non-text-contrast"},{tokenName:"ring-input-focus",pairedWith:"bg-action",type:"non-text-contrast",compositedOn:"bg-primary"},{tokenName:"ring-input-focus",pairedWith:"bg-primary",type:"non-text-contrast"},{tokenName:"text-link",pairedWith:"bg-action-secondary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link",pairedWith:"bg-tertiary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link-active",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link-focus",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-action-tertiary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-primary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-quaternary",type:"text-bg"},{tokenName:"text-link-hover",pairedWith:"bg-secondary",type:"text-bg"},{tokenName:"text-link-visited",pairedWith:"bg-action-secondary",type:"text-bg"},{tokenName:"text-link-visited",pairedWith:"bg-primary",type:"text-bg"}];class N{constructor(t){this.fixabilityCache=null,this.deps=t,this.fixedSurfaces=St(t.fixedSurfaceTokens),this.search=new p(this.fixedSurfaces)}buildTokenMap(t){const r=this.deps.generateOverrideThemes(t),n=new Map;for(const o of r)o.value&&n.set(o.name,o.value);return n}validate(t){if(!N.isValidActionColor(t))return{isAccessible:!1,details:[],invalidInput:!0,contrastCapPatches:{}};const r=this.buildTokenMap(t),n=this.collectFailures(r),o=this.computeContrastCapPatches(t),a={isAccessible:n.length===0,details:n,contrastCapPatches:o},i=t.actionColor;return i&&(a.suggestedActionColor=a.isAccessible?i:this.findSuggestedActionColor(t,i)),a}computeContrastCapPatches(t){const r={};if(!t.actionColor||!N.isValidActionColor(t))return r;const n=this.buildTokenMap(t),o=new Map,a=new Set;for(const i of w){const s=o.get(i.tokenName);s?s.push(i):o.set(i.tokenName,[i]),this.getFixabilityRecord(i).fixable||a.add(i.tokenName)}for(const i of a){const s=n.get(i);if(!s)continue;const c=P(s);if(!c)continue;const y=o.get(i);let g,f=!0;for(const l of y){const W=O(l.type),d=this.search.findMinimumAlphaForContrast(c.rgb,c.a,l,W,n);if(d===void 0){f=!1;break}(g===void 0||d>g)&&(g=d)}if(f&&g!==void 0){const l=D(c.rgb,g);if(this.verifyCandidateSatisfiesAll(i,l,y,n)){r[i]=l;continue}}const h=this.search.findRgbPatchForContrastAll(c.rgb,y,n);h!==void 0&&(r[i]=D(h,1))}return r}computeTokenContrast(t,r){return At(t,r,this.fixedSurfaces)}resolvePairedSurface(t,r){return R(t,r,this.fixedSurfaces)}getFixabilityRecord(t){var r;return this.fixabilityCache||(this.fixabilityCache=this.buildFixabilityCache()),(r=this.fixabilityCache.get(N.fixabilityCacheKey(t)))!==null&&r!==void 0?r:{fixable:!0,maxContrast:1/0}}collectFailures(t,r=!1){const n=[];for(const o of w){if(!this.getFixabilityRecord(o).fixable)continue;const a=this.computeTokenContrast(o,t);if(!a)continue;const i=O(o.type);if(!(a.contrastRatio>=i)&&(n.push({tokenName:o.tokenName,contrastRatio:a.contrastRatio,requiredRatio:i}),r))return n}return n}isAccessible(t){return this.collectFailures(t,!0).length===0}static isValidActionColor(t){return!t.actionColor||ot(t.actionColor)}withActionColor(t,r){return Object.assign(Object.assign({},t),{actionColor:r})}static fixabilityCacheKey(t){var r;return`${t.tokenName}|${t.pairedWith}|${(r=t.compositedOn)!==null&&r!==void 0?r:""}`}buildFixabilityCache(){const t=new Map,r={},n=N.FIXABILITY_PROBE_COLORS.map(o=>this.buildTokenMap(this.withActionColor(r,o)));for(const o of w){let a=0;for(const s of n){const c=this.computeTokenContrast(o,s);c&&c.contrastRatio>a&&(a=c.contrastRatio)}const i=O(o.type);t.set(N.fixabilityCacheKey(o),{fixable:a>=i,maxContrast:Math.round(a*100)/100})}return t}findSuggestedActionColor(t,r){const n=this.search.searchClosestFeasibleInOklch(gt(r),o=>this.isAccessible(this.buildTokenMap(this.withActionColor(t,V(o)))));return n===void 0?void 0:V(n)}verifyCandidateSatisfiesAll(t,r,n,o){const a=new Map(o);a.set(t,r);for(const i of n){const s=O(i.type),c=this.computeTokenContrast(i,a);if(!c||c.contrastRatio<s)return!1}return!0}}N.FIXABILITY_PROBE_COLORS=["#000000","#808080","#ffffff"];const Ct=new N({fixedSurfaceTokens:et,generateOverrideThemes:e=>rt.generateOverrideThemes(e)});export{Ct as vegaAccessibilityValidator};
@@ -1 +1 @@
1
- import{L as b,f}from"./index-bkDaCMH8.js";import{M}from"./mutation-observer-slimmer-58ebc13c-C22plZKJ.js";var d=function(s,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,i);else for(var r=s.length-1;r>=0;r--)(u=s[r])&&(o=(n<3?u(o):n>3?u(t,e,o):u(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o};class m extends M{constructor(t,e){const i=Array.from(new Set(Object.values(e).reduce((n,o)=>n.concat(o.dependency),[])));super({options:{attributes:!0,attributeFilter:i},callback:n=>{this.handleMutations(n)}}),this.targetGetter=t,this.ariaMap=e}componentDidLoad(){this.performMapping(),super.componentDidLoad&&super.componentDidLoad()}componentDidRender(){this.performMapping()}handleMutations(t){const e=new Set;if(t&&t.length)for(const i of t)i.attributeName&&e.add(i.attributeName);this.performMapping(e.size?e:void 0)}performMapping(t){const e=this.targetGetter?this.targetGetter():null;if(!e)return;const i=this.host;Object.keys(this.ariaMap).forEach(n=>{const{dependency:o,defaultValue:u}=this.ariaMap[n];if(t&&!o.some(l=>t.has(l)))return;let r=null;for(const l of o){let a=i.getAttribute(l);if(a==null||a===""){const h=l.replace(/-([a-z])/g,(D,g)=>g.toUpperCase()),p=i[l],c=i[h];p!=null?a=String(p):c!=null&&(a=String(c))}if(a!=null&&String(a).trim()!==""){r=a;break}}(r==null||String(r).trim()==="")&&(r=u);try{if(String(r).trim()===""){e.removeAttribute(n);return}const l=e.getAttribute(n);if(r==null){l!==null&&e.removeAttribute(n);return}const a=String(r);l!==a&&e.setAttribute(n,a)}catch(l){b.warn("Errors occurred when setting aria attribute:",{ariaAttr:n,finalValue:r,error:l})}})}}d([f("componentDidLoad")],m.prototype,"componentDidLoad",null);d([f("componentDidRender")],m.prototype,"componentDidRender",null);export{m as A};
1
+ import{L as b,f}from"./index-xErL25ZZ.js";import{M}from"./mutation-observer-slimmer-58ebc13c-C8NHwhLF.js";var d=function(s,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,i);else for(var r=s.length-1;r>=0;r--)(u=s[r])&&(o=(n<3?u(o):n>3?u(t,e,o):u(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o};class m extends M{constructor(t,e){const i=Array.from(new Set(Object.values(e).reduce((n,o)=>n.concat(o.dependency),[])));super({options:{attributes:!0,attributeFilter:i},callback:n=>{this.handleMutations(n)}}),this.targetGetter=t,this.ariaMap=e}componentDidLoad(){this.performMapping(),super.componentDidLoad&&super.componentDidLoad()}componentDidRender(){this.performMapping()}handleMutations(t){const e=new Set;if(t&&t.length)for(const i of t)i.attributeName&&e.add(i.attributeName);this.performMapping(e.size?e:void 0)}performMapping(t){const e=this.targetGetter?this.targetGetter():null;if(!e)return;const i=this.host;Object.keys(this.ariaMap).forEach(n=>{const{dependency:o,defaultValue:u}=this.ariaMap[n];if(t&&!o.some(l=>t.has(l)))return;let r=null;for(const l of o){let a=i.getAttribute(l);if(a==null||a===""){const h=l.replace(/-([a-z])/g,(D,g)=>g.toUpperCase()),p=i[l],c=i[h];p!=null?a=String(p):c!=null&&(a=String(c))}if(a!=null&&String(a).trim()!==""){r=a;break}}(r==null||String(r).trim()==="")&&(r=u);try{if(String(r).trim()===""){e.removeAttribute(n);return}const l=e.getAttribute(n);if(r==null){l!==null&&e.removeAttribute(n);return}const a=String(r);l!==a&&e.setAttribute(n,a)}catch(l){b.warn("Errors occurred when setting aria attribute:",{ariaAttr:n,finalValue:r,error:l})}})}}d([f("componentDidLoad")],m.prototype,"componentDidLoad",null);d([f("componentDidRender")],m.prototype,"componentDidRender",null);export{m as A};
@@ -1 +1 @@
1
- import{a as h,c_ as g,c$ as f,an as C,E as b,d0 as v,O as m,C as d,f as l}from"./index-bkDaCMH8.js";import{S as y}from"./synchronize-task-queue-ac8acc3b-Zj5FaVSX.js";var r=function(s,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,t,e,n);else for(var u=s.length-1;u>=0;u--)(a=s[u])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i};class c extends h{constructor(t){super(),this.isVoiceOverClick=!1,this.focusTriggerElement=null,this.focusDialogTaskQueue=new y,this.dialogContentReadyObserver=null,this.dialogContentReadySubject=null,this.isChildFocused=!1,this.eventListenerHandler=()=>{const e=this.entry.triggerEl()||window;e.addEventListener("click",this.handleClickEvent,{capture:!0}),e.addEventListener("contextmenu",this.handleContextMenuEvent,{capture:!0})},this.eventListenerRemover=()=>{const e=this.entry.triggerEl();e&&e.removeEventListener("click",this.handleClickEvent,{capture:!0}),window.removeEventListener("click",this.handleClickEvent,{capture:!0}),e&&e.removeEventListener("contextmenu",this.handleContextMenuEvent,{capture:!0})},this.handleClickEvent=e=>{this.isVoiceOverClick=g(e),this.isVoiceOverClick||(this.focusTriggerElement=null)},this.handleContextMenuEvent=e=>{this.isVoiceOverClick&&(e.preventDefault(),e.stopPropagation())},this.focusOnFirstFocusableElement=()=>{if(!this.isChildFocused){const e=this.entry.dialogEl(),n=f(e);n?(this.isChildFocused=!0,n.focus()):e.focus()}},this.entry=t}connectedCallback(){this.eventListenerHandler(),this.subscribeDialogContentReady()}disconnectedCallback(){this.eventListenerRemover(),this.unsubscribeDialogContentReady()}componentDidLoad(){this.eventListenerHandler(),this.subscribeDialogContentReady()}async componentDidRender(){await this.focusDialogTaskQueue.runTask()}async toggle(t){t?await this.show():await this.hide()}async show(){this.entry.dialogEl().removeAttribute("inert");const t=C(document,!0);t&&(this.isChildFocused=!1,await this.focusDialogTaskQueue.enqueue({run:async()=>{this.isVoiceOverClick&&(this.focusTriggerElement=t,this.focusOnFirstFocusableElement())}},!1))}async hide(){this.focusTriggerElement&&(this.entry.dialogEl().setAttribute("inert",""),await this.focusDialogTaskQueue.enqueue({run:async()=>{this.focusTriggerElement&&this.focusTriggerElement.focus(),this.focusTriggerElement=null}},!1))}subscribeDialogContentReady(){this.entry.dialogEl()&&!this.dialogContentReadySubject&&(this.dialogContentReadySubject=b.getSubject(this.entry.dialogEl(),v),this.dialogContentReadyObserver=new m(e=>!0,()=>{this.isVoiceOverClick&&this.focusOnFirstFocusableElement()}),d.register(this.dialogContentReadySubject,this.dialogContentReadyObserver))}unsubscribeDialogContentReady(){this.dialogContentReadyObserver&&this.dialogContentReadySubject&&(d.unregister(this.dialogContentReadySubject,this.dialogContentReadyObserver),this.dialogContentReadyObserver=null,this.dialogContentReadySubject=null)}}r([l("connectedCallback")],c.prototype,"connectedCallback",null);r([l("disconnectedCallback")],c.prototype,"disconnectedCallback",null);r([l("componentDidLoad")],c.prototype,"componentDidLoad",null);r([l("componentDidRender")],c.prototype,"componentDidRender",null);export{c as A};
1
+ import{a as h,c_ as g,c$ as f,an as C,E as b,d0 as v,O as m,C as d,f as l}from"./index-xErL25ZZ.js";import{S as y}from"./synchronize-task-queue-ac8acc3b-Zj5FaVSX.js";var r=function(s,t,e,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,t,e,n);else for(var u=s.length-1;u>=0;u--)(a=s[u])&&(i=(o<3?a(i):o>3?a(t,e,i):a(t,e))||i);return o>3&&i&&Object.defineProperty(t,e,i),i};class c extends h{constructor(t){super(),this.isVoiceOverClick=!1,this.focusTriggerElement=null,this.focusDialogTaskQueue=new y,this.dialogContentReadyObserver=null,this.dialogContentReadySubject=null,this.isChildFocused=!1,this.eventListenerHandler=()=>{const e=this.entry.triggerEl()||window;e.addEventListener("click",this.handleClickEvent,{capture:!0}),e.addEventListener("contextmenu",this.handleContextMenuEvent,{capture:!0})},this.eventListenerRemover=()=>{const e=this.entry.triggerEl();e&&e.removeEventListener("click",this.handleClickEvent,{capture:!0}),window.removeEventListener("click",this.handleClickEvent,{capture:!0}),e&&e.removeEventListener("contextmenu",this.handleContextMenuEvent,{capture:!0})},this.handleClickEvent=e=>{this.isVoiceOverClick=g(e),this.isVoiceOverClick||(this.focusTriggerElement=null)},this.handleContextMenuEvent=e=>{this.isVoiceOverClick&&(e.preventDefault(),e.stopPropagation())},this.focusOnFirstFocusableElement=()=>{if(!this.isChildFocused){const e=this.entry.dialogEl(),n=f(e);n?(this.isChildFocused=!0,n.focus()):e.focus()}},this.entry=t}connectedCallback(){this.eventListenerHandler(),this.subscribeDialogContentReady()}disconnectedCallback(){this.eventListenerRemover(),this.unsubscribeDialogContentReady()}componentDidLoad(){this.eventListenerHandler(),this.subscribeDialogContentReady()}async componentDidRender(){await this.focusDialogTaskQueue.runTask()}async toggle(t){t?await this.show():await this.hide()}async show(){this.entry.dialogEl().removeAttribute("inert");const t=C(document,!0);t&&(this.isChildFocused=!1,await this.focusDialogTaskQueue.enqueue({run:async()=>{this.isVoiceOverClick&&(this.focusTriggerElement=t,this.focusOnFirstFocusableElement())}},!1))}async hide(){this.focusTriggerElement&&(this.entry.dialogEl().setAttribute("inert",""),await this.focusDialogTaskQueue.enqueue({run:async()=>{this.focusTriggerElement&&this.focusTriggerElement.focus(),this.focusTriggerElement=null}},!1))}subscribeDialogContentReady(){this.entry.dialogEl()&&!this.dialogContentReadySubject&&(this.dialogContentReadySubject=b.getSubject(this.entry.dialogEl(),v),this.dialogContentReadyObserver=new m(e=>!0,()=>{this.isVoiceOverClick&&this.focusOnFirstFocusableElement()}),d.register(this.dialogContentReadySubject,this.dialogContentReadyObserver))}unsubscribeDialogContentReady(){this.dialogContentReadyObserver&&this.dialogContentReadySubject&&(d.unregister(this.dialogContentReadySubject,this.dialogContentReadyObserver),this.dialogContentReadyObserver=null,this.dialogContentReadySubject=null)}}r([l("connectedCallback")],c.prototype,"connectedCallback",null);r([l("disconnectedCallback")],c.prototype,"disconnectedCallback",null);r([l("componentDidLoad")],c.prototype,"componentDidLoad",null);r([l("componentDidRender")],c.prototype,"componentDidRender",null);export{c as A};
@@ -1 +1 @@
1
- import{bG as A}from"./index-bkDaCMH8.js";const y=(e,r="children")=>e.reduce((t,n)=>t.concat(n[r]?y(n[r],r):n),[]),h=(e,r,t=!1,n=(s,o)=>s<o?-1:s>o?1:0)=>{if(!Array.isArray(e)||!Array.isArray(r)||e.length!=r.length)return!1;if(t){const s=[...e].sort(n),o=[...r].sort(n);return s.every((c,f)=>n(c,o[f])===0)}else return e.every((s,o)=>n(s,r[o])===0)},N=e=>Object.keys(e).every(r=>!isNaN(A(r)));function p(e){let r=0;return e.forEach(t=>{r=t&&t.length>r?t.length:r}),r}function v(e,r){if(r.length){const t=[];return r.reduce((n,s)=>(t.push(e.slice(n,n+s)),n+s),0),t}return e}function d(e){return e&&Array.isArray(e[0])?e.reduce((r,t)=>r.concat(t),[]):e}function a(e,r){let t=e;return Array.isArray(e[0])?t=e.map(n=>(n.sort((s,o)=>r(s)-r(o)),n)):t.sort((n,s)=>r(n)-r(s)),t}function b(e,r,t,n){const s=u=>typeof r=="function"?r(u):u;n=n||Array.from(new Set(d(e).map(s)));const c=(typeof t=="function"?n.sort(t):n).reduce((u,i,l)=>(u[i]=l,u),{});return a(e,u=>c[s(u)])}function E(e,r){for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return n}}export{a,h as b,v as c,E as d,y as e,d as f,p as g,N as i,b as s};
1
+ import{bG as A}from"./index-xErL25ZZ.js";const y=(e,r="children")=>e.reduce((t,n)=>t.concat(n[r]?y(n[r],r):n),[]),h=(e,r,t=!1,n=(s,o)=>s<o?-1:s>o?1:0)=>{if(!Array.isArray(e)||!Array.isArray(r)||e.length!=r.length)return!1;if(t){const s=[...e].sort(n),o=[...r].sort(n);return s.every((c,f)=>n(c,o[f])===0)}else return e.every((s,o)=>n(s,r[o])===0)},N=e=>Object.keys(e).every(r=>!isNaN(A(r)));function p(e){let r=0;return e.forEach(t=>{r=t&&t.length>r?t.length:r}),r}function v(e,r){if(r.length){const t=[];return r.reduce((n,s)=>(t.push(e.slice(n,n+s)),n+s),0),t}return e}function d(e){return e&&Array.isArray(e[0])?e.reduce((r,t)=>r.concat(t),[]):e}function a(e,r){let t=e;return Array.isArray(e[0])?t=e.map(n=>(n.sort((s,o)=>r(s)-r(o)),n)):t.sort((n,s)=>r(n)-r(s)),t}function b(e,r,t,n){const s=u=>typeof r=="function"?r(u):u;n=n||Array.from(new Set(d(e).map(s)));const c=(typeof t=="function"?n.sort(t):n).reduce((u,i,l)=>(u[i]=l,u),{});return a(e,u=>c[s(u)])}function E(e,r){for(let t=0;t<e.length;t++){const n=e[t];if(r(n))return n}}export{a,h as b,v as c,E as d,y as e,d as f,p as g,N as i,b as s};
@@ -1 +1 @@
1
- import{a as i,L as c,f}from"./index-bkDaCMH8.js";import{S as l}from"./synchronize-task-queue-ac8acc3b-Zj5FaVSX.js";var p=function(o,e,t,n){var a=arguments.length,u=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(o,e,t,n);else for(var s=o.length-1;s>=0;s--)(r=o[s])&&(u=(a<3?r(u):a>3?r(e,t,u):r(e,t))||u);return a>3&&u&&Object.defineProperty(e,t,u),u};class h extends i{constructor(e){super(),this.autoRunTaskQueue=new l(e)}async executeTaskHook(){this.autoRunTaskQueue.queue.length&&await this.autoRunTaskQueue.runTask()}enqueueTheTaskIntoQueue(e=!1){this.autoRunTaskQueue.enqueue({run:async()=>{try{await this.doTask()}catch(t){c.error("The auto task run failed.",t)}}},e)}}p([f("componentDidUpdate")],h.prototype,"executeTaskHook",null);export{h as A};
1
+ import{a as i,L as c,f}from"./index-xErL25ZZ.js";import{S as l}from"./synchronize-task-queue-ac8acc3b-Zj5FaVSX.js";var p=function(o,e,t,n){var a=arguments.length,u=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(o,e,t,n);else for(var s=o.length-1;s>=0;s--)(r=o[s])&&(u=(a<3?r(u):a>3?r(e,t,u):r(e,t))||u);return a>3&&u&&Object.defineProperty(e,t,u),u};class h extends i{constructor(e){super(),this.autoRunTaskQueue=new l(e)}async executeTaskHook(){this.autoRunTaskQueue.queue.length&&await this.autoRunTaskQueue.runTask()}enqueueTheTaskIntoQueue(e=!1){this.autoRunTaskQueue.enqueue({run:async()=>{try{await this.doTask()}catch(t){c.error("The auto task run failed.",t)}}},e)}}p([f("componentDidUpdate")],h.prototype,"executeTaskHook",null);export{h as A};
@@ -1 +1 @@
1
- import{a as f,O as u,C as p,bH as b,M as v,f as d}from"./index-bkDaCMH8.js";var a=function(n,e,t,o){var c=arguments.length,r=c<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,o);else for(var i=n.length-1;i>=0;i--)(s=n[i])&&(r=(c<3?s(r):c>3?s(e,t,r):s(e,t))||r);return c>3&&r&&Object.defineProperty(e,t,r),r};class l extends f{connectedCallback(){this.observer=new u(this.isAcceptObserver.bind(this),e=>{this.currentBranding=e}),p.register(b,this.observer)}disconnectResizeObserver(){p.unregister(b,this.observer)}isAcceptObserver(){return!0}}a([v({writable:!0})],l.prototype,"currentBranding",void 0);a([d("connectedCallback")],l.prototype,"connectedCallback",null);a([d("disconnectedCallback")],l.prototype,"disconnectResizeObserver",null);export{l as B};
1
+ import{a as f,O as u,C as p,bH as b,M as v,f as d}from"./index-xErL25ZZ.js";var a=function(n,e,t,o){var c=arguments.length,r=c<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,o);else for(var i=n.length-1;i>=0;i--)(s=n[i])&&(r=(c<3?s(r):c>3?s(e,t,r):s(e,t))||r);return c>3&&r&&Object.defineProperty(e,t,r),r};class l extends f{connectedCallback(){this.observer=new u(this.isAcceptObserver.bind(this),e=>{this.currentBranding=e}),p.register(b,this.observer)}disconnectResizeObserver(){p.unregister(b,this.observer)}isAcceptObserver(){return!0}}a([v({writable:!0})],l.prototype,"currentBranding",void 0);a([d("connectedCallback")],l.prototype,"connectedCallback",null);a([d("disconnectedCallback")],l.prototype,"disconnectResizeObserver",null);export{l as B};
@@ -1 +1 @@
1
- import{aB as r}from"./index-bkDaCMH8.js";class d extends r{evaluate(e){return typeof e=="boolean"?{isValid:e,message:e?"":"This field is required"}:typeof e=="string"?{isValid:e!=="",message:e!==""?"":"This field is required"}:{isValid:!1,message:"This field is required"}}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return typeof e=="string"||typeof e=="boolean"||e===null}}export{d as C};
1
+ import{aB as r}from"./index-xErL25ZZ.js";class d extends r{evaluate(e){return typeof e=="boolean"?{isValid:e,message:e?"":"This field is required"}:typeof e=="string"?{isValid:e!=="",message:e!==""?"":"This field is required"}:{isValid:!1,message:"This field is required"}}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return typeof e=="string"||typeof e=="boolean"||e===null}}export{d as C};
@@ -1 +1 @@
1
- import{a as u,w as c,bI as p,b2 as h,b3 as E,M as m,f as v}from"./index-bkDaCMH8.js";var d=function(o,e,n,s){var i=arguments.length,t=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,n,s);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(t=(i<3?r(t):i>3?r(e,n,t):r(e,n))||t);return i>3&&t&&Object.defineProperty(e,n,t),t};class l extends u{constructor(e,n,s,i){if(super(),this.eventIds=[],this.useCapture=!1,this.isEventListenerAdded=!1,this.disabled=!1,this.preventChildEvent=t=>{const r=this.getHostElement();if(!this.shouldSkipEventPrevent())if(typeof this.customPreventHandle=="function")this.customPreventHandle(t);else{const a=t.composedPath();(r!==t.target||r!==a[0])&&t.stopImmediatePropagation()}},this.eventIds=e,this.getHostElement=n,s===!0)this.useCapture=!0;else if(s){const{useCapture:t=!1,customPreventHandle:r}=s;this.useCapture=t,this.customPreventHandle=r}this.disabled=i===!0}setup(){this.addOrRemoveEventListener("add")}checkEventListenerStatus(){this.isEventListenerAdded||this.setup(),this.setSkipEventPreventFlag()}destroy(){this.addOrRemoveEventListener("remove")}setSkipEventPreventFlag(){c.isEnabled("VEGA_REACT.SKIP_NATIVE_EVENT_PREVENT_BY_DEFAULT")&&this.disabled&&this.host&&p.getVegaEnv().framework==="react"&&h.getSemantics(this.host).namespace==="native"&&this.getHostElement().setAttribute("data-vega-no-event-prevent","true")}addOrRemoveEventListener(e){const n=this.getHostElement();this.eventIds&&this.eventIds.length&&n&&(this.eventIds.filter(s=>this.shouldPrevent(s)).forEach(s=>{n[e==="add"?"addEventListener":"removeEventListener"](this.getCurrentEventName(s),this.preventChildEvent,this.useCapture)}),this.isEventListenerAdded=e==="add")}getCurrentEventName(e){return e.getCurrentName(h.getSemantics(this.host))}shouldPrevent(e){const{namespace:n,jqueryDelegatedEvent:s}=h.getSemantics(this.host);return!(n==="native"&&s&&E.isSupportDelegated(this.host,e))}shouldSkipEventPrevent(){const e=this.getHostElement();return e&&e.dataset.vegaNoEventPrevent==="true"}}d([m()],l.prototype,"host",void 0);d([v("connectedCallback")],l.prototype,"setup",null);d([v("componentDidLoad")],l.prototype,"checkEventListenerStatus",null);d([v("disconnectedCallback")],l.prototype,"destroy",null);export{l as C};
1
+ import{a as u,w as c,bI as p,b2 as h,b3 as E,M as m,f as v}from"./index-xErL25ZZ.js";var d=function(o,e,n,s){var i=arguments.length,t=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,n,s);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(t=(i<3?r(t):i>3?r(e,n,t):r(e,n))||t);return i>3&&t&&Object.defineProperty(e,n,t),t};class l extends u{constructor(e,n,s,i){if(super(),this.eventIds=[],this.useCapture=!1,this.isEventListenerAdded=!1,this.disabled=!1,this.preventChildEvent=t=>{const r=this.getHostElement();if(!this.shouldSkipEventPrevent())if(typeof this.customPreventHandle=="function")this.customPreventHandle(t);else{const a=t.composedPath();(r!==t.target||r!==a[0])&&t.stopImmediatePropagation()}},this.eventIds=e,this.getHostElement=n,s===!0)this.useCapture=!0;else if(s){const{useCapture:t=!1,customPreventHandle:r}=s;this.useCapture=t,this.customPreventHandle=r}this.disabled=i===!0}setup(){this.addOrRemoveEventListener("add")}checkEventListenerStatus(){this.isEventListenerAdded||this.setup(),this.setSkipEventPreventFlag()}destroy(){this.addOrRemoveEventListener("remove")}setSkipEventPreventFlag(){c.isEnabled("VEGA_REACT.SKIP_NATIVE_EVENT_PREVENT_BY_DEFAULT")&&this.disabled&&this.host&&p.getVegaEnv().framework==="react"&&h.getSemantics(this.host).namespace==="native"&&this.getHostElement().setAttribute("data-vega-no-event-prevent","true")}addOrRemoveEventListener(e){const n=this.getHostElement();this.eventIds&&this.eventIds.length&&n&&(this.eventIds.filter(s=>this.shouldPrevent(s)).forEach(s=>{n[e==="add"?"addEventListener":"removeEventListener"](this.getCurrentEventName(s),this.preventChildEvent,this.useCapture)}),this.isEventListenerAdded=e==="add")}getCurrentEventName(e){return e.getCurrentName(h.getSemantics(this.host))}shouldPrevent(e){const{namespace:n,jqueryDelegatedEvent:s}=h.getSemantics(this.host);return!(n==="native"&&s&&E.isSupportDelegated(this.host,e))}shouldSkipEventPrevent(){const e=this.getHostElement();return e&&e.dataset.vegaNoEventPrevent==="true"}}d([m()],l.prototype,"host",void 0);d([v("connectedCallback")],l.prototype,"setup",null);d([v("componentDidLoad")],l.prototype,"checkEventListenerStatus",null);d([v("disconnectedCallback")],l.prototype,"destroy",null);export{l as C};
@@ -1 +1 @@
1
- import{a as f,ae as p,O as d,C as h,M as u,f as b}from"./index-bkDaCMH8.js";var r=function(l,s,a,c){var e=arguments.length,t=e<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,a):c,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(l,s,a,c);else for(var i=l.length-1;i>=0;i--)(o=l[i])&&(t=(e<3?o(t):e>3?o(s,a,t):o(s,a))||t);return e>3&&t&&Object.defineProperty(s,a,t),t};class n extends f{constructor(s,a,c){super(),this.acceptableResultMap=new WeakMap,this.isAcceptableObserverPayload=e=>{let t=!1;return typeof this.customAcceptableHandle=="function"?t=this.customAcceptableHandle(e):this.host&&e.host&&(this.acceptableResultMap.has(e.host)?t=!!this.acceptableResultMap.get(e.host):(t=this.host===e.host?!1:p(e.host,this.host),this.acceptableResultMap.set(e.host,t))),t},this.handleObserver=e=>{typeof this.callback=="function"&&this.callback(e)},this.subject=s,this.callback=a,this.customAcceptableHandle=c}connectedCallback(){this.subject&&(this.notifyObserver=new d(this.isAcceptableObserverPayload.bind(this),this.handleObserver),h.register(this.subject,this.notifyObserver))}disconnectedCallback(){this.subject&&h.unregister(this.subject,this.notifyObserver)}}r([u()],n.prototype,"host",void 0);r([b("connectedCallback")],n.prototype,"connectedCallback",null);r([b("disconnectedCallback")],n.prototype,"disconnectedCallback",null);export{n as C};
1
+ import{a as f,ae as p,O as d,C as h,M as u,f as b}from"./index-xErL25ZZ.js";var r=function(l,s,a,c){var e=arguments.length,t=e<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,a):c,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(l,s,a,c);else for(var i=l.length-1;i>=0;i--)(o=l[i])&&(t=(e<3?o(t):e>3?o(s,a,t):o(s,a))||t);return e>3&&t&&Object.defineProperty(s,a,t),t};class n extends f{constructor(s,a,c){super(),this.acceptableResultMap=new WeakMap,this.isAcceptableObserverPayload=e=>{let t=!1;return typeof this.customAcceptableHandle=="function"?t=this.customAcceptableHandle(e):this.host&&e.host&&(this.acceptableResultMap.has(e.host)?t=!!this.acceptableResultMap.get(e.host):(t=this.host===e.host?!1:p(e.host,this.host),this.acceptableResultMap.set(e.host,t))),t},this.handleObserver=e=>{typeof this.callback=="function"&&this.callback(e)},this.subject=s,this.callback=a,this.customAcceptableHandle=c}connectedCallback(){this.subject&&(this.notifyObserver=new d(this.isAcceptableObserverPayload.bind(this),this.handleObserver),h.register(this.subject,this.notifyObserver))}disconnectedCallback(){this.subject&&h.unregister(this.subject,this.notifyObserver)}}r([u()],n.prototype,"host",void 0);r([b("connectedCallback")],n.prototype,"connectedCallback",null);r([b("disconnectedCallback")],n.prototype,"disconnectedCallback",null);export{n as C};
@@ -1 +1 @@
1
- import{L as r}from"./index-bkDaCMH8.js";const v=["vega-flex-grow","vega-flex-shrink","vega-flex-grow-0","vega-flex-shrink-0","vega-flex-basis-0","v-flex-1","v-min-w-min","disabled","v-text-black","v-text-white","v-hidden","vega-page-notification-fade-out","v-h-full","v-h-screen"];function w(i,e){return h(i,e),g(e),i}function h(i,e){var a,s,t;const n=["hydrated"].concat(((s=(a=i.$attrs$)===null||a===void 0?void 0:a.class)===null||s===void 0?void 0:s.split(/\s+/).filter(Boolean))||[]),c=((t=e.dataset.verifiedClasses)===null||t===void 0?void 0:t.split(" "))||[],d=new Set([...n,...c,...v]),l=Array.from(e.classList).filter(Boolean).filter(o=>{const f=o.replace(/(S|M|L|XL):/,"");return!d.has(f)}).filter(o=>!o.startsWith("ng-"));l.length&&r.warn(`Found class(es) ${l} added to component:`,e," which is anti vega design pattern and we will forbid this behavior in the future release."," for more details, please refer to: https://heartlandpayments.github.io/Vega/?path=/docs/best-practice--page"),n.join()!=="hydrated"&&(e.dataset.verifiedClasses=n.join(" "))}function g(i){i.children&&Array.from(i.children).forEach(a=>{a.hasAttribute("data-shrink")&&r.warn("Found attribute [data-shrink='0'] inside component:",i," which will be deprecated, please use classes of vega-flex-shrink, vega-flex-grow, vega-flex-shrink-0, vega-flex-grow-0, vega-flex-basis-0 instead.")})}const u=(i=document)=>{const e=i.activeElement;return e!=null&&e.shadowRoot?u(e.shadowRoot):e||null};export{u as g,w as s};
1
+ import{L as r}from"./index-xErL25ZZ.js";const v=["vega-flex-grow","vega-flex-shrink","vega-flex-grow-0","vega-flex-shrink-0","vega-flex-basis-0","v-flex-1","v-min-w-min","disabled","v-text-black","v-text-white","v-hidden","vega-page-notification-fade-out","v-h-full","v-h-screen"];function w(i,e){return h(i,e),g(e),i}function h(i,e){var a,s,t;const n=["hydrated"].concat(((s=(a=i.$attrs$)===null||a===void 0?void 0:a.class)===null||s===void 0?void 0:s.split(/\s+/).filter(Boolean))||[]),c=((t=e.dataset.verifiedClasses)===null||t===void 0?void 0:t.split(" "))||[],d=new Set([...n,...c,...v]),l=Array.from(e.classList).filter(Boolean).filter(o=>{const f=o.replace(/(S|M|L|XL):/,"");return!d.has(f)}).filter(o=>!o.startsWith("ng-"));l.length&&r.warn(`Found class(es) ${l} added to component:`,e," which is anti vega design pattern and we will forbid this behavior in the future release."," for more details, please refer to: https://heartlandpayments.github.io/Vega/?path=/docs/best-practice--page"),n.join()!=="hydrated"&&(e.dataset.verifiedClasses=n.join(" "))}function g(i){i.children&&Array.from(i.children).forEach(a=>{a.hasAttribute("data-shrink")&&r.warn("Found attribute [data-shrink='0'] inside component:",i," which will be deprecated, please use classes of vega-flex-shrink, vega-flex-grow, vega-flex-shrink-0, vega-flex-grow-0, vega-flex-basis-0 instead.")})}const u=(i=document)=>{const e=i.activeElement;return e!=null&&e.shadowRoot?u(e.shadowRoot):e||null};export{u as g,w as s};
@@ -1 +1 @@
1
- import{a as r,t as h,u as f,v as m,M as u,f as p}from"./index-bkDaCMH8.js";var a=function(i,e,t,c){var s=arguments.length,o=s<3?e:c===null?c=Object.getOwnPropertyDescriptor(e,t):c,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,c);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(o=(s<3?l(o):s>3?l(e,t,o):l(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class n extends r{constructor(e){super(),this.style=e}connectedCallback(){const e=this.host.tagName,t=n.connectedComponents.get(e);t?t.add(this.host):n.connectedComponents.set(e,new Set([this.host]))}disconnectedCallback(){const e=this.host.tagName,t=n.connectedComponents.get(e);if(t&&(t.delete(this.host),t.size===0)){const c=this.getStyleElement();c&&c.remove()}}componentWillLoad(){this.id=`${this.host.tagName}-GLOBAL-STYLE`;let e=this.getStyleElement();e||(e=document.createElement("style"),e.id=this.id,e.innerHTML=h.sanitize(this.style,f),m.nonce&&e.setAttribute("nonce",m.nonce),document.head.append(e))}getStyleElement(){return document.head.querySelector(`style#${this.id}`)}}n.connectedComponents=new Map;a([u()],n.prototype,"host",void 0);a([p("connectedCallback")],n.prototype,"connectedCallback",null);a([p("disconnectedCallback")],n.prototype,"disconnectedCallback",null);a([p("componentWillLoad")],n.prototype,"componentWillLoad",null);export{n as C};
1
+ import{a as r,t as h,u as f,v as m,M as u,f as p}from"./index-xErL25ZZ.js";var a=function(i,e,t,c){var s=arguments.length,o=s<3?e:c===null?c=Object.getOwnPropertyDescriptor(e,t):c,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,c);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(o=(s<3?l(o):s>3?l(e,t,o):l(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class n extends r{constructor(e){super(),this.style=e}connectedCallback(){const e=this.host.tagName,t=n.connectedComponents.get(e);t?t.add(this.host):n.connectedComponents.set(e,new Set([this.host]))}disconnectedCallback(){const e=this.host.tagName,t=n.connectedComponents.get(e);if(t&&(t.delete(this.host),t.size===0)){const c=this.getStyleElement();c&&c.remove()}}componentWillLoad(){this.id=`${this.host.tagName}-GLOBAL-STYLE`;let e=this.getStyleElement();e||(e=document.createElement("style"),e.id=this.id,e.innerHTML=h.sanitize(this.style,f),m.nonce&&e.setAttribute("nonce",m.nonce),document.head.append(e))}getStyleElement(){return document.head.querySelector(`style#${this.id}`)}}n.connectedComponents=new Map;a([u()],n.prototype,"host",void 0);a([p("connectedCallback")],n.prototype,"connectedCallback",null);a([p("disconnectedCallback")],n.prototype,"disconnectedCallback",null);a([p("componentWillLoad")],n.prototype,"componentWillLoad",null);export{n as C};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-bkDaCMH8.js","./index-xkxY2lLz.css"])))=>i.map(i=>d[i]);
2
- import{a as c,aj as f,L as u,M as g,f as p,aN as d,aO as h,aP as y,aQ as b}from"./index-bkDaCMH8.js";function U(){return function(a,e){Object.defineProperty(a,e,{set:P(e),get:d(e)})}}function P(a){return function(){const e={};h.globalSlimmers.forEach(o=>{e[o.name]=new o({component:this})});const t=Object.values(e);t.forEach(o=>{y(a).call(this,o)}),t.length>0&&this[b].set(a,e)}}var m=function(a,e,t,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,o);else for(var l=a.length-1;l>=0;l--)(r=a[l])&&(n=(s<3?r(n):s>3?r(e,t,n):r(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n};class i extends c{constructor(e){super(),this.usageDefinitions=e}sendUsagePayloadToTelemetry(){f(()=>import("./index-bkDaCMH8.js").then(e=>e.fc),__vite__mapDeps([0,1]),import.meta.url).then(e=>{try{e.default.emit("componentUsage",this.getComponentUsageMetricsPayload())}catch(t){u.log("Component usage payload failed to emit telemetry:",t)}})}getComponentUsageMetricsPayload(){const e={};if(e[i.baseUsageKey]=!0,this.usageDefinitions)for(const t of this.usageDefinitions){const{payloadKey:o,payloadValue:s}=t;e[o]=s(this.host)}return{componentName:this.host.tagName.toUpperCase(),data:e}}}i.baseUsageKey="COMPONENT_USED";m([g()],i.prototype,"host",void 0);m([p("componentDidRender")],i.prototype,"sendUsagePayloadToTelemetry",null);export{U as I,i as V};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-xErL25ZZ.js","./index-xkxY2lLz.css"])))=>i.map(i=>d[i]);
2
+ import{a as c,aj as f,L as u,M as g,f as p,aN as d,aO as h,aP as y,aQ as b}from"./index-xErL25ZZ.js";function U(){return function(a,e){Object.defineProperty(a,e,{set:P(e),get:d(e)})}}function P(a){return function(){const e={};h.globalSlimmers.forEach(o=>{e[o.name]=new o({component:this})});const t=Object.values(e);t.forEach(o=>{y(a).call(this,o)}),t.length>0&&this[b].set(a,e)}}var m=function(a,e,t,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,o);else for(var l=a.length-1;l>=0;l--)(r=a[l])&&(n=(s<3?r(n):s>3?r(e,t,n):r(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n};class i extends c{constructor(e){super(),this.usageDefinitions=e}sendUsagePayloadToTelemetry(){f(()=>import("./index-xErL25ZZ.js").then(e=>e.fc),__vite__mapDeps([0,1]),import.meta.url).then(e=>{try{e.default.emit("componentUsage",this.getComponentUsageMetricsPayload())}catch(t){u.log("Component usage payload failed to emit telemetry:",t)}})}getComponentUsageMetricsPayload(){const e={};if(e[i.baseUsageKey]=!0,this.usageDefinitions)for(const t of this.usageDefinitions){const{payloadKey:o,payloadValue:s}=t;e[o]=s(this.host)}return{componentName:this.host.tagName.toUpperCase(),data:e}}}i.baseUsageKey="COMPONENT_USED";m([g()],i.prototype,"host",void 0);m([p("componentDidRender")],i.prototype,"sendUsagePayloadToTelemetry",null);export{U as I,i as V};
@@ -1 +1 @@
1
- import{ea as g,f9 as R,ce as u,c6 as h,cx as w,C as O,E as m,fa as T,D as _,fb as v,e6 as D,cr as b,c8 as M,ef as E,cj as x,cf as B,O as A,c9 as k,M as d,f as N}from"./index-bkDaCMH8.js";import{g as I}from"./component-7d906393-OYky_Eqf.js";import{A as F}from"./auto-run-when-re-render-task-queue-slimmer.abstract-27820d4c-CSj3jCXu.js";import{K as H}from"./keyboard-manager-slimmer-531ddb0e-Bj8XlAe8.js";class S{constructor(e,t,o=0,n=0,i,s,r){this._startOffset=0,this._endOffset=0,this._startContainer=e,this._endContainer=t,this._startOffset=o,this._endOffset=n,this._startNode=i,this._endNode=s,r&&(this._oldNativeRange=r)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(e,t){const{startOffset:o,endOffset:n}=e;this._startOffset=o,this._endOffset=n;const i=e.startNode,s=e.endNode;if(i instanceof g){this._startNode=i,this._endNode=s;const r=this._startNode.getRangeContainer(),a=this._startNode===this._endNode?r:this._endNode.getRangeContainer();r&&(this._startContainer=r,this._endContainer=a)}else this._startContainer=i,this._endContainer=s,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),t&&(this._oldNativeRange=t);return new S(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new S(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){let e=null;if(this._startNode){const t=this._startNode.getRangeContainer(),o=this._startNode===this._endNode?t:this._endNode.getRangeContainer();if(t&&o)return e=new Range,e.setStart(t,this.clampOffsetToContainer(t,this._startOffset)),e.setEnd(o,this.clampOffsetToContainer(o,this._endOffset)),this._startContainer=t,this._endContainer=o,this._oldNativeRange=e,e}if(!e&&this._oldNativeRange)return this._oldNativeRange}clampOffsetToContainer(e,t){var o,n;const i=e.nodeType===Node.TEXT_NODE?(n=(o=e.textContent)===null||o===void 0?void 0:o.length)!==null&&n!==void 0?n:0:e.childNodes.length;return Math.max(0,Math.min(t,i))}getRTENodeByElement(e){if(e){const t=e.nodeType===Node.TEXT_NODE?e.parentElement:R(e)&&u.isDecoratorNodeContainerElement(e)?u.getDecoratorNodeElement(e):e;return h.getEntityByDOM(t)}}}let p=!1;class P{constructor(){this.rangeCount=0,this.ranges=[]}getRangeAt(e){return this.ranges[e]}addRange(e){if(this.ranges.push(e),this.rangeCount=this.ranges.length,!p){const t=window.getSelection();t.removeAllRanges(),t.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset)}}removeAllRanges(){this.ranges=[],this.rangeCount=0}}class V{constructor(){this.supportShadowSelection=typeof window.ShadowRoot.prototype.getSelection=="function",this.supportBeforeInput=typeof window.InputEvent.prototype.getTargetRanges=="function",this.isFirefox=window.navigator.userAgent.toLowerCase().indexOf("firefox")>0,this.listen()}getSelection(e){return this.supportShadowSelection?e.getSelection():this.isFirefox?this.getFirefoxSelection():this.polyfilledShadowSelection}getFirefoxSelection(){const e=document.getSelection();if(e.rangeCount>0){const t=e.getRangeAt(0),o=t.startContainer,n=t.endContainer;if(o!==n&&o.textContent.length===t.startOffset){const i=o.nodeType===Node.TEXT_NODE?o.parentNode.nextSibling:o.nextSibling;t.setStart(i.firstChild,0)}if(n!==o&&t.endOffset===0){const i=n.nodeType===Node.TEXT_NODE?n.parentNode.previousSibling:n.previousSibling;t.setEnd(i.lastChild,i.lastChild.textContent.length)}}return e}listen(){this.isFirefox||this.supportShadowSelection||!this.supportBeforeInput||(this.polyfilledShadowSelection=new P,window.addEventListener("selectionchange",()=>{if(!p){p=!0;const e=I();e&&e.hasAttribute("contenteditable")?document.execCommand("indent"):this.polyfilledShadowSelection.removeAllRanges(),p=!1}},!0),window.addEventListener("beforeinput",e=>{if(p){const o=e.getTargetRanges()[0],n=new Range;n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),this.polyfilledShadowSelection.removeAllRanges(),this.polyfilledShadowSelection.addRange(n),e.preventDefault(),e.stopImmediatePropagation()}},!0))}}const j=new V;class C{constructor(e){this.range=e}clone(){const e=this.range.clone();return new C(e)}}var l=function(f,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,e,t,o);else for(var r=f.length-1;r>=0;r--)(s=f[r])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};class c extends F{constructor(){super(1),this.currentRange=new S,this.handleSelectionWithDebounce=w(this.handleSelectionChange,c.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.pendingRestoreSelectionNodes=[],this.doTask=async()=>{await Promise.resolve();const e=this.currentRange.toNativeRange();e&&(this.setSelectionRange(e),this.scrollCaretIntoView(e))}}connectedCallback(){this.registerSelectionRangeChangeObserver()}disconnectedCallback(){O.unregister(m.getSubject(this.host,T),this.selectionRangeChangeObserver),_.removeUniqueObserverFromNode(this.host,v)}componentDidLoad(){document.addEventListener("selectionchange",this.handleSelectionWithDebounce),this.registerUpdateCaretPositionObserver()}watchValueUpdate(){this.prepareRestoreSelectionState(),this.restoreSelection()}getCurrentRange(){return this.currentRange}getSelectedNodes(){return Array.from(this.selectionMap.values()).flat()}setSelectedNodes(e,t){this.clearSelectionMap(),this.addNodesToSelectionMap(e),t&&(this.currentRange=this.currentRange.updateRTERange(t))}getSelectedBlocks(){return Array.from(this.selectionMap.keys())}setSelectionState(e){this.selectionState=e}enqueueSelectionRangeFutureState(e,t,o,n,i=!1){e instanceof D?this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(e,t,i):(o=o||e,n=n||n===0?n:t,this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:o,startOffset:t,endOffset:n}),super.enqueueTheTaskIntoQueue(i))}setSelectionRange(e){const t=this.getSelection();t&&(t.removeAllRanges(),t.addRange(e),this.saveSelection())}getSelection(){const e=this.vegaRichTextEditorRenderer.getRichTextContentRef();return j.getSelection(e.shadowRoot)}scrollCaretIntoView(e){const t=this.getCaretElement(e);!t||typeof t.scrollIntoView!="function"||this.isCaretWithinViewport(e,t)||t.scrollIntoView({block:"center",inline:"nearest"})}getCaretElement(e){const t=e.startContainer;return t?t.nodeType===Node.TEXT_NODE?t.parentElement:t:null}isCaretWithinViewport(e,t){const o=e.getBoundingClientRect(),n=o.width===0&&o.height===0&&o.top===0?t.getBoundingClientRect():o;let i=0,s=window.innerHeight;const r=this.vegaRichTextEditorRenderer.getRichTextContentRef();if(r){const a=r.getBoundingClientRect();i=Math.max(i,a.top),s=Math.min(s,a.bottom)}return n.top>=i-1&&n.bottom<=s+1}saveSelection(){const e=this.getSelection();if(e&&e.rangeCount>0&&this.autoRunTaskQueue.queue.length===0&&!this.insertCompositionTextController.isComposing()){const t=e.getRangeAt(0),{startContainer:o,endContainer:n,startOffset:i,endOffset:s}=t;this.currentRange=this.currentRange.updateRTERange({startNode:o,endNode:n,startOffset:i,endOffset:s},t)}}restoreSelection(){if(this.selectionState){const{startNode:e,endNode:t,startOffset:o,endOffset:n}=this.selectionState.range;e instanceof b&&e===t&&e.text.length===0?this.enqueueSelectionRangeFutureState(e,M.length):e===t&&e instanceof b&&!e.isContentEditable()||this.enqueueSelectionRangeFutureState(e,o,t,n),this.selectionState=null}}handleSelectionChange(){if(this.disabled||this.sourceView)return;this.clearSelectionMap();const e=this.getSelection();if(!e||e.rangeCount===0)return;this.saveSelection();const t=e.getRangeAt(0),o=t.commonAncestorContainer,n=[];if(t.collapsed){const{startContainer:s}=t;if(s.nodeType===Node.TEXT_NODE){const r=s.parentElement,a=h.getEntityByDOM(r);a instanceof g&&n.push(a)}else if(R(s)){const r=u.isDecoratorNodeContainerElement(s)?u.getDecoratorNodeElement(s):s,a=h.getEntityByDOM(r);a instanceof g?n.push(a):a instanceof E&&t.collapsed&&this.tryToFindTheNearestSelectedNode(t,n)}}const i=s=>{if(t.intersectsNode(s)){if(s.nodeType===Node.TEXT_NODE){const r=s.parentElement,a=h.getEntityByDOM(r);if(a instanceof g){n.push(a);return}}if(R(s)){const r=u.isDecoratorNodeContainerElement(s)?u.getDecoratorNodeElement(s):s,a=h.getEntityByDOM(r);if(a instanceof k){this.internalCodeBlockSelectionController.isCodeBlockSelected(a,t)&&n.push(a.children[0]);return}if(a instanceof g){n.push(a);return}if(a instanceof E&&t.collapsed){this.tryToFindTheNearestSelectedNode(t,n);return}}s.childNodes.forEach(i)}};(!t.collapsed||n.length===0)&&i(o),this.addNodesToSelectionMap(n),this.getSelectedNodes().forEach(s=>s.apply(new x(t)))}addNodesToSelectionMap(e){e.forEach(t=>{this.selectionMap.has(t.parent)?this.selectionMap.get(t.parent).push(t):this.selectionMap.set(t.parent,[t])})}clearSelectionMap(){this.getSelectedNodes().filter(e=>e.type!=="CODE_BLOCK_NODE").forEach(e=>{e.annotationMap.delete(B.SELECTION_RANGE)}),this.selectionMap=new Map}isAcceptableSelectionRangeChange(){return!0}registerSelectionRangeChangeObserver(){this.selectionRangeChangeObserver=new A(this.isAcceptableSelectionRangeChange.bind(this),e=>{e.updateDirectly?this.enqueueSelectionRangeFutureState(e.node,e.offset):this.pendingRestoreSelectionNodes.push(e.node)}),O.register(m.getSubject(this.host,T),this.selectionRangeChangeObserver)}prepareRestoreSelectionState(){if(this.pendingRestoreSelectionNodes.length>0){const e=this.pendingRestoreSelectionNodes[0],t=this.pendingRestoreSelectionNodes.length>1?this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length-1]:e,{startOffset:o,endOffset:n,endContainer:i,startContainer:s}=this.currentRange;s&&h.getDOMByEntity(e)===s.parentElement&&i&&h.getDOMByEntity(t)===i.parentElement?(this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:t,startOffset:o,endOffset:n}),this.selectionState=new C(this.currentRange)):(this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:t,startOffset:0,endOffset:t.getRangeEndOffset()}),this.selectionState=new C(this.currentRange)),this.pendingRestoreSelectionNodes=[]}}registerUpdateCaretPositionObserver(){_.addUniqueObserverToNode(this.host,v,e=>{const{node:t,updateDirectly:o}=e,n=typeof e.offset=="number"?e.offset:t.getRangeEndOffset();this.enqueueSelectionRangeFutureState(t,n,t,n,o)})}tryToFindTheNearestSelectedNode(e,t){const{startContainer:o,startOffset:n,collapsed:i}=e;if(t.length===0&&R(o)&&i){const s=h.getEntityByDOM(o);if(s instanceof E&&s.children.length>=n){const r=this.detectNearestElement(s,n);if(r){const{startNode:a,startOffset:y}=r;t.push(a),this.currentRange=this.currentRange.updateRTERange({startNode:a,endNode:a,startOffset:y,endOffset:y},e)}else this.selectionMap.set(s,[])}}}detectNearestElement(e,t){if(e.children){const o=e.children[t],n=e.children[t-1];if(o&&o instanceof g)return{startNode:o,startOffset:0};if(n&&n instanceof g)return{startNode:n,startOffset:n.getRangeEndOffset()}}}}c.SELECTION_CHANGE_DEBOUNCE_TIME=50;l([d()],c.prototype,"vegaRichTextEditorRenderer",void 0);l([d({writable:!0})],c.prototype,"selectionMap",void 0);l([d()],c.prototype,"host",void 0);l([d()],c.prototype,"value",void 0);l([d()],c.prototype,"disabled",void 0);l([d()],c.prototype,"sourceView",void 0);l([d()],c.prototype,"valueController",void 0);l([d()],c.prototype,"insertCompositionTextController",void 0);l([d()],c.prototype,"historyController",void 0);l([d()],c.prototype,"internalCodeBlockSelectionController",void 0);l([N("connectedCallback")],c.prototype,"connectedCallback",null);l([N("disconnectedCallback")],c.prototype,"disconnectedCallback",null);l([N("componentDidLoad")],c.prototype,"componentDidLoad",null);l([N("watchValueUpdate")],c.prototype,"watchValueUpdate",null);class X extends H{constructor(){super(()=>this.getKeyboardShortcutOptions.call(this)),this.redoStack=[],this.undoStack=[],this.hasPendingHistory=!1,this.registerHistoryDelay=300,this.registerHistoryDebounced=w(e=>{this.internalRegisterHistory(e)},this.registerHistoryDelay,this)}registerHistory(e,t=!1){t?this.internalRegisterHistory(e):(this.hasPendingHistory=!0,this.redoStack=[],this.registerHistoryDebounced(e))}canUndo(){return this.undoStack.length>1||this.hasPendingHistory}canRedo(){return this.redoStack.length>0}internalRegisterHistory(e){this.hasPendingHistory=!1,this.redoStack=[],this.undoStack.push(e)}getKeyboardShortcutOptions(){const e={keyCode:"KeyZ",activeElementInScope:this.getEffectiveTargets(),activeElementOutScope:this.getIneffectiveTargets.bind(this),eventName:"keydown",modifierPressed:!0};return[Object.assign(Object.assign({},e),{shiftKey:!1,callback:t=>{t.preventDefault(),this.canUndo()&&this.undo()}}),Object.assign(Object.assign({},e),{shiftKey:!0,callback:t=>{t.preventDefault(),this.canRedo()&&this.redo()}})]}}export{X as C,C as R,j as S,c as a};
1
+ import{ea as g,f9 as R,ce as u,c6 as h,cx as w,C as O,E as m,fa as T,D as _,fb as v,e6 as D,cr as b,c8 as M,ef as E,cj as x,cf as B,O as A,c9 as k,M as d,f as N}from"./index-xErL25ZZ.js";import{g as I}from"./component-7d906393-D_sHVFWv.js";import{A as F}from"./auto-run-when-re-render-task-queue-slimmer.abstract-27820d4c-BomruzlI.js";import{K as H}from"./keyboard-manager-slimmer-531ddb0e-BFlOtog-.js";class S{constructor(e,t,o=0,n=0,i,s,r){this._startOffset=0,this._endOffset=0,this._startContainer=e,this._endContainer=t,this._startOffset=o,this._endOffset=n,this._startNode=i,this._endNode=s,r&&(this._oldNativeRange=r)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(e,t){const{startOffset:o,endOffset:n}=e;this._startOffset=o,this._endOffset=n;const i=e.startNode,s=e.endNode;if(i instanceof g){this._startNode=i,this._endNode=s;const r=this._startNode.getRangeContainer(),a=this._startNode===this._endNode?r:this._endNode.getRangeContainer();r&&(this._startContainer=r,this._endContainer=a)}else this._startContainer=i,this._endContainer=s,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),t&&(this._oldNativeRange=t);return new S(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new S(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){let e=null;if(this._startNode){const t=this._startNode.getRangeContainer(),o=this._startNode===this._endNode?t:this._endNode.getRangeContainer();if(t&&o)return e=new Range,e.setStart(t,this.clampOffsetToContainer(t,this._startOffset)),e.setEnd(o,this.clampOffsetToContainer(o,this._endOffset)),this._startContainer=t,this._endContainer=o,this._oldNativeRange=e,e}if(!e&&this._oldNativeRange)return this._oldNativeRange}clampOffsetToContainer(e,t){var o,n;const i=e.nodeType===Node.TEXT_NODE?(n=(o=e.textContent)===null||o===void 0?void 0:o.length)!==null&&n!==void 0?n:0:e.childNodes.length;return Math.max(0,Math.min(t,i))}getRTENodeByElement(e){if(e){const t=e.nodeType===Node.TEXT_NODE?e.parentElement:R(e)&&u.isDecoratorNodeContainerElement(e)?u.getDecoratorNodeElement(e):e;return h.getEntityByDOM(t)}}}let p=!1;class P{constructor(){this.rangeCount=0,this.ranges=[]}getRangeAt(e){return this.ranges[e]}addRange(e){if(this.ranges.push(e),this.rangeCount=this.ranges.length,!p){const t=window.getSelection();t.removeAllRanges(),t.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset)}}removeAllRanges(){this.ranges=[],this.rangeCount=0}}class V{constructor(){this.supportShadowSelection=typeof window.ShadowRoot.prototype.getSelection=="function",this.supportBeforeInput=typeof window.InputEvent.prototype.getTargetRanges=="function",this.isFirefox=window.navigator.userAgent.toLowerCase().indexOf("firefox")>0,this.listen()}getSelection(e){return this.supportShadowSelection?e.getSelection():this.isFirefox?this.getFirefoxSelection():this.polyfilledShadowSelection}getFirefoxSelection(){const e=document.getSelection();if(e.rangeCount>0){const t=e.getRangeAt(0),o=t.startContainer,n=t.endContainer;if(o!==n&&o.textContent.length===t.startOffset){const i=o.nodeType===Node.TEXT_NODE?o.parentNode.nextSibling:o.nextSibling;t.setStart(i.firstChild,0)}if(n!==o&&t.endOffset===0){const i=n.nodeType===Node.TEXT_NODE?n.parentNode.previousSibling:n.previousSibling;t.setEnd(i.lastChild,i.lastChild.textContent.length)}}return e}listen(){this.isFirefox||this.supportShadowSelection||!this.supportBeforeInput||(this.polyfilledShadowSelection=new P,window.addEventListener("selectionchange",()=>{if(!p){p=!0;const e=I();e&&e.hasAttribute("contenteditable")?document.execCommand("indent"):this.polyfilledShadowSelection.removeAllRanges(),p=!1}},!0),window.addEventListener("beforeinput",e=>{if(p){const o=e.getTargetRanges()[0],n=new Range;n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),this.polyfilledShadowSelection.removeAllRanges(),this.polyfilledShadowSelection.addRange(n),e.preventDefault(),e.stopImmediatePropagation()}},!0))}}const j=new V;class C{constructor(e){this.range=e}clone(){const e=this.range.clone();return new C(e)}}var l=function(f,e,t,o){var n=arguments.length,i=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,e,t,o);else for(var r=f.length-1;r>=0;r--)(s=f[r])&&(i=(n<3?s(i):n>3?s(e,t,i):s(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};class c extends F{constructor(){super(1),this.currentRange=new S,this.handleSelectionWithDebounce=w(this.handleSelectionChange,c.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.pendingRestoreSelectionNodes=[],this.doTask=async()=>{await Promise.resolve();const e=this.currentRange.toNativeRange();e&&(this.setSelectionRange(e),this.scrollCaretIntoView(e))}}connectedCallback(){this.registerSelectionRangeChangeObserver()}disconnectedCallback(){O.unregister(m.getSubject(this.host,T),this.selectionRangeChangeObserver),_.removeUniqueObserverFromNode(this.host,v)}componentDidLoad(){document.addEventListener("selectionchange",this.handleSelectionWithDebounce),this.registerUpdateCaretPositionObserver()}watchValueUpdate(){this.prepareRestoreSelectionState(),this.restoreSelection()}getCurrentRange(){return this.currentRange}getSelectedNodes(){return Array.from(this.selectionMap.values()).flat()}setSelectedNodes(e,t){this.clearSelectionMap(),this.addNodesToSelectionMap(e),t&&(this.currentRange=this.currentRange.updateRTERange(t))}getSelectedBlocks(){return Array.from(this.selectionMap.keys())}setSelectionState(e){this.selectionState=e}enqueueSelectionRangeFutureState(e,t,o,n,i=!1){e instanceof D?this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(e,t,i):(o=o||e,n=n||n===0?n:t,this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:o,startOffset:t,endOffset:n}),super.enqueueTheTaskIntoQueue(i))}setSelectionRange(e){const t=this.getSelection();t&&(t.removeAllRanges(),t.addRange(e),this.saveSelection())}getSelection(){const e=this.vegaRichTextEditorRenderer.getRichTextContentRef();return j.getSelection(e.shadowRoot)}scrollCaretIntoView(e){const t=this.getCaretElement(e);!t||typeof t.scrollIntoView!="function"||this.isCaretWithinViewport(e,t)||t.scrollIntoView({block:"center",inline:"nearest"})}getCaretElement(e){const t=e.startContainer;return t?t.nodeType===Node.TEXT_NODE?t.parentElement:t:null}isCaretWithinViewport(e,t){const o=e.getBoundingClientRect(),n=o.width===0&&o.height===0&&o.top===0?t.getBoundingClientRect():o;let i=0,s=window.innerHeight;const r=this.vegaRichTextEditorRenderer.getRichTextContentRef();if(r){const a=r.getBoundingClientRect();i=Math.max(i,a.top),s=Math.min(s,a.bottom)}return n.top>=i-1&&n.bottom<=s+1}saveSelection(){const e=this.getSelection();if(e&&e.rangeCount>0&&this.autoRunTaskQueue.queue.length===0&&!this.insertCompositionTextController.isComposing()){const t=e.getRangeAt(0),{startContainer:o,endContainer:n,startOffset:i,endOffset:s}=t;this.currentRange=this.currentRange.updateRTERange({startNode:o,endNode:n,startOffset:i,endOffset:s},t)}}restoreSelection(){if(this.selectionState){const{startNode:e,endNode:t,startOffset:o,endOffset:n}=this.selectionState.range;e instanceof b&&e===t&&e.text.length===0?this.enqueueSelectionRangeFutureState(e,M.length):e===t&&e instanceof b&&!e.isContentEditable()||this.enqueueSelectionRangeFutureState(e,o,t,n),this.selectionState=null}}handleSelectionChange(){if(this.disabled||this.sourceView)return;this.clearSelectionMap();const e=this.getSelection();if(!e||e.rangeCount===0)return;this.saveSelection();const t=e.getRangeAt(0),o=t.commonAncestorContainer,n=[];if(t.collapsed){const{startContainer:s}=t;if(s.nodeType===Node.TEXT_NODE){const r=s.parentElement,a=h.getEntityByDOM(r);a instanceof g&&n.push(a)}else if(R(s)){const r=u.isDecoratorNodeContainerElement(s)?u.getDecoratorNodeElement(s):s,a=h.getEntityByDOM(r);a instanceof g?n.push(a):a instanceof E&&t.collapsed&&this.tryToFindTheNearestSelectedNode(t,n)}}const i=s=>{if(t.intersectsNode(s)){if(s.nodeType===Node.TEXT_NODE){const r=s.parentElement,a=h.getEntityByDOM(r);if(a instanceof g){n.push(a);return}}if(R(s)){const r=u.isDecoratorNodeContainerElement(s)?u.getDecoratorNodeElement(s):s,a=h.getEntityByDOM(r);if(a instanceof k){this.internalCodeBlockSelectionController.isCodeBlockSelected(a,t)&&n.push(a.children[0]);return}if(a instanceof g){n.push(a);return}if(a instanceof E&&t.collapsed){this.tryToFindTheNearestSelectedNode(t,n);return}}s.childNodes.forEach(i)}};(!t.collapsed||n.length===0)&&i(o),this.addNodesToSelectionMap(n),this.getSelectedNodes().forEach(s=>s.apply(new x(t)))}addNodesToSelectionMap(e){e.forEach(t=>{this.selectionMap.has(t.parent)?this.selectionMap.get(t.parent).push(t):this.selectionMap.set(t.parent,[t])})}clearSelectionMap(){this.getSelectedNodes().filter(e=>e.type!=="CODE_BLOCK_NODE").forEach(e=>{e.annotationMap.delete(B.SELECTION_RANGE)}),this.selectionMap=new Map}isAcceptableSelectionRangeChange(){return!0}registerSelectionRangeChangeObserver(){this.selectionRangeChangeObserver=new A(this.isAcceptableSelectionRangeChange.bind(this),e=>{e.updateDirectly?this.enqueueSelectionRangeFutureState(e.node,e.offset):this.pendingRestoreSelectionNodes.push(e.node)}),O.register(m.getSubject(this.host,T),this.selectionRangeChangeObserver)}prepareRestoreSelectionState(){if(this.pendingRestoreSelectionNodes.length>0){const e=this.pendingRestoreSelectionNodes[0],t=this.pendingRestoreSelectionNodes.length>1?this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length-1]:e,{startOffset:o,endOffset:n,endContainer:i,startContainer:s}=this.currentRange;s&&h.getDOMByEntity(e)===s.parentElement&&i&&h.getDOMByEntity(t)===i.parentElement?(this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:t,startOffset:o,endOffset:n}),this.selectionState=new C(this.currentRange)):(this.currentRange=this.currentRange.updateRTERange({startNode:e,endNode:t,startOffset:0,endOffset:t.getRangeEndOffset()}),this.selectionState=new C(this.currentRange)),this.pendingRestoreSelectionNodes=[]}}registerUpdateCaretPositionObserver(){_.addUniqueObserverToNode(this.host,v,e=>{const{node:t,updateDirectly:o}=e,n=typeof e.offset=="number"?e.offset:t.getRangeEndOffset();this.enqueueSelectionRangeFutureState(t,n,t,n,o)})}tryToFindTheNearestSelectedNode(e,t){const{startContainer:o,startOffset:n,collapsed:i}=e;if(t.length===0&&R(o)&&i){const s=h.getEntityByDOM(o);if(s instanceof E&&s.children.length>=n){const r=this.detectNearestElement(s,n);if(r){const{startNode:a,startOffset:y}=r;t.push(a),this.currentRange=this.currentRange.updateRTERange({startNode:a,endNode:a,startOffset:y,endOffset:y},e)}else this.selectionMap.set(s,[])}}}detectNearestElement(e,t){if(e.children){const o=e.children[t],n=e.children[t-1];if(o&&o instanceof g)return{startNode:o,startOffset:0};if(n&&n instanceof g)return{startNode:n,startOffset:n.getRangeEndOffset()}}}}c.SELECTION_CHANGE_DEBOUNCE_TIME=50;l([d()],c.prototype,"vegaRichTextEditorRenderer",void 0);l([d({writable:!0})],c.prototype,"selectionMap",void 0);l([d()],c.prototype,"host",void 0);l([d()],c.prototype,"value",void 0);l([d()],c.prototype,"disabled",void 0);l([d()],c.prototype,"sourceView",void 0);l([d()],c.prototype,"valueController",void 0);l([d()],c.prototype,"insertCompositionTextController",void 0);l([d()],c.prototype,"historyController",void 0);l([d()],c.prototype,"internalCodeBlockSelectionController",void 0);l([N("connectedCallback")],c.prototype,"connectedCallback",null);l([N("disconnectedCallback")],c.prototype,"disconnectedCallback",null);l([N("componentDidLoad")],c.prototype,"componentDidLoad",null);l([N("watchValueUpdate")],c.prototype,"watchValueUpdate",null);class X extends H{constructor(){super(()=>this.getKeyboardShortcutOptions.call(this)),this.redoStack=[],this.undoStack=[],this.hasPendingHistory=!1,this.registerHistoryDelay=300,this.registerHistoryDebounced=w(e=>{this.internalRegisterHistory(e)},this.registerHistoryDelay,this)}registerHistory(e,t=!1){t?this.internalRegisterHistory(e):(this.hasPendingHistory=!0,this.redoStack=[],this.registerHistoryDebounced(e))}canUndo(){return this.undoStack.length>1||this.hasPendingHistory}canRedo(){return this.redoStack.length>0}internalRegisterHistory(e){this.hasPendingHistory=!1,this.redoStack=[],this.undoStack.push(e)}getKeyboardShortcutOptions(){const e={keyCode:"KeyZ",activeElementInScope:this.getEffectiveTargets(),activeElementOutScope:this.getIneffectiveTargets.bind(this),eventName:"keydown",modifierPressed:!0};return[Object.assign(Object.assign({},e),{shiftKey:!1,callback:t=>{t.preventDefault(),this.canUndo()&&this.undo()}}),Object.assign(Object.assign({},e),{shiftKey:!0,callback:t=>{t.preventDefault(),this.canRedo()&&this.redo()}})]}}export{X as C,C as R,j as S,c as a};
@@ -1 +1 @@
1
- import{a as f,O as v,C as p,bR as b,M as u,f as d}from"./index-bkDaCMH8.js";var i=function(n,e,t,o){var s=arguments.length,r=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,o);else for(var a=n.length-1;a>=0;a--)(c=n[a])&&(r=(s<3?c(r):s>3?c(e,t,r):c(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class l extends f{connectedCallback(){this.observer=new v(this.isAcceptObserver.bind(this),e=>{this.isInDarkMode=e}),p.register(b,this.observer)}disconnectResizeObserver(){p.unregister(b,this.observer)}isAcceptObserver(){return!0}}i([u({writable:!0})],l.prototype,"isInDarkMode",void 0);i([d("connectedCallback")],l.prototype,"connectedCallback",null);i([d("disconnectedCallback")],l.prototype,"disconnectResizeObserver",null);export{l as D};
1
+ import{a as f,O as v,C as p,bR as b,M as u,f as d}from"./index-xErL25ZZ.js";var i=function(n,e,t,o){var s=arguments.length,r=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,o);else for(var a=n.length-1;a>=0;a--)(c=n[a])&&(r=(s<3?c(r):s>3?c(e,t,r):c(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class l extends f{connectedCallback(){this.observer=new v(this.isAcceptObserver.bind(this),e=>{this.isInDarkMode=e}),p.register(b,this.observer)}disconnectResizeObserver(){p.unregister(b,this.observer)}isAcceptObserver(){return!0}}i([u({writable:!0})],l.prototype,"isInDarkMode",void 0);i([d("connectedCallback")],l.prototype,"connectedCallback",null);i([d("disconnectedCallback")],l.prototype,"disconnectResizeObserver",null);export{l as D};
@@ -1 +1 @@
1
- import{aB as s,cM as i}from"./index-bkDaCMH8.js";class a extends s{constructor(e){super(),this.config=e}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Invalid date value ${e} for mode ${this.config.mode}`);let r;switch(this.config.mode){case"single":r=i(e);break;case"range":r=Array.isArray(e)&&e.length===2&&e.every(i);break}return{isValid:r,message:r?"":"This field is required"}}canEvaluate(e,r){return r?this.isAcceptedInputType(e)&&!r.disabled&&r.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){if(e==null)return!0;if(!this.config.mode)throw new Error(`Unexpected type of mode: ${this.config.mode}`);switch(this.config.mode){case"single":return typeof e=="string";case"range":return Array.isArray(e);default:return!1}}}export{a as D};
1
+ import{aB as s,cM as i}from"./index-xErL25ZZ.js";class a extends s{constructor(e){super(),this.config=e}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Invalid date value ${e} for mode ${this.config.mode}`);let r;switch(this.config.mode){case"single":r=i(e);break;case"range":r=Array.isArray(e)&&e.length===2&&e.every(i);break}return{isValid:r,message:r?"":"This field is required"}}canEvaluate(e,r){return r?this.isAcceptedInputType(e)&&!r.disabled&&r.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){if(e==null)return!0;if(!this.config.mode)throw new Error(`Unexpected type of mode: ${this.config.mode}`);switch(this.config.mode){case"single":return typeof e=="string";case"range":return Array.isArray(e);default:return!1}}}export{a as D};
@@ -1 +1 @@
1
- import{b1 as s,a as m,bJ as o,aH as l}from"./index-bkDaCMH8.js";class p extends m{constructor({newPropertyName:e,oldPropertyName:t,defaultValue:r}){super(),this.newPropertyName=e,this.oldPropertyName=t,this.defaultValue=r}getValue(){const e=o(this.host,this.newPropertyName),t=o(this.host,this.oldPropertyName);return l(e,this.defaultValue)?t:e}}function u(a,e,t,r){return s(a,p,[{mapFrom:"host",mapTo:"host"}],[],[{newPropertyName:e,oldPropertyName:t,defaultValue:r}])}export{u as c};
1
+ import{b1 as s,a as m,bJ as o,aH as l}from"./index-xErL25ZZ.js";class p extends m{constructor({newPropertyName:e,oldPropertyName:t,defaultValue:r}){super(),this.newPropertyName=e,this.oldPropertyName=t,this.defaultValue=r}getValue(){const e=o(this.host,this.newPropertyName),t=o(this.host,this.oldPropertyName);return l(e,this.defaultValue)?t:e}}function u(a,e,t,r){return s(a,p,[{mapFrom:"host",mapTo:"host"}],[],[{newPropertyName:e,oldPropertyName:t,defaultValue:r}])}export{u as c};
@@ -1 +1 @@
1
- import{aR as d,aS as n,aT as i,aU as l,aV as f,L as u,aW as m,aX as c,aY as T,aZ as p,a_ as s,a$ as $,b0 as y}from"./index-bkDaCMH8.js";import{R as S}from"./responsive-format-facade-299e6304-Dvd6Sloj.js";import{S as g,a as h,b as v}from"./state-border-formatter-da52b626-Cd9qsDJ2.js";class b{format(r,e){switch(e){case"backgroundColor":return T.format(r);case"borderColor":return v.format(r);case"shadow":return h.format(r);case"border":return g.format(r);default:throw new Error(`Invalid flag ${e} passed into StateFormatFacade`)}}}const F=new b;function o(a,r,e){u.warn(`The ${a} value ${r} is invalid, it must be a value of: `,e)}function t(a,r){let e="";return r.includes("dark")&&(e+=` dark:v-dark-${a}`),e}function C(a){if(f(a))return`v-border-${a}`;o("border-style",a,p)}function A(a,r=[]){if(n(a))return`v-${a}`+t(a,r);o("background-color",a,s.filter(()=>/^bg-.+$/.test))}function x(a,r=[]){if(d(a))return`v-${a}`+t(a,r);o("text-color",a,s.filter(()=>/^text-.+$/.test))}function k(a){if(l(a))return`vega-flex-${a}`;o("breakpoint",a,Object.keys($))}function R(a,r=[]){if(i(a))return`v-${a}`+t(a,r);o("shadows",a,y)}function I(a,r){if(a!=null)return S.format(a,r)}function L(a){if(m(a))return`v-${a}`;o("font",a,c)}function M(a,r){if(a!=null)return F.format(a,r)}export{A as a,x as b,C as c,M as d,k as e,I as f,R as g,L as h};
1
+ import{aR as d,aS as n,aT as i,aU as l,aV as f,L as u,aW as m,aX as c,aY as T,aZ as p,a_ as s,a$ as $,b0 as y}from"./index-xErL25ZZ.js";import{R as S}from"./responsive-format-facade-299e6304-Da4ugpqp.js";import{S as g,a as h,b as v}from"./state-border-formatter-da52b626-vl0hMghR.js";class b{format(r,e){switch(e){case"backgroundColor":return T.format(r);case"borderColor":return v.format(r);case"shadow":return h.format(r);case"border":return g.format(r);default:throw new Error(`Invalid flag ${e} passed into StateFormatFacade`)}}}const F=new b;function o(a,r,e){u.warn(`The ${a} value ${r} is invalid, it must be a value of: `,e)}function t(a,r){let e="";return r.includes("dark")&&(e+=` dark:v-dark-${a}`),e}function C(a){if(f(a))return`v-border-${a}`;o("border-style",a,p)}function A(a,r=[]){if(n(a))return`v-${a}`+t(a,r);o("background-color",a,s.filter(()=>/^bg-.+$/.test))}function x(a,r=[]){if(d(a))return`v-${a}`+t(a,r);o("text-color",a,s.filter(()=>/^text-.+$/.test))}function k(a){if(l(a))return`vega-flex-${a}`;o("breakpoint",a,Object.keys($))}function R(a,r=[]){if(i(a))return`v-${a}`+t(a,r);o("shadows",a,y)}function I(a,r){if(a!=null)return S.format(a,r)}function L(a){if(m(a))return`v-${a}`;o("font",a,c)}function M(a,r){if(a!=null)return F.format(a,r)}export{A as a,x as b,C as c,M as d,k as e,I as f,R as g,L as h};
@@ -1 +1 @@
1
- import{a as c,M as l}from"./index-bkDaCMH8.js";var f=function(i,e,r,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,r,n);else for(var a=i.length-1;a>=0;a--)(t=i[a])&&(o=(s<3?t(o):s>3?t(e,r,o):t(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o};class p extends c{process(e){const r=Array.from(e||[]);if(e&&this.accept&&this.accept!=="*"&&this.accept!=="/*"&&this.accept!=="*/*"){const n=this.accept.split(",");return r.filter(s=>this.validateFileType(s,n))}return r}validateFileType(e,r){const n=e.name,s=(e.type||"").toLowerCase(),o=s.replace(/\/.*$/,"");return r.some(t=>(t=t.trim().toLowerCase(),t.startsWith(".")?n.toLowerCase().endsWith(t):t.endsWith("/*")?o===t.replace(/\/.*$/,""):s===t))}}f([l()],p.prototype,"accept",void 0);export{p as D};
1
+ import{a as c,M as l}from"./index-xErL25ZZ.js";var f=function(i,e,r,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,r,n);else for(var a=i.length-1;a>=0;a--)(t=i[a])&&(o=(s<3?t(o):s>3?t(e,r,o):t(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o};class p extends c{process(e){const r=Array.from(e||[]);if(e&&this.accept&&this.accept!=="*"&&this.accept!=="/*"&&this.accept!=="*/*"){const n=this.accept.split(",");return r.filter(s=>this.validateFileType(s,n))}return r}validateFileType(e,r){const n=e.name,s=(e.type||"").toLowerCase(),o=s.replace(/\/.*$/,"");return r.some(t=>(t=t.trim().toLowerCase(),t.startsWith(".")?n.toLowerCase().endsWith(t):t.endsWith("/*")?o===t.replace(/\/.*$/,""):s===t))}}f([l()],p.prototype,"accept",void 0);export{p as D};
@@ -1,4 +1,4 @@
1
- import{a as y,ae as P,B as p,N as q,O as B,C as j,cU as _,cV as ee,E as te,cW as V,D as ie,b1 as ne,af as F,P as oe,L as E,cX as L,w as I,x as N,cY as $,cZ as z,by as re,M as c,I as g,f as b}from"./index-bkDaCMH8.js";import{R as U}from"./responsive-format-facade-299e6304-Dvd6Sloj.js";var se=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class Y{canRetrieve(){return!0}retrieve(){const e=document.body;return this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}}se([c()],Y.prototype,"showConfig",void 0);class A{canRetrieve(){return!this.showConfig.isScreenPosition}}var ae=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class G extends A{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const e=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}}ae([c()],G.prototype,"showConfig",void 0);var le=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class X extends A{canRetrieve(){return super.canRetrieve()&&!!p(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(e,t){var n;const o=(n=Array.from(e.children).find(i=>{const r=i.getAttribute("slot");return r&&["content","modal-content"].includes(r)}))===null||n===void 0?void 0:n.getAttribute("slot");o&&t.setAttribute("slot",o)}getVegaModalShowConfigContainer(){const e=p(this.showConfig.target,"vega-modal"),t=e.shadowRoot.querySelector(".vega-modal-content-with-scroll"),n=e.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(e,this.showConfig.appendableElement),e.append(this.showConfig.appendableElement),t||n}}le([c({writable:!0})],X.prototype,"showConfig",void 0);var he=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class Z extends A{canRetrieve(){return super.canRetrieve()&&!!p(this.showConfig.target,".vega-popover")}retrieve(){const e=p(this.showConfig.target,".vega-popover");return e.append(this.showConfig.appendableElement),e}}he([c()],Z.prototype,"showConfig",void 0);var ce=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class J extends A{canRetrieve(){return this.focusTrapRoot=this.findFocusTrapRoot(this.showConfig.target),!!this.focusTrapRoot}retrieve(){const e=this.focusTrapRoot;return this.focusTrapRoot=null,this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}findFocusTrapRoot(e){var t;const n=p(e,'dialog, [aria-modal="true"]');return!n||this.isVegaOwned(n)?null:(t=n.closest('[tabindex="-1"]'))!==null&&t!==void 0?t:n}isVegaOwned(e){return e.tagName.startsWith("VEGA-")}}ce([c()],J.prototype,"showConfig",void 0);var f=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class u extends y{constructor(){super(...arguments),this.positionRelativeToWrapper=new G,this.vegaPopoverWrapper=new Z,this.vegaModalWrapper=new X,this.thirdPartyDialogWrapper=new J,this.defaultWrapper=new Y}setContainer(){this.setContainerRetrievers();for(const e of this.containerRetrievers)if(e.canRetrieve()){this.container=e.retrieve();return}}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.thirdPartyDialogWrapper,this.defaultWrapper]}}f([c({writable:!0})],u.prototype,"container",void 0);f([c({writable:!0})],u.prototype,"showConfig",void 0);f([g()],u.prototype,"positionRelativeToWrapper",void 0);f([g()],u.prototype,"vegaPopoverWrapper",void 0);f([g()],u.prototype,"vegaModalWrapper",void 0);f([g()],u.prototype,"thirdPartyDialogWrapper",void 0);f([g()],u.prototype,"defaultWrapper",void 0);class K extends y{shouldAdjustPosition(){return!0}getPositionBox(e,t){const n=e&&e.length>0?e:this.getPlacements(),o=t&&t.length>0?t:this.getAlignments(),i=this.getTargetBoundBox(),r=this.getElementBoundBox(),s=this.getElementScrollDimension(),l=this.getSuitablePlacement(s,r,i,n),d=l||n[0],m=this.getSuitableAlignment(s,r,i,d,o),x=m||o[0],v=this.calculatePosition(r,i,d,x),W=this.getTranslocationBox(d);return v.placement=l,v.alignment=m,v.left+=W.X,v.top+=W.Y,!this.showConfig.positionRelativeTo&&this.showConfig.isScreenPosition&&this.adjustPositionForViewport(v,r,i,d),v}hasEnoughAlignmentSpace(e,t,n,o,i){if(["top","bottom"].includes(o))switch(i){case"start":return t.left+n.width<=e.width;case"center":return t.left>=(n.width-t.width)/2&&t.left+t.width/2+n.width/2<=e.width;case"end":return t.left+t.width>=n.width}if(["right","left"].includes(o))switch(i){case"start":return t.top+n.height<=e.height;case"center":return t.top>=(n.height-t.height)/2&&t.top+t.height/2+n.height/2<=e.height;case"end":return t.top+t.height>=n.height}return!1}calculateLeft(e,t,n,o){switch(n){case"top":case"bottom":return o==="end"?t.left+t.width-e.width:o==="center"?t.left-(e.width-t.width)/2:t.left;case"left":return t.left-e.width;case"right":return t.left+t.width;default:throw new Error(`Unexpected placement: ${n}. Expected values are top, bottom, left, or right.`)}}calculateTop(e,t,n,o){switch(n){case"left":case"right":return o==="end"?t.top+t.height-e.height:o==="center"?t.top-(e.height-t.height)/2:t.top;case"top":return t.top-e.height;case"bottom":return t.top+t.height;default:throw new Error(`Unexpected placement: ${n}. Expected values are top, bottom, left, or right.`)}}getAlignments(){const e=this.showConfig.alignment;if(typeof e=="string"){const t=$.filter(n=>n!==e);return[e,...t]}else return Array.isArray(e)?e:[...$]}getSuitablePlacement(e,t,n,o){const i=o[0],r=o.find(s=>this.hasEnoughSpace(e,s,n,t));return r||(E.warn(`
1
+ import{a as y,ae as P,B as p,N as q,O as B,C as j,cU as _,cV as ee,E as te,cW as V,D as ie,b1 as ne,af as F,P as oe,L as E,cX as L,w as I,x as N,cY as $,cZ as z,by as re,M as c,I as g,f as b}from"./index-xErL25ZZ.js";import{R as U}from"./responsive-format-facade-299e6304-Da4ugpqp.js";var se=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class Y{canRetrieve(){return!0}retrieve(){const e=document.body;return this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}}se([c()],Y.prototype,"showConfig",void 0);class A{canRetrieve(){return!this.showConfig.isScreenPosition}}var ae=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class G extends A{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const e=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}}ae([c()],G.prototype,"showConfig",void 0);var le=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class X extends A{canRetrieve(){return super.canRetrieve()&&!!p(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(e,t){var n;const o=(n=Array.from(e.children).find(i=>{const r=i.getAttribute("slot");return r&&["content","modal-content"].includes(r)}))===null||n===void 0?void 0:n.getAttribute("slot");o&&t.setAttribute("slot",o)}getVegaModalShowConfigContainer(){const e=p(this.showConfig.target,"vega-modal"),t=e.shadowRoot.querySelector(".vega-modal-content-with-scroll"),n=e.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(e,this.showConfig.appendableElement),e.append(this.showConfig.appendableElement),t||n}}le([c({writable:!0})],X.prototype,"showConfig",void 0);var he=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class Z extends A{canRetrieve(){return super.canRetrieve()&&!!p(this.showConfig.target,".vega-popover")}retrieve(){const e=p(this.showConfig.target,".vega-popover");return e.append(this.showConfig.appendableElement),e}}he([c()],Z.prototype,"showConfig",void 0);var ce=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class J extends A{canRetrieve(){return this.focusTrapRoot=this.findFocusTrapRoot(this.showConfig.target),!!this.focusTrapRoot}retrieve(){const e=this.focusTrapRoot;return this.focusTrapRoot=null,this.showConfig.appendableElement.parentElement!==e&&e.append(this.showConfig.appendableElement),e}findFocusTrapRoot(e){var t;const n=p(e,'dialog, [aria-modal="true"]');return!n||this.isVegaOwned(n)?null:(t=n.closest('[tabindex="-1"]'))!==null&&t!==void 0?t:n}isVegaOwned(e){return e.tagName.startsWith("VEGA-")}}ce([c()],J.prototype,"showConfig",void 0);var f=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var s=a.length-1;s>=0;s--)(r=a[s])&&(i=(o<3?r(i):o>3?r(e,t,i):r(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class u extends y{constructor(){super(...arguments),this.positionRelativeToWrapper=new G,this.vegaPopoverWrapper=new Z,this.vegaModalWrapper=new X,this.thirdPartyDialogWrapper=new J,this.defaultWrapper=new Y}setContainer(){this.setContainerRetrievers();for(const e of this.containerRetrievers)if(e.canRetrieve()){this.container=e.retrieve();return}}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.thirdPartyDialogWrapper,this.defaultWrapper]}}f([c({writable:!0})],u.prototype,"container",void 0);f([c({writable:!0})],u.prototype,"showConfig",void 0);f([g()],u.prototype,"positionRelativeToWrapper",void 0);f([g()],u.prototype,"vegaPopoverWrapper",void 0);f([g()],u.prototype,"vegaModalWrapper",void 0);f([g()],u.prototype,"thirdPartyDialogWrapper",void 0);f([g()],u.prototype,"defaultWrapper",void 0);class K extends y{shouldAdjustPosition(){return!0}getPositionBox(e,t){const n=e&&e.length>0?e:this.getPlacements(),o=t&&t.length>0?t:this.getAlignments(),i=this.getTargetBoundBox(),r=this.getElementBoundBox(),s=this.getElementScrollDimension(),l=this.getSuitablePlacement(s,r,i,n),d=l||n[0],m=this.getSuitableAlignment(s,r,i,d,o),x=m||o[0],v=this.calculatePosition(r,i,d,x),W=this.getTranslocationBox(d);return v.placement=l,v.alignment=m,v.left+=W.X,v.top+=W.Y,!this.showConfig.positionRelativeTo&&this.showConfig.isScreenPosition&&this.adjustPositionForViewport(v,r,i,d),v}hasEnoughAlignmentSpace(e,t,n,o,i){if(["top","bottom"].includes(o))switch(i){case"start":return t.left+n.width<=e.width;case"center":return t.left>=(n.width-t.width)/2&&t.left+t.width/2+n.width/2<=e.width;case"end":return t.left+t.width>=n.width}if(["right","left"].includes(o))switch(i){case"start":return t.top+n.height<=e.height;case"center":return t.top>=(n.height-t.height)/2&&t.top+t.height/2+n.height/2<=e.height;case"end":return t.top+t.height>=n.height}return!1}calculateLeft(e,t,n,o){switch(n){case"top":case"bottom":return o==="end"?t.left+t.width-e.width:o==="center"?t.left-(e.width-t.width)/2:t.left;case"left":return t.left-e.width;case"right":return t.left+t.width;default:throw new Error(`Unexpected placement: ${n}. Expected values are top, bottom, left, or right.`)}}calculateTop(e,t,n,o){switch(n){case"left":case"right":return o==="end"?t.top+t.height-e.height:o==="center"?t.top-(e.height-t.height)/2:t.top;case"top":return t.top-e.height;case"bottom":return t.top+t.height;default:throw new Error(`Unexpected placement: ${n}. Expected values are top, bottom, left, or right.`)}}getAlignments(){const e=this.showConfig.alignment;if(typeof e=="string"){const t=$.filter(n=>n!==e);return[e,...t]}else return Array.isArray(e)?e:[...$]}getSuitablePlacement(e,t,n,o){const i=o[0],r=o.find(s=>this.hasEnoughSpace(e,s,n,t));return r||(E.warn(`
2
2
  No enough space found for placing element and we will keep using the defined placement:
3
3
  ${i}
4
4
  `),null)}getElementBoundBox(){const e=this.showConfig.appendableElement,t=e.classList.contains("vega-force-hidden");t&&e.classList.remove("vega-force-hidden");const n=e.getBoundingClientRect();return t&&e.classList.add("vega-force-hidden"),{width:n.width,height:n.height,left:n.left,top:n.top}}getPlacements(){const e=this.showConfig.placement;if(typeof e=="string"){const t=z.filter(n=>n!==e);return[e,...t]}else return Array.isArray(e)?e:[...z]}calculatePosition(e,t,n,o){return{top:this.calculateTop(e,t,n,o),left:this.calculateLeft(e,t,n,o)}}keepVerticallyInView(e,t){return Math.max(0,Math.min(e,window.innerHeight-t))}keepHorizontallyInView(e,t){return Math.max(0,Math.min(e,window.innerWidth-t))}isTargetInView(e){const t=window.innerHeight,n=window.innerWidth,o=e.top+e.height,i=e.left+e.width;return e.top<=t&&o>=0&&e.left<=n&&i>=0}adjustPositionForViewport(e,t,n,o){this.isTargetInView(n)&&(o==="top"||o==="bottom"?e.top=this.adjustForVerticalOverflow(e.top,t.height,n.height):(o==="left"||o==="right")&&(e.left=this.adjustForHorizontalOverflow(e.left,t.width,n.width)),e.top=this.keepVerticallyInView(e.top,t.height),e.left=this.keepHorizontallyInView(e.left,t.width))}adjustForVerticalOverflow(e,t,n){const o=e+t-window.innerHeight,i=-e;return o>0&&o<n?e-o:i>0&&i<n?e+i:e}adjustForHorizontalOverflow(e,t,n){const o=e+t-window.innerWidth,i=-e;return o>0&&o<n?e-o:i>0&&i<n?e+i:e}getTranslocationBox(e){const t=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,n=this.getTranslocation(),o={X:0,Y:0};if(re(n)){let i=n.X,r=n.Y;(t&&["left","right"].includes(t)&&["top","bottom"].includes(e)||t&&["top","bottom"].includes(t)&&["left","right"].includes(e))&&(i=n.Y,r=n.X),["bottom","top"].includes(e)&&(o.Y=e==="top"?-r:r,o.X=i),["left","right"].includes(e)&&(o.X=e==="left"?-i:i,o.Y=r)}return o}getSuitableAlignment(e,t,n,o,i){const r=i[0],s=i.find(l=>this.hasEnoughAlignmentSpace(e,n,t,o,l));return s||(E.warn(`
@@ -1 +1 @@
1
- import{b1 as g,a as v,C as b,E as D,b2 as y,D as H,N as j,b3 as f,M as l,I as c}from"./index-bkDaCMH8.js";var p=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class h extends v{constructor(){super(...arguments),this.canHandle=({namespace:e})=>e==="vega"||!this.nativeEvent||typeof this.nativeEvent.emit!="function",this.handle=e=>this.vegaEvent.emit(e)}}p([l()],h.prototype,"vegaEvent",void 0);p([l()],h.prototype,"nativeEvent",void 0);var N=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class d extends v{constructor(){super(...arguments),this.canHandle=({namespace:e})=>e==="native",this.handle=(e,t)=>(t&&t.stopPropagation(),this.nativeEvent.emit(e))}}N([l()],d.prototype,"nativeEvent",void 0);var O=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class E extends v{constructor(){super(...arguments),this.canHandle=({namespace:e,jqueryDelegatedEvent:t})=>e==="native"&&!!t&&f.isSupportDelegated(this.host,this.eventID),this.handle=(e,t)=>{const r=f.getStrategy(this.host,this.eventID);if(r)return t&&t.stopPropagation(),r.handle(this.host,e)}}setEventID(e){this.eventID=e}}O([l()],E.prototype,"host",void 0);var u=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class m extends v{constructor({eventID:e}){super(),this.vegaEventEmitHandler=new h,this.nativeEventEmitHandler=new d,this.jqueryDelegatedEventEmitHandler=new E,this.emit=(t,r)=>{let i=!1;b.notify(D.getSubject(this.host,this.eventID),{host:this.host,detail:t,eventName:this.eventName,preventDefault:()=>{i=!0}});const n=y.getSemantics(this.host);let a;for(const s of this.eventHandlers)if(s.canHandle(n)){a=s.handle(t,r);break}return a&&i&&a.preventDefault(),a},this.removeObserverFromHost=()=>{Promise.resolve(!0).then(()=>{this.isNodeRemovedFromDocument(this.host)&&H.removeUniqueObserverFromNode(this.host,this.eventID)})},this.eventID=e,this.eventName=e.getVegaName(),this.initialEventHandlers()}isNodeRemovedFromDocument(e){var t;return!!(e&&!(!((t=j())===null||t===void 0)&&t.body.contains(e))&&!e.parentNode)}initialEventHandlers(){this.jqueryDelegatedEventEmitHandler.setEventID(this.eventID),this.eventHandlers=[this.vegaEventEmitHandler,this.jqueryDelegatedEventEmitHandler,this.nativeEventEmitHandler]}}u([c()],m.prototype,"vegaEventEmitHandler",void 0);u([c()],m.prototype,"nativeEventEmitHandler",void 0);u([c()],m.prototype,"jqueryDelegatedEventEmitHandler",void 0);function R(o,e,t){const r=e.getVegaName(),i=t||e.getNativeName();return g(o,m,[{mapFrom:"host",mapTo:"host"},{mapFrom:r,mapTo:"vegaEvent"},{mapFrom:i,mapTo:"nativeEvent",isOptional:!0}],[{mapFrom:"disconnectedCallback",mapTo:"removeObserverFromHost"}],[{eventID:e}])}export{R as c};
1
+ import{b1 as g,a as v,C as b,E as D,b2 as y,D as H,N as j,b3 as f,M as l,I as c}from"./index-xErL25ZZ.js";var p=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class h extends v{constructor(){super(...arguments),this.canHandle=({namespace:e})=>e==="vega"||!this.nativeEvent||typeof this.nativeEvent.emit!="function",this.handle=e=>this.vegaEvent.emit(e)}}p([l()],h.prototype,"vegaEvent",void 0);p([l()],h.prototype,"nativeEvent",void 0);var N=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class d extends v{constructor(){super(...arguments),this.canHandle=({namespace:e})=>e==="native",this.handle=(e,t)=>(t&&t.stopPropagation(),this.nativeEvent.emit(e))}}N([l()],d.prototype,"nativeEvent",void 0);var O=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class E extends v{constructor(){super(...arguments),this.canHandle=({namespace:e,jqueryDelegatedEvent:t})=>e==="native"&&!!t&&f.isSupportDelegated(this.host,this.eventID),this.handle=(e,t)=>{const r=f.getStrategy(this.host,this.eventID);if(r)return t&&t.stopPropagation(),r.handle(this.host,e)}}setEventID(e){this.eventID=e}}O([l()],E.prototype,"host",void 0);var u=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var s=o.length-1;s>=0;s--)(a=o[s])&&(n=(i<3?a(n):i>3?a(e,t,n):a(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};class m extends v{constructor({eventID:e}){super(),this.vegaEventEmitHandler=new h,this.nativeEventEmitHandler=new d,this.jqueryDelegatedEventEmitHandler=new E,this.emit=(t,r)=>{let i=!1;b.notify(D.getSubject(this.host,this.eventID),{host:this.host,detail:t,eventName:this.eventName,preventDefault:()=>{i=!0}});const n=y.getSemantics(this.host);let a;for(const s of this.eventHandlers)if(s.canHandle(n)){a=s.handle(t,r);break}return a&&i&&a.preventDefault(),a},this.removeObserverFromHost=()=>{Promise.resolve(!0).then(()=>{this.isNodeRemovedFromDocument(this.host)&&H.removeUniqueObserverFromNode(this.host,this.eventID)})},this.eventID=e,this.eventName=e.getVegaName(),this.initialEventHandlers()}isNodeRemovedFromDocument(e){var t;return!!(e&&!(!((t=j())===null||t===void 0)&&t.body.contains(e))&&!e.parentNode)}initialEventHandlers(){this.jqueryDelegatedEventEmitHandler.setEventID(this.eventID),this.eventHandlers=[this.vegaEventEmitHandler,this.jqueryDelegatedEventEmitHandler,this.nativeEventEmitHandler]}}u([c()],m.prototype,"vegaEventEmitHandler",void 0);u([c()],m.prototype,"nativeEventEmitHandler",void 0);u([c()],m.prototype,"jqueryDelegatedEventEmitHandler",void 0);function R(o,e,t){const r=e.getVegaName(),i=t||e.getNativeName();return g(o,m,[{mapFrom:"host",mapTo:"host"},{mapFrom:r,mapTo:"vegaEvent"},{mapFrom:i,mapTo:"nativeEvent",isOptional:!0}],[{mapFrom:"disconnectedCallback",mapTo:"removeObserverFromHost"}],[{eventID:e}])}export{R as c};
@@ -1 +1 @@
1
- import{R as r}from"./required-field-rule-897fe8d1-Cf7Va5ZW.js";class o extends r{constructor(){super(...arguments),this.checkArrayItemType=e=>!!(e&&typeof e=="object")}}export{o as F};
1
+ import{R as r}from"./required-field-rule-897fe8d1-CTp6WGag.js";class o extends r{constructor(){super(...arguments),this.checkArrayItemType=e=>!!(e&&typeof e=="object")}}export{o as F};
@@ -1 +1 @@
1
- import{a as E,C as d,aa as z,bK as K,O as C,a5 as D,D as L,ag as U,b1 as W,B as F,P as k,ad as _,ac as $,W as j,ab as H,af as q,E as S,G as X,aB as J,bL as N,t as P,a3 as B,bM as Q,ay as G,bN as Y,bO as Z,I as m,M as c,f}from"./index-bkDaCMH8.js";import{M as ee}from"./mutation-observer-slimmer-58ebc13c-C22plZKJ.js";import{A as te}from"./mutation-observer-filters-1a054fb0-BWWLXWLE.js";import{b as re}from"./array-7888f339-CwtVR39P.js";import{S as ie}from"./sub-state-observer-slimmer-64532d94-CGnxgW0e.js";class se{constructor(e){this.rule=e}getStatus(e,t,r){return{canEvaluate:this.rule.canEvaluate(e,t,r),isAsync:Z(this.rule.evaluate)}}shouldShowError(e,t){try{return this.rule.shouldShowError?this.rule.shouldShowError(e,t):this.defaultShouldShowError(e)}catch{return!1}}handle(e){try{return this.rule.evaluate(e)}catch{return{isValid:!0,message:""}}}defaultShouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}}class oe{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(e,t,r){return!!this.handlers.find(i=>{const o=i.getStatus(e,t,r);return o.canEvaluate&&o.isAsync})}setHandlersByRules(e){e&&e.length?this.handlers=e.map(t=>new se(t)):this.handlers=[]}async process(e,t,r,s,i){const o=this.preProcess();let n;for(const u of this.handlers){if(o!==this.processId)break;const p=u.getStatus(e,t,r);if(!p.canEvaluate)continue;let g;if(p.isAsync)try{g=await u.handle(e)}catch{}else g=u.handle(e);if(g&&!g.isValid){const w=u.shouldShowError(t,r);n=Object.assign(Object.assign({},g),{shouldShowError:w});break}}return this.postProcess(o,s,n,i),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const e=Y();return this.processId=e,e}postProcess(e,t,r,s){this.processId===e&&s(t,r)}}class ne{run(e){const t=e.nextElementSibling;return t&&t.querySelector(".vega-error")?t.querySelector(".vega-error"):null}}class ae{run(e){let t=e.nextElementSibling;return t&&!t.classList.contains("vega-error")&&(t=document.createElement("label"),t.classList.add("vega-error"),t.setAttribute("part","field-error-message"),e.after(t)),t}}class le{run(e){let t=e.nextElementSibling;return t||(t=document.createElement("label"),t.classList.add("vega-error"),t.setAttribute("part","field-error-message"),e.after(t)),t}}class x extends E{getTranslatedMessage(e){return typeof e=="string"?G.t(e):G.t(e.key,...e.args||[])}}var A=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class R extends E{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new x,this.fieldErrorUiControllerStrategies=[new ne,new ae,new le],this.initTranslationObserver()}applyInputInvalidUI(e){const t=this.getInputElementContainer();if(d.notify(S.getSubject(this.host,N),{host:this.host,showError:!0}),t&&(t.classList.add("error"),e)){this.errorMessage=e;const r=this.getErrorContainer(t);r.innerHTML=P.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(e),B),r.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const e=this.getInputElementContainer();e&&(this.getErrorContainer(e).classList.add("vega-hidden"),e.classList.remove("error"),d.notify(S.getSubject(this.host,N),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(e){for(const t of this.fieldErrorUiControllerStrategies){const r=t.run(e);if(r)return r}}initTranslationObserver(){const e=new C(this.isAcceptableTranslationObserver.bind(this),()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const r=this.getErrorContainer(t);r&&(r.innerHTML=P.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),B))}});d.register(Q,e)}isAcceptableTranslationObserver(){return!0}}A([m()],R.prototype,"formFieldMessageTranslatorSlimmer",void 0);A([c()],R.prototype,"host",void 0);A([c()],R.prototype,"options",void 0);var M=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class v{constructor(e,t,r,s){var i,o;this.formFieldMessageTranslatorSlimmer=new x,this.fieldErrorUIController=new R,this.resizeObserverSlimmer=W(v,k,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:n=>{const u=this.isVisible,p=n[0].contentRect.height>0;this.isVisible=p,this.isAutoValidationEnabled()&&F(this.host,"vega-form")&&u!==p&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new oe,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(n,u)=>{let p=!0;return u?(n==="rule"?u.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(u.message):this.fieldErrorUIController.resetInputInvalidUI():n?this.fieldErrorUIController.applyInputInvalidUI(u.message):this.fieldErrorUIController.resetInputInvalidUI(),p=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(p),d.notify(_,{host:this.host,detail:p}),p},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter(n=>n&&this.hostChildAddedBlurEventMap.get(n)!==!0).forEach(n=>{n.addEventListener("blur",()=>{this.updateIsTouched(!0)}),this.hostChildAddedBlurEventMap.set(n,!0)})},this.defaultRules=e||[],this.host=t,this.defaultValue=r,this.options=s,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),(o=(i=this.host).componentOnReady)===null||o===void 0||o.call(i).then(()=>{this.didRender()}),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(e){return await this.valid([],e)}addListener(e){this.listeners.push(e)}getRules(){const e=[...this.additionalRules];return[...this.defaultRules.map(r=>this.overrideDefaultRuleByAdditionalRule(r,e)),...e]}setDefaultRules(e){this.defaultRules=e,this.updateValidationHandlers()}setAdditionalRules(e){this.additionalRules=e,this.updateValidationHandlers()}destroy(){d.notify($,{host:this.host}),this.unregisterFormResetObserver(),d.unregister(j,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(e){this.disableBlurValidation=e}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(e,t="rule"){const r=this.getStatus(),s=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(s,r,e)&&d.notify(_,{host:this.host,detail:null});const{isValid:o,message:n}=await this.formFieldValidationRuleHandlerChain.process(s,r,e,t,this.handleValidationResult),u=this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n);return{isValid:o,message:u}}invokeListeners(e){this.listeners.forEach(t=>t.callback(e))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(e){const t=this.isTouched;this.isTouched=e,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(t===e?[]:["touched"])}updateIsModified(e){const t=this.isModified;this.isModified=e,this.isAutoValidationEnabled()&&this.valid(t===e?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver(()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])}),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(e){return F(this.host,"vega-form")===e.host}unregisterFormResetObserver(){d.unregister(H,this.formResetTriggeredObserver)}monitorTouchedListener(){const e=this.getInputContainerElements();e&&(this.hostChildrenObserver=new MutationObserver(()=>{this.setupTouchedListener()}),this.hostChildrenObserver.observe(e,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new C(this.isCurrentTarget.bind(this),()=>this.updateIsModified(!0)),d.register(j,this.hostValueChangeObserver)}isCurrentTarget(e){return this.host===e.host}async reset(e){var t,r;if(this.shouldVisitElement(this.host,(t=e.option)===null||t===void 0?void 0:t.skipDisabled,(r=e.option)===null||r===void 0?void 0:r.skipInvisible)){const s=e.defaultValueMap,i=this.host.dataset.vegaForm,o=s[i]===void 0||s[i]===null?this.getDefaultValue():s[i];typeof this.host.setValue=="function"?await this.host.setValue(o):this.host.value=o,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new C(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),d.register(H,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return this.host.autoValidation!==!1}shouldVisitElement(e,t,r){return!!(e.dataset.vegaForm&&(!t||!e.disabled)&&(!r||q(e)))}listenHostElementKeydown(){this.host.addEventListener("keydown",e=>{if(this.canSubmitFormByEvent(e)){const t=F(this.host,"vega-form",{outerMost:!0});t&&d.notify(S.getSubject(t,X),{host:this.host})}})}canSubmitFormByEvent(e){const t=e.key==="Enter"||e.keyCode===13,r=t&&e.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return r&&e.preventDefault(),r;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return t}}overrideDefaultRuleByAdditionalRule(e,t){if(e&&t){const r=t.findIndex(s=>s instanceof J&&s instanceof e.constructor&&s.overrideDefault);if(r>-1)return t.splice(r,1)[0]}return e}}M([m()],v.prototype,"formFieldMessageTranslatorSlimmer",void 0);M([m()],v.prototype,"fieldErrorUIController",void 0);M([m()],v.prototype,"resizeObserverSlimmer",void 0);var I=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class b extends E{constructor(){super(...arguments),this.fieldErrorUIController=new R,this.handleFieldErrorMessageUpdate=e=>{const{message:t,isValid:r}=e;r?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(t)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new C(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),d.register(D,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){d.unregister(D,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(e){const{host:t}=e,r=this.host.parentElement;return r&&r===t&&r.tagName==="VEGA-FIELD-ERROR"||this.host===t}}I([c()],b.prototype,"host",void 0);I([c()],b.prototype,"options",void 0);I([m()],b.prototype,"fieldErrorUIController",void 0);I([f("setInjectFormFieldHelper")],b.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null);I([f("disconnectedCallback")],b.prototype,"handleUnregisterObserver",null);var V=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class y extends E{constructor(){super(...arguments),this.handleValidInvocation=async e=>{if(this.validator){e.timerId!==void 0&&clearTimeout(e.timerId);const t=await this.validator.validate(e.message);if(t){const{isValid:r,message:s}=t;typeof e.promiseResolve=="function"&&e.promiseResolve({isValid:r,message:s})}}}}registerValidInvocationObserver(){L.addUniqueObserverToNode(this.host,U,this.handleValidInvocation)}handleUnregisterObserver(){L.removeUniqueObserverFromNode(this.host,U)}}V([c()],y.prototype,"host",void 0);V([c()],y.prototype,"validator",void 0);V([f("setInjectFormFieldHelper")],y.prototype,"registerValidInvocationObserver",null);V([f("disconnectedCallback")],y.prototype,"handleUnregisterObserver",null);var T=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class O extends ie{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:e=>{var t;(t=this.validator)===null||t===void 0||t.updateDisableBlurValidation(e)}}]})}componentWillLoad(){super.componentWillLoad()}}T([c()],O.prototype,"host",void 0);T([c()],O.prototype,"validator",void 0);T([f("setInjectFormFieldHelper")],O.prototype,"componentWillLoad",null);var h=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class l extends E{constructor(e){super(),this.fieldErrorSlimmer=new b,this.formFieldValidInvokeSlimmer=new y,this.formFormStateController=new O,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=e,this.setMutationObserverSlimmer()}connectedCallback(){this.validator===null&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(e){return e&&!!e.getAttribute("data-vega-form")}watchValidationRulesByFormControllerSlimmer(e,t){re(e,t,!1,(r,s)=>r===s?0:-1)||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(l.isValidFormField(this.host)){const{defaultValue:e}=this.options,t=new v(this.getPropertyRules(),this.host,e,this.options);t.addListener({callback:r=>{this.isValid!=r&&(this.isValid=r,d.notify(z,{host:this.host,detail:r}))}}),this.validator=t,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&this.options.validationRulesName==="validationRules"&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:e,attributeGetter:t}=this.options;return e.map(r=>{const s=r.dependence&&typeof r.dependence=="string"?[t(r.dependence)]:Array.isArray(r.dependence)?r.dependence.map(i=>t(i)):[null];return r.ruleFactory(t(r.propertyName),...s)}).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new ee({options:{attributeFilter:this.options.propertyRules.map(e=>K(e.propertyName)),attributeOldValue:!0},mutationFilter:te(),callback:this.mutationObserverCallBack})}}h([c()],l.prototype,"host",void 0);h([c({writable:!0})],l.prototype,"validationRules",void 0);h([c()],l.prototype,"disabled",void 0);h([c()],l.prototype,"autoValidation",void 0);h([c({writable:!0})],l.prototype,"isValid",void 0);h([m()],l.prototype,"fieldErrorSlimmer",void 0);h([m()],l.prototype,"formFieldValidInvokeSlimmer",void 0);h([m()],l.prototype,"mutationObserverSlimmer",void 0);h([m()],l.prototype,"formFormStateController",void 0);h([f("connectedCallback")],l.prototype,"connectedCallback",null);h([f("disconnectedCallback")],l.prototype,"disconnectedCallback",null);h([f("componentDidLoad")],l.prototype,"componentDidLoad",null);h([f("watchValidationRules")],l.prototype,"watchValidationRulesByFormControllerSlimmer",null);h([f("componentWillLoad")],l.prototype,"setInjectFormFieldHelper",null);export{l as F};
1
+ import{a as E,C as d,aa as z,bK as K,O as C,a5 as D,D as L,ag as U,b1 as W,B as F,P as k,ad as _,ac as $,W as j,ab as H,af as q,E as S,G as X,aB as J,bL as N,t as P,a3 as B,bM as Q,ay as G,bN as Y,bO as Z,I as m,M as c,f}from"./index-xErL25ZZ.js";import{M as ee}from"./mutation-observer-slimmer-58ebc13c-C8NHwhLF.js";import{A as te}from"./mutation-observer-filters-1a054fb0-bfmjnP_b.js";import{b as re}from"./array-7888f339-Bw63bZyT.js";import{S as ie}from"./sub-state-observer-slimmer-64532d94-CCXNpyc0.js";class se{constructor(e){this.rule=e}getStatus(e,t,r){return{canEvaluate:this.rule.canEvaluate(e,t,r),isAsync:Z(this.rule.evaluate)}}shouldShowError(e,t){try{return this.rule.shouldShowError?this.rule.shouldShowError(e,t):this.defaultShouldShowError(e)}catch{return!1}}handle(e){try{return this.rule.evaluate(e)}catch{return{isValid:!0,message:""}}}defaultShouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}}class oe{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(e,t,r){return!!this.handlers.find(i=>{const o=i.getStatus(e,t,r);return o.canEvaluate&&o.isAsync})}setHandlersByRules(e){e&&e.length?this.handlers=e.map(t=>new se(t)):this.handlers=[]}async process(e,t,r,s,i){const o=this.preProcess();let n;for(const u of this.handlers){if(o!==this.processId)break;const p=u.getStatus(e,t,r);if(!p.canEvaluate)continue;let g;if(p.isAsync)try{g=await u.handle(e)}catch{}else g=u.handle(e);if(g&&!g.isValid){const w=u.shouldShowError(t,r);n=Object.assign(Object.assign({},g),{shouldShowError:w});break}}return this.postProcess(o,s,n,i),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const e=Y();return this.processId=e,e}postProcess(e,t,r,s){this.processId===e&&s(t,r)}}class ne{run(e){const t=e.nextElementSibling;return t&&t.querySelector(".vega-error")?t.querySelector(".vega-error"):null}}class ae{run(e){let t=e.nextElementSibling;return t&&!t.classList.contains("vega-error")&&(t=document.createElement("label"),t.classList.add("vega-error"),t.setAttribute("part","field-error-message"),e.after(t)),t}}class le{run(e){let t=e.nextElementSibling;return t||(t=document.createElement("label"),t.classList.add("vega-error"),t.setAttribute("part","field-error-message"),e.after(t)),t}}class x extends E{getTranslatedMessage(e){return typeof e=="string"?G.t(e):G.t(e.key,...e.args||[])}}var A=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class R extends E{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new x,this.fieldErrorUiControllerStrategies=[new ne,new ae,new le],this.initTranslationObserver()}applyInputInvalidUI(e){const t=this.getInputElementContainer();if(d.notify(S.getSubject(this.host,N),{host:this.host,showError:!0}),t&&(t.classList.add("error"),e)){this.errorMessage=e;const r=this.getErrorContainer(t);r.innerHTML=P.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(e),B),r.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const e=this.getInputElementContainer();e&&(this.getErrorContainer(e).classList.add("vega-hidden"),e.classList.remove("error"),d.notify(S.getSubject(this.host,N),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(e){for(const t of this.fieldErrorUiControllerStrategies){const r=t.run(e);if(r)return r}}initTranslationObserver(){const e=new C(this.isAcceptableTranslationObserver.bind(this),()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const r=this.getErrorContainer(t);r&&(r.innerHTML=P.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),B))}});d.register(Q,e)}isAcceptableTranslationObserver(){return!0}}A([m()],R.prototype,"formFieldMessageTranslatorSlimmer",void 0);A([c()],R.prototype,"host",void 0);A([c()],R.prototype,"options",void 0);var M=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class v{constructor(e,t,r,s){var i,o;this.formFieldMessageTranslatorSlimmer=new x,this.fieldErrorUIController=new R,this.resizeObserverSlimmer=W(v,k,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:n=>{const u=this.isVisible,p=n[0].contentRect.height>0;this.isVisible=p,this.isAutoValidationEnabled()&&F(this.host,"vega-form")&&u!==p&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new oe,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(n,u)=>{let p=!0;return u?(n==="rule"?u.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(u.message):this.fieldErrorUIController.resetInputInvalidUI():n?this.fieldErrorUIController.applyInputInvalidUI(u.message):this.fieldErrorUIController.resetInputInvalidUI(),p=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(p),d.notify(_,{host:this.host,detail:p}),p},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter(n=>n&&this.hostChildAddedBlurEventMap.get(n)!==!0).forEach(n=>{n.addEventListener("blur",()=>{this.updateIsTouched(!0)}),this.hostChildAddedBlurEventMap.set(n,!0)})},this.defaultRules=e||[],this.host=t,this.defaultValue=r,this.options=s,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),(o=(i=this.host).componentOnReady)===null||o===void 0||o.call(i).then(()=>{this.didRender()}),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(e){return await this.valid([],e)}addListener(e){this.listeners.push(e)}getRules(){const e=[...this.additionalRules];return[...this.defaultRules.map(r=>this.overrideDefaultRuleByAdditionalRule(r,e)),...e]}setDefaultRules(e){this.defaultRules=e,this.updateValidationHandlers()}setAdditionalRules(e){this.additionalRules=e,this.updateValidationHandlers()}destroy(){d.notify($,{host:this.host}),this.unregisterFormResetObserver(),d.unregister(j,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(e){this.disableBlurValidation=e}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(e,t="rule"){const r=this.getStatus(),s=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(s,r,e)&&d.notify(_,{host:this.host,detail:null});const{isValid:o,message:n}=await this.formFieldValidationRuleHandlerChain.process(s,r,e,t,this.handleValidationResult),u=this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n);return{isValid:o,message:u}}invokeListeners(e){this.listeners.forEach(t=>t.callback(e))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(e){const t=this.isTouched;this.isTouched=e,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(t===e?[]:["touched"])}updateIsModified(e){const t=this.isModified;this.isModified=e,this.isAutoValidationEnabled()&&this.valid(t===e?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver(()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])}),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(e){return F(this.host,"vega-form")===e.host}unregisterFormResetObserver(){d.unregister(H,this.formResetTriggeredObserver)}monitorTouchedListener(){const e=this.getInputContainerElements();e&&(this.hostChildrenObserver=new MutationObserver(()=>{this.setupTouchedListener()}),this.hostChildrenObserver.observe(e,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new C(this.isCurrentTarget.bind(this),()=>this.updateIsModified(!0)),d.register(j,this.hostValueChangeObserver)}isCurrentTarget(e){return this.host===e.host}async reset(e){var t,r;if(this.shouldVisitElement(this.host,(t=e.option)===null||t===void 0?void 0:t.skipDisabled,(r=e.option)===null||r===void 0?void 0:r.skipInvisible)){const s=e.defaultValueMap,i=this.host.dataset.vegaForm,o=s[i]===void 0||s[i]===null?this.getDefaultValue():s[i];typeof this.host.setValue=="function"?await this.host.setValue(o):this.host.value=o,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new C(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),d.register(H,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return this.host.autoValidation!==!1}shouldVisitElement(e,t,r){return!!(e.dataset.vegaForm&&(!t||!e.disabled)&&(!r||q(e)))}listenHostElementKeydown(){this.host.addEventListener("keydown",e=>{if(this.canSubmitFormByEvent(e)){const t=F(this.host,"vega-form",{outerMost:!0});t&&d.notify(S.getSubject(t,X),{host:this.host})}})}canSubmitFormByEvent(e){const t=e.key==="Enter"||e.keyCode===13,r=t&&e.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return r&&e.preventDefault(),r;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return t}}overrideDefaultRuleByAdditionalRule(e,t){if(e&&t){const r=t.findIndex(s=>s instanceof J&&s instanceof e.constructor&&s.overrideDefault);if(r>-1)return t.splice(r,1)[0]}return e}}M([m()],v.prototype,"formFieldMessageTranslatorSlimmer",void 0);M([m()],v.prototype,"fieldErrorUIController",void 0);M([m()],v.prototype,"resizeObserverSlimmer",void 0);var I=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class b extends E{constructor(){super(...arguments),this.fieldErrorUIController=new R,this.handleFieldErrorMessageUpdate=e=>{const{message:t,isValid:r}=e;r?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(t)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new C(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),d.register(D,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){d.unregister(D,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(e){const{host:t}=e,r=this.host.parentElement;return r&&r===t&&r.tagName==="VEGA-FIELD-ERROR"||this.host===t}}I([c()],b.prototype,"host",void 0);I([c()],b.prototype,"options",void 0);I([m()],b.prototype,"fieldErrorUIController",void 0);I([f("setInjectFormFieldHelper")],b.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null);I([f("disconnectedCallback")],b.prototype,"handleUnregisterObserver",null);var V=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class y extends E{constructor(){super(...arguments),this.handleValidInvocation=async e=>{if(this.validator){e.timerId!==void 0&&clearTimeout(e.timerId);const t=await this.validator.validate(e.message);if(t){const{isValid:r,message:s}=t;typeof e.promiseResolve=="function"&&e.promiseResolve({isValid:r,message:s})}}}}registerValidInvocationObserver(){L.addUniqueObserverToNode(this.host,U,this.handleValidInvocation)}handleUnregisterObserver(){L.removeUniqueObserverFromNode(this.host,U)}}V([c()],y.prototype,"host",void 0);V([c()],y.prototype,"validator",void 0);V([f("setInjectFormFieldHelper")],y.prototype,"registerValidInvocationObserver",null);V([f("disconnectedCallback")],y.prototype,"handleUnregisterObserver",null);var T=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class O extends ie{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:e=>{var t;(t=this.validator)===null||t===void 0||t.updateDisableBlurValidation(e)}}]})}componentWillLoad(){super.componentWillLoad()}}T([c()],O.prototype,"host",void 0);T([c()],O.prototype,"validator",void 0);T([f("setInjectFormFieldHelper")],O.prototype,"componentWillLoad",null);var h=function(a,e,t,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,r);else for(var n=a.length-1;n>=0;n--)(o=a[n])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class l extends E{constructor(e){super(),this.fieldErrorSlimmer=new b,this.formFieldValidInvokeSlimmer=new y,this.formFormStateController=new O,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=e,this.setMutationObserverSlimmer()}connectedCallback(){this.validator===null&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(e){return e&&!!e.getAttribute("data-vega-form")}watchValidationRulesByFormControllerSlimmer(e,t){re(e,t,!1,(r,s)=>r===s?0:-1)||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(l.isValidFormField(this.host)){const{defaultValue:e}=this.options,t=new v(this.getPropertyRules(),this.host,e,this.options);t.addListener({callback:r=>{this.isValid!=r&&(this.isValid=r,d.notify(z,{host:this.host,detail:r}))}}),this.validator=t,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&this.options.validationRulesName==="validationRules"&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:e,attributeGetter:t}=this.options;return e.map(r=>{const s=r.dependence&&typeof r.dependence=="string"?[t(r.dependence)]:Array.isArray(r.dependence)?r.dependence.map(i=>t(i)):[null];return r.ruleFactory(t(r.propertyName),...s)}).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new ee({options:{attributeFilter:this.options.propertyRules.map(e=>K(e.propertyName)),attributeOldValue:!0},mutationFilter:te(),callback:this.mutationObserverCallBack})}}h([c()],l.prototype,"host",void 0);h([c({writable:!0})],l.prototype,"validationRules",void 0);h([c()],l.prototype,"disabled",void 0);h([c()],l.prototype,"autoValidation",void 0);h([c({writable:!0})],l.prototype,"isValid",void 0);h([m()],l.prototype,"fieldErrorSlimmer",void 0);h([m()],l.prototype,"formFieldValidInvokeSlimmer",void 0);h([m()],l.prototype,"mutationObserverSlimmer",void 0);h([m()],l.prototype,"formFormStateController",void 0);h([f("connectedCallback")],l.prototype,"connectedCallback",null);h([f("disconnectedCallback")],l.prototype,"disconnectedCallback",null);h([f("componentDidLoad")],l.prototype,"componentDidLoad",null);h([f("watchValidationRules")],l.prototype,"watchValidationRulesByFormControllerSlimmer",null);h([f("componentWillLoad")],l.prototype,"setInjectFormFieldHelper",null);export{l as F};
@@ -1 +1 @@
1
- import{c4 as m,co as h,h as c,D as p,cp as y,cq as w,Z as T,cr as S,cs as C,ca as g,ct as O,a as D,b as x,cu as P,cb as N,M as a,d as R}from"./index-bkDaCMH8.js";const A={icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M64 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V80C0 53.5 21.5 32 48 32H224 400c26.5 0 48 21.5 48 48v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V96H256l0 320h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H144c-17.7 0-32-14.3-32-32s14.3-32 32-32h48l0-320H64z"/></svg>'};var f=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class u extends D{constructor({icon:e,tooltip:t,autoFocusOnClick:r=!0}){super(),this.renderBtn=({showArrowIcon:i,iconColor:o}={})=>{var n;return c("vega-tooltip",{text:this.translationSlimmer.t(this.tooltip.text),placement:["bottom","top"]},c("vega-rich-text-editor-toolbar-button",Object.assign({showArrowIcon:i,icon:this.icon,iconColor:o,ref:l=>{p.addUniqueObserverToNode(l,x,()=>{this.handleClick()})},selected:this.isSelected(),disabled:this.isDisabled(),hidden:this.isHidden()},this.preventLostFocus()),(n=this.renderSlotContent)===null||n===void 0?void 0:n.call(this)))},this.handleClick=()=>{typeof this.onClick=="function"&&(!this.selectionController.getSelectedNodes().length&&this.autoFocusOnClick?this.focusController.focusOnLastTextNode().then(()=>{this.onClick()}):this.onClick())},this.icon=e,this.tooltip=t,this.autoFocusOnClick=r}setIcon(e){this.icon=e}isHidden(){return!1}render(){return typeof this.renderBtnWrapper=="function"?this.renderBtnWrapper(this.renderBtn):this.renderBtn()}isDisabled(){return this.disabled}preventLostFocus(){return{onMouseDown:e=>e.preventDefault()}}}f([a()],u.prototype,"translationSlimmer",void 0);f([a()],u.prototype,"selectionController",void 0);f([a()],u.prototype,"focusController",void 0);f([a()],u.prototype,"disabled",void 0);var I=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class b extends u{constructor(e){super(e)}isHidden(){return this.sourceView}isDisabled(){return super.isDisabled()&&!this.sourceView}shouldDisabledToolbar(e,t){return e&&!O.canHandle(t,e)}}I([a()],b.prototype,"sourceView",void 0);var v=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class d extends b{constructor(){super({icon:"text",tooltip:{text:"Text Color"}}),this.popoverShow=!1,m.registerCustomDarkModeColor(d.formatDarkModeColor())}static formatDarkModeColor(){return h.reduce((e,t)=>(t.dark&&(e[`rich-text-editor-${t.key}`]=t.dark),e),{})}renderSlotContent(){return c("div",{class:{"toolbar-btn-color-preview-box":!0,disabled:this.isDisabled()},style:{backgroundColor:this.getCurrentColor()}})}handlePopoverShowChange(){this.popoverShow=!0}handlePopoverHideChange(){this.popoverShow=!1}renderBtnWrapper(e){return c("vega-popover",{placement:"bottom",alignment:"center",ref:t=>{this.popoverRef=t,p.addUniqueObserverToNode(t,y,this.handlePopoverShowChange.bind(this)),p.addUniqueObserverToNode(t,w,this.handlePopoverHideChange.bind(this))}},c("div",{slot:"popover-content"},e({showArrowIcon:!1})),c("div",Object.assign({slot:"popover",style:{userSelect:"none"}},super.preventLostFocus()),this.renderPopoverContent()))}renderPopoverContent(){return c("vega-color-picker",{isInline:!0,colors:h.map(e=>e[this.isInDarkMode?"dark":"light"]),ref:e=>{p.addUniqueObserverToNode(e,T,this.handleChange.bind(this))},value:this.getCurrentColor()})}async handleChange(e){this.popoverShow&&(this.selectionController.getSelectedNodes().length||await this.focusController.focusOnLastTextNode(),this.selectionController.getSelectedNodes().filter(t=>t instanceof S).forEach(t=>t.apply(new C(this.matchColor(e.detail).key)))),this.popoverRef.hide()}matchColor(e){return h.find(t=>t[this.isInDarkMode?"dark":"light"]===e)}getCurrentColor(){let e=h[0];const t=this.selectionController.getSelectedNodes();return t.length>1&&(this.isSelectedSameColor(t)?e=this.getTextColor(t[0]):e=null),t.length===1&&(e=this.getTextColor(t[0])),e?e[this.isInDarkMode?"dark":"light"]:null}isSelected(){return!1}isSelectedSameColor(e){return e.every(t=>this.getTextColor(t).key===this.getTextColor(e[0]).key)}getTextColor(e){var t;return((t=e.getAnnotationByType("TEXT_COLOR"))===null||t===void 0?void 0:t.textColor)||h[0]}isDisabled(){const e=this.selectionController.getSelectedNodes();return super.isDisabled()||e.some(t=>{var r;return((r=t.getAnnotationByType(g.CODE))===null||r===void 0?void 0:r.code)||t.getAnnotationByType(g.LINK)||this.shouldDisabledToolbar(t,C.name)})}}R.register({text:A});v([a()],d.prototype,"host",void 0);v([a()],d.prototype,"isInDarkMode",void 0);v([a()],d.prototype,"selectionController",void 0);v([a()],d.prototype,"focusController",void 0);const k=/^((\w+:(\/{2,})?)|(\W))/i;function V(s,e){const t=(s||"").trim();if(!t)return t;const r=(e||"").trim();return!r||k.test(t)?t:`${r}${t}`}class B extends P{constructor(e,t){super(),this.isFlushable=!0,this.size=e,this.alt=t}toAnnotation(){return new N(this.size,this.alt)}}export{B as I,d as T,b as V,u as a,V as n};
1
+ import{c4 as m,co as h,h as c,D as p,cp as y,cq as w,Z as T,cr as S,cs as C,ca as g,ct as O,a as D,b as x,cu as P,cb as N,M as a,d as R}from"./index-xErL25ZZ.js";const A={icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M64 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V80C0 53.5 21.5 32 48 32H224 400c26.5 0 48 21.5 48 48v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V96H256l0 320h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H144c-17.7 0-32-14.3-32-32s14.3-32 32-32h48l0-320H64z"/></svg>'};var f=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class u extends D{constructor({icon:e,tooltip:t,autoFocusOnClick:r=!0}){super(),this.renderBtn=({showArrowIcon:i,iconColor:o}={})=>{var n;return c("vega-tooltip",{text:this.translationSlimmer.t(this.tooltip.text),placement:["bottom","top"]},c("vega-rich-text-editor-toolbar-button",Object.assign({showArrowIcon:i,icon:this.icon,iconColor:o,ref:l=>{p.addUniqueObserverToNode(l,x,()=>{this.handleClick()})},selected:this.isSelected(),disabled:this.isDisabled(),hidden:this.isHidden()},this.preventLostFocus()),(n=this.renderSlotContent)===null||n===void 0?void 0:n.call(this)))},this.handleClick=()=>{typeof this.onClick=="function"&&(!this.selectionController.getSelectedNodes().length&&this.autoFocusOnClick?this.focusController.focusOnLastTextNode().then(()=>{this.onClick()}):this.onClick())},this.icon=e,this.tooltip=t,this.autoFocusOnClick=r}setIcon(e){this.icon=e}isHidden(){return!1}render(){return typeof this.renderBtnWrapper=="function"?this.renderBtnWrapper(this.renderBtn):this.renderBtn()}isDisabled(){return this.disabled}preventLostFocus(){return{onMouseDown:e=>e.preventDefault()}}}f([a()],u.prototype,"translationSlimmer",void 0);f([a()],u.prototype,"selectionController",void 0);f([a()],u.prototype,"focusController",void 0);f([a()],u.prototype,"disabled",void 0);var I=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class b extends u{constructor(e){super(e)}isHidden(){return this.sourceView}isDisabled(){return super.isDisabled()&&!this.sourceView}shouldDisabledToolbar(e,t){return e&&!O.canHandle(t,e)}}I([a()],b.prototype,"sourceView",void 0);var v=function(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};class d extends b{constructor(){super({icon:"text",tooltip:{text:"Text Color"}}),this.popoverShow=!1,m.registerCustomDarkModeColor(d.formatDarkModeColor())}static formatDarkModeColor(){return h.reduce((e,t)=>(t.dark&&(e[`rich-text-editor-${t.key}`]=t.dark),e),{})}renderSlotContent(){return c("div",{class:{"toolbar-btn-color-preview-box":!0,disabled:this.isDisabled()},style:{backgroundColor:this.getCurrentColor()}})}handlePopoverShowChange(){this.popoverShow=!0}handlePopoverHideChange(){this.popoverShow=!1}renderBtnWrapper(e){return c("vega-popover",{placement:"bottom",alignment:"center",ref:t=>{this.popoverRef=t,p.addUniqueObserverToNode(t,y,this.handlePopoverShowChange.bind(this)),p.addUniqueObserverToNode(t,w,this.handlePopoverHideChange.bind(this))}},c("div",{slot:"popover-content"},e({showArrowIcon:!1})),c("div",Object.assign({slot:"popover",style:{userSelect:"none"}},super.preventLostFocus()),this.renderPopoverContent()))}renderPopoverContent(){return c("vega-color-picker",{isInline:!0,colors:h.map(e=>e[this.isInDarkMode?"dark":"light"]),ref:e=>{p.addUniqueObserverToNode(e,T,this.handleChange.bind(this))},value:this.getCurrentColor()})}async handleChange(e){this.popoverShow&&(this.selectionController.getSelectedNodes().length||await this.focusController.focusOnLastTextNode(),this.selectionController.getSelectedNodes().filter(t=>t instanceof S).forEach(t=>t.apply(new C(this.matchColor(e.detail).key)))),this.popoverRef.hide()}matchColor(e){return h.find(t=>t[this.isInDarkMode?"dark":"light"]===e)}getCurrentColor(){let e=h[0];const t=this.selectionController.getSelectedNodes();return t.length>1&&(this.isSelectedSameColor(t)?e=this.getTextColor(t[0]):e=null),t.length===1&&(e=this.getTextColor(t[0])),e?e[this.isInDarkMode?"dark":"light"]:null}isSelected(){return!1}isSelectedSameColor(e){return e.every(t=>this.getTextColor(t).key===this.getTextColor(e[0]).key)}getTextColor(e){var t;return((t=e.getAnnotationByType("TEXT_COLOR"))===null||t===void 0?void 0:t.textColor)||h[0]}isDisabled(){const e=this.selectionController.getSelectedNodes();return super.isDisabled()||e.some(t=>{var r;return((r=t.getAnnotationByType(g.CODE))===null||r===void 0?void 0:r.code)||t.getAnnotationByType(g.LINK)||this.shouldDisabledToolbar(t,C.name)})}}R.register({text:A});v([a()],d.prototype,"host",void 0);v([a()],d.prototype,"isInDarkMode",void 0);v([a()],d.prototype,"selectionController",void 0);v([a()],d.prototype,"focusController",void 0);const k=/^((\w+:(\/{2,})?)|(\W))/i;function V(s,e){const t=(s||"").trim();if(!t)return t;const r=(e||"").trim();return!r||k.test(t)?t:`${r}${t}`}class B extends P{constructor(e,t){super(),this.isFlushable=!0,this.size=e,this.alt=t}toAnnotation(){return new N(this.size,this.alt)}}export{B as I,d as T,b as V,u as a,V as n};