genesys-spark-components 4.237.0 → 4.239.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{en-fRy-d84u.js → en-IPkzvxIf.js} +1 -1
- package/dist/cjs/{floating-ui.dom-CMUN3LzO.js → floating-ui.dom-BuKBQkiD.js} +23 -19
- package/dist/cjs/genesys-webcomponents.cjs.js +3 -3
- package/dist/cjs/{get-valid-timezone-D3lxIQ6I.js → get-valid-timezone-D4Tzo9st.js} +1 -1
- package/dist/cjs/gux-accordion-section.cjs.entry.js +1 -1
- package/dist/cjs/gux-accordion.cjs.entry.js +2 -2
- package/dist/cjs/gux-action-button.cjs.entry.js +4 -4
- package/dist/cjs/gux-action-toast-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-actionable-inline-alert-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-advanced-dropdown-legacy.cjs.entry.js +4 -4
- package/dist/cjs/gux-ai-indicator-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-ai-powered-badge-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-ai-powered-button-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-ai-spinner-loader-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-all-row-select.cjs.entry.js +2 -2
- package/dist/cjs/gux-announce-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-avatar-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-avatar-change-photo-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-avatar-focusable-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-avatar-group-add-item-beta_3.cjs.entry.js +5 -5
- package/dist/cjs/gux-avatar-group-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-avatar-group-item-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-badge.cjs.entry.js +4 -4
- package/dist/cjs/gux-blank-state-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-blank-state.cjs.entry.js +3 -3
- package/dist/cjs/gux-branch-multi.cjs.entry.js +2 -2
- package/dist/cjs/gux-branch.cjs.entry.js +2 -2
- package/dist/cjs/gux-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/gux-breadcrumbs.cjs.entry.js +3 -3
- package/dist/cjs/gux-button-multi.cjs.entry.js +3 -3
- package/dist/cjs/gux-button-slot.cjs.entry.js +2 -2
- package/dist/cjs/gux-button_2.cjs.entry.js +4 -4
- package/dist/cjs/gux-calendar-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-calendar.cjs.entry.js +3 -3
- package/dist/cjs/gux-card.cjs.entry.js +2 -2
- package/dist/cjs/gux-cloud-logo-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-cloud-logomark-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-column-manager-item.cjs.entry.js +2 -2
- package/dist/cjs/gux-column-manager.cjs.entry.js +3 -3
- package/dist/cjs/gux-content-search.cjs.entry.js +3 -3
- package/dist/cjs/gux-context-menu.cjs.entry.js +4 -4
- package/dist/cjs/gux-copy-to-clipboard.cjs.entry.js +3 -3
- package/dist/cjs/gux-create-option.cjs.entry.js +2 -2
- package/dist/cjs/gux-cta-group.cjs.entry.js +1 -1
- package/dist/cjs/gux-date-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-date-time-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-datepicker.cjs.entry.js +5 -5
- package/dist/cjs/gux-day-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-disclosure-button-legacy.cjs.entry.js +3 -3
- package/dist/cjs/gux-dismiss-button.cjs.entry.js +3 -3
- package/dist/cjs/gux-dropdown-multi-tag.cjs.entry.js +2 -2
- package/dist/cjs/gux-dropdown-multi.cjs.entry.js +5 -5
- package/dist/cjs/gux-dropdown-option.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown_3.cjs.entry.js +5 -5
- package/dist/cjs/gux-file-list-item.cjs.entry.js +3 -3
- package/dist/cjs/gux-flag-icon-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-flyout-menu.cjs.entry.js +4 -4
- package/dist/cjs/gux-form-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-description.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-checkbox-group-beta.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/gux-form-field-color.cjs.entry.js +5 -5
- package/dist/cjs/{gux-form-field-container-DfaeGHPr.js → gux-form-field-container-DyKm2DFo.js} +1 -1
- package/dist/cjs/gux-form-field-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/{gux-form-field-error-B8eN90t4.js → gux-form-field-error-DXIQw28P.js} +1 -1
- package/dist/cjs/{gux-form-field-fieldset-container-BYdx9Zf8.js → gux-form-field-fieldset-container-BAVkFe1L.js} +1 -1
- package/dist/cjs/gux-form-field-file-beta.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-file.cjs.entry.js +5 -5
- package/dist/cjs/gux-form-field-input-clear-button.cjs.entry.js +3 -3
- package/dist/cjs/gux-form-field-label-indicator.cjs.entry.js +3 -3
- package/dist/cjs/gux-form-field-number_2.cjs.entry.js +7 -7
- package/dist/cjs/gux-form-field-phone.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-radio-group-beta.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-radio.cjs.entry.js +4 -4
- package/dist/cjs/gux-form-field-range.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-search.cjs.entry.js +5 -5
- package/dist/cjs/gux-form-field-select.cjs.entry.js +5 -5
- package/dist/cjs/gux-form-field-text-like.cjs.entry.js +7 -7
- package/dist/cjs/gux-form-field-textarea.cjs.entry.js +7 -7
- package/dist/cjs/gux-form-field-time-picker.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-field-time-zone-picker.cjs.entry.js +6 -6
- package/dist/cjs/gux-form-fieldset-heading.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-footer.cjs.entry.js +2 -2
- package/dist/cjs/gux-form-heading.cjs.entry.js +1 -1
- package/dist/cjs/gux-icon-tooltip-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-icon.cjs.entry.js +2 -2
- package/dist/cjs/gux-illustration-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-inline-alert.cjs.entry.js +3 -3
- package/dist/cjs/gux-inline-dropdown-beta.cjs.entry.js +5 -5
- package/dist/cjs/gux-label-info-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-leaf-multi.cjs.entry.js +2 -2
- package/dist/cjs/gux-leaf.cjs.entry.js +2 -2
- package/dist/cjs/gux-link-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-list-divider.cjs.entry.js +1 -1
- package/dist/cjs/gux-list-item.cjs.entry.js +1 -1
- package/dist/cjs/gux-list.cjs.entry.js +2 -2
- package/dist/cjs/gux-listbox-multi.cjs.entry.js +4 -4
- package/dist/cjs/gux-loading-message.cjs.entry.js +2 -2
- package/dist/cjs/gux-logo-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-logomark-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-menu-option.cjs.entry.js +3 -3
- package/dist/cjs/gux-menu.cjs.entry.js +1 -1
- package/dist/cjs/gux-modal-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-modal-side-panel-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-modal.cjs.entry.js +2 -2
- package/dist/cjs/gux-month-calendar.cjs.entry.js +2 -2
- package/dist/cjs/gux-month-list_2.cjs.entry.js +1 -1
- package/dist/cjs/gux-month-picker-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-notification-indicator-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-notification-toast-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-option-group-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-option-icon.cjs.entry.js +1 -1
- package/dist/cjs/gux-option-multi.cjs.entry.js +2 -2
- package/dist/cjs/gux-option-status-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-page-loading-spinner.cjs.entry.js +2 -2
- package/dist/cjs/gux-pagination-buttons-legacy_3.cjs.entry.js +2 -2
- package/dist/cjs/gux-pagination-buttons_2.cjs.entry.js +2 -2
- package/dist/cjs/gux-pagination-cursor.cjs.entry.js +3 -3
- package/dist/cjs/gux-pagination-items-per-page.cjs.entry.js +2 -2
- package/dist/cjs/gux-pagination-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-pagination.cjs.entry.js +2 -2
- package/dist/cjs/gux-phone-input-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-popover-beta.cjs.entry.js +19 -16
- package/dist/cjs/gux-popover-list-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-popover-list.cjs.entry.js +4 -4
- package/dist/cjs/gux-popup.cjs.entry.js +2 -2
- package/dist/cjs/gux-prompt-input-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-radial-loading.cjs.entry.js +3 -3
- package/dist/cjs/gux-radial-progress.cjs.entry.js +2 -2
- package/dist/cjs/gux-rating.cjs.entry.js +4 -4
- package/dist/cjs/gux-rich-highlight-list-item.cjs.entry.js +3 -3
- package/dist/cjs/gux-rich-style-list-item_3.cjs.entry.js +5 -5
- package/dist/cjs/gux-rich-text-editor-action-group.cjs.entry.js +1 -1
- package/dist/cjs/gux-rich-text-editor-action-link.cjs.entry.js +4 -4
- package/dist/cjs/gux-rich-text-editor-action-rich-style.cjs.entry.js +4 -4
- package/dist/cjs/gux-rich-text-editor-action-text-highlight.cjs.entry.js +4 -4
- package/dist/cjs/gux-rich-text-editor-action.cjs.entry.js +3 -3
- package/dist/cjs/gux-rich-text-editor-beta.cjs.entry.js +15 -9
- package/dist/cjs/gux-rich-text-editor-list.cjs.entry.js +2 -2
- package/dist/cjs/gux-row-select.cjs.entry.js +2 -2
- package/dist/cjs/gux-screen-reader-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-segmented-control-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-segmented-control-divider.cjs.entry.js +1 -1
- package/dist/cjs/gux-segmented-control-item.cjs.entry.js +1 -1
- package/dist/cjs/gux-select-all.cjs.entry.js +2 -2
- package/dist/cjs/gux-selector-card-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-selector-cards-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-side-panel-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-side-panel-header-mini.cjs.entry.js +3 -3
- package/dist/cjs/gux-side-panel-header.cjs.entry.js +2 -2
- package/dist/cjs/gux-side-panel-heading.cjs.entry.js +2 -2
- package/dist/cjs/gux-simple-toast-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-skip-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/gux-skip-navigation-list.cjs.entry.js +3 -3
- package/dist/cjs/gux-sort-control.cjs.entry.js +3 -3
- package/dist/cjs/gux-status-indicator-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-step-title.cjs.entry.js +2 -2
- package/dist/cjs/gux-step.cjs.entry.js +2 -2
- package/dist/cjs/gux-stepper-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-submenu.cjs.entry.js +6 -6
- package/dist/cjs/gux-switch-item.cjs.entry.js +1 -1
- package/dist/cjs/gux-switch-legacy.cjs.entry.js +2 -2
- package/dist/cjs/gux-tab-advanced-list.cjs.entry.js +79 -93
- package/dist/cjs/gux-tab-advanced-panel.cjs.entry.js +1 -1
- package/dist/cjs/gux-tab-advanced.cjs.entry.js +2 -2
- package/dist/cjs/gux-tab-list.cjs.entry.js +3 -3
- package/dist/cjs/gux-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/gux-tab.cjs.entry.js +1 -1
- package/dist/cjs/gux-table-select-menu.cjs.entry.js +2 -2
- package/dist/cjs/gux-table-toolbar-action.cjs.entry.js +3 -3
- package/dist/cjs/gux-table-toolbar-custom-action.cjs.entry.js +2 -2
- package/dist/cjs/gux-table-toolbar-menu-button.cjs.entry.js +4 -4
- package/dist/cjs/gux-table-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/gux-table.cjs.entry.js +11 -4
- package/dist/cjs/gux-tabs-advanced.cjs.entry.js +2 -2
- package/dist/cjs/gux-tabs.cjs.entry.js +3 -3
- package/dist/cjs/gux-tag.cjs.entry.js +4 -4
- package/dist/cjs/gux-text-highlight.cjs.entry.js +2 -2
- package/dist/cjs/gux-time-beta.cjs.entry.js +4 -4
- package/dist/cjs/gux-time-picker.cjs.entry.js +4 -4
- package/dist/cjs/gux-time-zone-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-time-zone-picker-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-toast.cjs.entry.js +2 -2
- package/dist/cjs/gux-toggle-slider.cjs.entry.js +1 -1
- package/dist/cjs/gux-toggle.cjs.entry.js +3 -3
- package/dist/cjs/gux-tooltip-base-beta_2.cjs.entry.js +4 -4
- package/dist/cjs/gux-tooltip-pointer-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-tooltip-title.cjs.entry.js +3 -3
- package/dist/cjs/gux-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/gux-tree-beta.cjs.entry.js +3 -3
- package/dist/cjs/gux-tree-dropdown-beta.cjs.entry.js +5 -5
- package/dist/cjs/gux-tree-multi-beta.cjs.entry.js +3 -3
- package/dist/cjs/{gux-tree-multi.service-Df25NYyu.js → gux-tree-multi.service-BB_OgWTg.js} +1 -1
- package/dist/cjs/{gux-tree.service-DdbZ1oAM.js → gux-tree.service-kFg3nmC3.js} +1 -1
- package/dist/cjs/{index-BXAD_GRb.js → index-ChcZBLNR.js} +36 -9
- package/dist/cjs/{index-DFX9280s.js → index-Dy5Ze2UO.js} +409 -773
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{on-click-outside-B_-dUlVD.js → on-click-outside-R3P5EvNj.js} +1 -1
- package/dist/cjs/{on-mutation-B4_z6b_J.js → on-mutation-DUVcmmRz.js} +1 -1
- package/dist/cjs/{on-resize-COMnbjAs.js → on-resize-D_060jod.js} +1 -1
- package/dist/cjs/{overflow-detection-9h_D5bek.js → overflow-detection-CSuq7Nk-.js} +1 -1
- package/dist/cjs/{usage-C24W9jKD.js → usage-CcO87EFj.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/beta/gux-popover-beta/gux-popover.js +15 -12
- package/dist/collection/components/beta/gux-rich-text-editor/gux-rich-text-editor-beta.js +20 -4
- package/dist/collection/components/beta/gux-rich-text-editor/gux-rich-text-editor.css +37 -26
- package/dist/collection/components/stable/gux-flyout-menu/gux-menu/gux-menu-option/gux-menu-option.css +1 -4
- package/dist/collection/components/stable/gux-flyout-menu/gux-menu/gux-menu-option/gux-menu-option.js +1 -1
- package/dist/collection/components/stable/gux-flyout-menu/gux-menu/gux-submenu/gux-submenu.css +1 -4
- package/dist/collection/components/stable/gux-flyout-menu/gux-menu/gux-submenu/gux-submenu.js +3 -3
- package/dist/collection/components/stable/gux-table/gux-table.js +9 -1
- package/dist/collection/components/stable/gux-table/tests/gux-table.common.js +26 -1
- package/dist/esm/{en-tmnRV1Kr.js → en-CGyAgMj8.js} +1 -1
- package/dist/esm/{floating-ui.dom-8w8ltg_h.js → floating-ui.dom-CBOPktOE.js} +23 -19
- package/dist/esm/genesys-webcomponents.js +4 -4
- package/dist/esm/{get-valid-timezone-Dx1BVjLM.js → get-valid-timezone-CfoscnQi.js} +1 -1
- package/dist/esm/gux-accordion-section.entry.js +1 -1
- package/dist/esm/gux-accordion.entry.js +2 -2
- package/dist/esm/gux-action-button.entry.js +4 -4
- package/dist/esm/gux-action-toast-legacy.entry.js +2 -2
- package/dist/esm/gux-actionable-inline-alert-beta.entry.js +2 -2
- package/dist/esm/gux-advanced-dropdown-legacy.entry.js +4 -4
- package/dist/esm/gux-ai-indicator-beta.entry.js +3 -3
- package/dist/esm/gux-ai-powered-badge-beta.entry.js +3 -3
- package/dist/esm/gux-ai-powered-button-beta.entry.js +2 -2
- package/dist/esm/gux-ai-spinner-loader-beta.entry.js +3 -3
- package/dist/esm/gux-all-row-select.entry.js +2 -2
- package/dist/esm/gux-announce-beta.entry.js +2 -2
- package/dist/esm/gux-avatar-beta.entry.js +3 -3
- package/dist/esm/gux-avatar-change-photo-beta.entry.js +3 -3
- package/dist/esm/gux-avatar-focusable-beta.entry.js +1 -1
- package/dist/esm/gux-avatar-group-add-item-beta_3.entry.js +5 -5
- package/dist/esm/gux-avatar-group-beta.entry.js +2 -2
- package/dist/esm/gux-avatar-group-item-beta.entry.js +2 -2
- package/dist/esm/gux-badge.entry.js +4 -4
- package/dist/esm/gux-blank-state-beta.entry.js +3 -3
- package/dist/esm/gux-blank-state.entry.js +3 -3
- package/dist/esm/gux-branch-multi.entry.js +2 -2
- package/dist/esm/gux-branch.entry.js +2 -2
- package/dist/esm/gux-breadcrumb-item.entry.js +1 -1
- package/dist/esm/gux-breadcrumbs.entry.js +3 -3
- package/dist/esm/gux-button-multi.entry.js +3 -3
- package/dist/esm/gux-button-slot.entry.js +2 -2
- package/dist/esm/gux-button_2.entry.js +4 -4
- package/dist/esm/gux-calendar-beta.entry.js +2 -2
- package/dist/esm/gux-calendar.entry.js +3 -3
- package/dist/esm/gux-card.entry.js +2 -2
- package/dist/esm/gux-cloud-logo-beta.entry.js +3 -3
- package/dist/esm/gux-cloud-logomark-beta.entry.js +3 -3
- package/dist/esm/gux-column-manager-item.entry.js +2 -2
- package/dist/esm/gux-column-manager.entry.js +3 -3
- package/dist/esm/gux-content-search.entry.js +3 -3
- package/dist/esm/gux-context-menu.entry.js +4 -4
- package/dist/esm/gux-copy-to-clipboard.entry.js +3 -3
- package/dist/esm/gux-create-option.entry.js +2 -2
- package/dist/esm/gux-cta-group.entry.js +1 -1
- package/dist/esm/gux-date-beta.entry.js +4 -4
- package/dist/esm/gux-date-time-beta.entry.js +4 -4
- package/dist/esm/gux-datepicker.entry.js +5 -5
- package/dist/esm/gux-day-beta.entry.js +2 -2
- package/dist/esm/gux-disclosure-button-legacy.entry.js +3 -3
- package/dist/esm/gux-dismiss-button.entry.js +3 -3
- package/dist/esm/gux-dropdown-multi-tag.entry.js +2 -2
- package/dist/esm/gux-dropdown-multi.entry.js +5 -5
- package/dist/esm/gux-dropdown-option.entry.js +1 -1
- package/dist/esm/gux-dropdown_3.entry.js +5 -5
- package/dist/esm/gux-file-list-item.entry.js +3 -3
- package/dist/esm/gux-flag-icon-beta.entry.js +3 -3
- package/dist/esm/gux-flyout-menu.entry.js +4 -4
- package/dist/esm/gux-form-beta.entry.js +1 -1
- package/dist/esm/gux-form-description.entry.js +1 -1
- package/dist/esm/gux-form-field-checkbox-group-beta.entry.js +6 -6
- package/dist/esm/gux-form-field-checkbox.entry.js +4 -4
- package/dist/esm/gux-form-field-color.entry.js +5 -5
- package/dist/esm/{gux-form-field-container-CWao7HW4.js → gux-form-field-container-WeXFa2gy.js} +1 -1
- package/dist/esm/gux-form-field-dropdown.entry.js +6 -6
- package/dist/esm/{gux-form-field-error-Cx3Ss86c.js → gux-form-field-error-D1B0SkSN.js} +1 -1
- package/dist/esm/{gux-form-field-fieldset-container-V3zKZ48g.js → gux-form-field-fieldset-container-D4XkeSFs.js} +1 -1
- package/dist/esm/gux-form-field-file-beta.entry.js +6 -6
- package/dist/esm/gux-form-field-file.entry.js +5 -5
- package/dist/esm/gux-form-field-input-clear-button.entry.js +3 -3
- package/dist/esm/gux-form-field-label-indicator.entry.js +3 -3
- package/dist/esm/gux-form-field-number_2.entry.js +7 -7
- package/dist/esm/gux-form-field-phone.entry.js +6 -6
- package/dist/esm/gux-form-field-radio-group-beta.entry.js +6 -6
- package/dist/esm/gux-form-field-radio.entry.js +4 -4
- package/dist/esm/gux-form-field-range.entry.js +6 -6
- package/dist/esm/gux-form-field-search.entry.js +5 -5
- package/dist/esm/gux-form-field-select.entry.js +5 -5
- package/dist/esm/gux-form-field-text-like.entry.js +7 -7
- package/dist/esm/gux-form-field-textarea.entry.js +7 -7
- package/dist/esm/gux-form-field-time-picker.entry.js +6 -6
- package/dist/esm/gux-form-field-time-zone-picker.entry.js +6 -6
- package/dist/esm/gux-form-fieldset-heading.entry.js +1 -1
- package/dist/esm/gux-form-footer.entry.js +2 -2
- package/dist/esm/gux-form-heading.entry.js +1 -1
- package/dist/esm/gux-icon-tooltip-beta.entry.js +2 -2
- package/dist/esm/gux-icon.entry.js +2 -2
- package/dist/esm/gux-illustration-beta.entry.js +3 -3
- package/dist/esm/gux-inline-alert.entry.js +3 -3
- package/dist/esm/gux-inline-dropdown-beta.entry.js +5 -5
- package/dist/esm/gux-label-info-beta.entry.js +2 -2
- package/dist/esm/gux-leaf-multi.entry.js +2 -2
- package/dist/esm/gux-leaf.entry.js +2 -2
- package/dist/esm/gux-link-beta.entry.js +2 -2
- package/dist/esm/gux-list-divider.entry.js +1 -1
- package/dist/esm/gux-list-item.entry.js +1 -1
- package/dist/esm/gux-list.entry.js +2 -2
- package/dist/esm/gux-listbox-multi.entry.js +4 -4
- package/dist/esm/gux-loading-message.entry.js +2 -2
- package/dist/esm/gux-logo-beta.entry.js +3 -3
- package/dist/esm/gux-logomark-beta.entry.js +3 -3
- package/dist/esm/gux-menu-option.entry.js +3 -3
- package/dist/esm/gux-menu.entry.js +1 -1
- package/dist/esm/gux-modal-legacy.entry.js +2 -2
- package/dist/esm/gux-modal-side-panel-beta.entry.js +2 -2
- package/dist/esm/gux-modal.entry.js +2 -2
- package/dist/esm/gux-month-calendar.entry.js +2 -2
- package/dist/esm/gux-month-list_2.entry.js +1 -1
- package/dist/esm/gux-month-picker-beta.entry.js +4 -4
- package/dist/esm/gux-notification-indicator-beta.entry.js +2 -2
- package/dist/esm/gux-notification-toast-legacy.entry.js +2 -2
- package/dist/esm/gux-option-group-beta.entry.js +1 -1
- package/dist/esm/gux-option-icon.entry.js +1 -1
- package/dist/esm/gux-option-multi.entry.js +2 -2
- package/dist/esm/gux-option-status-beta.entry.js +1 -1
- package/dist/esm/gux-page-loading-spinner.entry.js +2 -2
- package/dist/esm/gux-pagination-buttons-legacy_3.entry.js +2 -2
- package/dist/esm/gux-pagination-buttons_2.entry.js +2 -2
- package/dist/esm/gux-pagination-cursor.entry.js +3 -3
- package/dist/esm/gux-pagination-items-per-page.entry.js +2 -2
- package/dist/esm/gux-pagination-legacy.entry.js +2 -2
- package/dist/esm/gux-pagination.entry.js +2 -2
- package/dist/esm/gux-phone-input-beta.entry.js +4 -4
- package/dist/esm/gux-popover-beta.entry.js +19 -16
- package/dist/esm/gux-popover-list-beta.entry.js +4 -4
- package/dist/esm/gux-popover-list.entry.js +4 -4
- package/dist/esm/gux-popup.entry.js +2 -2
- package/dist/esm/gux-prompt-input-beta.entry.js +3 -3
- package/dist/esm/gux-radial-loading.entry.js +3 -3
- package/dist/esm/gux-radial-progress.entry.js +2 -2
- package/dist/esm/gux-rating.entry.js +4 -4
- package/dist/esm/gux-rich-highlight-list-item.entry.js +3 -3
- package/dist/esm/gux-rich-style-list-item_3.entry.js +5 -5
- package/dist/esm/gux-rich-text-editor-action-group.entry.js +1 -1
- package/dist/esm/gux-rich-text-editor-action-link.entry.js +4 -4
- package/dist/esm/gux-rich-text-editor-action-rich-style.entry.js +4 -4
- package/dist/esm/gux-rich-text-editor-action-text-highlight.entry.js +4 -4
- package/dist/esm/gux-rich-text-editor-action.entry.js +3 -3
- package/dist/esm/gux-rich-text-editor-beta.entry.js +15 -9
- package/dist/esm/gux-rich-text-editor-list.entry.js +2 -2
- package/dist/esm/gux-row-select.entry.js +2 -2
- package/dist/esm/gux-screen-reader-beta.entry.js +2 -2
- package/dist/esm/gux-segmented-control-beta.entry.js +2 -2
- package/dist/esm/gux-segmented-control-divider.entry.js +1 -1
- package/dist/esm/gux-segmented-control-item.entry.js +1 -1
- package/dist/esm/gux-select-all.entry.js +2 -2
- package/dist/esm/gux-selector-card-beta.entry.js +2 -2
- package/dist/esm/gux-selector-cards-beta.entry.js +2 -2
- package/dist/esm/gux-side-panel-beta.entry.js +2 -2
- package/dist/esm/gux-side-panel-header-mini.entry.js +3 -3
- package/dist/esm/gux-side-panel-header.entry.js +2 -2
- package/dist/esm/gux-side-panel-heading.entry.js +2 -2
- package/dist/esm/gux-simple-toast-legacy.entry.js +2 -2
- package/dist/esm/gux-skip-navigation-item.entry.js +1 -1
- package/dist/esm/gux-skip-navigation-list.entry.js +3 -3
- package/dist/esm/gux-sort-control.entry.js +3 -3
- package/dist/esm/gux-status-indicator-beta.entry.js +2 -2
- package/dist/esm/gux-step-title.entry.js +2 -2
- package/dist/esm/gux-step.entry.js +2 -2
- package/dist/esm/gux-stepper-beta.entry.js +2 -2
- package/dist/esm/gux-submenu.entry.js +6 -6
- package/dist/esm/gux-switch-item.entry.js +1 -1
- package/dist/esm/gux-switch-legacy.entry.js +2 -2
- package/dist/esm/gux-tab-advanced-list.entry.js +79 -93
- package/dist/esm/gux-tab-advanced-panel.entry.js +1 -1
- package/dist/esm/gux-tab-advanced.entry.js +2 -2
- package/dist/esm/gux-tab-list.entry.js +3 -3
- package/dist/esm/gux-tab-panel.entry.js +1 -1
- package/dist/esm/gux-tab.entry.js +1 -1
- package/dist/esm/gux-table-select-menu.entry.js +2 -2
- package/dist/esm/gux-table-toolbar-action.entry.js +3 -3
- package/dist/esm/gux-table-toolbar-custom-action.entry.js +2 -2
- package/dist/esm/gux-table-toolbar-menu-button.entry.js +4 -4
- package/dist/esm/gux-table-toolbar.entry.js +4 -4
- package/dist/esm/gux-table.entry.js +11 -4
- package/dist/esm/gux-tabs-advanced.entry.js +2 -2
- package/dist/esm/gux-tabs.entry.js +3 -3
- package/dist/esm/gux-tag.entry.js +4 -4
- package/dist/esm/gux-text-highlight.entry.js +2 -2
- package/dist/esm/gux-time-beta.entry.js +4 -4
- package/dist/esm/gux-time-picker.entry.js +4 -4
- package/dist/esm/gux-time-zone-beta.entry.js +3 -3
- package/dist/esm/gux-time-zone-picker-beta.entry.js +3 -3
- package/dist/esm/gux-toast.entry.js +2 -2
- package/dist/esm/gux-toggle-slider.entry.js +1 -1
- package/dist/esm/gux-toggle.entry.js +3 -3
- package/dist/esm/gux-tooltip-base-beta_2.entry.js +4 -4
- package/dist/esm/gux-tooltip-pointer-beta.entry.js +2 -2
- package/dist/esm/gux-tooltip-title.entry.js +3 -3
- package/dist/esm/gux-tooltip_2.entry.js +6 -6
- package/dist/esm/gux-tree-beta.entry.js +3 -3
- package/dist/esm/gux-tree-dropdown-beta.entry.js +5 -5
- package/dist/esm/gux-tree-multi-beta.entry.js +3 -3
- package/dist/esm/{gux-tree-multi.service-DDTCiza2.js → gux-tree-multi.service-CIAxXzNO.js} +1 -1
- package/dist/esm/{gux-tree.service--PF44v65.js → gux-tree.service-BenusRE2.js} +1 -1
- package/dist/esm/{index-CtJlU2pR.js → index-CBZRYI-e.js} +36 -9
- package/dist/esm/{index-DicTjeXq.js → index-DKBT_eWB.js} +409 -773
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{on-click-outside-DvnPj58Q.js → on-click-outside-B-hs51PE.js} +1 -1
- package/dist/esm/{on-mutation-CLCUvmaC.js → on-mutation-BjlO-CEA.js} +1 -1
- package/dist/esm/{on-resize-PPwHsBey.js → on-resize-Dcfa4yPL.js} +1 -1
- package/dist/esm/{overflow-detection-CBtlRuho.js → overflow-detection-CpAXvqj6.js} +1 -1
- package/dist/esm/{usage-D_JNwzDi.js → usage-d58ENWqi.js} +1 -1
- package/dist/genesys-webcomponents/genesys-webcomponents.esm.js +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.da.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.fr-ca.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.pt-pt.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.sv.json +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.uk.json +1 -1
- package/dist/genesys-webcomponents/{p-7fe33028.entry.js → p-02601548.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-25cf6c36.entry.js → p-0319cc8e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-badeb3b7.entry.js → p-036b40a8.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-0371fbec.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-b0eb317e.entry.js → p-04dfc791.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-db6c0447.entry.js → p-05821d4a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a95e0f7c.entry.js → p-05a72351.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d482cccc.entry.js → p-072fed05.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8e4d91f7.entry.js → p-0a43980c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-daeb6670.entry.js → p-0a582eab.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d0e3f4e1.entry.js → p-0bd9be8f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-04968180.entry.js → p-119aaead.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4fa51a91.entry.js → p-131d7452.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3f314818.entry.js → p-140db5a0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b189b13f.entry.js → p-174abce9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a12c3938.entry.js → p-1a2b4ede.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-09cb6c96.entry.js → p-1bce9d6e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-88b2102e.entry.js → p-1dc237e2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4b3eb7fe.entry.js → p-1e36dab4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-effb3f83.entry.js → p-1f3ab5c7.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-1fb01d8c.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-321d6c7f.entry.js → p-24ba174b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9005d1e5.entry.js → p-270b0ad2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7030cb25.entry.js → p-27a384db.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ed0458ad.entry.js → p-28141ea4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a0ed5fbd.entry.js → p-2942ce13.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a19741e6.entry.js → p-2aef0a61.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b9291975.entry.js → p-2b78e650.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-61bdd820.entry.js → p-2bc38c1e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-530d710a.entry.js → p-2dfb9a94.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d2111647.entry.js → p-2ecd7135.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4e15c21b.entry.js → p-2f9993f8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-285ef139.entry.js → p-300e76ad.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c97698c1.entry.js → p-347b7212.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4519702d.entry.js → p-36bda83b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2892a163.entry.js → p-377bd4e0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8c872aea.entry.js → p-379dce17.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0842ea9e.entry.js → p-37f25533.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-43f49208.entry.js → p-3826962a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-46193e6c.entry.js → p-389c4479.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f85017d8.entry.js → p-39e432ce.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-394fdf0a.entry.js → p-3b352f05.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d0c9d9ce.entry.js → p-3b89ab29.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-3bdee8c3.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-501d5879.entry.js → p-400c0b28.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-79cab3be.entry.js → p-41b0c959.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4eca2ce8.entry.js → p-431ebca7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f271ccd9.entry.js → p-44069b9a.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-4433c626.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-49b732df.entry.js → p-488aadcf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bf8427d4.entry.js → p-48d6d071.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7b4f6df2.entry.js → p-49790c9b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8d545d05.entry.js → p-4d503ae0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c0c58955.entry.js → p-4fa0f6e2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ed9f6737.entry.js → p-504d5a37.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fc420152.entry.js → p-505fa881.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3818fd77.entry.js → p-54a2a513.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7a0cca0b.entry.js → p-555c4bb5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-61189c85.entry.js → p-56b21eac.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-66ec044e.entry.js → p-5795be45.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-924ba239.entry.js → p-57b7d0b3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a13b41f4.entry.js → p-57bfaf5b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f071f921.entry.js → p-58069712.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4ccd37e5.entry.js → p-59091884.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-76d66a33.entry.js → p-5e16e39c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fcf34930.entry.js → p-60f89824.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1b989ec7.entry.js → p-6471b6f9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a50368e4.entry.js → p-666349fb.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2b8d67f5.entry.js → p-6693a111.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7f740bdc.entry.js → p-6a9815fa.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4165025e.entry.js → p-701b2dfe.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-59849521.entry.js → p-70b5e4f8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-18593bd2.entry.js → p-721dad70.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-732fe390.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-4f76a688.entry.js → p-7347857e.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-7398f2f5.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-20215ba6.entry.js → p-74a3484c.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-74f685f8.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-f25fecfa.entry.js → p-75203ceb.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-756d304c.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-93d41c3d.entry.js → p-756f5cae.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4a9e8283.entry.js → p-761c5bfc.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-208ba91f.entry.js → p-766d251c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e6280d4b.entry.js → p-7b26acb5.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-7ce4b999.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-99b89080.entry.js → p-7cfa2b88.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b1908995.entry.js → p-7d9e0461.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d5e3aec1.entry.js → p-7dbe6041.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9d927c76.entry.js → p-7ee40b44.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-17d21cdc.entry.js → p-7fcbc905.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-88841b08.entry.js → p-80b0002e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-629f1606.entry.js → p-810551aa.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-825dea46.entry.js → p-81804a91.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0ca4980f.entry.js → p-847c74c5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e3e3338f.entry.js → p-84fdb6a6.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d846d567.entry.js → p-8558f3ee.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5b35aa6b.entry.js → p-868b819b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-21e30a87.entry.js → p-8b4d8f86.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e1aa758e.entry.js → p-8c89986a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7a82ec95.entry.js → p-8ca8c8e8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d9da4cb2.entry.js → p-8d9d9945.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ffb198fc.entry.js → p-8da417e1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c820df5f.entry.js → p-8e3cca70.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-8f58625c.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-b72749a0.entry.js → p-8fa313c3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1150212c.entry.js → p-8fc6c43e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5ecaddf7.entry.js → p-93d6432f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a53adad9.entry.js → p-9927fe8d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5461d89a.entry.js → p-9a3691e5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1145d3c3.entry.js → p-9aad71e5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d1d138db.entry.js → p-9d842c35.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-742a5aeb.entry.js → p-9d8f8b04.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e7fbfb5b.entry.js → p-9e584520.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ec811968.entry.js → p-9f45ca27.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9a92dec5.entry.js → p-9f926fd7.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-BFTNmhzP.js +1 -0
- package/dist/genesys-webcomponents/p-BLndZcXP.js +1 -0
- package/dist/genesys-webcomponents/p-BRvLWeU-.js +1 -0
- package/dist/genesys-webcomponents/{p-CZu7FF2m.js → p-BTcND-V9.js} +1 -1
- package/dist/genesys-webcomponents/{p-Dc4kLPnc.js → p-BY1Z9s-d.js} +1 -1
- package/dist/genesys-webcomponents/p-CBOPktOE.js +1 -0
- package/dist/genesys-webcomponents/{p-CtJlU2pR.js → p-CBZRYI-e.js} +2 -2
- package/dist/genesys-webcomponents/{p-CQsL0TUe.js → p-CLgkPriK.js} +1 -1
- package/dist/genesys-webcomponents/p-CTJc4utt.js +1 -0
- package/dist/genesys-webcomponents/{p-CJS5b2Zs.js → p-Ch7MIpxK.js} +1 -1
- package/dist/genesys-webcomponents/{p-DxOB_U0E.js → p-DknVE5Yu.js} +1 -1
- package/dist/genesys-webcomponents/p-DwAkUtfc.js +1 -0
- package/dist/genesys-webcomponents/{p-TPLfzlH9.js → p-SF31Tbcy.js} +1 -1
- package/dist/genesys-webcomponents/p-a0f9eb8e.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-f754cd61.entry.js → p-a144ac7a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-415dff77.entry.js → p-a93d6f13.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-db7c51a7.entry.js → p-a9e1ac59.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0fc664bf.entry.js → p-ab00c9a9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4a6b2623.entry.js → p-abde77c8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-77bf29cd.entry.js → p-adb993d7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c09d0061.entry.js → p-ae5ed395.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9d6751a1.entry.js → p-aeb14476.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3ec885a4.entry.js → p-aecb6540.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-43917ff4.entry.js → p-af9ad80b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7bc13bcd.entry.js → p-b01fa50d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b5fecfd4.entry.js → p-b2948e28.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9458df35.entry.js → p-b29a03cf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8b2d923c.entry.js → p-b358862c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bed1ebc4.entry.js → p-b4008b25.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-97e4d5dd.entry.js → p-b4d31ead.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1d10fd3b.entry.js → p-b7c9b050.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0f18e5f3.entry.js → p-b83ae7c7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-be6cdb80.entry.js → p-baa7e646.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-816ab59f.entry.js → p-bb434389.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8c88deaf.entry.js → p-bcab1696.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f833f31b.entry.js → p-be418dab.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8e2322ea.entry.js → p-bfb72d48.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e6de94f6.entry.js → p-bff48461.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-674e8dc8.entry.js → p-c298b26b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-05fec4d8.entry.js → p-c2b24d5b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e795d149.entry.js → p-c3fd95c5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9db2c6aa.entry.js → p-c41cae11.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9bb44053.entry.js → p-c6154b39.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-c887ff77.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-8d20353a.entry.js → p-c9a27482.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1baf3a6b.entry.js → p-ca5a210b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c6930837.entry.js → p-cb3b9c23.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-22933f03.entry.js → p-cb802c7c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-37b84411.entry.js → p-cc5f7def.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b1fc1154.entry.js → p-cd80549c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-Y2jQoKOm.js → p-d-448h8N.js} +1 -1
- package/dist/genesys-webcomponents/{p-5c4d8cc7.entry.js → p-d05628ba.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c45659f1.entry.js → p-d48bf262.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-D_JNwzDi.js → p-d58ENWqi.js} +1 -1
- package/dist/genesys-webcomponents/{p-6bb17e6a.entry.js → p-da137d68.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d79be496.entry.js → p-dbc0fcfa.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f8c7d267.entry.js → p-dddeed2d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3f49fa15.entry.js → p-dde23640.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-e08f3a34.entry.js +7 -0
- package/dist/genesys-webcomponents/{p-43ef64aa.entry.js → p-e0c6e049.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d84f1625.entry.js → p-e18cb7ce.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-847e12a8.entry.js → p-e24e5bf4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-045d73ca.entry.js → p-e55657f9.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-e7d86f9a.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-a618b228.entry.js → p-e810918f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ef02365f.entry.js → p-eb2e6da4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1796a988.entry.js → p-ec3e488f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-82e1d4d3.entry.js → p-ec9e6d4b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1ebb52dc.entry.js → p-ecd87f23.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-50668ce1.entry.js → p-edfada35.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-ee5dd884.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-bac7a9a3.entry.js → p-eea586b5.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-eee3f09b.entry.js +1 -0
- package/dist/genesys-webcomponents/p-eff18951.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-43ade8e9.entry.js → p-f1001c59.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-90b56423.entry.js → p-f27658d3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d79bfcb6.entry.js → p-f32ccfe6.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e6f1d760.entry.js → p-f498141e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-cc9eed46.entry.js → p-f5dab601.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-28ebcb76.entry.js → p-f71a9626.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-27872ad8.entry.js → p-f97d3253.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7cdf41e2.entry.js → p-fa377c35.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-794cf57b.entry.js → p-fac85bd5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-362147d9.entry.js → p-fd2ea4c4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5b9b739f.entry.js → p-ff56753c.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/components/beta/gux-popover-beta/gux-popover.d.ts +1 -0
- package/dist/types/components/beta/gux-rich-text-editor/gux-rich-text-editor-beta.d.ts +2 -0
- package/dist/types/components/stable/gux-table/gux-table.d.ts +2 -0
- package/dist/types/components/stable/gux-table/tests/gux-table.common.d.ts +4 -0
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +8 -8
- package/dist/genesys-webcomponents/p-18e7fd4b.entry.js +0 -1
- package/dist/genesys-webcomponents/p-296b109f.entry.js +0 -1
- package/dist/genesys-webcomponents/p-2b7a40df.entry.js +0 -1
- package/dist/genesys-webcomponents/p-3_lZiJlW.js +0 -1
- package/dist/genesys-webcomponents/p-3f838c40.entry.js +0 -1
- package/dist/genesys-webcomponents/p-486786a2.entry.js +0 -1
- package/dist/genesys-webcomponents/p-588fee99.entry.js +0 -1
- package/dist/genesys-webcomponents/p-6fe87496.entry.js +0 -1
- package/dist/genesys-webcomponents/p-7e0ab78c.entry.js +0 -1
- package/dist/genesys-webcomponents/p-88ec2744.entry.js +0 -1
- package/dist/genesys-webcomponents/p-8be8c355.entry.js +0 -1
- package/dist/genesys-webcomponents/p-8w8ltg_h.js +0 -1
- package/dist/genesys-webcomponents/p-9e9aaf9f.entry.js +0 -1
- package/dist/genesys-webcomponents/p-9f947560.entry.js +0 -7
- package/dist/genesys-webcomponents/p-BtyAIt6b.js +0 -1
- package/dist/genesys-webcomponents/p-CRHTf_An.js +0 -1
- package/dist/genesys-webcomponents/p-VP5Cxz7T.js +0 -1
- package/dist/genesys-webcomponents/p-bfda6d0b.entry.js +0 -1
- package/dist/genesys-webcomponents/p-c4bf7350.entry.js +0 -1
- package/dist/genesys-webcomponents/p-d15f3152.entry.js +0 -1
- package/dist/genesys-webcomponents/p-d68a0521.entry.js +0 -1
- package/dist/genesys-webcomponents/p-e66913bc.entry.js +0 -1
- package/dist/genesys-webcomponents/p-s89OxFk-.js +0 -1
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-ChcZBLNR.js');
|
|
4
4
|
var getClosestElement = require('./get-closest-element-CfyZl7i7.js');
|
|
5
5
|
|
|
6
|
+
//#region packages/fast-memoize/index.ts
|
|
6
7
|
function memoize(fn, options) {
|
|
7
8
|
const cache = options && options.cache ? options.cache : cacheDefault;
|
|
8
9
|
const serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
9
|
-
|
|
10
|
-
return strategy(fn, {
|
|
10
|
+
return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
|
|
11
11
|
cache,
|
|
12
12
|
serializer
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
//
|
|
16
|
-
// Strategy
|
|
17
|
-
//
|
|
18
15
|
function isPrimitive(value) {
|
|
19
16
|
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
20
17
|
}
|
|
@@ -47,17 +44,10 @@ function strategyDefault(fn, options) {
|
|
|
47
44
|
function strategyVariadic(fn, options) {
|
|
48
45
|
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
49
46
|
}
|
|
50
|
-
//
|
|
51
|
-
// Serializer
|
|
52
|
-
//
|
|
53
47
|
const serializerDefault = function() {
|
|
54
48
|
return JSON.stringify(arguments);
|
|
55
49
|
};
|
|
56
|
-
|
|
57
|
-
// Cache
|
|
58
|
-
//
|
|
59
|
-
class ObjectWithoutPrototypeCache {
|
|
60
|
-
cache;
|
|
50
|
+
var ObjectWithoutPrototypeCache = class {
|
|
61
51
|
constructor() {
|
|
62
52
|
this.cache = Object.create(null);
|
|
63
53
|
}
|
|
@@ -67,13 +57,14 @@ class ObjectWithoutPrototypeCache {
|
|
|
67
57
|
set(key, value) {
|
|
68
58
|
this.cache[key] = value;
|
|
69
59
|
}
|
|
70
|
-
}
|
|
60
|
+
};
|
|
71
61
|
const cacheDefault = { create: function create() {
|
|
72
62
|
return new ObjectWithoutPrototypeCache();
|
|
73
63
|
} };
|
|
74
64
|
const strategies = {
|
|
75
65
|
variadic: strategyVariadic};
|
|
76
66
|
|
|
67
|
+
//#region packages/icu-skeleton-parser/date-time.ts
|
|
77
68
|
/**
|
|
78
69
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
79
70
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
@@ -125,9 +116,7 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
125
116
|
result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
126
117
|
break;
|
|
127
118
|
case "e":
|
|
128
|
-
if (len < 4)
|
|
129
|
-
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
130
|
-
}
|
|
119
|
+
if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
131
120
|
result.weekday = [
|
|
132
121
|
"short",
|
|
133
122
|
"long",
|
|
@@ -136,9 +125,7 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
136
125
|
][len - 4];
|
|
137
126
|
break;
|
|
138
127
|
case "c":
|
|
139
|
-
if (len < 4)
|
|
140
|
-
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
141
|
-
}
|
|
128
|
+
if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
142
129
|
result.weekday = [
|
|
143
130
|
"short",
|
|
144
131
|
"long",
|
|
@@ -192,28 +179,20 @@ function parseDateTimeSkeleton(skeleton) {
|
|
|
192
179
|
});
|
|
193
180
|
return result;
|
|
194
181
|
}
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js
|
|
197
184
|
const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
198
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region packages/icu-skeleton-parser/number.ts
|
|
199
187
|
function parseNumberSkeletonFromString(skeleton) {
|
|
200
|
-
if (skeleton.length === 0)
|
|
201
|
-
throw new Error("Number skeleton cannot be empty");
|
|
202
|
-
}
|
|
203
|
-
// Parse the skeleton
|
|
188
|
+
if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty");
|
|
204
189
|
const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0);
|
|
205
190
|
const tokens = [];
|
|
206
191
|
for (const stringToken of stringTokens) {
|
|
207
192
|
let stemAndOptions = stringToken.split("/");
|
|
208
|
-
if (stemAndOptions.length === 0)
|
|
209
|
-
throw new Error("Invalid number skeleton");
|
|
210
|
-
}
|
|
193
|
+
if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton");
|
|
211
194
|
const [stem, ...options] = stemAndOptions;
|
|
212
|
-
for (const option of options)
|
|
213
|
-
if (option.length === 0) {
|
|
214
|
-
throw new Error("Invalid number skeleton");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
195
|
+
for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton");
|
|
217
196
|
tokens.push({
|
|
218
197
|
stem,
|
|
219
198
|
options
|
|
@@ -230,21 +209,15 @@ const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
|
230
209
|
const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
231
210
|
function parseSignificantPrecision(str) {
|
|
232
211
|
const result = {};
|
|
233
|
-
if (str[str.length - 1] === "r")
|
|
234
|
-
|
|
235
|
-
} else if (str[str.length - 1] === "s") {
|
|
236
|
-
result.roundingPriority = "lessPrecision";
|
|
237
|
-
}
|
|
212
|
+
if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision";
|
|
213
|
+
else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision";
|
|
238
214
|
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
239
|
-
// @@@ case
|
|
240
215
|
if (typeof g2 !== "string") {
|
|
241
216
|
result.minimumSignificantDigits = g1.length;
|
|
242
217
|
result.maximumSignificantDigits = g1.length;
|
|
243
|
-
} else if (g2 === "+")
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
result.maximumSignificantDigits = g1.length;
|
|
247
|
-
} else {
|
|
218
|
+
} else if (g2 === "+") result.minimumSignificantDigits = g1.length;
|
|
219
|
+
else if (g1[0] === "#") result.maximumSignificantDigits = g1.length;
|
|
220
|
+
else {
|
|
248
221
|
result.minimumSignificantDigits = g1.length;
|
|
249
222
|
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
250
223
|
}
|
|
@@ -276,7 +249,6 @@ function parseSign(str) {
|
|
|
276
249
|
}
|
|
277
250
|
}
|
|
278
251
|
function parseConciseScientificAndEngineeringStem(stem) {
|
|
279
|
-
// Engineering
|
|
280
252
|
let result;
|
|
281
253
|
if (stem[0] === "E" && stem[1] === "E") {
|
|
282
254
|
result = { notation: "engineering" };
|
|
@@ -294,9 +266,7 @@ function parseConciseScientificAndEngineeringStem(stem) {
|
|
|
294
266
|
result.signDisplay = "exceptZero";
|
|
295
267
|
stem = stem.slice(2);
|
|
296
268
|
}
|
|
297
|
-
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem))
|
|
298
|
-
throw new Error("Malformed concise eng/scientific notation");
|
|
299
|
-
}
|
|
269
|
+
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation");
|
|
300
270
|
result.minimumIntegerDigits = stem.length;
|
|
301
271
|
}
|
|
302
272
|
return result;
|
|
@@ -304,9 +274,7 @@ function parseConciseScientificAndEngineeringStem(stem) {
|
|
|
304
274
|
function parseNotationOptions(opt) {
|
|
305
275
|
const result = {};
|
|
306
276
|
const signOpts = parseSign(opt);
|
|
307
|
-
if (signOpts)
|
|
308
|
-
return signOpts;
|
|
309
|
-
}
|
|
277
|
+
if (signOpts) return signOpts;
|
|
310
278
|
return result;
|
|
311
279
|
}
|
|
312
280
|
/**
|
|
@@ -414,40 +382,25 @@ function parseNumberSkeleton(tokens) {
|
|
|
414
382
|
result.roundingMode = "halfExpand";
|
|
415
383
|
continue;
|
|
416
384
|
case "integer-width":
|
|
417
|
-
if (token.options.length > 1)
|
|
418
|
-
throw new RangeError("integer-width stems only accept a single optional option");
|
|
419
|
-
}
|
|
385
|
+
if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option");
|
|
420
386
|
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
421
|
-
if (g1)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
throw new Error("We currently do not support maximum integer digits");
|
|
425
|
-
} else if (g5) {
|
|
426
|
-
throw new Error("We currently do not support exact integer digits");
|
|
427
|
-
}
|
|
387
|
+
if (g1) result.minimumIntegerDigits = g2.length;
|
|
388
|
+
else if (g3 && g4) throw new Error("We currently do not support maximum integer digits");
|
|
389
|
+
else if (g5) throw new Error("We currently do not support exact integer digits");
|
|
428
390
|
return "";
|
|
429
391
|
});
|
|
430
392
|
continue;
|
|
431
393
|
}
|
|
432
|
-
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
433
394
|
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
|
|
434
395
|
result.minimumIntegerDigits = token.stem.length;
|
|
435
396
|
continue;
|
|
436
397
|
}
|
|
437
398
|
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
|
|
438
|
-
|
|
439
|
-
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
440
|
-
// precision-integer case
|
|
441
|
-
if (token.options.length > 1) {
|
|
442
|
-
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
443
|
-
}
|
|
399
|
+
if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
444
400
|
token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
445
|
-
|
|
446
|
-
if (
|
|
447
|
-
|
|
448
|
-
} else if (g3 && g3[0] === "#") {
|
|
449
|
-
result.maximumFractionDigits = g3.length;
|
|
450
|
-
} else if (g4 && g5) {
|
|
401
|
+
if (g2 === "*") result.minimumFractionDigits = g1.length;
|
|
402
|
+
else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length;
|
|
403
|
+
else if (g4 && g5) {
|
|
451
404
|
result.minimumFractionDigits = g4.length;
|
|
452
405
|
result.maximumFractionDigits = g4.length + g5.length;
|
|
453
406
|
} else {
|
|
@@ -457,21 +410,16 @@ function parseNumberSkeleton(tokens) {
|
|
|
457
410
|
return "";
|
|
458
411
|
});
|
|
459
412
|
const opt = token.options[0];
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
...result,
|
|
469
|
-
...parseSignificantPrecision(opt)
|
|
470
|
-
};
|
|
471
|
-
}
|
|
413
|
+
if (opt === "w") result = {
|
|
414
|
+
...result,
|
|
415
|
+
trailingZeroDisplay: "stripIfInteger"
|
|
416
|
+
};
|
|
417
|
+
else if (opt) result = {
|
|
418
|
+
...result,
|
|
419
|
+
...parseSignificantPrecision(opt)
|
|
420
|
+
};
|
|
472
421
|
continue;
|
|
473
422
|
}
|
|
474
|
-
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
475
423
|
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
|
|
476
424
|
result = {
|
|
477
425
|
...result,
|
|
@@ -480,23 +428,85 @@ function parseNumberSkeleton(tokens) {
|
|
|
480
428
|
continue;
|
|
481
429
|
}
|
|
482
430
|
const signOpts = parseSign(token.stem);
|
|
483
|
-
if (signOpts) {
|
|
484
|
-
result
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
};
|
|
488
|
-
}
|
|
431
|
+
if (signOpts) result = {
|
|
432
|
+
...result,
|
|
433
|
+
...signOpts
|
|
434
|
+
};
|
|
489
435
|
const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
|
|
490
|
-
if (conciseScientificAndEngineeringOpts) {
|
|
491
|
-
result
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
};
|
|
495
|
-
}
|
|
436
|
+
if (conciseScientificAndEngineeringOpts) result = {
|
|
437
|
+
...result,
|
|
438
|
+
...conciseScientificAndEngineeringOpts
|
|
439
|
+
};
|
|
496
440
|
}
|
|
497
441
|
return result;
|
|
498
442
|
}
|
|
499
443
|
|
|
444
|
+
//#region packages/icu-messageformat-parser/error.ts
|
|
445
|
+
let ErrorKind = /* @__PURE__ */ function(ErrorKind) {
|
|
446
|
+
/** Argument is unclosed (e.g. `{0`) */
|
|
447
|
+
ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
|
|
448
|
+
/** Argument is empty (e.g. `{}`). */
|
|
449
|
+
ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
|
|
450
|
+
/** Argument is malformed (e.g. `{foo!}``) */
|
|
451
|
+
ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
|
|
452
|
+
/** Expect an argument type (e.g. `{foo,}`) */
|
|
453
|
+
ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
|
|
454
|
+
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
455
|
+
ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
|
|
456
|
+
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
457
|
+
ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
|
|
458
|
+
/** The number skeleton is invalid. */
|
|
459
|
+
ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
|
|
460
|
+
/** The date time skeleton is invalid. */
|
|
461
|
+
ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
|
|
462
|
+
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
463
|
+
ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
|
|
464
|
+
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
465
|
+
ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
|
|
466
|
+
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
467
|
+
ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
|
|
468
|
+
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
469
|
+
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
|
|
470
|
+
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
471
|
+
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
472
|
+
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
473
|
+
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
474
|
+
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
475
|
+
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
|
|
476
|
+
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
477
|
+
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
|
|
478
|
+
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
479
|
+
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
|
|
480
|
+
/**
|
|
481
|
+
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
482
|
+
* (e.g. `{foo, plural, one}`)
|
|
483
|
+
*/
|
|
484
|
+
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
|
|
485
|
+
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
486
|
+
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
|
|
487
|
+
/**
|
|
488
|
+
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
489
|
+
* (e.g. {foo, plural, one {#} one {#}})
|
|
490
|
+
*/
|
|
491
|
+
ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
|
|
492
|
+
/** Duplicate selectors in `select` argument.
|
|
493
|
+
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
494
|
+
*/
|
|
495
|
+
ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
|
|
496
|
+
/** Plural or select argument option must have `other` clause. */
|
|
497
|
+
ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
|
|
498
|
+
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
499
|
+
ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG";
|
|
500
|
+
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
501
|
+
ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
|
|
502
|
+
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
503
|
+
ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
|
|
504
|
+
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
505
|
+
ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
506
|
+
return ErrorKind;
|
|
507
|
+
}({});
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region packages/icu-messageformat-parser/types.ts
|
|
500
510
|
let TYPE = /* @__PURE__ */ function(TYPE) {
|
|
501
511
|
/**
|
|
502
512
|
* Raw text
|
|
@@ -578,76 +588,11 @@ function isNumberSkeleton(el) {
|
|
|
578
588
|
function isDateTimeSkeleton(el) {
|
|
579
589
|
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
580
590
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
/** Argument is unclosed (e.g. `{0`) */
|
|
584
|
-
ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
|
|
585
|
-
/** Argument is empty (e.g. `{}`). */
|
|
586
|
-
ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
|
|
587
|
-
/** Argument is malformed (e.g. `{foo!}``) */
|
|
588
|
-
ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
|
|
589
|
-
/** Expect an argument type (e.g. `{foo,}`) */
|
|
590
|
-
ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
|
|
591
|
-
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
592
|
-
ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
|
|
593
|
-
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
594
|
-
ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
|
|
595
|
-
/** The number skeleton is invalid. */
|
|
596
|
-
ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
|
|
597
|
-
/** The date time skeleton is invalid. */
|
|
598
|
-
ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
|
|
599
|
-
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
600
|
-
ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
|
|
601
|
-
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
602
|
-
ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
|
|
603
|
-
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
604
|
-
ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
|
|
605
|
-
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
606
|
-
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
|
|
607
|
-
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
608
|
-
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
609
|
-
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
610
|
-
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
611
|
-
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
612
|
-
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
|
|
613
|
-
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
614
|
-
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
|
|
615
|
-
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
616
|
-
ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
|
|
617
|
-
/**
|
|
618
|
-
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
619
|
-
* (e.g. `{foo, plural, one}`)
|
|
620
|
-
*/
|
|
621
|
-
ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
|
|
622
|
-
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
623
|
-
ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
|
|
624
|
-
/**
|
|
625
|
-
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
626
|
-
* (e.g. {foo, plural, one {#} one {#}})
|
|
627
|
-
*/
|
|
628
|
-
ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
|
|
629
|
-
/** Duplicate selectors in `select` argument.
|
|
630
|
-
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
631
|
-
*/
|
|
632
|
-
ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
|
|
633
|
-
/** Plural or select argument option must have `other` clause. */
|
|
634
|
-
ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
|
|
635
|
-
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
636
|
-
ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG";
|
|
637
|
-
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
638
|
-
ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
|
|
639
|
-
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
640
|
-
ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
|
|
641
|
-
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
642
|
-
ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
643
|
-
return ErrorKind;
|
|
644
|
-
}({});
|
|
645
|
-
|
|
646
|
-
// @generated from regex-gen.ts
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js
|
|
647
593
|
const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
// prettier-ignore
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region node_modules/.aspect_rules_js/@formatjs_generated+cldr.core@0.0.0/node_modules/@formatjs_generated/cldr.core/time-data.js
|
|
651
596
|
const timeData = {
|
|
652
597
|
"001": ["H", "h"],
|
|
653
598
|
"419": [
|
|
@@ -1811,7 +1756,8 @@ const timeData = {
|
|
|
1811
1756
|
"h"
|
|
1812
1757
|
]
|
|
1813
1758
|
};
|
|
1814
|
-
|
|
1759
|
+
//#endregion
|
|
1760
|
+
//#region packages/icu-messageformat-parser/date-time-pattern-generator.ts
|
|
1815
1761
|
/**
|
|
1816
1762
|
* Returns the best matching date time pattern if a date time skeleton
|
|
1817
1763
|
* pattern is provided with a locale. Follows the Unicode specification:
|
|
@@ -1833,20 +1779,11 @@ function getBestPattern(skeleton, locale) {
|
|
|
1833
1779
|
let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
|
|
1834
1780
|
let dayPeriodChar = "a";
|
|
1835
1781
|
let hourChar = getDefaultHourSymbolFromLocale(locale);
|
|
1836
|
-
if (hourChar == "H" || hourChar == "k")
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
}
|
|
1842
|
-
while (hourLen-- > 0) {
|
|
1843
|
-
skeletonCopy = hourChar + skeletonCopy;
|
|
1844
|
-
}
|
|
1845
|
-
} else if (patternChar === "J") {
|
|
1846
|
-
skeletonCopy += "H";
|
|
1847
|
-
} else {
|
|
1848
|
-
skeletonCopy += patternChar;
|
|
1849
|
-
}
|
|
1782
|
+
if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0;
|
|
1783
|
+
while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar;
|
|
1784
|
+
while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy;
|
|
1785
|
+
} else if (patternChar === "J") skeletonCopy += "H";
|
|
1786
|
+
else skeletonCopy += patternChar;
|
|
1850
1787
|
}
|
|
1851
1788
|
return skeletonCopy;
|
|
1852
1789
|
}
|
|
@@ -1857,29 +1794,21 @@ function getBestPattern(skeleton, locale) {
|
|
|
1857
1794
|
*/
|
|
1858
1795
|
function getDefaultHourSymbolFromLocale(locale) {
|
|
1859
1796
|
let hourCycle = locale.hourCycle;
|
|
1860
|
-
if (hourCycle ===
|
|
1861
|
-
|
|
1862
|
-
|
|
1797
|
+
if (hourCycle === void 0 && locale.hourCycles && locale.hourCycles.length) hourCycle = locale.hourCycles[0];
|
|
1798
|
+
if (hourCycle) switch (hourCycle) {
|
|
1799
|
+
case "h24": return "k";
|
|
1800
|
+
case "h23": return "H";
|
|
1801
|
+
case "h12": return "h";
|
|
1802
|
+
case "h11": return "K";
|
|
1803
|
+
default: throw new Error("Invalid hourCycle");
|
|
1863
1804
|
}
|
|
1864
|
-
if (hourCycle) {
|
|
1865
|
-
switch (hourCycle) {
|
|
1866
|
-
case "h24": return "k";
|
|
1867
|
-
case "h23": return "H";
|
|
1868
|
-
case "h12": return "h";
|
|
1869
|
-
case "h11": return "K";
|
|
1870
|
-
default: throw new Error("Invalid hourCycle");
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
1874
1805
|
const languageTag = locale.language;
|
|
1875
1806
|
let regionTag;
|
|
1876
|
-
if (languageTag !== "root")
|
|
1877
|
-
|
|
1878
|
-
}
|
|
1879
|
-
const hourCycles = timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"];
|
|
1880
|
-
return hourCycles[0];
|
|
1807
|
+
if (languageTag !== "root") regionTag = locale.maximize().region;
|
|
1808
|
+
return (timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0];
|
|
1881
1809
|
}
|
|
1882
|
-
|
|
1810
|
+
//#endregion
|
|
1811
|
+
//#region packages/icu-messageformat-parser/parser.ts
|
|
1883
1812
|
const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`);
|
|
1884
1813
|
const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`);
|
|
1885
1814
|
function createLocation(start, end) {
|
|
@@ -1888,16 +1817,12 @@ function createLocation(start, end) {
|
|
|
1888
1817
|
end
|
|
1889
1818
|
};
|
|
1890
1819
|
}
|
|
1891
|
-
// #region Ponyfills
|
|
1892
|
-
// Consolidate these variables up top for easier toggling during debugging
|
|
1893
1820
|
const hasNativeFromEntries = !!Object.fromEntries;
|
|
1894
1821
|
const hasTrimStart = !!String.prototype.trimStart;
|
|
1895
1822
|
const hasTrimEnd = !!String.prototype.trimEnd;
|
|
1896
1823
|
const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) {
|
|
1897
1824
|
const obj = {};
|
|
1898
|
-
for (const [k, v] of entries)
|
|
1899
|
-
obj[k] = v;
|
|
1900
|
-
}
|
|
1825
|
+
for (const [k, v] of entries) obj[k] = v;
|
|
1901
1826
|
return obj;
|
|
1902
1827
|
};
|
|
1903
1828
|
const trimStart = hasTrimStart ? function trimStart(s) {
|
|
@@ -1910,20 +1835,12 @@ const trimEnd = hasTrimEnd ? function trimEnd(s) {
|
|
|
1910
1835
|
} : function trimEnd(s) {
|
|
1911
1836
|
return s.replace(SPACE_SEPARATOR_END_REGEX, "");
|
|
1912
1837
|
};
|
|
1913
|
-
|
|
1914
|
-
const IDENTIFIER_PREFIX_RE = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1838
|
+
const IDENTIFIER_PREFIX_RE = /* @__PURE__ */ new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1915
1839
|
function matchIdentifierAtIndex(s, index) {
|
|
1916
1840
|
IDENTIFIER_PREFIX_RE.lastIndex = index;
|
|
1917
|
-
|
|
1918
|
-
return match[1] ?? "";
|
|
1841
|
+
return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? "";
|
|
1919
1842
|
}
|
|
1920
|
-
|
|
1921
|
-
message;
|
|
1922
|
-
position;
|
|
1923
|
-
locale;
|
|
1924
|
-
ignoreTag;
|
|
1925
|
-
requiresOtherClause;
|
|
1926
|
-
shouldParseSkeletons;
|
|
1843
|
+
var Parser = class {
|
|
1927
1844
|
constructor(message, options = {}) {
|
|
1928
1845
|
this.message = message;
|
|
1929
1846
|
this.position = {
|
|
@@ -1937,9 +1854,7 @@ class Parser {
|
|
|
1937
1854
|
this.shouldParseSkeletons = !!options.shouldParseSkeletons;
|
|
1938
1855
|
}
|
|
1939
1856
|
parse() {
|
|
1940
|
-
if (this.offset() !== 0)
|
|
1941
|
-
throw Error("parser can only be used once");
|
|
1942
|
-
}
|
|
1857
|
+
if (this.offset() !== 0) throw Error("parser can only be used once");
|
|
1943
1858
|
return this.parseMessage(0, "", false);
|
|
1944
1859
|
}
|
|
1945
1860
|
parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
|
|
@@ -1948,36 +1863,25 @@ class Parser {
|
|
|
1948
1863
|
const char = this.char();
|
|
1949
1864
|
if (char === 123) {
|
|
1950
1865
|
const result = this.parseArgument(nestingLevel, expectingCloseTag);
|
|
1951
|
-
if (result.err)
|
|
1952
|
-
return result;
|
|
1953
|
-
}
|
|
1866
|
+
if (result.err) return result;
|
|
1954
1867
|
elements.push(result.val);
|
|
1955
|
-
} else if (char === 125 && nestingLevel > 0)
|
|
1956
|
-
|
|
1957
|
-
} else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
|
|
1868
|
+
} else if (char === 125 && nestingLevel > 0) break;
|
|
1869
|
+
else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
|
|
1958
1870
|
const position = this.clonePosition();
|
|
1959
1871
|
this.bump();
|
|
1960
1872
|
elements.push({
|
|
1961
1873
|
type: TYPE.pound,
|
|
1962
1874
|
location: createLocation(position, this.clonePosition())
|
|
1963
1875
|
});
|
|
1964
|
-
} else if (char === 60 && !this.ignoreTag && this.peek() === 47)
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
} else {
|
|
1968
|
-
return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
|
|
1969
|
-
}
|
|
1970
|
-
} else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
|
|
1876
|
+
} else if (char === 60 && !this.ignoreTag && this.peek() === 47) if (expectingCloseTag) break;
|
|
1877
|
+
else return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
|
|
1878
|
+
else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
|
|
1971
1879
|
const result = this.parseTag(nestingLevel, parentArgType);
|
|
1972
|
-
if (result.err)
|
|
1973
|
-
return result;
|
|
1974
|
-
}
|
|
1880
|
+
if (result.err) return result;
|
|
1975
1881
|
elements.push(result.val);
|
|
1976
1882
|
} else {
|
|
1977
1883
|
const result = this.parseLiteral(nestingLevel, parentArgType);
|
|
1978
|
-
if (result.err)
|
|
1979
|
-
return result;
|
|
1980
|
-
}
|
|
1884
|
+
if (result.err) return result;
|
|
1981
1885
|
elements.push(result.val);
|
|
1982
1886
|
}
|
|
1983
1887
|
}
|
|
@@ -2009,37 +1913,25 @@ class Parser {
|
|
|
2009
1913
|
this.bump();
|
|
2010
1914
|
const tagName = this.parseTagName();
|
|
2011
1915
|
this.bumpSpace();
|
|
2012
|
-
if (this.bumpIf("/>")) {
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
};
|
|
2022
|
-
} else if (this.bumpIf(">")) {
|
|
1916
|
+
if (this.bumpIf("/>")) return {
|
|
1917
|
+
val: {
|
|
1918
|
+
type: TYPE.literal,
|
|
1919
|
+
value: `<${tagName}/>`,
|
|
1920
|
+
location: createLocation(startPosition, this.clonePosition())
|
|
1921
|
+
},
|
|
1922
|
+
err: null
|
|
1923
|
+
};
|
|
1924
|
+
else if (this.bumpIf(">")) {
|
|
2023
1925
|
const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
|
|
2024
|
-
if (childrenResult.err)
|
|
2025
|
-
return childrenResult;
|
|
2026
|
-
}
|
|
1926
|
+
if (childrenResult.err) return childrenResult;
|
|
2027
1927
|
const children = childrenResult.val;
|
|
2028
|
-
// Expecting a close tag
|
|
2029
1928
|
const endTagStartPosition = this.clonePosition();
|
|
2030
1929
|
if (this.bumpIf("</")) {
|
|
2031
|
-
if (this.isEOF() || !_isAlpha(this.char()))
|
|
2032
|
-
return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2033
|
-
}
|
|
1930
|
+
if (this.isEOF() || !_isAlpha(this.char())) return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2034
1931
|
const closingTagNameStartPosition = this.clonePosition();
|
|
2035
|
-
|
|
2036
|
-
if (tagName !== closingTagName) {
|
|
2037
|
-
return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));
|
|
2038
|
-
}
|
|
1932
|
+
if (tagName !== this.parseTagName()) return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));
|
|
2039
1933
|
this.bumpSpace();
|
|
2040
|
-
if (!this.bumpIf(">"))
|
|
2041
|
-
return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2042
|
-
}
|
|
1934
|
+
if (!this.bumpIf(">")) return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2043
1935
|
return {
|
|
2044
1936
|
val: {
|
|
2045
1937
|
type: TYPE.tag,
|
|
@@ -2049,12 +1941,8 @@ class Parser {
|
|
|
2049
1941
|
},
|
|
2050
1942
|
err: null
|
|
2051
1943
|
};
|
|
2052
|
-
} else
|
|
2053
|
-
|
|
2054
|
-
}
|
|
2055
|
-
} else {
|
|
2056
|
-
return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));
|
|
2057
|
-
}
|
|
1944
|
+
} else return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));
|
|
1945
|
+
} else return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));
|
|
2058
1946
|
}
|
|
2059
1947
|
/**
|
|
2060
1948
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
@@ -2062,9 +1950,7 @@ class Parser {
|
|
|
2062
1950
|
parseTagName() {
|
|
2063
1951
|
const startOffset = this.offset();
|
|
2064
1952
|
this.bump();
|
|
2065
|
-
while (!this.isEOF() && _isPotentialElementNameChar(this.char()))
|
|
2066
|
-
this.bump();
|
|
2067
|
-
}
|
|
1953
|
+
while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump();
|
|
2068
1954
|
return this.message.slice(startOffset, this.offset());
|
|
2069
1955
|
}
|
|
2070
1956
|
parseLiteral(nestingLevel, parentArgType) {
|
|
@@ -2111,14 +1997,9 @@ class Parser {
|
|
|
2111
1997
|
* nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
|
|
2112
1998
|
*/
|
|
2113
1999
|
tryParseQuote(parentArgType) {
|
|
2114
|
-
if (this.isEOF() || this.char() !== 39)
|
|
2115
|
-
return null;
|
|
2116
|
-
}
|
|
2117
|
-
// Parse escaped char following the apostrophe, or early return if there is no escaped char.
|
|
2118
|
-
// Check if is valid escaped character
|
|
2000
|
+
if (this.isEOF() || this.char() !== 39) return null;
|
|
2119
2001
|
switch (this.peek()) {
|
|
2120
2002
|
case 39:
|
|
2121
|
-
// double quote, should return as a single quote.
|
|
2122
2003
|
this.bump();
|
|
2123
2004
|
this.bump();
|
|
2124
2005
|
return "'";
|
|
@@ -2127,43 +2008,32 @@ class Parser {
|
|
|
2127
2008
|
case 62:
|
|
2128
2009
|
case 125: break;
|
|
2129
2010
|
case 35:
|
|
2130
|
-
if (parentArgType === "plural" || parentArgType === "selectordinal")
|
|
2131
|
-
break;
|
|
2132
|
-
}
|
|
2011
|
+
if (parentArgType === "plural" || parentArgType === "selectordinal") break;
|
|
2133
2012
|
return null;
|
|
2134
2013
|
default: return null;
|
|
2135
2014
|
}
|
|
2136
2015
|
this.bump();
|
|
2137
2016
|
const codePoints = [this.char()];
|
|
2138
2017
|
this.bump();
|
|
2139
|
-
// read chars until the optional closing apostrophe is found
|
|
2140
2018
|
while (!this.isEOF()) {
|
|
2141
2019
|
const ch = this.char();
|
|
2142
|
-
if (ch === 39) {
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
// Bump one more time because we need to skip 2 characters.
|
|
2146
|
-
this.bump();
|
|
2147
|
-
} else {
|
|
2148
|
-
// Optional closing apostrophe.
|
|
2149
|
-
this.bump();
|
|
2150
|
-
break;
|
|
2151
|
-
}
|
|
2020
|
+
if (ch === 39) if (this.peek() === 39) {
|
|
2021
|
+
codePoints.push(39);
|
|
2022
|
+
this.bump();
|
|
2152
2023
|
} else {
|
|
2153
|
-
|
|
2024
|
+
this.bump();
|
|
2025
|
+
break;
|
|
2154
2026
|
}
|
|
2027
|
+
else codePoints.push(ch);
|
|
2155
2028
|
this.bump();
|
|
2156
2029
|
}
|
|
2157
2030
|
return String.fromCodePoint(...codePoints);
|
|
2158
2031
|
}
|
|
2159
2032
|
tryParseUnquoted(nestingLevel, parentArgType) {
|
|
2160
|
-
if (this.isEOF())
|
|
2161
|
-
return null;
|
|
2162
|
-
}
|
|
2033
|
+
if (this.isEOF()) return null;
|
|
2163
2034
|
const ch = this.char();
|
|
2164
|
-
if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0)
|
|
2165
|
-
|
|
2166
|
-
} else {
|
|
2035
|
+
if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null;
|
|
2036
|
+
else {
|
|
2167
2037
|
this.bump();
|
|
2168
2038
|
return String.fromCodePoint(ch);
|
|
2169
2039
|
}
|
|
@@ -2172,24 +2042,17 @@ class Parser {
|
|
|
2172
2042
|
const openingBracePosition = this.clonePosition();
|
|
2173
2043
|
this.bump();
|
|
2174
2044
|
this.bumpSpace();
|
|
2175
|
-
if (this.isEOF())
|
|
2176
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2177
|
-
}
|
|
2045
|
+
if (this.isEOF()) return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2178
2046
|
if (this.char() === 125) {
|
|
2179
2047
|
this.bump();
|
|
2180
2048
|
return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2181
2049
|
}
|
|
2182
|
-
// argument name
|
|
2183
2050
|
let value = this.parseIdentifierIfPossible().value;
|
|
2184
|
-
if (!value)
|
|
2185
|
-
return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2186
|
-
}
|
|
2051
|
+
if (!value) return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2187
2052
|
this.bumpSpace();
|
|
2188
|
-
if (this.isEOF())
|
|
2189
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2190
|
-
}
|
|
2053
|
+
if (this.isEOF()) return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2191
2054
|
switch (this.char()) {
|
|
2192
|
-
case 125:
|
|
2055
|
+
case 125:
|
|
2193
2056
|
this.bump();
|
|
2194
2057
|
return {
|
|
2195
2058
|
val: {
|
|
@@ -2199,15 +2062,11 @@ class Parser {
|
|
|
2199
2062
|
},
|
|
2200
2063
|
err: null
|
|
2201
2064
|
};
|
|
2202
|
-
|
|
2203
|
-
case 44: {
|
|
2065
|
+
case 44:
|
|
2204
2066
|
this.bump();
|
|
2205
2067
|
this.bumpSpace();
|
|
2206
|
-
if (this.isEOF())
|
|
2207
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2208
|
-
}
|
|
2068
|
+
if (this.isEOF()) return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2209
2069
|
return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
|
|
2210
|
-
}
|
|
2211
2070
|
default: return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2212
2071
|
}
|
|
2213
2072
|
}
|
|
@@ -2221,63 +2080,42 @@ class Parser {
|
|
|
2221
2080
|
const value = matchIdentifierAtIndex(this.message, startOffset);
|
|
2222
2081
|
const endOffset = startOffset + value.length;
|
|
2223
2082
|
this.bumpTo(endOffset);
|
|
2224
|
-
const endPosition = this.clonePosition();
|
|
2225
|
-
const location = createLocation(startingPosition, endPosition);
|
|
2226
2083
|
return {
|
|
2227
2084
|
value,
|
|
2228
|
-
location
|
|
2085
|
+
location: createLocation(startingPosition, this.clonePosition())
|
|
2229
2086
|
};
|
|
2230
2087
|
}
|
|
2231
2088
|
parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) {
|
|
2232
|
-
// Parse this range:
|
|
2233
|
-
// {name, type, style}
|
|
2234
|
-
// ^---^
|
|
2235
2089
|
let typeStartPosition = this.clonePosition();
|
|
2236
2090
|
let argType = this.parseIdentifierIfPossible().value;
|
|
2237
2091
|
let typeEndPosition = this.clonePosition();
|
|
2238
2092
|
switch (argType) {
|
|
2239
|
-
case "":
|
|
2240
|
-
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
2241
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2093
|
+
case "": return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2242
2094
|
case "number":
|
|
2243
2095
|
case "date":
|
|
2244
2096
|
case "time": {
|
|
2245
|
-
// Parse this range:
|
|
2246
|
-
// {name, number, style}
|
|
2247
|
-
// ^-------^
|
|
2248
2097
|
this.bumpSpace();
|
|
2249
2098
|
let styleAndLocation = null;
|
|
2250
2099
|
if (this.bumpIf(",")) {
|
|
2251
2100
|
this.bumpSpace();
|
|
2252
2101
|
const styleStartPosition = this.clonePosition();
|
|
2253
2102
|
const result = this.parseSimpleArgStyleIfPossible();
|
|
2254
|
-
if (result.err)
|
|
2255
|
-
return result;
|
|
2256
|
-
}
|
|
2103
|
+
if (result.err) return result;
|
|
2257
2104
|
const style = trimEnd(result.val);
|
|
2258
|
-
if (style.length === 0)
|
|
2259
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2260
|
-
}
|
|
2261
|
-
const styleLocation = createLocation(styleStartPosition, this.clonePosition());
|
|
2105
|
+
if (style.length === 0) return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2262
2106
|
styleAndLocation = {
|
|
2263
2107
|
style,
|
|
2264
|
-
styleLocation
|
|
2108
|
+
styleLocation: createLocation(styleStartPosition, this.clonePosition())
|
|
2265
2109
|
};
|
|
2266
2110
|
}
|
|
2267
2111
|
const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2268
|
-
if (argCloseResult.err)
|
|
2269
|
-
return argCloseResult;
|
|
2270
|
-
}
|
|
2112
|
+
if (argCloseResult.err) return argCloseResult;
|
|
2271
2113
|
const location = createLocation(openingBracePosition, this.clonePosition());
|
|
2272
|
-
// Extract style or skeleton
|
|
2273
2114
|
if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
|
|
2274
|
-
// Skeleton starts with `::`.
|
|
2275
2115
|
let skeleton = trimStart(styleAndLocation.style.slice(2));
|
|
2276
2116
|
if (argType === "number") {
|
|
2277
2117
|
const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
|
|
2278
|
-
if (result.err)
|
|
2279
|
-
return result;
|
|
2280
|
-
}
|
|
2118
|
+
if (result.err) return result;
|
|
2281
2119
|
return {
|
|
2282
2120
|
val: {
|
|
2283
2121
|
type: TYPE.number,
|
|
@@ -2288,26 +2126,18 @@ class Parser {
|
|
|
2288
2126
|
err: null
|
|
2289
2127
|
};
|
|
2290
2128
|
} else {
|
|
2291
|
-
if (skeleton.length === 0)
|
|
2292
|
-
return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location);
|
|
2293
|
-
}
|
|
2129
|
+
if (skeleton.length === 0) return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location);
|
|
2294
2130
|
let dateTimePattern = skeleton;
|
|
2295
|
-
|
|
2296
|
-
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
2297
|
-
// for unsupported patterns.
|
|
2298
|
-
if (this.locale) {
|
|
2299
|
-
dateTimePattern = getBestPattern(skeleton, this.locale);
|
|
2300
|
-
}
|
|
2131
|
+
if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale);
|
|
2301
2132
|
const style = {
|
|
2302
2133
|
type: SKELETON_TYPE.dateTime,
|
|
2303
2134
|
pattern: dateTimePattern,
|
|
2304
2135
|
location: styleAndLocation.styleLocation,
|
|
2305
2136
|
parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
|
|
2306
2137
|
};
|
|
2307
|
-
const type = argType === "date" ? TYPE.date : TYPE.time;
|
|
2308
2138
|
return {
|
|
2309
2139
|
val: {
|
|
2310
|
-
type,
|
|
2140
|
+
type: argType === "date" ? TYPE.date : TYPE.time,
|
|
2311
2141
|
value,
|
|
2312
2142
|
location,
|
|
2313
2143
|
style
|
|
@@ -2316,7 +2146,6 @@ class Parser {
|
|
|
2316
2146
|
};
|
|
2317
2147
|
}
|
|
2318
2148
|
}
|
|
2319
|
-
// Regular style or no style.
|
|
2320
2149
|
return {
|
|
2321
2150
|
val: {
|
|
2322
2151
|
type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time,
|
|
@@ -2330,81 +2159,52 @@ class Parser {
|
|
|
2330
2159
|
case "plural":
|
|
2331
2160
|
case "selectordinal":
|
|
2332
2161
|
case "select": {
|
|
2333
|
-
// Parse this range:
|
|
2334
|
-
// {name, plural, options}
|
|
2335
|
-
// ^---------^
|
|
2336
2162
|
const typeEndPosition = this.clonePosition();
|
|
2337
2163
|
this.bumpSpace();
|
|
2338
|
-
if (!this.bumpIf(",")) {
|
|
2339
|
-
return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition, { ...typeEndPosition }));
|
|
2340
|
-
}
|
|
2164
|
+
if (!this.bumpIf(",")) return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition, { ...typeEndPosition }));
|
|
2341
2165
|
this.bumpSpace();
|
|
2342
|
-
// Parse offset:
|
|
2343
|
-
// {name, plural, offset:1, options}
|
|
2344
|
-
// ^-----^
|
|
2345
|
-
//
|
|
2346
|
-
// or the first option:
|
|
2347
|
-
//
|
|
2348
|
-
// {name, plural, one {...} other {...}}
|
|
2349
|
-
// ^--^
|
|
2350
2166
|
let identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2351
2167
|
let pluralOffset = 0;
|
|
2352
2168
|
if (argType !== "select" && identifierAndLocation.value === "offset") {
|
|
2353
|
-
if (!this.bumpIf(":"))
|
|
2354
|
-
return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2355
|
-
}
|
|
2169
|
+
if (!this.bumpIf(":")) return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2356
2170
|
this.bumpSpace();
|
|
2357
2171
|
const result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2358
|
-
if (result.err)
|
|
2359
|
-
return result;
|
|
2360
|
-
}
|
|
2361
|
-
// Parse another identifier for option parsing
|
|
2172
|
+
if (result.err) return result;
|
|
2362
2173
|
this.bumpSpace();
|
|
2363
2174
|
identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2364
2175
|
pluralOffset = result.val;
|
|
2365
2176
|
}
|
|
2366
2177
|
const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
|
|
2367
|
-
if (optionsResult.err)
|
|
2368
|
-
return optionsResult;
|
|
2369
|
-
}
|
|
2178
|
+
if (optionsResult.err) return optionsResult;
|
|
2370
2179
|
const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2371
|
-
if (argCloseResult.err)
|
|
2372
|
-
return argCloseResult;
|
|
2373
|
-
}
|
|
2180
|
+
if (argCloseResult.err) return argCloseResult;
|
|
2374
2181
|
const location = createLocation(openingBracePosition, this.clonePosition());
|
|
2375
|
-
if (argType === "select") {
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
err: null
|
|
2396
|
-
};
|
|
2397
|
-
}
|
|
2182
|
+
if (argType === "select") return {
|
|
2183
|
+
val: {
|
|
2184
|
+
type: TYPE.select,
|
|
2185
|
+
value,
|
|
2186
|
+
options: fromEntries(optionsResult.val),
|
|
2187
|
+
location
|
|
2188
|
+
},
|
|
2189
|
+
err: null
|
|
2190
|
+
};
|
|
2191
|
+
else return {
|
|
2192
|
+
val: {
|
|
2193
|
+
type: TYPE.plural,
|
|
2194
|
+
value,
|
|
2195
|
+
options: fromEntries(optionsResult.val),
|
|
2196
|
+
offset: pluralOffset,
|
|
2197
|
+
pluralType: argType === "plural" ? "cardinal" : "ordinal",
|
|
2198
|
+
location
|
|
2199
|
+
},
|
|
2200
|
+
err: null
|
|
2201
|
+
};
|
|
2398
2202
|
}
|
|
2399
2203
|
default: return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2400
2204
|
}
|
|
2401
2205
|
}
|
|
2402
2206
|
tryParseArgumentClose(openingBracePosition) {
|
|
2403
|
-
|
|
2404
|
-
//
|
|
2405
|
-
if (this.isEOF() || this.char() !== 125) {
|
|
2406
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2407
|
-
}
|
|
2207
|
+
if (this.isEOF() || this.char() !== 125) return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2408
2208
|
this.bump();
|
|
2409
2209
|
return {
|
|
2410
2210
|
val: true,
|
|
@@ -2417,40 +2217,28 @@ class Parser {
|
|
|
2417
2217
|
parseSimpleArgStyleIfPossible() {
|
|
2418
2218
|
let nestedBraces = 0;
|
|
2419
2219
|
const startPosition = this.clonePosition();
|
|
2420
|
-
while (!this.isEOF()) {
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
let apostrophePosition = this.clonePosition();
|
|
2428
|
-
if (!this.bumpUntil("'")) {
|
|
2429
|
-
return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
|
|
2430
|
-
}
|
|
2431
|
-
this.bump();
|
|
2432
|
-
break;
|
|
2433
|
-
}
|
|
2434
|
-
case 123: {
|
|
2435
|
-
nestedBraces += 1;
|
|
2436
|
-
this.bump();
|
|
2437
|
-
break;
|
|
2438
|
-
}
|
|
2439
|
-
case 125: {
|
|
2440
|
-
if (nestedBraces > 0) {
|
|
2441
|
-
nestedBraces -= 1;
|
|
2442
|
-
} else {
|
|
2443
|
-
return {
|
|
2444
|
-
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2445
|
-
err: null
|
|
2446
|
-
};
|
|
2447
|
-
}
|
|
2448
|
-
break;
|
|
2449
|
-
}
|
|
2450
|
-
default:
|
|
2451
|
-
this.bump();
|
|
2452
|
-
break;
|
|
2220
|
+
while (!this.isEOF()) switch (this.char()) {
|
|
2221
|
+
case 39: {
|
|
2222
|
+
this.bump();
|
|
2223
|
+
let apostrophePosition = this.clonePosition();
|
|
2224
|
+
if (!this.bumpUntil("'")) return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
|
|
2225
|
+
this.bump();
|
|
2226
|
+
break;
|
|
2453
2227
|
}
|
|
2228
|
+
case 123:
|
|
2229
|
+
nestedBraces += 1;
|
|
2230
|
+
this.bump();
|
|
2231
|
+
break;
|
|
2232
|
+
case 125:
|
|
2233
|
+
if (nestedBraces > 0) nestedBraces -= 1;
|
|
2234
|
+
else return {
|
|
2235
|
+
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2236
|
+
err: null
|
|
2237
|
+
};
|
|
2238
|
+
break;
|
|
2239
|
+
default:
|
|
2240
|
+
this.bump();
|
|
2241
|
+
break;
|
|
2454
2242
|
}
|
|
2455
2243
|
return {
|
|
2456
2244
|
val: this.message.slice(startPosition.offset, this.offset()),
|
|
@@ -2487,65 +2275,37 @@ class Parser {
|
|
|
2487
2275
|
tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
|
|
2488
2276
|
let hasOtherClause = false;
|
|
2489
2277
|
const options = [];
|
|
2490
|
-
const parsedSelectors = new Set();
|
|
2278
|
+
const parsedSelectors = /* @__PURE__ */ new Set();
|
|
2491
2279
|
let { value: selector, location: selectorLocation } = parsedFirstIdentifier;
|
|
2492
|
-
// Parse:
|
|
2493
|
-
// one {one apple}
|
|
2494
|
-
// ^--^
|
|
2495
2280
|
while (true) {
|
|
2496
2281
|
if (selector.length === 0) {
|
|
2497
2282
|
const startPosition = this.clonePosition();
|
|
2498
2283
|
if (parentArgType !== "select" && this.bumpIf("=")) {
|
|
2499
|
-
// Try parse `={number}` selector
|
|
2500
2284
|
const result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2501
|
-
if (result.err)
|
|
2502
|
-
return result;
|
|
2503
|
-
}
|
|
2285
|
+
if (result.err) return result;
|
|
2504
2286
|
selectorLocation = createLocation(startPosition, this.clonePosition());
|
|
2505
2287
|
selector = this.message.slice(startPosition.offset, this.offset());
|
|
2506
|
-
} else
|
|
2507
|
-
break;
|
|
2508
|
-
}
|
|
2288
|
+
} else break;
|
|
2509
2289
|
}
|
|
2510
|
-
|
|
2511
|
-
if (
|
|
2512
|
-
return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);
|
|
2513
|
-
}
|
|
2514
|
-
if (selector === "other") {
|
|
2515
|
-
hasOtherClause = true;
|
|
2516
|
-
}
|
|
2517
|
-
// Parse:
|
|
2518
|
-
// one {one apple}
|
|
2519
|
-
// ^----------^
|
|
2290
|
+
if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);
|
|
2291
|
+
if (selector === "other") hasOtherClause = true;
|
|
2520
2292
|
this.bumpSpace();
|
|
2521
2293
|
const openingBracePosition = this.clonePosition();
|
|
2522
|
-
if (!this.bumpIf("{"))
|
|
2523
|
-
return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2524
|
-
}
|
|
2294
|
+
if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2525
2295
|
const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
|
|
2526
|
-
if (fragmentResult.err)
|
|
2527
|
-
return fragmentResult;
|
|
2528
|
-
}
|
|
2296
|
+
if (fragmentResult.err) return fragmentResult;
|
|
2529
2297
|
const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2530
|
-
if (argCloseResult.err)
|
|
2531
|
-
return argCloseResult;
|
|
2532
|
-
}
|
|
2298
|
+
if (argCloseResult.err) return argCloseResult;
|
|
2533
2299
|
options.push([selector, {
|
|
2534
2300
|
value: fragmentResult.val,
|
|
2535
2301
|
location: createLocation(openingBracePosition, this.clonePosition())
|
|
2536
2302
|
}]);
|
|
2537
|
-
// Keep track of the existing selectors
|
|
2538
2303
|
parsedSelectors.add(selector);
|
|
2539
|
-
// Prep next selector clause.
|
|
2540
2304
|
this.bumpSpace();
|
|
2541
2305
|
({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible());
|
|
2542
2306
|
}
|
|
2543
|
-
if (options.length === 0)
|
|
2544
|
-
|
|
2545
|
-
}
|
|
2546
|
-
if (this.requiresOtherClause && !hasOtherClause) {
|
|
2547
|
-
return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2548
|
-
}
|
|
2307
|
+
if (options.length === 0) return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2308
|
+
if (this.requiresOtherClause && !hasOtherClause) return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2549
2309
|
return {
|
|
2550
2310
|
val: options,
|
|
2551
2311
|
err: null
|
|
@@ -2554,9 +2314,7 @@ class Parser {
|
|
|
2554
2314
|
tryParseDecimalInteger(expectNumberError, invalidNumberError) {
|
|
2555
2315
|
let sign = 1;
|
|
2556
2316
|
const startingPosition = this.clonePosition();
|
|
2557
|
-
if (this.bumpIf("+")) ; else if (this.bumpIf("-"))
|
|
2558
|
-
sign = -1;
|
|
2559
|
-
}
|
|
2317
|
+
if (this.bumpIf("+")) ; else if (this.bumpIf("-")) sign = -1;
|
|
2560
2318
|
let hasDigits = false;
|
|
2561
2319
|
let decimal = 0;
|
|
2562
2320
|
while (!this.isEOF()) {
|
|
@@ -2565,18 +2323,12 @@ class Parser {
|
|
|
2565
2323
|
hasDigits = true;
|
|
2566
2324
|
decimal = decimal * 10 + (ch - 48);
|
|
2567
2325
|
this.bump();
|
|
2568
|
-
} else
|
|
2569
|
-
break;
|
|
2570
|
-
}
|
|
2326
|
+
} else break;
|
|
2571
2327
|
}
|
|
2572
2328
|
const location = createLocation(startingPosition, this.clonePosition());
|
|
2573
|
-
if (!hasDigits)
|
|
2574
|
-
return this.error(expectNumberError, location);
|
|
2575
|
-
}
|
|
2329
|
+
if (!hasDigits) return this.error(expectNumberError, location);
|
|
2576
2330
|
decimal *= sign;
|
|
2577
|
-
if (!Number.isSafeInteger(decimal))
|
|
2578
|
-
return this.error(invalidNumberError, location);
|
|
2579
|
-
}
|
|
2331
|
+
if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location);
|
|
2580
2332
|
return {
|
|
2581
2333
|
val: decimal,
|
|
2582
2334
|
err: null
|
|
@@ -2589,7 +2341,6 @@ class Parser {
|
|
|
2589
2341
|
return this.offset() === this.message.length;
|
|
2590
2342
|
}
|
|
2591
2343
|
clonePosition() {
|
|
2592
|
-
// This is much faster than `Object.assign` or spread.
|
|
2593
2344
|
return {
|
|
2594
2345
|
offset: this.position.offset,
|
|
2595
2346
|
line: this.position.line,
|
|
@@ -2602,13 +2353,9 @@ class Parser {
|
|
|
2602
2353
|
*/
|
|
2603
2354
|
char() {
|
|
2604
2355
|
const offset = this.position.offset;
|
|
2605
|
-
if (offset >= this.message.length)
|
|
2606
|
-
throw Error("out of bound");
|
|
2607
|
-
}
|
|
2356
|
+
if (offset >= this.message.length) throw Error("out of bound");
|
|
2608
2357
|
const code = this.message.codePointAt(offset);
|
|
2609
|
-
if (code ===
|
|
2610
|
-
throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
|
|
2611
|
-
}
|
|
2358
|
+
if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
|
|
2612
2359
|
return code;
|
|
2613
2360
|
}
|
|
2614
2361
|
error(kind, location) {
|
|
@@ -2623,9 +2370,7 @@ class Parser {
|
|
|
2623
2370
|
}
|
|
2624
2371
|
/** Bump the parser to the next UTF-16 code unit. */
|
|
2625
2372
|
bump() {
|
|
2626
|
-
if (this.isEOF())
|
|
2627
|
-
return;
|
|
2628
|
-
}
|
|
2373
|
+
if (this.isEOF()) return;
|
|
2629
2374
|
const code = this.char();
|
|
2630
2375
|
if (code === 10) {
|
|
2631
2376
|
this.position.line += 1;
|
|
@@ -2633,7 +2378,6 @@ class Parser {
|
|
|
2633
2378
|
this.position.offset += 1;
|
|
2634
2379
|
} else {
|
|
2635
2380
|
this.position.column += 1;
|
|
2636
|
-
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
2637
2381
|
this.position.offset += code < 65536 ? 1 : 2;
|
|
2638
2382
|
}
|
|
2639
2383
|
}
|
|
@@ -2645,9 +2389,7 @@ class Parser {
|
|
|
2645
2389
|
*/
|
|
2646
2390
|
bumpIf(prefix) {
|
|
2647
2391
|
if (this.message.startsWith(prefix, this.offset())) {
|
|
2648
|
-
for (let i = 0; i < prefix.length; i++)
|
|
2649
|
-
this.bump();
|
|
2650
|
-
}
|
|
2392
|
+
for (let i = 0; i < prefix.length; i++) this.bump();
|
|
2651
2393
|
return true;
|
|
2652
2394
|
}
|
|
2653
2395
|
return false;
|
|
@@ -2672,44 +2414,31 @@ class Parser {
|
|
|
2672
2414
|
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
2673
2415
|
*/
|
|
2674
2416
|
bumpTo(targetOffset) {
|
|
2675
|
-
if (this.offset() > targetOffset) {
|
|
2676
|
-
throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
|
|
2677
|
-
}
|
|
2417
|
+
if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
|
|
2678
2418
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
2679
2419
|
while (true) {
|
|
2680
2420
|
const offset = this.offset();
|
|
2681
|
-
if (offset === targetOffset)
|
|
2682
|
-
|
|
2683
|
-
}
|
|
2684
|
-
if (offset > targetOffset) {
|
|
2685
|
-
throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
|
|
2686
|
-
}
|
|
2421
|
+
if (offset === targetOffset) break;
|
|
2422
|
+
if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
|
|
2687
2423
|
this.bump();
|
|
2688
|
-
if (this.isEOF())
|
|
2689
|
-
break;
|
|
2690
|
-
}
|
|
2424
|
+
if (this.isEOF()) break;
|
|
2691
2425
|
}
|
|
2692
2426
|
}
|
|
2693
2427
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
2694
2428
|
bumpSpace() {
|
|
2695
|
-
while (!this.isEOF() && _isWhiteSpace(this.char()))
|
|
2696
|
-
this.bump();
|
|
2697
|
-
}
|
|
2429
|
+
while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump();
|
|
2698
2430
|
}
|
|
2699
2431
|
/**
|
|
2700
2432
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
2701
2433
|
* If the input has been exhausted, then this returns null.
|
|
2702
2434
|
*/
|
|
2703
2435
|
peek() {
|
|
2704
|
-
if (this.isEOF())
|
|
2705
|
-
return null;
|
|
2706
|
-
}
|
|
2436
|
+
if (this.isEOF()) return null;
|
|
2707
2437
|
const code = this.char();
|
|
2708
2438
|
const offset = this.offset();
|
|
2709
|
-
|
|
2710
|
-
return nextCode ?? null;
|
|
2439
|
+
return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null;
|
|
2711
2440
|
}
|
|
2712
|
-
}
|
|
2441
|
+
};
|
|
2713
2442
|
/**
|
|
2714
2443
|
* This check if codepoint is alphabet (lower & uppercase)
|
|
2715
2444
|
* @param codepoint
|
|
@@ -2732,22 +2461,18 @@ function _isPotentialElementNameChar(c) {
|
|
|
2732
2461
|
function _isWhiteSpace(c) {
|
|
2733
2462
|
return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
|
|
2734
2463
|
}
|
|
2735
|
-
|
|
2464
|
+
//#endregion
|
|
2465
|
+
//#region packages/icu-messageformat-parser/index.ts
|
|
2736
2466
|
function pruneLocation(els) {
|
|
2737
2467
|
els.forEach((el) => {
|
|
2738
2468
|
delete el.location;
|
|
2739
|
-
if (isSelectElement(el) || isPluralElement(el)) {
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
pruneLocation(el.options[k].value);
|
|
2743
|
-
}
|
|
2744
|
-
} else if (isNumberElement(el) && isNumberSkeleton(el.style)) {
|
|
2745
|
-
delete el.style.location;
|
|
2746
|
-
} else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) {
|
|
2747
|
-
delete el.style.location;
|
|
2748
|
-
} else if (isTagElement(el)) {
|
|
2749
|
-
pruneLocation(el.children);
|
|
2469
|
+
if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) {
|
|
2470
|
+
delete el.options[k].location;
|
|
2471
|
+
pruneLocation(el.options[k].value);
|
|
2750
2472
|
}
|
|
2473
|
+
else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location;
|
|
2474
|
+
else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location;
|
|
2475
|
+
else if (isTagElement(el)) pruneLocation(el.children);
|
|
2751
2476
|
});
|
|
2752
2477
|
}
|
|
2753
2478
|
function parse(message, opts = {}) {
|
|
@@ -2759,37 +2484,22 @@ function parse(message, opts = {}) {
|
|
|
2759
2484
|
const result = new Parser(message, opts).parse();
|
|
2760
2485
|
if (result.err) {
|
|
2761
2486
|
const error = SyntaxError(ErrorKind[result.err.kind]);
|
|
2762
|
-
// @ts-expect-error Assign to error object
|
|
2763
2487
|
error.location = result.err.location;
|
|
2764
|
-
// @ts-expect-error Assign to error object
|
|
2765
2488
|
error.originalMessage = result.err.message;
|
|
2766
2489
|
throw error;
|
|
2767
2490
|
}
|
|
2768
|
-
if (!opts?.captureLocation)
|
|
2769
|
-
pruneLocation(result.val);
|
|
2770
|
-
}
|
|
2491
|
+
if (!opts?.captureLocation) pruneLocation(result.val);
|
|
2771
2492
|
return result.val;
|
|
2772
2493
|
}
|
|
2773
2494
|
|
|
2495
|
+
//#region packages/intl-messageformat/error.ts
|
|
2774
2496
|
let ErrorCode = /* @__PURE__ */ function(ErrorCode) {
|
|
2775
|
-
// When we have a placeholder but no value to format
|
|
2776
2497
|
ErrorCode["MISSING_VALUE"] = "MISSING_VALUE";
|
|
2777
|
-
// When value supplied is invalid
|
|
2778
2498
|
ErrorCode["INVALID_VALUE"] = "INVALID_VALUE";
|
|
2779
|
-
// When we need specific Intl API but it's not available
|
|
2780
2499
|
ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API";
|
|
2781
2500
|
return ErrorCode;
|
|
2782
2501
|
}({});
|
|
2783
|
-
|
|
2784
|
-
code;
|
|
2785
|
-
/**
|
|
2786
|
-
* Original message we're trying to format
|
|
2787
|
-
* `undefined` if we're only dealing w/ AST
|
|
2788
|
-
*
|
|
2789
|
-
* @type {(string | undefined)}
|
|
2790
|
-
* @memberof FormatError
|
|
2791
|
-
*/
|
|
2792
|
-
originalMessage;
|
|
2502
|
+
var FormatError = class extends Error {
|
|
2793
2503
|
constructor(msg, code, originalMessage) {
|
|
2794
2504
|
super(msg);
|
|
2795
2505
|
this.code = code;
|
|
@@ -2798,57 +2508,48 @@ class FormatError extends Error {
|
|
|
2798
2508
|
toString() {
|
|
2799
2509
|
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2800
2510
|
}
|
|
2801
|
-
}
|
|
2802
|
-
|
|
2511
|
+
};
|
|
2512
|
+
var InvalidValueError = class extends FormatError {
|
|
2803
2513
|
constructor(variableId, value, options, originalMessage) {
|
|
2804
2514
|
super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, ErrorCode.INVALID_VALUE, originalMessage);
|
|
2805
2515
|
}
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2516
|
+
};
|
|
2517
|
+
var InvalidValueTypeError = class extends FormatError {
|
|
2808
2518
|
constructor(value, type, originalMessage) {
|
|
2809
2519
|
super(`Value for "${value}" must be of type ${type}`, ErrorCode.INVALID_VALUE, originalMessage);
|
|
2810
2520
|
}
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2521
|
+
};
|
|
2522
|
+
var MissingValueError = class extends FormatError {
|
|
2813
2523
|
constructor(variableId, originalMessage) {
|
|
2814
2524
|
super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, ErrorCode.MISSING_VALUE, originalMessage);
|
|
2815
2525
|
}
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2526
|
+
};
|
|
2527
|
+
//#endregion
|
|
2528
|
+
//#region packages/intl-messageformat/formatters.ts
|
|
2818
2529
|
let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) {
|
|
2819
2530
|
PART_TYPE[PART_TYPE["literal"] = 0] = "literal";
|
|
2820
2531
|
PART_TYPE[PART_TYPE["object"] = 1] = "object";
|
|
2821
2532
|
return PART_TYPE;
|
|
2822
2533
|
}({});
|
|
2823
2534
|
function mergeLiteral(parts) {
|
|
2824
|
-
if (parts.length < 2)
|
|
2825
|
-
return parts;
|
|
2826
|
-
}
|
|
2535
|
+
if (parts.length < 2) return parts;
|
|
2827
2536
|
return parts.reduce((all, part) => {
|
|
2828
2537
|
const lastPart = all[all.length - 1];
|
|
2829
|
-
if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal)
|
|
2830
|
-
|
|
2831
|
-
} else {
|
|
2832
|
-
lastPart.value += part.value;
|
|
2833
|
-
}
|
|
2538
|
+
if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) all.push(part);
|
|
2539
|
+
else lastPart.value += part.value;
|
|
2834
2540
|
return all;
|
|
2835
2541
|
}, []);
|
|
2836
2542
|
}
|
|
2837
2543
|
function isFormatXMLElementFn(el) {
|
|
2838
2544
|
return typeof el === "function";
|
|
2839
2545
|
}
|
|
2840
|
-
// TODO(skeleton): add skeleton support
|
|
2841
2546
|
function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
value: els[0].value
|
|
2847
|
-
}];
|
|
2848
|
-
}
|
|
2547
|
+
if (els.length === 1 && isLiteralElement(els[0])) return [{
|
|
2548
|
+
type: PART_TYPE.literal,
|
|
2549
|
+
value: els[0].value
|
|
2550
|
+
}];
|
|
2849
2551
|
const result = [];
|
|
2850
2552
|
for (const el of els) {
|
|
2851
|
-
// Exit early for string parts.
|
|
2852
2553
|
if (isLiteralElement(el)) {
|
|
2853
2554
|
result.push({
|
|
2854
2555
|
type: PART_TYPE.literal,
|
|
@@ -2856,38 +2557,26 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
2856
2557
|
});
|
|
2857
2558
|
continue;
|
|
2858
2559
|
}
|
|
2859
|
-
// TODO: should this part be literal type?
|
|
2860
|
-
// Replace `#` in plural rules with the actual numeric value.
|
|
2861
2560
|
if (isPoundElement(el)) {
|
|
2862
|
-
if (typeof currentPluralValue === "number") {
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
});
|
|
2867
|
-
}
|
|
2561
|
+
if (typeof currentPluralValue === "number") result.push({
|
|
2562
|
+
type: PART_TYPE.literal,
|
|
2563
|
+
value: formatters.getNumberFormat(locales).format(currentPluralValue)
|
|
2564
|
+
});
|
|
2868
2565
|
continue;
|
|
2869
2566
|
}
|
|
2870
2567
|
const { value: varName } = el;
|
|
2871
|
-
|
|
2872
|
-
if (!(values && varName in values)) {
|
|
2873
|
-
throw new MissingValueError(varName, originalMessage);
|
|
2874
|
-
}
|
|
2568
|
+
if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage);
|
|
2875
2569
|
let value = values[varName];
|
|
2876
2570
|
if (isArgumentElement(el)) {
|
|
2877
|
-
if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint")
|
|
2878
|
-
value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : "";
|
|
2879
|
-
}
|
|
2571
|
+
if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : "";
|
|
2880
2572
|
result.push({
|
|
2881
2573
|
type: typeof value === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
2882
2574
|
value
|
|
2883
2575
|
});
|
|
2884
2576
|
continue;
|
|
2885
2577
|
}
|
|
2886
|
-
// Recursively format plural and select parts' option — which can be a
|
|
2887
|
-
// nested pattern structure. The choosing of the option to use is
|
|
2888
|
-
// abstracted-by and delegated-to the part helper object.
|
|
2889
2578
|
if (isDateElement(el)) {
|
|
2890
|
-
const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions :
|
|
2579
|
+
const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
2891
2580
|
result.push({
|
|
2892
2581
|
type: PART_TYPE.literal,
|
|
2893
2582
|
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
@@ -2903,20 +2592,13 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
2903
2592
|
continue;
|
|
2904
2593
|
}
|
|
2905
2594
|
if (isNumberElement(el)) {
|
|
2906
|
-
const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions :
|
|
2595
|
+
const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
2907
2596
|
if (style && style.scale) {
|
|
2908
2597
|
const scale = style.scale || 1;
|
|
2909
|
-
// Handle bigint scale multiplication
|
|
2910
|
-
// BigInt can only be multiplied by BigInt
|
|
2911
2598
|
if (typeof value === "bigint") {
|
|
2912
|
-
|
|
2913
|
-
if (!Number.isInteger(scale)) {
|
|
2914
|
-
throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`);
|
|
2915
|
-
}
|
|
2599
|
+
if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`);
|
|
2916
2600
|
value = value * BigInt(scale);
|
|
2917
|
-
} else
|
|
2918
|
-
value = value * scale;
|
|
2919
|
-
}
|
|
2601
|
+
} else value = value * scale;
|
|
2920
2602
|
}
|
|
2921
2603
|
result.push({
|
|
2922
2604
|
type: PART_TYPE.literal,
|
|
@@ -2927,14 +2609,9 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
2927
2609
|
if (isTagElement(el)) {
|
|
2928
2610
|
const { children, value } = el;
|
|
2929
2611
|
const formatFn = values[value];
|
|
2930
|
-
if (!isFormatXMLElementFn(formatFn))
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
const parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
|
|
2934
|
-
let chunks = formatFn(parts.map((p) => p.value));
|
|
2935
|
-
if (!Array.isArray(chunks)) {
|
|
2936
|
-
chunks = [chunks];
|
|
2937
|
-
}
|
|
2612
|
+
if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage);
|
|
2613
|
+
let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value));
|
|
2614
|
+
if (!Array.isArray(chunks)) chunks = [chunks];
|
|
2938
2615
|
result.push(...chunks.map((c) => {
|
|
2939
2616
|
return {
|
|
2940
2617
|
type: typeof c === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
@@ -2943,34 +2620,24 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
2943
2620
|
}));
|
|
2944
2621
|
}
|
|
2945
2622
|
if (isSelectElement(el)) {
|
|
2946
|
-
// GH #4490: Use hasOwnProperty to avoid prototype chain issues with keys like "constructor"
|
|
2947
2623
|
const key = value;
|
|
2948
|
-
const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] :
|
|
2949
|
-
if (!opt)
|
|
2950
|
-
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2951
|
-
}
|
|
2624
|
+
const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other;
|
|
2625
|
+
if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2952
2626
|
result.push(...formatToParts(opt.value, locales, formatters, formats, values));
|
|
2953
2627
|
continue;
|
|
2954
2628
|
}
|
|
2955
2629
|
if (isPluralElement(el)) {
|
|
2956
|
-
// GH #4490: Use hasOwnProperty to avoid prototype chain issues
|
|
2957
2630
|
const exactKey = `=${value}`;
|
|
2958
|
-
let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] :
|
|
2631
|
+
let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0;
|
|
2959
2632
|
if (!opt) {
|
|
2960
|
-
if (!Intl.PluralRules)
|
|
2961
|
-
throw new FormatError(`Intl.PluralRules is not available in this environment.
|
|
2633
|
+
if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment.
|
|
2962
2634
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2963
2635
|
`, ErrorCode.MISSING_INTL_API, originalMessage);
|
|
2964
|
-
}
|
|
2965
|
-
// Convert bigint to number for PluralRules (which only accepts number)
|
|
2966
2636
|
const numericValue = typeof value === "bigint" ? Number(value) : value;
|
|
2967
2637
|
const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue - (el.offset || 0));
|
|
2968
|
-
opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] :
|
|
2969
|
-
}
|
|
2970
|
-
if (!opt) {
|
|
2971
|
-
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2638
|
+
opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other;
|
|
2972
2639
|
}
|
|
2973
|
-
|
|
2640
|
+
if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2974
2641
|
const numericValue = typeof value === "bigint" ? Number(value) : value;
|
|
2975
2642
|
result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0)));
|
|
2976
2643
|
continue;
|
|
@@ -2978,17 +2645,10 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
2978
2645
|
}
|
|
2979
2646
|
return mergeLiteral(result);
|
|
2980
2647
|
}
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
2984
|
-
Copyrights licensed under the New BSD License.
|
|
2985
|
-
See the accompanying LICENSE file for terms.
|
|
2986
|
-
*/
|
|
2987
|
-
// -- MessageFormat --------------------------------------------------------
|
|
2648
|
+
//#endregion
|
|
2649
|
+
//#region packages/intl-messageformat/core.ts
|
|
2988
2650
|
function mergeConfig(c1, c2) {
|
|
2989
|
-
if (!c2)
|
|
2990
|
-
return c1;
|
|
2991
|
-
}
|
|
2651
|
+
if (!c2) return c1;
|
|
2992
2652
|
return {
|
|
2993
2653
|
...c1,
|
|
2994
2654
|
...c2,
|
|
@@ -3002,9 +2662,7 @@ function mergeConfig(c1, c2) {
|
|
|
3002
2662
|
};
|
|
3003
2663
|
}
|
|
3004
2664
|
function mergeConfigs(defaultConfig, configs) {
|
|
3005
|
-
if (!configs)
|
|
3006
|
-
return defaultConfig;
|
|
3007
|
-
}
|
|
2665
|
+
if (!configs) return defaultConfig;
|
|
3008
2666
|
return Object.keys(defaultConfig).reduce((all, k) => {
|
|
3009
2667
|
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
3010
2668
|
return all;
|
|
@@ -3042,141 +2700,119 @@ function createDefaultFormatters(cache = {
|
|
|
3042
2700
|
})
|
|
3043
2701
|
};
|
|
3044
2702
|
}
|
|
3045
|
-
class IntlMessageFormat {
|
|
3046
|
-
ast;
|
|
3047
|
-
locales;
|
|
3048
|
-
resolvedLocale;
|
|
3049
|
-
formatters;
|
|
3050
|
-
formats;
|
|
3051
|
-
message;
|
|
3052
|
-
formatterCache = {
|
|
3053
|
-
number: {},
|
|
3054
|
-
dateTime: {},
|
|
3055
|
-
pluralRules: {}
|
|
3056
|
-
};
|
|
2703
|
+
var IntlMessageFormat = class IntlMessageFormat {
|
|
3057
2704
|
constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts) {
|
|
3058
|
-
|
|
2705
|
+
this.formatterCache = {
|
|
2706
|
+
number: {},
|
|
2707
|
+
dateTime: {},
|
|
2708
|
+
pluralRules: {}
|
|
2709
|
+
};
|
|
2710
|
+
this.format = (values) => {
|
|
2711
|
+
const parts = this.formatToParts(values);
|
|
2712
|
+
if (parts.length === 1) return parts[0].value;
|
|
2713
|
+
const result = parts.reduce((all, part) => {
|
|
2714
|
+
if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") all.push(part.value);
|
|
2715
|
+
else all[all.length - 1] += part.value;
|
|
2716
|
+
return all;
|
|
2717
|
+
}, []);
|
|
2718
|
+
if (result.length <= 1) return result[0] || "";
|
|
2719
|
+
return result;
|
|
2720
|
+
};
|
|
2721
|
+
this.formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message);
|
|
2722
|
+
this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] });
|
|
2723
|
+
this.getAst = () => this.ast;
|
|
3059
2724
|
this.locales = locales;
|
|
3060
2725
|
this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);
|
|
3061
2726
|
if (typeof message === "string") {
|
|
3062
2727
|
this.message = message;
|
|
3063
|
-
if (!IntlMessageFormat.__parse)
|
|
3064
|
-
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3065
|
-
}
|
|
2728
|
+
if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3066
2729
|
const { ...parseOpts } = opts || {};
|
|
3067
|
-
// Parse string messages into an AST.
|
|
3068
2730
|
this.ast = IntlMessageFormat.__parse(message, {
|
|
3069
2731
|
...parseOpts,
|
|
3070
2732
|
locale: this.resolvedLocale
|
|
3071
2733
|
});
|
|
3072
|
-
} else
|
|
3073
|
-
|
|
3074
|
-
}
|
|
3075
|
-
if (!Array.isArray(this.ast)) {
|
|
3076
|
-
throw new TypeError("A message must be provided as a String or AST.");
|
|
3077
|
-
}
|
|
3078
|
-
// Creates a new object with the specified `formats` merged with the default
|
|
3079
|
-
// formats.
|
|
2734
|
+
} else this.ast = message;
|
|
2735
|
+
if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST.");
|
|
3080
2736
|
this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);
|
|
3081
2737
|
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
3082
2738
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
if (parts.length === 1) {
|
|
3087
|
-
return parts[0].value;
|
|
3088
|
-
}
|
|
3089
|
-
const result = parts.reduce((all, part) => {
|
|
3090
|
-
if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") {
|
|
3091
|
-
all.push(part.value);
|
|
3092
|
-
} else {
|
|
3093
|
-
all[all.length - 1] += part.value;
|
|
3094
|
-
}
|
|
3095
|
-
return all;
|
|
3096
|
-
}, []);
|
|
3097
|
-
if (result.length <= 1) {
|
|
3098
|
-
return result[0] || "";
|
|
3099
|
-
}
|
|
3100
|
-
return result;
|
|
3101
|
-
};
|
|
3102
|
-
formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, undefined, this.message);
|
|
3103
|
-
resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] });
|
|
3104
|
-
getAst = () => this.ast;
|
|
3105
|
-
static memoizedDefaultLocale = null;
|
|
2739
|
+
static {
|
|
2740
|
+
this.memoizedDefaultLocale = null;
|
|
2741
|
+
}
|
|
3106
2742
|
static get defaultLocale() {
|
|
3107
|
-
if (!IntlMessageFormat.memoizedDefaultLocale)
|
|
3108
|
-
IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3109
|
-
}
|
|
2743
|
+
if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3110
2744
|
return IntlMessageFormat.memoizedDefaultLocale;
|
|
3111
2745
|
}
|
|
3112
|
-
static
|
|
3113
|
-
|
|
3114
|
-
return;
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
currency: { style: "currency" },
|
|
3130
|
-
percent: { style: "percent" }
|
|
3131
|
-
},
|
|
3132
|
-
date: {
|
|
3133
|
-
short: {
|
|
3134
|
-
month: "numeric",
|
|
3135
|
-
day: "numeric",
|
|
3136
|
-
year: "2-digit"
|
|
3137
|
-
},
|
|
3138
|
-
medium: {
|
|
3139
|
-
month: "short",
|
|
3140
|
-
day: "numeric",
|
|
3141
|
-
year: "numeric"
|
|
3142
|
-
},
|
|
3143
|
-
long: {
|
|
3144
|
-
month: "long",
|
|
3145
|
-
day: "numeric",
|
|
3146
|
-
year: "numeric"
|
|
3147
|
-
},
|
|
3148
|
-
full: {
|
|
3149
|
-
weekday: "long",
|
|
3150
|
-
month: "long",
|
|
3151
|
-
day: "numeric",
|
|
3152
|
-
year: "numeric"
|
|
3153
|
-
}
|
|
3154
|
-
},
|
|
3155
|
-
time: {
|
|
3156
|
-
short: {
|
|
3157
|
-
hour: "numeric",
|
|
3158
|
-
minute: "numeric"
|
|
3159
|
-
},
|
|
3160
|
-
medium: {
|
|
3161
|
-
hour: "numeric",
|
|
3162
|
-
minute: "numeric",
|
|
3163
|
-
second: "numeric"
|
|
2746
|
+
static {
|
|
2747
|
+
this.resolveLocale = (locales) => {
|
|
2748
|
+
if (typeof Intl.Locale === "undefined") return;
|
|
2749
|
+
const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
|
|
2750
|
+
if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]);
|
|
2751
|
+
return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
|
|
2752
|
+
};
|
|
2753
|
+
}
|
|
2754
|
+
static {
|
|
2755
|
+
this.__parse = parse;
|
|
2756
|
+
}
|
|
2757
|
+
static {
|
|
2758
|
+
this.formats = {
|
|
2759
|
+
number: {
|
|
2760
|
+
integer: { maximumFractionDigits: 0 },
|
|
2761
|
+
currency: { style: "currency" },
|
|
2762
|
+
percent: { style: "percent" }
|
|
3164
2763
|
},
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
2764
|
+
date: {
|
|
2765
|
+
short: {
|
|
2766
|
+
month: "numeric",
|
|
2767
|
+
day: "numeric",
|
|
2768
|
+
year: "2-digit"
|
|
2769
|
+
},
|
|
2770
|
+
medium: {
|
|
2771
|
+
month: "short",
|
|
2772
|
+
day: "numeric",
|
|
2773
|
+
year: "numeric"
|
|
2774
|
+
},
|
|
2775
|
+
long: {
|
|
2776
|
+
month: "long",
|
|
2777
|
+
day: "numeric",
|
|
2778
|
+
year: "numeric"
|
|
2779
|
+
},
|
|
2780
|
+
full: {
|
|
2781
|
+
weekday: "long",
|
|
2782
|
+
month: "long",
|
|
2783
|
+
day: "numeric",
|
|
2784
|
+
year: "numeric"
|
|
2785
|
+
}
|
|
3170
2786
|
},
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
2787
|
+
time: {
|
|
2788
|
+
short: {
|
|
2789
|
+
hour: "numeric",
|
|
2790
|
+
minute: "numeric"
|
|
2791
|
+
},
|
|
2792
|
+
medium: {
|
|
2793
|
+
hour: "numeric",
|
|
2794
|
+
minute: "numeric",
|
|
2795
|
+
second: "numeric"
|
|
2796
|
+
},
|
|
2797
|
+
long: {
|
|
2798
|
+
hour: "numeric",
|
|
2799
|
+
minute: "numeric",
|
|
2800
|
+
second: "numeric",
|
|
2801
|
+
timeZoneName: "short"
|
|
2802
|
+
},
|
|
2803
|
+
full: {
|
|
2804
|
+
hour: "numeric",
|
|
2805
|
+
minute: "numeric",
|
|
2806
|
+
second: "numeric",
|
|
2807
|
+
timeZoneName: "short"
|
|
2808
|
+
}
|
|
3176
2809
|
}
|
|
3177
|
-
}
|
|
3178
|
-
}
|
|
3179
|
-
}
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
//#endregion
|
|
2814
|
+
//#region packages/intl-messageformat/index.ts
|
|
2815
|
+
var intl_messageformat_default = IntlMessageFormat;
|
|
3180
2816
|
|
|
3181
2817
|
const resourceCache = {};
|
|
3182
2818
|
const determineFetchUrl = (locale = 'en') => index.getAssetPath(`i18n/genesys-webcomponents.i18n.${locale}.json`);
|
|
@@ -3280,11 +2916,11 @@ async function buildI18nForComponent(component, defaultResources, parentComponen
|
|
|
3280
2916
|
resources = await getComponentI18nResources(component, defaultResources, locale, parentComponent);
|
|
3281
2917
|
}
|
|
3282
2918
|
const intlFormats = Object.entries(resources).reduce((map, [key, val]) => {
|
|
3283
|
-
map.set(key, new
|
|
2919
|
+
map.set(key, new intl_messageformat_default(val, locale));
|
|
3284
2920
|
return map;
|
|
3285
2921
|
}, new Map());
|
|
3286
2922
|
const defaultFormats = Object.entries(defaultResources).reduce((map, [key, val]) => {
|
|
3287
|
-
map.set(key, new
|
|
2923
|
+
map.set(key, new intl_messageformat_default(val, DEFAULT_LOCALE));
|
|
3288
2924
|
return map;
|
|
3289
2925
|
}, new Map());
|
|
3290
2926
|
return (resourceKey, context) => {
|