@vonage/vivid 5.1.0 → 5.3.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/accordion-item/definition.cjs +2 -1
- package/accordion-item/definition.js +2 -1
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +41 -6
- package/audio-player/definition.js +41 -6
- package/audio-player/index.cjs +27 -25
- package/audio-player/index.js +88 -62
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +21 -21
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +66 -37
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +17 -14
- package/bundled/definition19.js +85 -77
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +6 -6
- package/bundled/definition6.js +34 -31
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +1 -1
- package/bundled/definition9.js +1 -1
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +43 -31
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +18 -13
- package/bundled/picker-field.template.js +45 -37
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +2126 -1172
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +17 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +6 -6
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +10 -2
- package/card/definition.js +10 -2
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +13 -6
- package/combobox/definition.js +14 -7
- package/combobox/index.cjs +15 -11
- package/combobox/index.js +82 -75
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1621 -325
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +55 -1
- package/dial-pad/definition.js +56 -2
- package/dial-pad/index.cjs +21 -18
- package/dial-pad/index.js +138 -104
- package/dialog/definition.cjs +4 -1
- package/dialog/definition.js +4 -1
- package/dialog/index.cjs +21 -18
- package/dialog/index.js +43 -40
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +16 -7
- package/file-picker/definition.js +17 -8
- package/file-picker/index.cjs +12 -9
- package/file-picker/index.js +103 -93
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +4 -0
- package/index.js +1 -0
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +6 -2
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +495 -78
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +906 -894
- package/lib/date-range-picker/date-range-picker.d.ts +596 -590
- package/lib/date-time-picker/date-time-picker.d.ts +907 -895
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +2 -2
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +495 -78
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +5 -4
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +19 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +521 -104
- package/lib/select/select.d.ts +484 -67
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +6 -6
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -16
- package/lib/text-field/text-field.d.ts +19 -18
- package/lib/time-picker/time-picker.d.ts +579 -573
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +15 -3
- package/locales/de-DE.js +15 -3
- package/locales/en-GB.cjs +15 -3
- package/locales/en-GB.js +15 -3
- package/locales/en-US.cjs +15 -3
- package/locales/en-US.js +15 -3
- package/locales/ja-JP.cjs +15 -3
- package/locales/ja-JP.js +15 -3
- package/locales/zh-CN.cjs +15 -3
- package/locales/zh-CN.js +15 -3
- package/menu/definition.cjs +8 -4
- package/menu/definition.js +9 -5
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +3 -3
- package/number-field/definition.js +4 -4
- package/number-field/index.cjs +8 -8
- package/number-field/index.js +41 -40
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +5 -5
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +2 -2
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/definition.cjs +30 -21
- package/searchable-select/definition.js +31 -22
- package/searchable-select/index.cjs +28 -25
- package/searchable-select/index.js +149 -140
- package/select/definition.cjs +15 -7
- package/select/definition.js +16 -8
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +2 -2
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +454 -451
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +600 -594
- package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
- package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
- package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
- package/shared/picker-field/picker-field.d.ts +495 -78
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +28 -215
- package/simple-color-picker/definition.js +29 -216
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +4 -4
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +9 -9
- package/text-field/definition.cjs +3 -3
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +2 -2
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +2 -2
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +3 -3
- package/unbundled/calendar-picker.template.js +4 -4
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +2 -2
- package/unbundled/definition3.cjs +2 -1
- package/unbundled/definition3.js +2 -1
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +13 -5
- package/unbundled/picker-field.template.js +14 -6
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/unbundled/with-contextual-help.cjs +11 -0
- package/unbundled/with-contextual-help.js +11 -0
- package/video-player/definition.cjs +69007 -1
- package/video-player/definition.js +69007 -1
- package/video-player/index.cjs +35 -35
- package/video-player/index.js +1358 -1384
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +347 -69
package/bundled/vivid-element.js
CHANGED
|
@@ -1,170 +1,195 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
let F;
|
|
2
|
+
const ft = "fast-kernel";
|
|
3
|
+
try {
|
|
4
|
+
if (document.currentScript)
|
|
5
|
+
F = document.currentScript.getAttribute(ft);
|
|
6
|
+
else {
|
|
7
|
+
const i = document.getElementsByTagName("script");
|
|
8
|
+
F = i[i.length - 1].getAttribute(ft);
|
|
9
|
+
}
|
|
10
|
+
} catch {
|
|
11
|
+
F = "isolate";
|
|
12
|
+
}
|
|
13
|
+
let k;
|
|
14
|
+
switch (F) {
|
|
15
|
+
case "share":
|
|
16
|
+
k = Object.freeze({
|
|
17
|
+
updateQueue: 1,
|
|
18
|
+
observable: 2,
|
|
19
|
+
contextEvent: 3,
|
|
20
|
+
elementRegistry: 4
|
|
21
|
+
});
|
|
22
|
+
break;
|
|
23
|
+
case "share-v2":
|
|
24
|
+
k = Object.freeze({
|
|
25
|
+
updateQueue: 1.2,
|
|
26
|
+
observable: 2.2,
|
|
27
|
+
contextEvent: 3.2,
|
|
28
|
+
elementRegistry: 4.2
|
|
29
|
+
});
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
const i = `-${Math.random().toString(36).substring(2, 8)}`;
|
|
33
|
+
k = Object.freeze({
|
|
34
|
+
updateQueue: `1.2${i}`,
|
|
35
|
+
observable: `2.2${i}`,
|
|
36
|
+
contextEvent: `3.2${i}`,
|
|
37
|
+
elementRegistry: `4.2${i}`
|
|
38
|
+
});
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
const O = (i) => typeof i == "function", B = (i) => typeof i == "string", pe = () => {
|
|
42
|
+
};
|
|
43
|
+
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
44
|
+
function li(i) {
|
|
45
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
46
|
+
}
|
|
47
|
+
function ci(i) {
|
|
48
|
+
if (i.__esModule) return i;
|
|
49
|
+
var t = i.default;
|
|
50
|
+
if (typeof t == "function") {
|
|
51
|
+
var e = function s() {
|
|
52
|
+
return this instanceof s ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
|
|
53
|
+
};
|
|
54
|
+
e.prototype = t.prototype;
|
|
55
|
+
} else e = {};
|
|
56
|
+
return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(i).forEach(function(s) {
|
|
57
|
+
var n = Object.getOwnPropertyDescriptor(i, s);
|
|
58
|
+
Object.defineProperty(e, s, n.get ? n : {
|
|
59
|
+
enumerable: !0,
|
|
60
|
+
get: function() {
|
|
61
|
+
return i[s];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}), e;
|
|
65
|
+
}
|
|
66
|
+
(function() {
|
|
67
|
+
if (!(typeof globalThis < "u"))
|
|
68
|
+
if (typeof Z < "u")
|
|
69
|
+
Z.globalThis = Z;
|
|
70
|
+
else if (typeof self < "u")
|
|
71
|
+
self.globalThis = self;
|
|
72
|
+
else if (typeof window < "u")
|
|
73
|
+
window.globalThis = window;
|
|
74
|
+
else {
|
|
75
|
+
const t = new Function("return this")();
|
|
76
|
+
t.globalThis = t;
|
|
77
|
+
}
|
|
78
|
+
})();
|
|
79
|
+
const Pt = {
|
|
18
80
|
configurable: !1,
|
|
19
81
|
enumerable: !1,
|
|
20
82
|
writable: !1
|
|
21
83
|
};
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
Reflect.defineProperty(
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
} },
|
|
30
|
-
}
|
|
31
|
-
const Ke = Object.freeze([]);
|
|
32
|
-
function _() {
|
|
33
|
-
const s = /* @__PURE__ */ new WeakMap();
|
|
34
|
-
return function(e) {
|
|
35
|
-
let t = s.get(e);
|
|
36
|
-
if (t === void 0) {
|
|
37
|
-
let i = Reflect.getPrototypeOf(e);
|
|
38
|
-
for (; t === void 0 && i !== null; )
|
|
39
|
-
t = s.get(i), i = Reflect.getPrototypeOf(i);
|
|
40
|
-
t = t === void 0 ? [] : t.slice(0), s.set(e, t);
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
84
|
+
globalThis.FAST === void 0 && Reflect.defineProperty(globalThis, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, Pt));
|
|
85
|
+
const g = globalThis.FAST;
|
|
86
|
+
if (g.getById === void 0) {
|
|
87
|
+
const i = /* @__PURE__ */ Object.create(null);
|
|
88
|
+
Reflect.defineProperty(g, "getById", Object.assign({ value(t, e) {
|
|
89
|
+
let s = i[t];
|
|
90
|
+
return s === void 0 && (s = e ? i[t] = e() : null), s;
|
|
91
|
+
} }, Pt));
|
|
44
92
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
o.call();
|
|
54
|
-
} catch (a) {
|
|
55
|
-
e.push(a), setTimeout(t, 0);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function n() {
|
|
59
|
-
let a = 0;
|
|
60
|
-
for (; a < s.length; )
|
|
61
|
-
if (i(s[a]), a++, a > 1024) {
|
|
62
|
-
for (let c = 0, l = s.length - a; c < l; c++)
|
|
63
|
-
s[c] = s[c + a];
|
|
64
|
-
s.length -= a, a = 0;
|
|
65
|
-
}
|
|
66
|
-
s.length = 0;
|
|
67
|
-
}
|
|
68
|
-
function r(o) {
|
|
69
|
-
s.length < 1 && v.requestAnimationFrame(n), s.push(o);
|
|
93
|
+
g.error === void 0 && Object.assign(g, {
|
|
94
|
+
warn() {
|
|
95
|
+
},
|
|
96
|
+
error(i) {
|
|
97
|
+
return new Error(`Error ${i}`);
|
|
98
|
+
},
|
|
99
|
+
addMessages() {
|
|
70
100
|
}
|
|
101
|
+
});
|
|
102
|
+
const di = Object.freeze([]);
|
|
103
|
+
function Dt() {
|
|
104
|
+
const i = /* @__PURE__ */ new Map();
|
|
71
105
|
return Object.freeze({
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
register(t) {
|
|
107
|
+
return i.has(t.type) ? !1 : (i.set(t.type, t), !0);
|
|
108
|
+
},
|
|
109
|
+
getByType(t) {
|
|
110
|
+
return i.get(t);
|
|
111
|
+
},
|
|
112
|
+
getForInstance(t) {
|
|
113
|
+
if (t != null)
|
|
114
|
+
return i.get(t.constructor);
|
|
115
|
+
}
|
|
74
116
|
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
117
|
+
}
|
|
118
|
+
function zt() {
|
|
119
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
120
|
+
return function(t) {
|
|
121
|
+
let e = i.get(t);
|
|
122
|
+
if (e === void 0) {
|
|
123
|
+
let s = Reflect.getPrototypeOf(t);
|
|
124
|
+
for (; e === void 0 && s !== null; )
|
|
125
|
+
e = i.get(s), s = Reflect.getPrototypeOf(s);
|
|
126
|
+
e = e === void 0 ? [] : e.slice(0), i.set(t, e);
|
|
127
|
+
}
|
|
128
|
+
return e;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function x(i) {
|
|
132
|
+
i.prototype.toJSON = pe;
|
|
133
|
+
}
|
|
134
|
+
const b = Object.freeze({
|
|
80
135
|
/**
|
|
81
|
-
*
|
|
136
|
+
* Not aspected.
|
|
82
137
|
*/
|
|
83
|
-
|
|
138
|
+
none: 0,
|
|
84
139
|
/**
|
|
85
|
-
*
|
|
86
|
-
* @param policy - The policy to set for HTML.
|
|
87
|
-
* @remarks
|
|
88
|
-
* This API can only be called once, for security reasons. It should be
|
|
89
|
-
* called by the application developer at the start of their program.
|
|
140
|
+
* An attribute.
|
|
90
141
|
*/
|
|
91
|
-
|
|
92
|
-
if (k !== te)
|
|
93
|
-
throw new Error("The HTML policy can only be set once.");
|
|
94
|
-
k = s;
|
|
95
|
-
},
|
|
142
|
+
attribute: 1,
|
|
96
143
|
/**
|
|
97
|
-
*
|
|
98
|
-
* @param html - The string to turn into trusted HTML.
|
|
99
|
-
* @remarks
|
|
100
|
-
* Used internally by the template engine when creating templates
|
|
101
|
-
* and setting innerHTML.
|
|
144
|
+
* A boolean attribute.
|
|
102
145
|
*/
|
|
103
|
-
|
|
104
|
-
return k.createHTML(s);
|
|
105
|
-
},
|
|
146
|
+
booleanAttribute: 2,
|
|
106
147
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @param node - The node to test.
|
|
148
|
+
* A property.
|
|
109
149
|
*/
|
|
110
|
-
|
|
111
|
-
return s && s.nodeType === 8 && s.data.startsWith(m);
|
|
112
|
-
},
|
|
150
|
+
property: 3,
|
|
113
151
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @param node - The marker node to extract the index from.
|
|
152
|
+
* Content
|
|
116
153
|
*/
|
|
117
|
-
|
|
118
|
-
return parseInt(s.data.replace(`${m}:`, ""));
|
|
119
|
-
},
|
|
154
|
+
content: 4,
|
|
120
155
|
/**
|
|
121
|
-
*
|
|
122
|
-
* an attribute value or HTML content.
|
|
123
|
-
* @param index - The directive index to create the placeholder for.
|
|
124
|
-
* @remarks
|
|
125
|
-
* Used internally by binding directives.
|
|
156
|
+
* A token list.
|
|
126
157
|
*/
|
|
127
|
-
|
|
128
|
-
return `${se}${s}${R}`;
|
|
129
|
-
},
|
|
158
|
+
tokenList: 5,
|
|
130
159
|
/**
|
|
131
|
-
*
|
|
132
|
-
* element.
|
|
133
|
-
* @param attributeName - The name of the custom attribute.
|
|
134
|
-
* @param index - The directive index to create the placeholder for.
|
|
135
|
-
* @remarks
|
|
136
|
-
* Used internally by attribute directives such as `ref`, `slotted`, and `children`.
|
|
160
|
+
* An event.
|
|
137
161
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
162
|
+
event: 6
|
|
163
|
+
}), pt = (i) => i, be = globalThis.trustedTypes ? globalThis.trustedTypes.createPolicy("fast-html", { createHTML: pt }) : { createHTML: pt };
|
|
164
|
+
let H = Object.freeze({
|
|
165
|
+
createHTML(i) {
|
|
166
|
+
return be.createHTML(i);
|
|
140
167
|
},
|
|
168
|
+
protect(i, t, e, s) {
|
|
169
|
+
return s;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const ge = H, $ = Object.freeze({
|
|
141
173
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @param index - The directive index to create the placeholder for.
|
|
144
|
-
* @remarks
|
|
145
|
-
* Used internally by structural directives such as `repeat`.
|
|
174
|
+
* Gets the dom policy used by the templating system.
|
|
146
175
|
*/
|
|
147
|
-
|
|
148
|
-
return
|
|
176
|
+
get policy() {
|
|
177
|
+
return H;
|
|
149
178
|
},
|
|
150
179
|
/**
|
|
151
|
-
*
|
|
152
|
-
* @param
|
|
153
|
-
*/
|
|
154
|
-
queueUpdate: N.enqueue,
|
|
155
|
-
/**
|
|
156
|
-
* Immediately processes all work previously scheduled
|
|
157
|
-
* through queueUpdate.
|
|
180
|
+
* Sets the dom policy used by the templating system.
|
|
181
|
+
* @param policy - The policy to set.
|
|
158
182
|
* @remarks
|
|
159
|
-
* This
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
processUpdates: N.process,
|
|
163
|
-
/**
|
|
164
|
-
* Resolves with the next DOM update.
|
|
183
|
+
* This API can only be called once, for security reasons. It should be
|
|
184
|
+
* called by the application developer at the start of their program.
|
|
165
185
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
186
|
+
setPolicy(i) {
|
|
187
|
+
if (H !== ge)
|
|
188
|
+
throw g.error(
|
|
189
|
+
1201
|
|
190
|
+
/* Message.onlySetDOMPolicyOnce */
|
|
191
|
+
);
|
|
192
|
+
H = i;
|
|
168
193
|
},
|
|
169
194
|
/**
|
|
170
195
|
* Sets an attribute value on an element.
|
|
@@ -175,8 +200,8 @@ const m = `fast-${Math.random().toString(36).substring(2, 8)}`, se = `${m}{`, R
|
|
|
175
200
|
* If the value is `null` or `undefined`, the attribute is removed, otherwise
|
|
176
201
|
* it is set to the provided value using the standard `setAttribute` API.
|
|
177
202
|
*/
|
|
178
|
-
setAttribute(
|
|
179
|
-
|
|
203
|
+
setAttribute(i, t, e) {
|
|
204
|
+
e == null ? i.removeAttribute(t) : i.setAttribute(t, e);
|
|
180
205
|
},
|
|
181
206
|
/**
|
|
182
207
|
* Sets a boolean attribute value.
|
|
@@ -186,218 +211,252 @@ const m = `fast-${Math.random().toString(36).substring(2, 8)}`, se = `${m}{`, R
|
|
|
186
211
|
* @remarks
|
|
187
212
|
* If the value is true, the attribute is added; otherwise it is removed.
|
|
188
213
|
*/
|
|
189
|
-
setBooleanAttribute(
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
)
|
|
214
|
+
setBooleanAttribute(i, t, e) {
|
|
215
|
+
e ? i.setAttribute(t, "") : i.removeAttribute(t);
|
|
216
|
+
}
|
|
217
|
+
}), Ut = g.getById(k.updateQueue, () => {
|
|
218
|
+
const i = [], t = [], e = globalThis.requestAnimationFrame;
|
|
219
|
+
let s = !0;
|
|
220
|
+
function n() {
|
|
221
|
+
if (t.length)
|
|
222
|
+
throw t.shift();
|
|
223
|
+
}
|
|
224
|
+
function r(d) {
|
|
225
|
+
try {
|
|
226
|
+
d.call();
|
|
227
|
+
} catch (l) {
|
|
228
|
+
if (s)
|
|
229
|
+
t.push(l), setTimeout(n, 0);
|
|
230
|
+
else
|
|
231
|
+
throw i.length = 0, l;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function a() {
|
|
235
|
+
let l = 0;
|
|
236
|
+
for (; l < i.length; )
|
|
237
|
+
if (r(i[l]), l++, l > 1024) {
|
|
238
|
+
for (let o = 0, h = i.length - l; o < h; o++)
|
|
239
|
+
i[o] = i[o + l];
|
|
240
|
+
i.length -= l, l = 0;
|
|
241
|
+
}
|
|
242
|
+
i.length = 0;
|
|
243
|
+
}
|
|
244
|
+
function c(d) {
|
|
245
|
+
i.push(d), i.length < 2 && (s ? e(a) : a());
|
|
212
246
|
}
|
|
247
|
+
return Object.freeze({
|
|
248
|
+
enqueue: c,
|
|
249
|
+
next: () => new Promise(c),
|
|
250
|
+
process: a,
|
|
251
|
+
setMode: (d) => s = d
|
|
252
|
+
});
|
|
213
253
|
});
|
|
214
|
-
class
|
|
254
|
+
class rt {
|
|
215
255
|
/**
|
|
216
|
-
* Creates an instance of SubscriberSet for the specified
|
|
217
|
-
* @param
|
|
256
|
+
* Creates an instance of SubscriberSet for the specified subject.
|
|
257
|
+
* @param subject - The subject that subscribers will receive notifications from.
|
|
218
258
|
* @param initialSubscriber - An initial subscriber to changes.
|
|
219
259
|
*/
|
|
220
|
-
constructor(
|
|
221
|
-
this.sub1 = void 0, this.sub2 = void 0, this.spillover = void 0, this.
|
|
260
|
+
constructor(t, e) {
|
|
261
|
+
this.sub1 = void 0, this.sub2 = void 0, this.spillover = void 0, this.subject = t, this.sub1 = e;
|
|
222
262
|
}
|
|
223
263
|
/**
|
|
224
264
|
* Checks whether the provided subscriber has been added to this set.
|
|
225
265
|
* @param subscriber - The subscriber to test for inclusion in this set.
|
|
226
266
|
*/
|
|
227
|
-
has(
|
|
228
|
-
return this.spillover === void 0 ? this.sub1 ===
|
|
267
|
+
has(t) {
|
|
268
|
+
return this.spillover === void 0 ? this.sub1 === t || this.sub2 === t : this.spillover.indexOf(t) !== -1;
|
|
229
269
|
}
|
|
230
270
|
/**
|
|
231
271
|
* Subscribes to notification of changes in an object's state.
|
|
232
272
|
* @param subscriber - The object that is subscribing for change notification.
|
|
233
273
|
*/
|
|
234
|
-
subscribe(
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
if (this.has(
|
|
274
|
+
subscribe(t) {
|
|
275
|
+
const e = this.spillover;
|
|
276
|
+
if (e === void 0) {
|
|
277
|
+
if (this.has(t))
|
|
238
278
|
return;
|
|
239
279
|
if (this.sub1 === void 0) {
|
|
240
|
-
this.sub1 =
|
|
280
|
+
this.sub1 = t;
|
|
241
281
|
return;
|
|
242
282
|
}
|
|
243
283
|
if (this.sub2 === void 0) {
|
|
244
|
-
this.sub2 =
|
|
284
|
+
this.sub2 = t;
|
|
245
285
|
return;
|
|
246
286
|
}
|
|
247
|
-
this.spillover = [this.sub1, this.sub2,
|
|
287
|
+
this.spillover = [this.sub1, this.sub2, t], this.sub1 = void 0, this.sub2 = void 0;
|
|
248
288
|
} else
|
|
249
|
-
|
|
289
|
+
e.indexOf(t) === -1 && e.push(t);
|
|
250
290
|
}
|
|
251
291
|
/**
|
|
252
292
|
* Unsubscribes from notification of changes in an object's state.
|
|
253
293
|
* @param subscriber - The object that is unsubscribing from change notification.
|
|
254
294
|
*/
|
|
255
|
-
unsubscribe(
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
this.sub1 ===
|
|
295
|
+
unsubscribe(t) {
|
|
296
|
+
const e = this.spillover;
|
|
297
|
+
if (e === void 0)
|
|
298
|
+
this.sub1 === t ? this.sub1 = void 0 : this.sub2 === t && (this.sub2 = void 0);
|
|
259
299
|
else {
|
|
260
|
-
const
|
|
261
|
-
|
|
300
|
+
const s = e.indexOf(t);
|
|
301
|
+
s !== -1 && e.splice(s, 1);
|
|
262
302
|
}
|
|
263
303
|
}
|
|
264
304
|
/**
|
|
265
305
|
* Notifies all subscribers.
|
|
266
306
|
* @param args - Data passed along to subscribers during notification.
|
|
267
307
|
*/
|
|
268
|
-
notify(
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
308
|
+
notify(t) {
|
|
309
|
+
const e = this.spillover, s = this.subject;
|
|
310
|
+
if (e === void 0) {
|
|
271
311
|
const n = this.sub1, r = this.sub2;
|
|
272
|
-
n !== void 0 && n.handleChange(
|
|
312
|
+
n !== void 0 && n.handleChange(s, t), r !== void 0 && r.handleChange(s, t);
|
|
273
313
|
} else
|
|
274
|
-
for (let n = 0, r =
|
|
275
|
-
|
|
314
|
+
for (let n = 0, r = e.length; n < r; ++n)
|
|
315
|
+
e[n].handleChange(s, t);
|
|
276
316
|
}
|
|
277
317
|
}
|
|
278
|
-
class
|
|
318
|
+
class Wt {
|
|
279
319
|
/**
|
|
280
|
-
* Creates an instance of PropertyChangeNotifier for the specified
|
|
281
|
-
* @param
|
|
320
|
+
* Creates an instance of PropertyChangeNotifier for the specified subject.
|
|
321
|
+
* @param subject - The object that subscribers will receive notifications for.
|
|
282
322
|
*/
|
|
283
|
-
constructor(
|
|
284
|
-
this.subscribers = {}, this.
|
|
323
|
+
constructor(t) {
|
|
324
|
+
this.subscribers = {}, this.subjectSubscribers = null, this.subject = t;
|
|
285
325
|
}
|
|
286
326
|
/**
|
|
287
327
|
* Notifies all subscribers, based on the specified property.
|
|
288
328
|
* @param propertyName - The property name, passed along to subscribers during notification.
|
|
289
329
|
*/
|
|
290
|
-
notify(
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
i !== void 0 && i.notify(e), (t = this.sourceSubscribers) === null || t === void 0 || t.notify(e);
|
|
330
|
+
notify(t) {
|
|
331
|
+
var e, s;
|
|
332
|
+
(e = this.subscribers[t]) === null || e === void 0 || e.notify(t), (s = this.subjectSubscribers) === null || s === void 0 || s.notify(t);
|
|
294
333
|
}
|
|
295
334
|
/**
|
|
296
335
|
* Subscribes to notification of changes in an object's state.
|
|
297
336
|
* @param subscriber - The object that is subscribing for change notification.
|
|
298
337
|
* @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.
|
|
299
338
|
*/
|
|
300
|
-
subscribe(
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
n === void 0 && (this.subscribers[t] = n = new I(this.source)), n.subscribe(e);
|
|
305
|
-
} else
|
|
306
|
-
this.sourceSubscribers = (i = this.sourceSubscribers) !== null && i !== void 0 ? i : new I(this.source), this.sourceSubscribers.subscribe(e);
|
|
339
|
+
subscribe(t, e) {
|
|
340
|
+
var s, n;
|
|
341
|
+
let r;
|
|
342
|
+
e ? r = (s = this.subscribers[e]) !== null && s !== void 0 ? s : this.subscribers[e] = new rt(this.subject) : r = (n = this.subjectSubscribers) !== null && n !== void 0 ? n : this.subjectSubscribers = new rt(this.subject), r.subscribe(t);
|
|
307
343
|
}
|
|
308
344
|
/**
|
|
309
345
|
* Unsubscribes from notification of changes in an object's state.
|
|
310
346
|
* @param subscriber - The object that is unsubscribing from change notification.
|
|
311
347
|
* @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.
|
|
312
348
|
*/
|
|
313
|
-
unsubscribe(
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
const n = this.subscribers[t];
|
|
317
|
-
n !== void 0 && n.unsubscribe(e);
|
|
318
|
-
} else
|
|
319
|
-
(i = this.sourceSubscribers) === null || i === void 0 || i.unsubscribe(e);
|
|
349
|
+
unsubscribe(t, e) {
|
|
350
|
+
var s, n;
|
|
351
|
+
e ? (s = this.subscribers[e]) === null || s === void 0 || s.unsubscribe(t) : (n = this.subjectSubscribers) === null || n === void 0 || n.unsubscribe(t);
|
|
320
352
|
}
|
|
321
353
|
}
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
354
|
+
const G = Object.freeze({
|
|
355
|
+
/**
|
|
356
|
+
* The source to controller lifetime relationship is unknown.
|
|
357
|
+
*/
|
|
358
|
+
unknown: void 0,
|
|
359
|
+
/**
|
|
360
|
+
* The source and controller lifetimes are coupled to one another.
|
|
361
|
+
* They can/will be GC'd together.
|
|
362
|
+
*/
|
|
363
|
+
coupled: 1
|
|
364
|
+
}), p = g.getById(k.observable, () => {
|
|
365
|
+
const i = Ut.enqueue, t = /(:|&&|\|\||if|\?\.)/, e = /* @__PURE__ */ new WeakMap();
|
|
366
|
+
let s, n = (l) => {
|
|
367
|
+
throw g.error(
|
|
368
|
+
1101
|
|
369
|
+
/* Message.needsArrayObservation */
|
|
370
|
+
);
|
|
326
371
|
};
|
|
327
372
|
function r(l) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
373
|
+
var o;
|
|
374
|
+
let h = (o = l.$fastController) !== null && o !== void 0 ? o : e.get(l);
|
|
375
|
+
return h === void 0 && (Array.isArray(l) ? h = n(l) : e.set(l, h = new Wt(l))), h;
|
|
376
|
+
}
|
|
377
|
+
const a = zt();
|
|
378
|
+
class c {
|
|
379
|
+
constructor(o) {
|
|
380
|
+
this.name = o, this.field = `_${o}`, this.callback = `${o}Changed`;
|
|
381
|
+
}
|
|
382
|
+
getValue(o) {
|
|
383
|
+
return s !== void 0 && s.watch(o, this.name), o[this.field];
|
|
384
|
+
}
|
|
385
|
+
setValue(o, h) {
|
|
386
|
+
const u = this.field, y = o[u];
|
|
387
|
+
if (y !== h) {
|
|
388
|
+
o[u] = h;
|
|
389
|
+
const C = o[this.callback];
|
|
390
|
+
O(C) && C.call(o, y, h), r(o).notify(this.name);
|
|
345
391
|
}
|
|
346
392
|
}
|
|
347
393
|
}
|
|
348
|
-
class
|
|
349
|
-
constructor(
|
|
350
|
-
super(
|
|
394
|
+
class d extends rt {
|
|
395
|
+
constructor(o, h, u = !1) {
|
|
396
|
+
super(o, h), this.expression = o, this.isVolatileBinding = u, this.needsRefresh = !0, this.needsQueue = !0, this.isAsync = !0, this.first = this, this.last = null, this.propertySource = void 0, this.propertyName = void 0, this.notifier = void 0, this.next = void 0;
|
|
397
|
+
}
|
|
398
|
+
setMode(o) {
|
|
399
|
+
this.isAsync = this.needsQueue = o;
|
|
400
|
+
}
|
|
401
|
+
bind(o) {
|
|
402
|
+
this.controller = o;
|
|
403
|
+
const h = this.observe(o.source, o.context);
|
|
404
|
+
return !o.isBound && this.requiresUnbind(o) && o.onUnbind(this), h;
|
|
351
405
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
406
|
+
requiresUnbind(o) {
|
|
407
|
+
return o.sourceLifetime !== G.coupled || this.first !== this.last || this.first.propertySource !== o.source;
|
|
408
|
+
}
|
|
409
|
+
unbind(o) {
|
|
410
|
+
this.dispose();
|
|
411
|
+
}
|
|
412
|
+
observe(o, h) {
|
|
413
|
+
this.needsRefresh && this.last !== null && this.dispose();
|
|
414
|
+
const u = s;
|
|
415
|
+
s = this.needsRefresh ? this : void 0, this.needsRefresh = this.isVolatileBinding;
|
|
416
|
+
let y;
|
|
417
|
+
try {
|
|
418
|
+
y = this.expression(o, h);
|
|
419
|
+
} finally {
|
|
420
|
+
s = u;
|
|
421
|
+
}
|
|
422
|
+
return y;
|
|
358
423
|
}
|
|
424
|
+
// backwards compat with v1 kernel
|
|
359
425
|
disconnect() {
|
|
426
|
+
this.dispose();
|
|
427
|
+
}
|
|
428
|
+
dispose() {
|
|
360
429
|
if (this.last !== null) {
|
|
361
|
-
let
|
|
362
|
-
for (;
|
|
363
|
-
|
|
364
|
-
this.last = null, this.needsRefresh = this.needsQueue =
|
|
430
|
+
let o = this.first;
|
|
431
|
+
for (; o !== void 0; )
|
|
432
|
+
o.notifier.unsubscribe(this, o.propertyName), o = o.next;
|
|
433
|
+
this.last = null, this.needsRefresh = this.needsQueue = this.isAsync;
|
|
365
434
|
}
|
|
366
435
|
}
|
|
367
|
-
watch(
|
|
368
|
-
const
|
|
369
|
-
if (
|
|
436
|
+
watch(o, h) {
|
|
437
|
+
const u = this.last, y = r(o), C = u === null ? this.first : {};
|
|
438
|
+
if (C.propertySource = o, C.propertyName = h, C.notifier = y, y.subscribe(this, h), u !== null) {
|
|
370
439
|
if (!this.needsRefresh) {
|
|
371
|
-
let
|
|
372
|
-
|
|
440
|
+
let ut;
|
|
441
|
+
s = void 0, ut = u.propertySource[u.propertyName], s = this, o === ut && (this.needsRefresh = !0);
|
|
373
442
|
}
|
|
374
|
-
|
|
443
|
+
u.next = C;
|
|
375
444
|
}
|
|
376
|
-
this.last =
|
|
445
|
+
this.last = C;
|
|
377
446
|
}
|
|
378
447
|
handleChange() {
|
|
379
|
-
this.needsQueue
|
|
448
|
+
this.needsQueue ? (this.needsQueue = !1, i(this)) : this.isAsync || this.call();
|
|
380
449
|
}
|
|
381
450
|
call() {
|
|
382
|
-
this.last !== null && (this.needsQueue =
|
|
383
|
-
}
|
|
384
|
-
records() {
|
|
385
|
-
let
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
const d = h;
|
|
389
|
-
return d === void 0 ? { value: void 0, done: !0 } : (h = h.next, {
|
|
390
|
-
value: d,
|
|
391
|
-
done: !1
|
|
392
|
-
});
|
|
393
|
-
},
|
|
394
|
-
[Symbol.iterator]: function() {
|
|
395
|
-
return this;
|
|
396
|
-
}
|
|
397
|
-
};
|
|
451
|
+
this.last !== null && (this.needsQueue = this.isAsync, this.notify(this));
|
|
452
|
+
}
|
|
453
|
+
*records() {
|
|
454
|
+
let o = this.first;
|
|
455
|
+
for (; o !== void 0; )
|
|
456
|
+
yield o, o = o.next;
|
|
398
457
|
}
|
|
399
458
|
}
|
|
400
|
-
return Object.freeze({
|
|
459
|
+
return x(d), Object.freeze({
|
|
401
460
|
/**
|
|
402
461
|
* @internal
|
|
403
462
|
* @param factory - The factory used to create array observers.
|
|
@@ -415,23 +474,23 @@ const b = S.getById(2, () => {
|
|
|
415
474
|
* @param source - The object to record the change against.
|
|
416
475
|
* @param propertyName - The property to track as changed.
|
|
417
476
|
*/
|
|
418
|
-
track(l,
|
|
419
|
-
|
|
477
|
+
track(l, o) {
|
|
478
|
+
s && s.watch(l, o);
|
|
420
479
|
},
|
|
421
480
|
/**
|
|
422
481
|
* Notifies watchers that the currently executing property getter or function is volatile
|
|
423
482
|
* with respect to its observable dependencies.
|
|
424
483
|
*/
|
|
425
484
|
trackVolatile() {
|
|
426
|
-
|
|
485
|
+
s && (s.needsRefresh = !0);
|
|
427
486
|
},
|
|
428
487
|
/**
|
|
429
488
|
* Notifies subscribers of a source object of changes.
|
|
430
489
|
* @param source - the object to notify of changes.
|
|
431
490
|
* @param args - The change args to pass to subscribers.
|
|
432
491
|
*/
|
|
433
|
-
notify(l,
|
|
434
|
-
r(l).notify(
|
|
492
|
+
notify(l, o) {
|
|
493
|
+
r(l).notify(o);
|
|
435
494
|
},
|
|
436
495
|
/**
|
|
437
496
|
* Defines an observable property on an object or prototype.
|
|
@@ -439,14 +498,14 @@ const b = S.getById(2, () => {
|
|
|
439
498
|
* @param nameOrAccessor - The name of the property to define as observable;
|
|
440
499
|
* or a custom accessor that specifies the property name and accessor implementation.
|
|
441
500
|
*/
|
|
442
|
-
defineProperty(l,
|
|
443
|
-
|
|
501
|
+
defineProperty(l, o) {
|
|
502
|
+
B(o) && (o = new c(o)), a(l).push(o), Reflect.defineProperty(l, o.name, {
|
|
444
503
|
enumerable: !0,
|
|
445
|
-
get
|
|
446
|
-
return
|
|
504
|
+
get() {
|
|
505
|
+
return o.getValue(this);
|
|
447
506
|
},
|
|
448
|
-
set
|
|
449
|
-
|
|
507
|
+
set(h) {
|
|
508
|
+
o.setValue(this, h);
|
|
450
509
|
}
|
|
451
510
|
});
|
|
452
511
|
},
|
|
@@ -455,57 +514,532 @@ const b = S.getById(2, () => {
|
|
|
455
514
|
* including its prototype chain.
|
|
456
515
|
* @param target - The target object to search for accessor on.
|
|
457
516
|
*/
|
|
458
|
-
getAccessors:
|
|
517
|
+
getAccessors: a,
|
|
459
518
|
/**
|
|
460
|
-
* Creates a {@link
|
|
461
|
-
* provided {@link
|
|
462
|
-
* @param
|
|
519
|
+
* Creates a {@link ExpressionNotifier} that can watch the
|
|
520
|
+
* provided {@link Expression} for changes.
|
|
521
|
+
* @param expression - The binding to observe.
|
|
463
522
|
* @param initialSubscriber - An initial subscriber to changes in the binding value.
|
|
464
523
|
* @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
|
|
465
524
|
*/
|
|
466
|
-
binding(l,
|
|
467
|
-
return new
|
|
525
|
+
binding(l, o, h = this.isVolatileBinding(l)) {
|
|
526
|
+
return new d(l, o, h);
|
|
468
527
|
},
|
|
469
528
|
/**
|
|
470
529
|
* Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
|
|
471
530
|
* on every evaluation of the value.
|
|
472
|
-
* @param
|
|
531
|
+
* @param expression - The binding to inspect.
|
|
473
532
|
*/
|
|
474
533
|
isVolatileBinding(l) {
|
|
475
|
-
return
|
|
534
|
+
return t.test(l.toString());
|
|
476
535
|
}
|
|
477
536
|
});
|
|
478
537
|
});
|
|
479
|
-
function
|
|
480
|
-
|
|
538
|
+
function hi(i, t) {
|
|
539
|
+
p.defineProperty(i, t);
|
|
481
540
|
}
|
|
482
|
-
function
|
|
483
|
-
return Object.assign({},
|
|
484
|
-
get
|
|
485
|
-
return
|
|
541
|
+
function ui(i, t, e) {
|
|
542
|
+
return Object.assign({}, e, {
|
|
543
|
+
get() {
|
|
544
|
+
return p.trackVolatile(), e.get.apply(this);
|
|
486
545
|
}
|
|
487
546
|
});
|
|
488
547
|
}
|
|
489
|
-
const
|
|
490
|
-
let
|
|
548
|
+
const bt = g.getById(k.contextEvent, () => {
|
|
549
|
+
let i = null;
|
|
491
550
|
return {
|
|
492
551
|
get() {
|
|
493
|
-
return
|
|
552
|
+
return i;
|
|
494
553
|
},
|
|
495
|
-
set(
|
|
496
|
-
|
|
554
|
+
set(t) {
|
|
555
|
+
i = t;
|
|
497
556
|
}
|
|
498
557
|
};
|
|
558
|
+
}), M = Object.freeze({
|
|
559
|
+
/**
|
|
560
|
+
* A default execution context.
|
|
561
|
+
*/
|
|
562
|
+
default: {
|
|
563
|
+
index: 0,
|
|
564
|
+
length: 0,
|
|
565
|
+
get event() {
|
|
566
|
+
return M.getEvent();
|
|
567
|
+
},
|
|
568
|
+
eventDetail() {
|
|
569
|
+
return this.event.detail;
|
|
570
|
+
},
|
|
571
|
+
eventTarget() {
|
|
572
|
+
return this.event.target;
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
/**
|
|
576
|
+
* Gets the current event.
|
|
577
|
+
* @returns An event object.
|
|
578
|
+
*/
|
|
579
|
+
getEvent() {
|
|
580
|
+
return bt.get();
|
|
581
|
+
},
|
|
582
|
+
/**
|
|
583
|
+
* Sets the current event.
|
|
584
|
+
* @param event - An event object.
|
|
585
|
+
*/
|
|
586
|
+
setEvent(i) {
|
|
587
|
+
bt.set(i);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
class lt {
|
|
591
|
+
/**
|
|
592
|
+
* Creates a binding.
|
|
593
|
+
* @param evaluate - Evaluates the binding.
|
|
594
|
+
* @param policy - The security policy to associate with this binding.
|
|
595
|
+
* @param isVolatile - Indicates whether the binding is volatile.
|
|
596
|
+
*/
|
|
597
|
+
constructor(t, e, s = !1) {
|
|
598
|
+
this.evaluate = t, this.policy = e, this.isVolatile = s;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
class ye extends lt {
|
|
602
|
+
createObserver(t) {
|
|
603
|
+
return p.binding(this.evaluate, t, this.isVolatile);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function qt(i, t, e = p.isVolatileBinding(i)) {
|
|
607
|
+
return new ye(i, t, e);
|
|
608
|
+
}
|
|
609
|
+
class Qt extends lt {
|
|
610
|
+
createObserver() {
|
|
611
|
+
return this;
|
|
612
|
+
}
|
|
613
|
+
bind(t) {
|
|
614
|
+
return this.evaluate(t.source, t.context);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
x(Qt);
|
|
618
|
+
function Gt(i, t) {
|
|
619
|
+
return new Qt(i, t);
|
|
620
|
+
}
|
|
621
|
+
let gt;
|
|
622
|
+
function Jt(i) {
|
|
623
|
+
return i.map((t) => t instanceof v ? Jt(t.styles) : [t]).reduce((t, e) => t.concat(e), []);
|
|
624
|
+
}
|
|
625
|
+
class v {
|
|
626
|
+
/**
|
|
627
|
+
* Creates an instance of ElementStyles.
|
|
628
|
+
* @param styles - The styles that will be associated with elements.
|
|
629
|
+
*/
|
|
630
|
+
constructor(t) {
|
|
631
|
+
this.styles = t, this.targets = /* @__PURE__ */ new WeakSet(), this._strategy = null, this.behaviors = t.map((e) => e instanceof v ? e.behaviors : null).reduce((e, s) => s === null ? e : e === null ? s : e.concat(s), null);
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Gets the StyleStrategy associated with these element styles.
|
|
635
|
+
*/
|
|
636
|
+
get strategy() {
|
|
637
|
+
return this._strategy === null && this.withStrategy(gt), this._strategy;
|
|
638
|
+
}
|
|
639
|
+
/** @internal */
|
|
640
|
+
addStylesTo(t) {
|
|
641
|
+
this.strategy.addStylesTo(t), this.targets.add(t);
|
|
642
|
+
}
|
|
643
|
+
/** @internal */
|
|
644
|
+
removeStylesFrom(t) {
|
|
645
|
+
this.strategy.removeStylesFrom(t), this.targets.delete(t);
|
|
646
|
+
}
|
|
647
|
+
/** @internal */
|
|
648
|
+
isAttachedTo(t) {
|
|
649
|
+
return this.targets.has(t);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Associates behaviors with this set of styles.
|
|
653
|
+
* @param behaviors - The behaviors to associate.
|
|
654
|
+
*/
|
|
655
|
+
withBehaviors(...t) {
|
|
656
|
+
return this.behaviors = this.behaviors === null ? t : this.behaviors.concat(t), this;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Sets the strategy that handles adding/removing these styles for an element.
|
|
660
|
+
* @param strategy - The strategy to use.
|
|
661
|
+
*/
|
|
662
|
+
withStrategy(t) {
|
|
663
|
+
return this._strategy = new t(Jt(this.styles)), this;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Sets the default strategy type to use when creating style strategies.
|
|
667
|
+
* @param Strategy - The strategy type to construct.
|
|
668
|
+
*/
|
|
669
|
+
static setDefaultStrategy(t) {
|
|
670
|
+
gt = t;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Normalizes a set of composable style options.
|
|
674
|
+
* @param styles - The style options to normalize.
|
|
675
|
+
* @returns A singular ElementStyles instance or undefined.
|
|
676
|
+
*/
|
|
677
|
+
static normalize(t) {
|
|
678
|
+
return t === void 0 ? void 0 : Array.isArray(t) ? new v(t) : t instanceof v ? t : new v([t]);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
v.supportsAdoptedStyleSheets = Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype;
|
|
682
|
+
const yt = /fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/, vt = /fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/, mt = /fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/, wt = /fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/, St = /^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/, Ct = /fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;
|
|
683
|
+
function $t(i) {
|
|
684
|
+
return i && i.nodeType === Node.COMMENT_NODE;
|
|
685
|
+
}
|
|
686
|
+
const m = Object.freeze({
|
|
687
|
+
attributeMarkerName: "data-fe-b",
|
|
688
|
+
attributeBindingSeparator: " ",
|
|
689
|
+
contentBindingStartMarker(i, t) {
|
|
690
|
+
return `fe-b$$start$$${i}$$${t}$$fe-b`;
|
|
691
|
+
},
|
|
692
|
+
contentBindingEndMarker(i, t) {
|
|
693
|
+
return `fe-b$$end$$${i}$$${t}$$fe-b`;
|
|
694
|
+
},
|
|
695
|
+
repeatStartMarker(i) {
|
|
696
|
+
return `fe-repeat$$start$$${i}$$fe-repeat`;
|
|
697
|
+
},
|
|
698
|
+
repeatEndMarker(i) {
|
|
699
|
+
return `fe-repeat$$end$$${i}$$fe-repeat`;
|
|
700
|
+
},
|
|
701
|
+
isContentBindingStartMarker(i) {
|
|
702
|
+
return yt.test(i);
|
|
703
|
+
},
|
|
704
|
+
isContentBindingEndMarker(i) {
|
|
705
|
+
return vt.test(i);
|
|
706
|
+
},
|
|
707
|
+
isRepeatViewStartMarker(i) {
|
|
708
|
+
return mt.test(i);
|
|
709
|
+
},
|
|
710
|
+
isRepeatViewEndMarker(i) {
|
|
711
|
+
return wt.test(i);
|
|
712
|
+
},
|
|
713
|
+
isElementBoundaryStartMarker(i) {
|
|
714
|
+
return $t(i) && St.test(i.data.trim());
|
|
715
|
+
},
|
|
716
|
+
isElementBoundaryEndMarker(i) {
|
|
717
|
+
return $t(i) && Ct.test(i.data);
|
|
718
|
+
},
|
|
719
|
+
/**
|
|
720
|
+
* Returns the indexes of the ViewBehaviorFactories affecting
|
|
721
|
+
* attributes for the element, or null if no factories were found.
|
|
722
|
+
*/
|
|
723
|
+
parseAttributeBinding(i) {
|
|
724
|
+
const t = i.getAttribute(this.attributeMarkerName);
|
|
725
|
+
return t === null ? t : t.split(this.attributeBindingSeparator).map((e) => parseInt(e));
|
|
726
|
+
},
|
|
727
|
+
/**
|
|
728
|
+
* Returns the indexes of the ViewBehaviorFactories affecting
|
|
729
|
+
* attributes for the element, or null if no factories were found.
|
|
730
|
+
*
|
|
731
|
+
* Uses the alternative syntax of data-fe-b-<number>
|
|
732
|
+
*/
|
|
733
|
+
parseEnumeratedAttributeBinding(i) {
|
|
734
|
+
const t = [], e = this.attributeMarkerName.length + 1, s = `${this.attributeMarkerName}-`;
|
|
735
|
+
for (const n of i.getAttributeNames())
|
|
736
|
+
if (n.startsWith(s)) {
|
|
737
|
+
const r = Number(n.slice(e));
|
|
738
|
+
if (!Number.isNaN(r))
|
|
739
|
+
t.push(r);
|
|
740
|
+
else
|
|
741
|
+
throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${s}<number>.`);
|
|
742
|
+
}
|
|
743
|
+
return t.length === 0 ? null : t;
|
|
744
|
+
},
|
|
745
|
+
/**
|
|
746
|
+
* Parses the ViewBehaviorFactory index from string data. Returns
|
|
747
|
+
* the binding index or null if the index cannot be retrieved.
|
|
748
|
+
*/
|
|
749
|
+
parseContentBindingStartMarker(i) {
|
|
750
|
+
return kt(yt, i);
|
|
751
|
+
},
|
|
752
|
+
parseContentBindingEndMarker(i) {
|
|
753
|
+
return kt(vt, i);
|
|
754
|
+
},
|
|
755
|
+
/**
|
|
756
|
+
* Parses the index of a repeat directive from a content string.
|
|
757
|
+
*/
|
|
758
|
+
parseRepeatStartMarker(i) {
|
|
759
|
+
return Tt(mt, i);
|
|
760
|
+
},
|
|
761
|
+
parseRepeatEndMarker(i) {
|
|
762
|
+
return Tt(wt, i);
|
|
763
|
+
},
|
|
764
|
+
/**
|
|
765
|
+
* Parses element Id from element boundary markers
|
|
766
|
+
*/
|
|
767
|
+
parseElementBoundaryStartMarker(i) {
|
|
768
|
+
return Nt(St, i.trim());
|
|
769
|
+
},
|
|
770
|
+
parseElementBoundaryEndMarker(i) {
|
|
771
|
+
return Nt(Ct, i);
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
function Tt(i, t) {
|
|
775
|
+
const e = i.exec(t);
|
|
776
|
+
return e === null ? e : parseInt(e[1]);
|
|
777
|
+
}
|
|
778
|
+
function Nt(i, t) {
|
|
779
|
+
const e = i.exec(t);
|
|
780
|
+
return e === null ? e : e[1];
|
|
781
|
+
}
|
|
782
|
+
function kt(i, t) {
|
|
783
|
+
const e = i.exec(t);
|
|
784
|
+
return e === null ? e : [parseInt(e[1]), e[2]];
|
|
785
|
+
}
|
|
786
|
+
const D = Symbol.for("fe-hydration");
|
|
787
|
+
function z(i) {
|
|
788
|
+
return i[D] === D;
|
|
789
|
+
}
|
|
790
|
+
const ct = `fast-${Math.random().toString(36).substring(2, 8)}`, I = `${ct}{`, _ = `}${ct}`, ve = _.length;
|
|
791
|
+
let me = 0;
|
|
792
|
+
const L = () => `${ct}-${++me}`, Kt = Object.freeze({
|
|
793
|
+
/**
|
|
794
|
+
* Creates a placeholder string suitable for marking out a location *within*
|
|
795
|
+
* an attribute value or HTML content.
|
|
796
|
+
* @param index - The directive index to create the placeholder for.
|
|
797
|
+
* @remarks
|
|
798
|
+
* Used internally by binding directives.
|
|
799
|
+
*/
|
|
800
|
+
interpolation: (i) => `${I}${i}${_}`,
|
|
801
|
+
/**
|
|
802
|
+
* Creates a placeholder that manifests itself as an attribute on an
|
|
803
|
+
* element.
|
|
804
|
+
* @param attributeName - The name of the custom attribute.
|
|
805
|
+
* @param index - The directive index to create the placeholder for.
|
|
806
|
+
* @remarks
|
|
807
|
+
* Used internally by attribute directives such as `ref`, `slotted`, and `children`.
|
|
808
|
+
*/
|
|
809
|
+
attribute: (i) => `${L()}="${I}${i}${_}"`,
|
|
810
|
+
/**
|
|
811
|
+
* Creates a placeholder that manifests itself as a marker within the DOM structure.
|
|
812
|
+
* @param index - The directive index to create the placeholder for.
|
|
813
|
+
* @remarks
|
|
814
|
+
* Used internally by structural directives such as `repeat`.
|
|
815
|
+
*/
|
|
816
|
+
comment: (i) => `<!--${I}${i}${_}-->`
|
|
817
|
+
}), J = Object.freeze({
|
|
818
|
+
/**
|
|
819
|
+
* Parses text content or HTML attribute content, separating out the static strings
|
|
820
|
+
* from the directives.
|
|
821
|
+
* @param value - The content or attribute string to parse.
|
|
822
|
+
* @param factories - A list of directives to search for in the string.
|
|
823
|
+
* @returns A heterogeneous array of static strings interspersed with
|
|
824
|
+
* directives or null if no directives are found in the string.
|
|
825
|
+
*/
|
|
826
|
+
parse(i, t) {
|
|
827
|
+
const e = i.split(I);
|
|
828
|
+
if (e.length === 1)
|
|
829
|
+
return null;
|
|
830
|
+
const s = [];
|
|
831
|
+
for (let n = 0, r = e.length; n < r; ++n) {
|
|
832
|
+
const a = e[n], c = a.indexOf(_);
|
|
833
|
+
let d;
|
|
834
|
+
if (c === -1)
|
|
835
|
+
d = a;
|
|
836
|
+
else {
|
|
837
|
+
const l = a.substring(0, c);
|
|
838
|
+
s.push(t[l]), d = a.substring(c + ve);
|
|
839
|
+
}
|
|
840
|
+
d !== "" && s.push(d);
|
|
841
|
+
}
|
|
842
|
+
return s;
|
|
843
|
+
}
|
|
844
|
+
}), tt = Dt(), T = Object.freeze({
|
|
845
|
+
/**
|
|
846
|
+
* Gets the directive definition associated with the instance.
|
|
847
|
+
* @param instance - The directive instance to retrieve the definition for.
|
|
848
|
+
*/
|
|
849
|
+
getForInstance: tt.getForInstance,
|
|
850
|
+
/**
|
|
851
|
+
* Gets the directive definition associated with the specified type.
|
|
852
|
+
* @param type - The directive type to retrieve the definition for.
|
|
853
|
+
*/
|
|
854
|
+
getByType: tt.getByType,
|
|
855
|
+
/**
|
|
856
|
+
* Defines an HTMLDirective based on the options.
|
|
857
|
+
* @param type - The type to define as a directive.
|
|
858
|
+
* @param options - Options that specify the directive's application.
|
|
859
|
+
*/
|
|
860
|
+
define(i, t) {
|
|
861
|
+
return t = t || {}, t.type = i, tt.register(t), i;
|
|
862
|
+
},
|
|
863
|
+
/**
|
|
864
|
+
*
|
|
865
|
+
* @param directive - The directive to assign the aspect to.
|
|
866
|
+
* @param value - The value to base the aspect determination on.
|
|
867
|
+
* @remarks
|
|
868
|
+
* If a falsy value is provided, then the content aspect will be assigned.
|
|
869
|
+
*/
|
|
870
|
+
assignAspect(i, t) {
|
|
871
|
+
if (!t) {
|
|
872
|
+
i.aspectType = b.content;
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
switch (i.sourceAspect = t, t[0]) {
|
|
876
|
+
case ":":
|
|
877
|
+
i.targetAspect = t.substring(1), i.aspectType = i.targetAspect === "classList" ? b.tokenList : b.property;
|
|
878
|
+
break;
|
|
879
|
+
case "?":
|
|
880
|
+
i.targetAspect = t.substring(1), i.aspectType = b.booleanAttribute;
|
|
881
|
+
break;
|
|
882
|
+
case "@":
|
|
883
|
+
i.targetAspect = t.substring(1), i.aspectType = b.event;
|
|
884
|
+
break;
|
|
885
|
+
default:
|
|
886
|
+
i.targetAspect = t, i.aspectType = b.attribute;
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
499
890
|
});
|
|
500
|
-
class
|
|
891
|
+
class we {
|
|
892
|
+
/**
|
|
893
|
+
* Creates an instance of RefDirective.
|
|
894
|
+
* @param options - The options to use in configuring the directive.
|
|
895
|
+
*/
|
|
896
|
+
constructor(t) {
|
|
897
|
+
this.options = t;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Creates a placeholder string based on the directive's index within the template.
|
|
901
|
+
* @param index - The index of the directive within the template.
|
|
902
|
+
* @remarks
|
|
903
|
+
* Creates a custom attribute placeholder.
|
|
904
|
+
*/
|
|
905
|
+
createHTML(t) {
|
|
906
|
+
return Kt.attribute(t(this));
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Creates a behavior.
|
|
910
|
+
* @param targets - The targets available for behaviors to be attached to.
|
|
911
|
+
*/
|
|
912
|
+
createBehavior() {
|
|
913
|
+
return this;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
x(we);
|
|
917
|
+
class Xt extends Error {
|
|
918
|
+
constructor(t, e, s) {
|
|
919
|
+
super(t), this.factories = e, this.node = s;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function dt(i) {
|
|
923
|
+
return i.nodeType === Node.COMMENT_NODE;
|
|
924
|
+
}
|
|
925
|
+
function Yt(i) {
|
|
926
|
+
return i.nodeType === Node.TEXT_NODE;
|
|
927
|
+
}
|
|
928
|
+
function Zt(i, t) {
|
|
929
|
+
const e = document.createRange();
|
|
930
|
+
return e.setStart(i, 0), e.setEnd(t, dt(t) || Yt(t) ? t.data.length : t.childNodes.length), e;
|
|
931
|
+
}
|
|
932
|
+
function Se(i) {
|
|
933
|
+
return i instanceof DocumentFragment && "mode" in i;
|
|
934
|
+
}
|
|
935
|
+
function Ce(i, t, e) {
|
|
936
|
+
const s = Zt(i, t), n = s.commonAncestorContainer, r = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_COMMENT + NodeFilter.SHOW_TEXT, {
|
|
937
|
+
acceptNode(l) {
|
|
938
|
+
return s.comparePoint(l, 0) === 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
|
939
|
+
}
|
|
940
|
+
}), a = {}, c = {};
|
|
941
|
+
let d = r.currentNode = i;
|
|
942
|
+
for (; d !== null; ) {
|
|
943
|
+
switch (d.nodeType) {
|
|
944
|
+
case Node.ELEMENT_NODE: {
|
|
945
|
+
$e(d, e, a);
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
case Node.COMMENT_NODE: {
|
|
949
|
+
Te(d, r, e, a, c);
|
|
950
|
+
break;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
d = r.nextNode();
|
|
954
|
+
}
|
|
955
|
+
return s.detach(), { targets: a, boundaries: c };
|
|
956
|
+
}
|
|
957
|
+
function $e(i, t, e) {
|
|
958
|
+
var s;
|
|
959
|
+
const n = (s = m.parseAttributeBinding(i)) !== null && s !== void 0 ? s : m.parseEnumeratedAttributeBinding(i);
|
|
960
|
+
if (n !== null) {
|
|
961
|
+
for (const r of n) {
|
|
962
|
+
if (!t[r])
|
|
963
|
+
throw new Xt(`HydrationView was unable to successfully target factory on ${i.nodeName} inside ${i.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`, t, i);
|
|
964
|
+
U(t[r], i, e);
|
|
965
|
+
}
|
|
966
|
+
i.removeAttribute(m.attributeMarkerName);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function Te(i, t, e, s, n) {
|
|
970
|
+
if (m.isElementBoundaryStartMarker(i)) {
|
|
971
|
+
Ne(i, t);
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
if (m.isContentBindingStartMarker(i.data)) {
|
|
975
|
+
const r = m.parseContentBindingStartMarker(i.data);
|
|
976
|
+
if (r === null)
|
|
977
|
+
return;
|
|
978
|
+
const [a, c] = r, d = e[a], l = [];
|
|
979
|
+
let o = t.nextSibling();
|
|
980
|
+
i.data = "";
|
|
981
|
+
const h = o;
|
|
982
|
+
for (; o !== null; ) {
|
|
983
|
+
if (dt(o)) {
|
|
984
|
+
const u = m.parseContentBindingEndMarker(o.data);
|
|
985
|
+
if (u && u[1] === c)
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
l.push(o), o = t.nextSibling();
|
|
989
|
+
}
|
|
990
|
+
if (o === null) {
|
|
991
|
+
const u = i.getRootNode();
|
|
992
|
+
throw new Error(`Error hydrating Comment node inside "${Se(u) ? u.host.nodeName : u.nodeName}".`);
|
|
993
|
+
}
|
|
994
|
+
if (o.data = "", l.length === 1 && Yt(l[0]))
|
|
995
|
+
U(d, l[0], s);
|
|
996
|
+
else {
|
|
997
|
+
o !== h && o.previousSibling !== null && (n[d.targetNodeId] = {
|
|
998
|
+
first: h,
|
|
999
|
+
last: o.previousSibling
|
|
1000
|
+
});
|
|
1001
|
+
const u = o.parentNode.insertBefore(document.createTextNode(""), o);
|
|
1002
|
+
U(d, u, s);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
function Ne(i, t) {
|
|
1007
|
+
const e = m.parseElementBoundaryStartMarker(i.data);
|
|
1008
|
+
let s = t.nextSibling();
|
|
1009
|
+
for (; s !== null; ) {
|
|
1010
|
+
if (dt(s)) {
|
|
1011
|
+
const n = m.parseElementBoundaryEndMarker(s.data);
|
|
1012
|
+
if (n && n === e)
|
|
1013
|
+
break;
|
|
1014
|
+
}
|
|
1015
|
+
s = t.nextSibling();
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function U(i, t, e) {
|
|
1019
|
+
if (i.targetNodeId === void 0)
|
|
1020
|
+
throw new Error("Factory could not be target to the node");
|
|
1021
|
+
e[i.targetNodeId] = t;
|
|
1022
|
+
}
|
|
1023
|
+
var te;
|
|
1024
|
+
function ot(i, t) {
|
|
1025
|
+
const e = i.parentNode;
|
|
1026
|
+
let s = i, n;
|
|
1027
|
+
for (; s !== t; ) {
|
|
1028
|
+
if (n = s.nextSibling, !n)
|
|
1029
|
+
throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);
|
|
1030
|
+
e.removeChild(s), s = n;
|
|
1031
|
+
}
|
|
1032
|
+
e.removeChild(t);
|
|
1033
|
+
}
|
|
1034
|
+
class ee {
|
|
501
1035
|
constructor() {
|
|
502
|
-
this.index = 0, this.length = 0
|
|
1036
|
+
this.index = 0, this.length = 0;
|
|
503
1037
|
}
|
|
504
1038
|
/**
|
|
505
1039
|
* The current event within an event handler.
|
|
506
1040
|
*/
|
|
507
1041
|
get event() {
|
|
508
|
-
return
|
|
1042
|
+
return M.getEvent();
|
|
509
1043
|
}
|
|
510
1044
|
/**
|
|
511
1045
|
* Indicates whether the current item within a repeat context
|
|
@@ -543,441 +1077,623 @@ class C {
|
|
|
543
1077
|
return this.index === this.length - 1;
|
|
544
1078
|
}
|
|
545
1079
|
/**
|
|
546
|
-
*
|
|
547
|
-
* @param event - The event to set.
|
|
548
|
-
* @internal
|
|
1080
|
+
* Returns the typed event detail of a custom event.
|
|
549
1081
|
*/
|
|
550
|
-
|
|
551
|
-
|
|
1082
|
+
eventDetail() {
|
|
1083
|
+
return this.event.detail;
|
|
552
1084
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
constructor() {
|
|
559
|
-
this.targetIndex = 0;
|
|
1085
|
+
/**
|
|
1086
|
+
* Returns the typed event target of the event.
|
|
1087
|
+
*/
|
|
1088
|
+
eventTarget() {
|
|
1089
|
+
return this.event.target;
|
|
560
1090
|
}
|
|
561
1091
|
}
|
|
562
|
-
class
|
|
563
|
-
|
|
564
|
-
|
|
1092
|
+
class K extends ee {
|
|
1093
|
+
/**
|
|
1094
|
+
* Constructs an instance of HTMLView.
|
|
1095
|
+
* @param fragment - The html fragment that contains the nodes for this view.
|
|
1096
|
+
* @param behaviors - The behaviors to be applied to this view.
|
|
1097
|
+
*/
|
|
1098
|
+
constructor(t, e, s) {
|
|
1099
|
+
super(), this.fragment = t, this.factories = e, this.targets = s, this.behaviors = null, this.unbindables = [], this.source = null, this.isBound = !1, this.sourceLifetime = G.unknown, this.context = this, this.firstChild = t.firstChild, this.lastChild = t.lastChild;
|
|
565
1100
|
}
|
|
566
|
-
}
|
|
567
|
-
class Xe extends P {
|
|
568
1101
|
/**
|
|
569
|
-
*
|
|
570
|
-
* @param
|
|
571
|
-
* @param behavior - The behavior to instantiate and attach to the element.
|
|
572
|
-
* @param options - Options to pass to the behavior during creation.
|
|
1102
|
+
* Appends the view's DOM nodes to the referenced node.
|
|
1103
|
+
* @param node - The parent node to append the view's DOM nodes to.
|
|
573
1104
|
*/
|
|
574
|
-
|
|
575
|
-
|
|
1105
|
+
appendTo(t) {
|
|
1106
|
+
t.appendChild(this.fragment);
|
|
576
1107
|
}
|
|
577
1108
|
/**
|
|
578
|
-
*
|
|
579
|
-
* @param
|
|
580
|
-
* @remarks
|
|
581
|
-
* Creates a custom attribute placeholder.
|
|
1109
|
+
* Inserts the view's DOM nodes before the referenced node.
|
|
1110
|
+
* @param node - The node to insert the view's DOM before.
|
|
582
1111
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
1112
|
+
insertBefore(t) {
|
|
1113
|
+
if (this.fragment.hasChildNodes())
|
|
1114
|
+
t.parentNode.insertBefore(this.fragment, t);
|
|
1115
|
+
else {
|
|
1116
|
+
const e = this.lastChild;
|
|
1117
|
+
if (t.previousSibling === e)
|
|
1118
|
+
return;
|
|
1119
|
+
const s = t.parentNode;
|
|
1120
|
+
let n = this.firstChild, r;
|
|
1121
|
+
for (; n !== e; )
|
|
1122
|
+
r = n.nextSibling, s.insertBefore(n, t), n = r;
|
|
1123
|
+
s.insertBefore(e, t);
|
|
1124
|
+
}
|
|
585
1125
|
}
|
|
586
1126
|
/**
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
* @remarks
|
|
590
|
-
* Creates an instance of the `behavior` type this directive was constructed with
|
|
591
|
-
* and passes the target and options to that `behavior`'s constructor.
|
|
1127
|
+
* Removes the view's DOM nodes.
|
|
1128
|
+
* The nodes are not disposed and the view can later be re-inserted.
|
|
592
1129
|
*/
|
|
593
|
-
|
|
594
|
-
|
|
1130
|
+
remove() {
|
|
1131
|
+
const t = this.fragment, e = this.lastChild;
|
|
1132
|
+
let s = this.firstChild, n;
|
|
1133
|
+
for (; s !== e; )
|
|
1134
|
+
n = s.nextSibling, t.appendChild(s), s = n;
|
|
1135
|
+
t.appendChild(e);
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.
|
|
1139
|
+
* Once a view has been disposed, it cannot be inserted or bound again.
|
|
1140
|
+
*/
|
|
1141
|
+
dispose() {
|
|
1142
|
+
ot(this.firstChild, this.lastChild), this.unbind();
|
|
1143
|
+
}
|
|
1144
|
+
onUnbind(t) {
|
|
1145
|
+
this.unbindables.push(t);
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Binds a view's behaviors to its binding source.
|
|
1149
|
+
* @param source - The binding source for the view's binding behaviors.
|
|
1150
|
+
* @param context - The execution context to run the behaviors within.
|
|
1151
|
+
*/
|
|
1152
|
+
bind(t, e = this) {
|
|
1153
|
+
if (this.source === t)
|
|
1154
|
+
return;
|
|
1155
|
+
let s = this.behaviors;
|
|
1156
|
+
if (s === null) {
|
|
1157
|
+
this.source = t, this.context = e, this.behaviors = s = new Array(this.factories.length);
|
|
1158
|
+
const n = this.factories;
|
|
1159
|
+
for (let r = 0, a = n.length; r < a; ++r) {
|
|
1160
|
+
const c = n[r].createBehavior();
|
|
1161
|
+
c.bind(this), s[r] = c;
|
|
1162
|
+
}
|
|
1163
|
+
} else {
|
|
1164
|
+
this.source !== null && this.evaluateUnbindables(), this.isBound = !1, this.source = t, this.context = e;
|
|
1165
|
+
for (let n = 0, r = s.length; n < r; ++n)
|
|
1166
|
+
s[n].bind(this);
|
|
1167
|
+
}
|
|
1168
|
+
this.isBound = !0;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* Unbinds a view's behaviors from its binding source.
|
|
1172
|
+
*/
|
|
1173
|
+
unbind() {
|
|
1174
|
+
!this.isBound || this.source === null || (this.evaluateUnbindables(), this.source = null, this.context = this, this.isBound = !1);
|
|
1175
|
+
}
|
|
1176
|
+
evaluateUnbindables() {
|
|
1177
|
+
const t = this.unbindables;
|
|
1178
|
+
for (let e = 0, s = t.length; e < s; ++e)
|
|
1179
|
+
t[e].unbind(this);
|
|
1180
|
+
t.length = 0;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Efficiently disposes of a contiguous range of synthetic view instances.
|
|
1184
|
+
* @param views - A contiguous range of views to be disposed.
|
|
1185
|
+
*/
|
|
1186
|
+
static disposeContiguousBatch(t) {
|
|
1187
|
+
if (t.length !== 0) {
|
|
1188
|
+
ot(t[0].firstChild, t[t.length - 1].lastChild);
|
|
1189
|
+
for (let e = 0, s = t.length; e < s; ++e)
|
|
1190
|
+
t[e].unbind();
|
|
1191
|
+
}
|
|
595
1192
|
}
|
|
596
1193
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
s !== void 0 && s.isComposed && (s.unbind(), s.needsBindOnly = !0);
|
|
610
|
-
}
|
|
611
|
-
function ye() {
|
|
612
|
-
this.target.removeEventListener(this.targetName, this), this.source = null, this.context = null;
|
|
1194
|
+
x(K);
|
|
1195
|
+
p.defineProperty(K.prototype, "index");
|
|
1196
|
+
p.defineProperty(K.prototype, "length");
|
|
1197
|
+
const A = {
|
|
1198
|
+
unhydrated: "unhydrated",
|
|
1199
|
+
hydrating: "hydrating",
|
|
1200
|
+
hydrated: "hydrated"
|
|
1201
|
+
};
|
|
1202
|
+
class ke extends Error {
|
|
1203
|
+
constructor(t, e, s, n) {
|
|
1204
|
+
super(t), this.factory = e, this.fragment = s, this.templateString = n;
|
|
1205
|
+
}
|
|
613
1206
|
}
|
|
614
|
-
|
|
615
|
-
|
|
1207
|
+
class Be extends ee {
|
|
1208
|
+
constructor(t, e, s, n) {
|
|
1209
|
+
super(), this.firstChild = t, this.lastChild = e, this.sourceTemplate = s, this.hostBindingTarget = n, this[te] = D, this.context = this, this.source = null, this.isBound = !1, this.sourceLifetime = G.unknown, this.unbindables = [], this.fragment = null, this.behaviors = null, this._hydrationStage = A.unhydrated, this._bindingViewBoundaries = {}, this._targets = {}, this.factories = s.compile().factories;
|
|
1210
|
+
}
|
|
1211
|
+
get hydrationStage() {
|
|
1212
|
+
return this._hydrationStage;
|
|
1213
|
+
}
|
|
1214
|
+
get targets() {
|
|
1215
|
+
return this._targets;
|
|
1216
|
+
}
|
|
1217
|
+
get bindingViewBoundaries() {
|
|
1218
|
+
return this._bindingViewBoundaries;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* no-op. Hydrated views are don't need to be moved from a documentFragment
|
|
1222
|
+
* to the target node.
|
|
1223
|
+
*/
|
|
1224
|
+
insertBefore(t) {
|
|
1225
|
+
if (this.fragment !== null)
|
|
1226
|
+
if (this.fragment.hasChildNodes())
|
|
1227
|
+
t.parentNode.insertBefore(this.fragment, t);
|
|
1228
|
+
else {
|
|
1229
|
+
const e = this.lastChild;
|
|
1230
|
+
if (t.previousSibling === e)
|
|
1231
|
+
return;
|
|
1232
|
+
const s = t.parentNode;
|
|
1233
|
+
let n = this.firstChild, r;
|
|
1234
|
+
for (; n !== e; )
|
|
1235
|
+
r = n.nextSibling, s.insertBefore(n, t), n = r;
|
|
1236
|
+
s.insertBefore(e, t);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Appends the view to a node. In cases where this is called before the
|
|
1241
|
+
* view has been removed, the method will no-op.
|
|
1242
|
+
* @param node - the node to append the view to.
|
|
1243
|
+
*/
|
|
1244
|
+
appendTo(t) {
|
|
1245
|
+
this.fragment !== null && t.appendChild(this.fragment);
|
|
1246
|
+
}
|
|
1247
|
+
remove() {
|
|
1248
|
+
const t = this.fragment || (this.fragment = document.createDocumentFragment()), e = this.lastChild;
|
|
1249
|
+
let s = this.firstChild, n;
|
|
1250
|
+
for (; s !== e; ) {
|
|
1251
|
+
if (n = s.nextSibling, !n)
|
|
1252
|
+
throw new Error(`Unmatched first/last child inside "${e.getRootNode().host.nodeName}".`);
|
|
1253
|
+
t.appendChild(s), s = n;
|
|
1254
|
+
}
|
|
1255
|
+
t.appendChild(e);
|
|
1256
|
+
}
|
|
1257
|
+
bind(t, e = this) {
|
|
1258
|
+
var s, n;
|
|
1259
|
+
if (this.hydrationStage !== A.hydrated && (this._hydrationStage = A.hydrating), this.source === t)
|
|
1260
|
+
return;
|
|
1261
|
+
let r = this.behaviors;
|
|
1262
|
+
if (r === null) {
|
|
1263
|
+
this.source = t, this.context = e;
|
|
1264
|
+
try {
|
|
1265
|
+
const { targets: c, boundaries: d } = Ce(this.firstChild, this.lastChild, this.factories);
|
|
1266
|
+
this._targets = c, this._bindingViewBoundaries = d;
|
|
1267
|
+
} catch (c) {
|
|
1268
|
+
if (c instanceof Xt) {
|
|
1269
|
+
let d = this.sourceTemplate.html;
|
|
1270
|
+
typeof d != "string" && (d = d.innerHTML), c.templateString = d;
|
|
1271
|
+
}
|
|
1272
|
+
throw c;
|
|
1273
|
+
}
|
|
1274
|
+
this.behaviors = r = new Array(this.factories.length);
|
|
1275
|
+
const a = this.factories;
|
|
1276
|
+
for (let c = 0, d = a.length; c < d; ++c) {
|
|
1277
|
+
const l = a[c];
|
|
1278
|
+
if (l.targetNodeId === "h" && this.hostBindingTarget && U(l, this.hostBindingTarget, this._targets), l.targetNodeId in this.targets) {
|
|
1279
|
+
const o = l.createBehavior();
|
|
1280
|
+
o.bind(this), r[c] = o;
|
|
1281
|
+
} else {
|
|
1282
|
+
let o = this.sourceTemplate.html;
|
|
1283
|
+
throw typeof o != "string" && (o = o.innerHTML), new ke(`HydrationView was unable to successfully target bindings inside "${(n = ((s = this.firstChild) === null || s === void 0 ? void 0 : s.getRootNode()).host) === null || n === void 0 ? void 0 : n.nodeName}".`, l, Zt(this.firstChild, this.lastChild).cloneContents(), o);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
} else {
|
|
1287
|
+
this.source !== null && this.evaluateUnbindables(), this.isBound = !1, this.source = t, this.context = e;
|
|
1288
|
+
for (let a = 0, c = r.length; a < c; ++a)
|
|
1289
|
+
r[a].bind(this);
|
|
1290
|
+
}
|
|
1291
|
+
this.isBound = !0, this._hydrationStage = A.hydrated;
|
|
1292
|
+
}
|
|
1293
|
+
unbind() {
|
|
1294
|
+
!this.isBound || this.source === null || (this.evaluateUnbindables(), this.source = null, this.context = this, this.isBound = !1);
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.
|
|
1298
|
+
* Once a view has been disposed, it cannot be inserted or bound again.
|
|
1299
|
+
*/
|
|
1300
|
+
dispose() {
|
|
1301
|
+
ot(this.firstChild, this.lastChild), this.unbind();
|
|
1302
|
+
}
|
|
1303
|
+
onUnbind(t) {
|
|
1304
|
+
this.unbindables.push(t);
|
|
1305
|
+
}
|
|
1306
|
+
evaluateUnbindables() {
|
|
1307
|
+
const t = this.unbindables;
|
|
1308
|
+
for (let e = 0, s = t.length; e < s; ++e)
|
|
1309
|
+
t[e].unbind(this);
|
|
1310
|
+
t.length = 0;
|
|
1311
|
+
}
|
|
616
1312
|
}
|
|
617
|
-
|
|
618
|
-
|
|
1313
|
+
te = D;
|
|
1314
|
+
x(Be);
|
|
1315
|
+
function xe(i) {
|
|
1316
|
+
return i.create !== void 0;
|
|
619
1317
|
}
|
|
620
|
-
function
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
let
|
|
624
|
-
|
|
1318
|
+
function Ae(i, t, e, s) {
|
|
1319
|
+
if (e == null && (e = ""), xe(e)) {
|
|
1320
|
+
i.textContent = "";
|
|
1321
|
+
let n = i.$fastView;
|
|
1322
|
+
if (n === void 0)
|
|
1323
|
+
if (z(s) && z(e) && s.bindingViewBoundaries[this.targetNodeId] !== void 0 && s.hydrationStage !== A.hydrated) {
|
|
1324
|
+
const r = s.bindingViewBoundaries[this.targetNodeId];
|
|
1325
|
+
n = e.hydrate(r.first, r.last);
|
|
1326
|
+
} else
|
|
1327
|
+
n = e.create();
|
|
1328
|
+
else
|
|
1329
|
+
i.$fastTemplate !== e && (n.isComposed && (n.remove(), n.unbind()), n = e.create());
|
|
1330
|
+
n.isComposed ? n.needsBindOnly && (n.needsBindOnly = !1, n.bind(s.source, s.context)) : (n.isComposed = !0, n.bind(s.source, s.context), n.insertBefore(i), i.$fastView = n, i.$fastTemplate = e);
|
|
625
1331
|
} else {
|
|
626
|
-
const
|
|
627
|
-
|
|
1332
|
+
const n = i.$fastView;
|
|
1333
|
+
n !== void 0 && n.isComposed && (n.isComposed = !1, n.remove(), n.needsBindOnly ? n.needsBindOnly = !1 : n.unbind()), i.textContent = e;
|
|
628
1334
|
}
|
|
629
1335
|
}
|
|
630
|
-
function
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
a !== "" && (e[a] = i, t.classList.add(a));
|
|
1336
|
+
function Ee(i, t, e) {
|
|
1337
|
+
var s;
|
|
1338
|
+
const n = `${this.id}-t`, r = (s = i[n]) !== null && s !== void 0 ? s : i[n] = { v: 0, cv: /* @__PURE__ */ Object.create(null) }, a = r.cv;
|
|
1339
|
+
let c = r.v;
|
|
1340
|
+
const d = i[t];
|
|
1341
|
+
if (e != null && e.length) {
|
|
1342
|
+
const l = e.split(/\s+/);
|
|
1343
|
+
for (let o = 0, h = l.length; o < h; ++o) {
|
|
1344
|
+
const u = l[o];
|
|
1345
|
+
u !== "" && (a[u] = c, d.add(u));
|
|
641
1346
|
}
|
|
642
1347
|
}
|
|
643
|
-
if (
|
|
644
|
-
|
|
645
|
-
for (const
|
|
646
|
-
|
|
1348
|
+
if (r.v = c + 1, c !== 0) {
|
|
1349
|
+
c -= 1;
|
|
1350
|
+
for (const l in a)
|
|
1351
|
+
a[l] === c && d.remove(l);
|
|
647
1352
|
}
|
|
648
1353
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
1354
|
+
const Me = {
|
|
1355
|
+
[b.attribute]: $.setAttribute,
|
|
1356
|
+
[b.booleanAttribute]: $.setBooleanAttribute,
|
|
1357
|
+
[b.property]: (i, t, e) => i[t] = e,
|
|
1358
|
+
[b.content]: Ae,
|
|
1359
|
+
[b.tokenList]: Ee,
|
|
1360
|
+
[b.event]: () => {
|
|
656
1361
|
}
|
|
1362
|
+
};
|
|
1363
|
+
class E {
|
|
657
1364
|
/**
|
|
658
|
-
*
|
|
659
|
-
* binding
|
|
1365
|
+
* Creates an instance of HTMLBindingDirective.
|
|
1366
|
+
* @param dataBinding - The binding configuration to apply.
|
|
660
1367
|
*/
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
set targetName(e) {
|
|
665
|
-
if (this.originalTargetName = e, e !== void 0)
|
|
666
|
-
switch (e[0]) {
|
|
667
|
-
case ":":
|
|
668
|
-
if (this.cleanedTargetName = e.substr(1), this.updateTarget = we, this.cleanedTargetName === "innerHTML") {
|
|
669
|
-
const t = this.binding;
|
|
670
|
-
this.binding = (i, n) => u.createHTML(t(i, n));
|
|
671
|
-
}
|
|
672
|
-
break;
|
|
673
|
-
case "?":
|
|
674
|
-
this.cleanedTargetName = e.substr(1), this.updateTarget = Se;
|
|
675
|
-
break;
|
|
676
|
-
case "@":
|
|
677
|
-
this.cleanedTargetName = e.substr(1), this.bind = pe, this.unbind = ye;
|
|
678
|
-
break;
|
|
679
|
-
default:
|
|
680
|
-
this.cleanedTargetName = e, e === "class" && (this.updateTarget = xe);
|
|
681
|
-
break;
|
|
682
|
-
}
|
|
1368
|
+
constructor(t) {
|
|
1369
|
+
this.dataBinding = t, this.updateTarget = null, this.aspectType = b.content;
|
|
683
1370
|
}
|
|
684
1371
|
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
1372
|
+
* Creates HTML to be used within a template.
|
|
1373
|
+
* @param add - Can be used to add behavior factories to a template.
|
|
687
1374
|
*/
|
|
688
|
-
|
|
689
|
-
|
|
1375
|
+
createHTML(t) {
|
|
1376
|
+
return Kt.interpolation(t(this));
|
|
690
1377
|
}
|
|
691
1378
|
/**
|
|
692
|
-
* Creates
|
|
693
|
-
* information stored in the BindingDirective.
|
|
694
|
-
* @param target - The target node that the binding behavior should attach to.
|
|
1379
|
+
* Creates a behavior.
|
|
695
1380
|
*/
|
|
696
|
-
createBehavior(
|
|
697
|
-
|
|
1381
|
+
createBehavior() {
|
|
1382
|
+
var t;
|
|
1383
|
+
if (this.updateTarget === null) {
|
|
1384
|
+
const e = Me[this.aspectType], s = (t = this.dataBinding.policy) !== null && t !== void 0 ? t : this.policy;
|
|
1385
|
+
if (!e)
|
|
1386
|
+
throw g.error(
|
|
1387
|
+
1205
|
|
1388
|
+
/* Message.unsupportedBindingBehavior */
|
|
1389
|
+
);
|
|
1390
|
+
this.data = `${this.id}-d`, this.updateTarget = s.protect(this.targetTagName, this.aspectType, this.targetAspect, e);
|
|
1391
|
+
}
|
|
1392
|
+
return this;
|
|
698
1393
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1394
|
+
/** @internal */
|
|
1395
|
+
bind(t) {
|
|
1396
|
+
var e;
|
|
1397
|
+
const s = t.targets[this.targetNodeId], n = z(t) && t.hydrationStage && t.hydrationStage !== A.hydrated;
|
|
1398
|
+
switch (this.aspectType) {
|
|
1399
|
+
case b.event:
|
|
1400
|
+
s[this.data] = t, s.addEventListener(this.targetAspect, this, this.dataBinding.options);
|
|
1401
|
+
break;
|
|
1402
|
+
case b.content:
|
|
1403
|
+
t.onUnbind(this);
|
|
1404
|
+
default:
|
|
1405
|
+
const r = (e = s[this.data]) !== null && e !== void 0 ? e : s[this.data] = this.dataBinding.createObserver(this, this);
|
|
1406
|
+
if (r.target = s, r.controller = t, n && (this.aspectType === b.attribute || this.aspectType === b.booleanAttribute)) {
|
|
1407
|
+
r.bind(t);
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
this.updateTarget(s, this.targetAspect, r.bind(t), t);
|
|
1411
|
+
break;
|
|
1412
|
+
}
|
|
713
1413
|
}
|
|
714
1414
|
/** @internal */
|
|
715
|
-
|
|
716
|
-
|
|
1415
|
+
unbind(t) {
|
|
1416
|
+
const s = t.targets[this.targetNodeId].$fastView;
|
|
1417
|
+
s !== void 0 && s.isComposed && (s.unbind(), s.needsBindOnly = !0);
|
|
717
1418
|
}
|
|
718
1419
|
/** @internal */
|
|
719
|
-
handleEvent(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
1420
|
+
handleEvent(t) {
|
|
1421
|
+
const e = t.currentTarget[this.data];
|
|
1422
|
+
if (e.isBound) {
|
|
1423
|
+
M.setEvent(t);
|
|
1424
|
+
const s = this.dataBinding.evaluate(e.source, e.context);
|
|
1425
|
+
M.setEvent(null), s !== !0 && t.preventDefault();
|
|
1426
|
+
}
|
|
723
1427
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
e.targetIndex = this.targetIndex, this.behaviorFactories.push(e);
|
|
1428
|
+
/** @internal */
|
|
1429
|
+
handleChange(t, e) {
|
|
1430
|
+
const s = e.target, n = e.controller;
|
|
1431
|
+
this.updateTarget(s, this.targetAspect, e.bind(n), n);
|
|
729
1432
|
}
|
|
730
|
-
|
|
731
|
-
|
|
1433
|
+
}
|
|
1434
|
+
T.define(E, { aspected: !0 });
|
|
1435
|
+
const ie = (i, t) => `${i}.${t}`, Bt = {}, w = {
|
|
1436
|
+
index: 0,
|
|
1437
|
+
node: null
|
|
1438
|
+
};
|
|
1439
|
+
function xt(i) {
|
|
1440
|
+
i.startsWith("fast-") || g.warn(1204, { name: i });
|
|
1441
|
+
}
|
|
1442
|
+
const Oe = new Proxy(document.createElement("div"), {
|
|
1443
|
+
get(i, t) {
|
|
1444
|
+
xt(t);
|
|
1445
|
+
const e = Reflect.get(i, t);
|
|
1446
|
+
return O(e) ? e.bind(i) : e;
|
|
1447
|
+
},
|
|
1448
|
+
set(i, t, e) {
|
|
1449
|
+
return xt(t), Reflect.set(i, t, e);
|
|
732
1450
|
}
|
|
733
|
-
|
|
734
|
-
|
|
1451
|
+
});
|
|
1452
|
+
class _e {
|
|
1453
|
+
constructor(t, e, s) {
|
|
1454
|
+
this.fragment = t, this.directives = e, this.policy = s, this.proto = null, this.nodeIds = /* @__PURE__ */ new Set(), this.descriptors = {}, this.factories = [];
|
|
1455
|
+
}
|
|
1456
|
+
addFactory(t, e, s, n, r) {
|
|
1457
|
+
var a, c;
|
|
1458
|
+
this.nodeIds.has(s) || (this.nodeIds.add(s), this.addTargetDescriptor(e, s, n)), t.id = (a = t.id) !== null && a !== void 0 ? a : L(), t.targetNodeId = s, t.targetTagName = r, t.policy = (c = t.policy) !== null && c !== void 0 ? c : this.policy, this.factories.push(t);
|
|
1459
|
+
}
|
|
1460
|
+
freeze() {
|
|
1461
|
+
return this.proto = Object.create(null, this.descriptors), this;
|
|
1462
|
+
}
|
|
1463
|
+
addTargetDescriptor(t, e, s) {
|
|
1464
|
+
const n = this.descriptors;
|
|
1465
|
+
if (e === "r" || // root
|
|
1466
|
+
e === "h" || // host
|
|
1467
|
+
n[e])
|
|
1468
|
+
return;
|
|
1469
|
+
if (!n[t]) {
|
|
1470
|
+
const a = t.lastIndexOf("."), c = t.substring(0, a), d = parseInt(t.substring(a + 1));
|
|
1471
|
+
this.addTargetDescriptor(c, t, d);
|
|
1472
|
+
}
|
|
1473
|
+
let r = Bt[e];
|
|
1474
|
+
if (!r) {
|
|
1475
|
+
const a = `_${e}`;
|
|
1476
|
+
Bt[e] = r = {
|
|
1477
|
+
get() {
|
|
1478
|
+
var c;
|
|
1479
|
+
return (c = this[a]) !== null && c !== void 0 ? c : this[a] = this[t].childNodes[s];
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
n[e] = r;
|
|
735
1484
|
}
|
|
736
|
-
|
|
737
|
-
|
|
1485
|
+
createView(t) {
|
|
1486
|
+
const e = this.fragment.cloneNode(!0), s = Object.create(this.proto);
|
|
1487
|
+
s.r = e, s.h = t ?? Oe;
|
|
1488
|
+
for (const n of this.nodeIds)
|
|
1489
|
+
s[n];
|
|
1490
|
+
return new K(e, this.factories, s);
|
|
738
1491
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
1492
|
+
}
|
|
1493
|
+
function se(i, t, e, s, n, r = !1) {
|
|
1494
|
+
const a = e.attributes, c = i.directives;
|
|
1495
|
+
for (let d = 0, l = a.length; d < l; ++d) {
|
|
1496
|
+
const o = a[d], h = o.value, u = J.parse(h, c);
|
|
1497
|
+
let y = null;
|
|
1498
|
+
u === null ? r && (y = new E(Gt(() => h, i.policy)), T.assignAspect(y, o.name)) : y = ht.aggregate(u, i.policy), y !== null && (e.removeAttributeNode(o), d--, l--, i.addFactory(y, t, s, n, e.tagName));
|
|
742
1499
|
}
|
|
743
1500
|
}
|
|
744
|
-
function
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
return r.targetName = e, r;
|
|
755
|
-
}
|
|
756
|
-
const Be = R.length;
|
|
757
|
-
function re(s, e) {
|
|
758
|
-
const t = e.split(se);
|
|
759
|
-
if (t.length === 1)
|
|
760
|
-
return null;
|
|
761
|
-
const i = [];
|
|
762
|
-
for (let n = 0, r = t.length; n < r; ++n) {
|
|
763
|
-
const o = t[n], a = o.indexOf(R);
|
|
764
|
-
let c;
|
|
765
|
-
if (a === -1)
|
|
766
|
-
c = o;
|
|
767
|
-
else {
|
|
768
|
-
const l = parseInt(o.substring(0, a));
|
|
769
|
-
i.push(s.directives[l]), c = o.substring(a + Be);
|
|
770
|
-
}
|
|
771
|
-
c !== "" && i.push(c);
|
|
772
|
-
}
|
|
773
|
-
return i;
|
|
774
|
-
}
|
|
775
|
-
function U(s, e, t = !1) {
|
|
776
|
-
const i = e.attributes;
|
|
777
|
-
for (let n = 0, r = i.length; n < r; ++n) {
|
|
778
|
-
const o = i[n], a = o.value, c = re(s, a);
|
|
779
|
-
let l = null;
|
|
780
|
-
c === null ? t && (l = new L(() => a), l.targetName = o.name) : l = Ae(c), l !== null && (e.removeAttributeNode(o), n--, r--, s.addFactory(l));
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
function Ne(s, e, t) {
|
|
784
|
-
const i = re(s, e.textContent);
|
|
785
|
-
if (i !== null) {
|
|
786
|
-
let n = e;
|
|
787
|
-
for (let r = 0, o = i.length; r < o; ++r) {
|
|
788
|
-
const a = i[r], c = r === 0 ? e : n.parentNode.insertBefore(document.createTextNode(""), n.nextSibling);
|
|
789
|
-
typeof a == "string" ? c.textContent = a : (c.textContent = " ", s.captureContentBinding(a)), n = c, s.targetIndex++, c !== e && t.nextNode();
|
|
790
|
-
}
|
|
791
|
-
s.targetIndex--;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
function ke(s, e) {
|
|
795
|
-
const t = s.content;
|
|
796
|
-
document.adoptNode(t);
|
|
797
|
-
const i = j.borrow(e);
|
|
798
|
-
U(i, s, !0);
|
|
799
|
-
const n = i.behaviorFactories;
|
|
800
|
-
i.reset();
|
|
801
|
-
const r = u.createTemplateWalker(t);
|
|
802
|
-
let o;
|
|
803
|
-
for (; o = r.nextNode(); )
|
|
804
|
-
switch (i.targetIndex++, o.nodeType) {
|
|
805
|
-
case 1:
|
|
806
|
-
U(i, o);
|
|
807
|
-
break;
|
|
808
|
-
case 3:
|
|
809
|
-
Ne(i, o, r);
|
|
810
|
-
break;
|
|
811
|
-
case 8:
|
|
812
|
-
u.isMarker(o) && i.addFactory(e[u.extractDirectiveIndexFromMarker(o)]);
|
|
813
|
-
}
|
|
814
|
-
let a = 0;
|
|
815
|
-
// If the first node in a fragment is a marker, that means it's an unstable first node,
|
|
816
|
-
// because something like a when, repeat, etc. could add nodes before the marker.
|
|
817
|
-
// To mitigate this, we insert a stable first node. However, if we insert a node,
|
|
818
|
-
// that will alter the result of the TreeWalker. So, we also need to offset the target index.
|
|
819
|
-
(u.isMarker(t.firstChild) || // Or if there is only one node and a directive, it means the template's content
|
|
820
|
-
// is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by
|
|
821
|
-
// the directive. Inserting a new node ensures proper disposal of nodes added by the directive.
|
|
822
|
-
t.childNodes.length === 1 && e.length) && (t.insertBefore(document.createComment(""), t.firstChild), a = -1);
|
|
823
|
-
const c = i.behaviorFactories;
|
|
824
|
-
return i.release(), {
|
|
825
|
-
fragment: t,
|
|
826
|
-
viewBehaviorFactories: c,
|
|
827
|
-
hostBehaviorFactories: n,
|
|
828
|
-
targetOffset: a
|
|
829
|
-
};
|
|
1501
|
+
function Re(i, t, e, s, n) {
|
|
1502
|
+
const r = J.parse(t.textContent, i.directives);
|
|
1503
|
+
if (r === null)
|
|
1504
|
+
return w.node = t.nextSibling, w.index = n + 1, w;
|
|
1505
|
+
let a, c = a = t;
|
|
1506
|
+
for (let d = 0, l = r.length; d < l; ++d) {
|
|
1507
|
+
const o = r[d];
|
|
1508
|
+
d !== 0 && (n++, s = ie(e, n), a = c.parentNode.insertBefore(document.createTextNode(""), c.nextSibling)), B(o) ? a.textContent = o : (a.textContent = " ", T.assignAspect(o), i.addFactory(o, e, s, n, null)), c = a;
|
|
1509
|
+
}
|
|
1510
|
+
return w.index = n + 1, w.node = c.nextSibling, w;
|
|
830
1511
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
* @param behaviors - The behaviors to be applied to this view.
|
|
837
|
-
*/
|
|
838
|
-
constructor(e, t) {
|
|
839
|
-
this.fragment = e, this.behaviors = t, this.source = null, this.context = null, this.firstChild = e.firstChild, this.lastChild = e.lastChild;
|
|
1512
|
+
function ne(i, t, e) {
|
|
1513
|
+
let s = 0, n = t.firstChild;
|
|
1514
|
+
for (; n; ) {
|
|
1515
|
+
const r = Ve(i, e, n, s);
|
|
1516
|
+
n = r.node, s = r.index;
|
|
840
1517
|
}
|
|
1518
|
+
}
|
|
1519
|
+
function Ve(i, t, e, s) {
|
|
1520
|
+
const n = ie(t, s);
|
|
1521
|
+
switch (e.nodeType) {
|
|
1522
|
+
case 1:
|
|
1523
|
+
se(i, t, e, n, s), ne(i, e, n);
|
|
1524
|
+
break;
|
|
1525
|
+
case 3:
|
|
1526
|
+
return Re(i, e, t, n, s);
|
|
1527
|
+
case 8:
|
|
1528
|
+
const r = J.parse(e.data, i.directives);
|
|
1529
|
+
r !== null && i.addFactory(
|
|
1530
|
+
/* eslint-disable-next-line @typescript-eslint/no-use-before-define */
|
|
1531
|
+
ht.aggregate(r),
|
|
1532
|
+
t,
|
|
1533
|
+
n,
|
|
1534
|
+
s,
|
|
1535
|
+
null
|
|
1536
|
+
);
|
|
1537
|
+
break;
|
|
1538
|
+
}
|
|
1539
|
+
return w.index = s + 1, w.node = e.nextSibling, w;
|
|
1540
|
+
}
|
|
1541
|
+
function Le(i, t) {
|
|
1542
|
+
return i && i.nodeType == 8 && J.parse(i.data, t) !== null;
|
|
1543
|
+
}
|
|
1544
|
+
const At = "TEMPLATE", ht = {
|
|
841
1545
|
/**
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1546
|
+
* Compiles a template and associated directives into a compilation
|
|
1547
|
+
* result which can be used to create views.
|
|
1548
|
+
* @param html - The html string or template element to compile.
|
|
1549
|
+
* @param factories - The behavior factories referenced by the template.
|
|
1550
|
+
* @param policy - The security policy to compile the html with.
|
|
1551
|
+
* @remarks
|
|
1552
|
+
* The template that is provided for compilation is altered in-place
|
|
1553
|
+
* and cannot be compiled again. If the original template must be preserved,
|
|
1554
|
+
* it is recommended that you clone the original and pass the clone to this API.
|
|
1555
|
+
* @public
|
|
1556
|
+
*/
|
|
1557
|
+
compile(i, t, e = $.policy) {
|
|
1558
|
+
let s;
|
|
1559
|
+
if (B(i)) {
|
|
1560
|
+
s = document.createElement(At), s.innerHTML = e.createHTML(i);
|
|
1561
|
+
const a = s.content.firstElementChild;
|
|
1562
|
+
a !== null && a.tagName === At && (s = a);
|
|
1563
|
+
} else
|
|
1564
|
+
s = i;
|
|
1565
|
+
!s.content.firstChild && !s.content.lastChild && s.content.appendChild(document.createComment(""));
|
|
1566
|
+
const n = document.adoptNode(s.content), r = new _e(n, t, e);
|
|
1567
|
+
return se(
|
|
1568
|
+
r,
|
|
1569
|
+
"",
|
|
1570
|
+
s,
|
|
1571
|
+
/* host */
|
|
1572
|
+
"h",
|
|
1573
|
+
0,
|
|
1574
|
+
!0
|
|
1575
|
+
), // If the first node in a fragment is a marker, that means it's an unstable first node,
|
|
1576
|
+
// because something like a when, repeat, etc. could add nodes before the marker.
|
|
1577
|
+
// To mitigate this, we insert a stable first node. However, if we insert a node,
|
|
1578
|
+
// that will alter the result of the TreeWalker. So, we also need to offset the target index.
|
|
1579
|
+
(Le(n.firstChild, t) || // Or if there is only one node and a directive, it means the template's content
|
|
1580
|
+
// is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by
|
|
1581
|
+
// the directive. Inserting a new node ensures proper disposal of nodes added by the directive.
|
|
1582
|
+
n.childNodes.length === 1 && Object.keys(t).length > 0) && n.insertBefore(document.createComment(""), n.firstChild), ne(
|
|
1583
|
+
r,
|
|
1584
|
+
n,
|
|
1585
|
+
/* root */
|
|
1586
|
+
"r"
|
|
1587
|
+
), w.node = null, r.freeze();
|
|
1588
|
+
},
|
|
848
1589
|
/**
|
|
849
|
-
*
|
|
850
|
-
*
|
|
1590
|
+
* Sets the default compilation strategy that will be used by the ViewTemplate whenever
|
|
1591
|
+
* it needs to compile a view preprocessed with the html template function.
|
|
1592
|
+
* @param strategy - The compilation strategy to use when compiling templates.
|
|
851
1593
|
*/
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
else {
|
|
856
|
-
const t = this.lastChild;
|
|
857
|
-
if (e.previousSibling === t)
|
|
858
|
-
return;
|
|
859
|
-
const i = e.parentNode;
|
|
860
|
-
let n = this.firstChild, r;
|
|
861
|
-
for (; n !== t; )
|
|
862
|
-
r = n.nextSibling, i.insertBefore(n, e), n = r;
|
|
863
|
-
i.insertBefore(t, e);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
1594
|
+
setDefaultStrategy(i) {
|
|
1595
|
+
this.compile = i;
|
|
1596
|
+
},
|
|
866
1597
|
/**
|
|
867
|
-
*
|
|
868
|
-
*
|
|
1598
|
+
* Aggregates an array of strings and directives into a single directive.
|
|
1599
|
+
* @param parts - A heterogeneous array of static strings interspersed with
|
|
1600
|
+
* directives.
|
|
1601
|
+
* @param policy - The security policy to use with the aggregated bindings.
|
|
1602
|
+
* @returns A single inline directive that aggregates the behavior of all the parts.
|
|
1603
|
+
*/
|
|
1604
|
+
aggregate(i, t = $.policy) {
|
|
1605
|
+
if (i.length === 1)
|
|
1606
|
+
return i[0];
|
|
1607
|
+
let e, s = !1, n;
|
|
1608
|
+
const r = i.length, a = i.map((l) => B(l) ? () => l : (e = l.sourceAspect || e, s = s || l.dataBinding.isVolatile, n = n || l.dataBinding.policy, l.dataBinding.evaluate)), c = (l, o) => {
|
|
1609
|
+
let h = "";
|
|
1610
|
+
for (let u = 0; u < r; ++u)
|
|
1611
|
+
h += a[u](l, o);
|
|
1612
|
+
return h;
|
|
1613
|
+
}, d = new E(qt(c, n ?? t, s));
|
|
1614
|
+
return T.assignAspect(d, e), d;
|
|
1615
|
+
}
|
|
1616
|
+
}, je = (
|
|
1617
|
+
/* eslint-disable-next-line no-control-regex, max-len */
|
|
1618
|
+
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/
|
|
1619
|
+
), Fe = /* @__PURE__ */ Object.create(null);
|
|
1620
|
+
class j {
|
|
1621
|
+
/**
|
|
1622
|
+
* Creates an instance of InlineTemplateDirective.
|
|
1623
|
+
* @param template - The template to inline.
|
|
869
1624
|
*/
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
let i = this.firstChild, n;
|
|
873
|
-
for (; i !== t; )
|
|
874
|
-
n = i.nextSibling, e.appendChild(i), i = n;
|
|
875
|
-
e.appendChild(t);
|
|
1625
|
+
constructor(t, e = Fe) {
|
|
1626
|
+
this.html = t, this.factories = e;
|
|
876
1627
|
}
|
|
877
1628
|
/**
|
|
878
|
-
*
|
|
879
|
-
*
|
|
1629
|
+
* Creates HTML to be used within a template.
|
|
1630
|
+
* @param add - Can be used to add behavior factories to a template.
|
|
880
1631
|
*/
|
|
881
|
-
|
|
882
|
-
const e = this.
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
e.removeChild(t);
|
|
887
|
-
const r = this.behaviors, o = this.source;
|
|
888
|
-
for (let a = 0, c = r.length; a < c; ++a)
|
|
889
|
-
r[a].unbind(o);
|
|
1632
|
+
createHTML(t) {
|
|
1633
|
+
const e = this.factories;
|
|
1634
|
+
for (const s in e)
|
|
1635
|
+
t(e[s]);
|
|
1636
|
+
return this.html;
|
|
890
1637
|
}
|
|
1638
|
+
}
|
|
1639
|
+
j.empty = new j("");
|
|
1640
|
+
T.define(j);
|
|
1641
|
+
function He(i, t, e, s = T.getForInstance(i)) {
|
|
1642
|
+
if (s.aspected) {
|
|
1643
|
+
const n = je.exec(t);
|
|
1644
|
+
n !== null && T.assignAspect(i, n[2]);
|
|
1645
|
+
}
|
|
1646
|
+
return i.createHTML(e);
|
|
1647
|
+
}
|
|
1648
|
+
class X {
|
|
891
1649
|
/**
|
|
892
|
-
*
|
|
893
|
-
* @param
|
|
894
|
-
* @param
|
|
1650
|
+
* Creates an instance of ViewTemplate.
|
|
1651
|
+
* @param html - The html representing what this template will instantiate, including placeholders for directives.
|
|
1652
|
+
* @param factories - The directives that will be connected to placeholders in the html.
|
|
1653
|
+
* @param policy - The security policy to use when compiling this template.
|
|
895
1654
|
*/
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
if (this.source !== e)
|
|
899
|
-
if (this.source !== null) {
|
|
900
|
-
const n = this.source;
|
|
901
|
-
this.source = e, this.context = t;
|
|
902
|
-
for (let r = 0, o = i.length; r < o; ++r) {
|
|
903
|
-
const a = i[r];
|
|
904
|
-
a.unbind(n), a.bind(e, t);
|
|
905
|
-
}
|
|
906
|
-
} else {
|
|
907
|
-
this.source = e, this.context = t;
|
|
908
|
-
for (let n = 0, r = i.length; n < r; ++n)
|
|
909
|
-
i[n].bind(e, t);
|
|
910
|
-
}
|
|
1655
|
+
constructor(t, e = {}, s) {
|
|
1656
|
+
this.policy = s, this.result = null, this.html = t, this.factories = e;
|
|
911
1657
|
}
|
|
912
1658
|
/**
|
|
913
|
-
*
|
|
1659
|
+
* @internal
|
|
914
1660
|
*/
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
return;
|
|
918
|
-
const e = this.behaviors, t = this.source;
|
|
919
|
-
for (let i = 0, n = e.length; i < n; ++i)
|
|
920
|
-
e[i].unbind(t);
|
|
921
|
-
this.source = null;
|
|
1661
|
+
compile() {
|
|
1662
|
+
return this.result === null && (this.result = ht.compile(this.html, this.factories, this.policy)), this.result;
|
|
922
1663
|
}
|
|
923
1664
|
/**
|
|
924
|
-
*
|
|
925
|
-
* @param
|
|
1665
|
+
* Creates an HTMLView instance based on this template definition.
|
|
1666
|
+
* @param hostBindingTarget - The element that host behaviors will be bound to.
|
|
926
1667
|
*/
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
O.setStartBefore(e[0].firstChild), O.setEndAfter(e[e.length - 1].lastChild), O.deleteContents();
|
|
930
|
-
for (let t = 0, i = e.length; t < i; ++t) {
|
|
931
|
-
const n = e[t], r = n.behaviors, o = n.source;
|
|
932
|
-
for (let a = 0, c = r.length; a < c; ++a)
|
|
933
|
-
r[a].unbind(o);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
1668
|
+
create(t) {
|
|
1669
|
+
return this.compile().createView(t);
|
|
936
1670
|
}
|
|
937
|
-
}
|
|
938
|
-
class W {
|
|
939
1671
|
/**
|
|
940
|
-
*
|
|
941
|
-
* @param html - The html representing what this template will instantiate, including placeholders for directives.
|
|
942
|
-
* @param directives - The directives that will be connected to placeholders in the html.
|
|
1672
|
+
* Returns a directive that can inline the template.
|
|
943
1673
|
*/
|
|
944
|
-
|
|
945
|
-
|
|
1674
|
+
inline() {
|
|
1675
|
+
return new j(B(this.html) ? this.html : this.html.innerHTML, this.factories);
|
|
946
1676
|
}
|
|
947
1677
|
/**
|
|
948
|
-
*
|
|
949
|
-
* @param
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
const h = i[o], d = h.targetIndex;
|
|
968
|
-
for (; c !== null; )
|
|
969
|
-
if (a === d) {
|
|
970
|
-
n[o] = h.createBehavior(c);
|
|
971
|
-
break;
|
|
972
|
-
} else
|
|
973
|
-
c = r.nextNode(), a++;
|
|
974
|
-
}
|
|
975
|
-
if (this.hasHostBehaviors) {
|
|
976
|
-
const l = this.hostBehaviorFactories;
|
|
977
|
-
for (let h = 0, d = l.length; h < d; ++h, ++o)
|
|
978
|
-
n[o] = l[h].createBehavior(e);
|
|
979
|
-
}
|
|
980
|
-
return new Fe(t, n);
|
|
1678
|
+
* Sets the DOMPolicy for this template.
|
|
1679
|
+
* @param policy - The policy to associated with this template.
|
|
1680
|
+
* @returns The modified template instance.
|
|
1681
|
+
* @remarks
|
|
1682
|
+
* The DOMPolicy can only be set once for a template and cannot be
|
|
1683
|
+
* set after the template is compiled.
|
|
1684
|
+
*/
|
|
1685
|
+
withPolicy(t) {
|
|
1686
|
+
if (this.result)
|
|
1687
|
+
throw g.error(
|
|
1688
|
+
1208
|
|
1689
|
+
/* Message.cannotSetTemplatePolicyAfterCompilation */
|
|
1690
|
+
);
|
|
1691
|
+
if (this.policy)
|
|
1692
|
+
throw g.error(
|
|
1693
|
+
1207
|
|
1694
|
+
/* Message.onlySetTemplatePolicyOnce */
|
|
1695
|
+
);
|
|
1696
|
+
return this.policy = t, this;
|
|
981
1697
|
}
|
|
982
1698
|
/**
|
|
983
1699
|
* Creates an HTMLView from this template, binds it to the source, and then appends it to the host.
|
|
@@ -986,179 +1702,83 @@ class W {
|
|
|
986
1702
|
* @param hostBindingTarget - An HTML element to target the host bindings at if different from the
|
|
987
1703
|
* host that the template is being attached to.
|
|
988
1704
|
*/
|
|
989
|
-
render(
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
return n.bind(e, w), n.appendTo(t), n;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
const Oe = (
|
|
996
|
-
/* eslint-disable-next-line no-control-regex */
|
|
997
|
-
/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/
|
|
998
|
-
);
|
|
999
|
-
function Ye(s, ...e) {
|
|
1000
|
-
const t = [];
|
|
1001
|
-
let i = "";
|
|
1002
|
-
for (let n = 0, r = s.length - 1; n < r; ++n) {
|
|
1003
|
-
const o = s[n];
|
|
1004
|
-
let a = e[n];
|
|
1005
|
-
if (i += o, a instanceof W) {
|
|
1006
|
-
const c = a;
|
|
1007
|
-
a = () => c;
|
|
1008
|
-
}
|
|
1009
|
-
if (typeof a == "function" && (a = new L(a)), a instanceof ne) {
|
|
1010
|
-
const c = Oe.exec(o);
|
|
1011
|
-
c !== null && (a.targetName = c[2]);
|
|
1012
|
-
}
|
|
1013
|
-
a instanceof P ? (i += a.createPlaceholder(t.length), t.push(a)) : i += a;
|
|
1014
|
-
}
|
|
1015
|
-
return i += s[s.length - 1], new W(i, t);
|
|
1016
|
-
}
|
|
1017
|
-
class g {
|
|
1018
|
-
constructor() {
|
|
1019
|
-
this.targets = /* @__PURE__ */ new WeakSet();
|
|
1020
|
-
}
|
|
1021
|
-
/** @internal */
|
|
1022
|
-
addStylesTo(e) {
|
|
1023
|
-
this.targets.add(e);
|
|
1024
|
-
}
|
|
1025
|
-
/** @internal */
|
|
1026
|
-
removeStylesFrom(e) {
|
|
1027
|
-
this.targets.delete(e);
|
|
1028
|
-
}
|
|
1029
|
-
/** @internal */
|
|
1030
|
-
isAttachedTo(e) {
|
|
1031
|
-
return this.targets.has(e);
|
|
1705
|
+
render(t, e, s) {
|
|
1706
|
+
const n = this.create(s);
|
|
1707
|
+
return n.bind(t), n.appendTo(e), n;
|
|
1032
1708
|
}
|
|
1033
1709
|
/**
|
|
1034
|
-
*
|
|
1035
|
-
* @param
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
return s.map((e) => e instanceof g ? H(e.styles) : [e]).reduce((e, t) => e.concat(t), []);
|
|
1053
|
-
}
|
|
1054
|
-
function oe(s) {
|
|
1055
|
-
return s.map((e) => e instanceof g ? e.behaviors : null).reduce((e, t) => t === null ? e : (e === null && (e = []), e.concat(t)), null);
|
|
1056
|
-
}
|
|
1057
|
-
const Ee = Symbol("prependToAdoptedStyleSheets");
|
|
1058
|
-
function ae(s) {
|
|
1059
|
-
const e = [], t = [];
|
|
1060
|
-
return s.forEach((i) => (i[Ee] ? e : t).push(i)), { prepend: e, append: t };
|
|
1061
|
-
}
|
|
1062
|
-
let le = (s, e) => {
|
|
1063
|
-
const { prepend: t, append: i } = ae(e);
|
|
1064
|
-
s.adoptedStyleSheets = [...t, ...s.adoptedStyleSheets, ...i];
|
|
1065
|
-
}, he = (s, e) => {
|
|
1066
|
-
s.adoptedStyleSheets = s.adoptedStyleSheets.filter((t) => e.indexOf(t) === -1);
|
|
1067
|
-
};
|
|
1068
|
-
if (u.supportsAdoptedStyleSheets)
|
|
1069
|
-
try {
|
|
1070
|
-
document.adoptedStyleSheets.push(), document.adoptedStyleSheets.splice(), le = (s, e) => {
|
|
1071
|
-
const { prepend: t, append: i } = ae(e);
|
|
1072
|
-
s.adoptedStyleSheets.splice(0, 0, ...t), s.adoptedStyleSheets.push(...i);
|
|
1073
|
-
}, he = (s, e) => {
|
|
1074
|
-
for (const t of e) {
|
|
1075
|
-
const i = s.adoptedStyleSheets.indexOf(t);
|
|
1076
|
-
i !== -1 && s.adoptedStyleSheets.splice(i, 1);
|
|
1077
|
-
}
|
|
1710
|
+
* Creates a template based on a set of static strings and dynamic values.
|
|
1711
|
+
* @param strings - The static strings to create the template with.
|
|
1712
|
+
* @param values - The dynamic values to create the template with.
|
|
1713
|
+
* @param policy - The DOMPolicy to associated with the template.
|
|
1714
|
+
* @returns A ViewTemplate.
|
|
1715
|
+
* @remarks
|
|
1716
|
+
* This API should not be used directly under normal circumstances because constructing
|
|
1717
|
+
* a template in this way, if not done properly, can open up the application to XSS
|
|
1718
|
+
* attacks. When using this API, provide a strong DOMPolicy that can properly sanitize
|
|
1719
|
+
* and also be sure to manually sanitize all static strings particularly if they can
|
|
1720
|
+
* come from user input.
|
|
1721
|
+
*/
|
|
1722
|
+
static create(t, e, s) {
|
|
1723
|
+
let n = "";
|
|
1724
|
+
const r = /* @__PURE__ */ Object.create(null), a = (c) => {
|
|
1725
|
+
var d;
|
|
1726
|
+
const l = (d = c.id) !== null && d !== void 0 ? d : c.id = L();
|
|
1727
|
+
return r[l] = c, l;
|
|
1078
1728
|
};
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
let n = t.get(i);
|
|
1092
|
-
return n === void 0 && (n = new CSSStyleSheet(), n.replaceSync(i), t.set(i, n)), n;
|
|
1093
|
-
});
|
|
1094
|
-
}
|
|
1095
|
-
return this._styleSheets;
|
|
1096
|
-
}
|
|
1097
|
-
addStylesTo(e) {
|
|
1098
|
-
le(e, this.styleSheets), super.addStylesTo(e);
|
|
1099
|
-
}
|
|
1100
|
-
removeStylesFrom(e) {
|
|
1101
|
-
he(e, this.styleSheets), super.removeStylesFrom(e);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
let Ie = 0;
|
|
1105
|
-
function $e() {
|
|
1106
|
-
return `fast-style-class-${++Ie}`;
|
|
1107
|
-
}
|
|
1108
|
-
class Ve extends g {
|
|
1109
|
-
constructor(e) {
|
|
1110
|
-
super(), this.styles = e, this.behaviors = null, this.behaviors = oe(e), this.styleSheets = H(e), this.styleClass = $e();
|
|
1111
|
-
}
|
|
1112
|
-
addStylesTo(e) {
|
|
1113
|
-
const t = this.styleSheets, i = this.styleClass;
|
|
1114
|
-
e = this.normalizeTarget(e);
|
|
1115
|
-
for (let n = 0; n < t.length; n++) {
|
|
1116
|
-
const r = document.createElement("style");
|
|
1117
|
-
r.innerHTML = t[n], r.className = i, e.append(r);
|
|
1729
|
+
for (let c = 0, d = t.length - 1; c < d; ++c) {
|
|
1730
|
+
const l = t[c];
|
|
1731
|
+
let o = e[c], h;
|
|
1732
|
+
if (n += l, O(o))
|
|
1733
|
+
o = new E(qt(o));
|
|
1734
|
+
else if (o instanceof lt)
|
|
1735
|
+
o = new E(o);
|
|
1736
|
+
else if (!(h = T.getForInstance(o))) {
|
|
1737
|
+
const u = o;
|
|
1738
|
+
o = new E(Gt(() => u));
|
|
1739
|
+
}
|
|
1740
|
+
n += He(o, l, a, h);
|
|
1118
1741
|
}
|
|
1119
|
-
|
|
1120
|
-
}
|
|
1121
|
-
removeStylesFrom(e) {
|
|
1122
|
-
e = this.normalizeTarget(e);
|
|
1123
|
-
const t = e.querySelectorAll(`.${this.styleClass}`);
|
|
1124
|
-
for (let i = 0, n = t.length; i < n; ++i)
|
|
1125
|
-
e.removeChild(t[i]);
|
|
1126
|
-
super.removeStylesFrom(e);
|
|
1127
|
-
}
|
|
1128
|
-
isAttachedTo(e) {
|
|
1129
|
-
return super.isAttachedTo(this.normalizeTarget(e));
|
|
1130
|
-
}
|
|
1131
|
-
normalizeTarget(e) {
|
|
1132
|
-
return e === document ? document.body : e;
|
|
1742
|
+
return new X(n + t[t.length - 1], r, s);
|
|
1133
1743
|
}
|
|
1134
1744
|
}
|
|
1135
|
-
|
|
1745
|
+
x(X);
|
|
1746
|
+
const re = (i, ...t) => {
|
|
1747
|
+
if (Array.isArray(i) && Array.isArray(i.raw))
|
|
1748
|
+
return X.create(i, t);
|
|
1749
|
+
throw g.error(
|
|
1750
|
+
1206
|
|
1751
|
+
/* Message.directCallToHTMLTagNotAllowed */
|
|
1752
|
+
);
|
|
1753
|
+
};
|
|
1754
|
+
re.partial = (i) => new j(i);
|
|
1755
|
+
const Et = "boolean", Mt = "reflect", oe = Object.freeze({
|
|
1136
1756
|
/**
|
|
1137
1757
|
* Locates all attribute configurations associated with a type.
|
|
1138
1758
|
*/
|
|
1139
|
-
locate:
|
|
1140
|
-
}),
|
|
1141
|
-
toView(
|
|
1142
|
-
return
|
|
1759
|
+
locate: zt()
|
|
1760
|
+
}), Ie = {
|
|
1761
|
+
toView(i) {
|
|
1762
|
+
return i ? "true" : "false";
|
|
1143
1763
|
},
|
|
1144
|
-
fromView(
|
|
1145
|
-
return !(
|
|
1764
|
+
fromView(i) {
|
|
1765
|
+
return !(i == null || i === "false" || i === !1 || i === 0);
|
|
1146
1766
|
}
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1767
|
+
};
|
|
1768
|
+
function Ot(i) {
|
|
1769
|
+
if (i == null)
|
|
1770
|
+
return null;
|
|
1771
|
+
const t = i * 1;
|
|
1772
|
+
return isNaN(t) ? null : t;
|
|
1773
|
+
}
|
|
1774
|
+
const fi = {
|
|
1775
|
+
toView(i) {
|
|
1776
|
+
const t = Ot(i);
|
|
1777
|
+
return t && t.toString();
|
|
1153
1778
|
},
|
|
1154
|
-
fromView
|
|
1155
|
-
if (s == null)
|
|
1156
|
-
return null;
|
|
1157
|
-
const e = s * 1;
|
|
1158
|
-
return isNaN(e) ? null : e;
|
|
1159
|
-
}
|
|
1779
|
+
fromView: Ot
|
|
1160
1780
|
};
|
|
1161
|
-
class
|
|
1781
|
+
class W {
|
|
1162
1782
|
/**
|
|
1163
1783
|
* Creates an instance of AttributeDefinition.
|
|
1164
1784
|
* @param Owner - The class constructor that owns this attribute.
|
|
@@ -1168,44 +1788,44 @@ class x {
|
|
|
1168
1788
|
* @param converter - A {@link ValueConverter} that integrates with the property getter/setter
|
|
1169
1789
|
* to convert values to and from a DOM string.
|
|
1170
1790
|
*/
|
|
1171
|
-
constructor(
|
|
1172
|
-
this.guards = /* @__PURE__ */ new Set(), this.Owner =
|
|
1791
|
+
constructor(t, e, s = e.toLowerCase(), n = Mt, r) {
|
|
1792
|
+
this.guards = /* @__PURE__ */ new Set(), this.Owner = t, this.name = e, this.attribute = s, this.mode = n, this.converter = r, this.fieldName = `_${e}`, this.callbackName = `${e}Changed`, this.hasCallback = this.callbackName in t.prototype, n === Et && r === void 0 && (this.converter = Ie);
|
|
1173
1793
|
}
|
|
1174
1794
|
/**
|
|
1175
1795
|
* Sets the value of the attribute/property on the source element.
|
|
1176
1796
|
* @param source - The source element to access.
|
|
1177
|
-
* @param
|
|
1797
|
+
* @param newValue - The value to set the attribute/property to.
|
|
1178
1798
|
*/
|
|
1179
|
-
setValue(
|
|
1180
|
-
const
|
|
1181
|
-
n !== void 0 && (
|
|
1799
|
+
setValue(t, e) {
|
|
1800
|
+
const s = t[this.fieldName], n = this.converter;
|
|
1801
|
+
n !== void 0 && (e = n.fromView(e)), s !== e && (t[this.fieldName] = e, this.tryReflectToAttribute(t), this.hasCallback && t[this.callbackName](s, e), t.$fastController.notify(this.name));
|
|
1182
1802
|
}
|
|
1183
1803
|
/**
|
|
1184
1804
|
* Gets the value of the attribute/property on the source element.
|
|
1185
1805
|
* @param source - The source element to access.
|
|
1186
1806
|
*/
|
|
1187
|
-
getValue(
|
|
1188
|
-
return
|
|
1807
|
+
getValue(t) {
|
|
1808
|
+
return p.track(t, this.name), t[this.fieldName];
|
|
1189
1809
|
}
|
|
1190
1810
|
/** @internal */
|
|
1191
|
-
onAttributeChangedCallback(
|
|
1192
|
-
this.guards.has(
|
|
1193
|
-
}
|
|
1194
|
-
tryReflectToAttribute(
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
const n =
|
|
1199
|
-
switch (
|
|
1200
|
-
case
|
|
1811
|
+
onAttributeChangedCallback(t, e) {
|
|
1812
|
+
this.guards.has(t) || (this.guards.add(t), this.setValue(t, e), this.guards.delete(t));
|
|
1813
|
+
}
|
|
1814
|
+
tryReflectToAttribute(t) {
|
|
1815
|
+
const e = this.mode, s = this.guards;
|
|
1816
|
+
s.has(t) || e === "fromView" || Ut.enqueue(() => {
|
|
1817
|
+
s.add(t);
|
|
1818
|
+
const n = t[this.fieldName];
|
|
1819
|
+
switch (e) {
|
|
1820
|
+
case Mt:
|
|
1201
1821
|
const r = this.converter;
|
|
1202
|
-
|
|
1822
|
+
$.setAttribute(t, this.attribute, r !== void 0 ? r.toView(n) : n);
|
|
1203
1823
|
break;
|
|
1204
|
-
case
|
|
1205
|
-
|
|
1824
|
+
case Et:
|
|
1825
|
+
$.setBooleanAttribute(t, this.attribute, n);
|
|
1206
1826
|
break;
|
|
1207
1827
|
}
|
|
1208
|
-
|
|
1828
|
+
s.delete(t);
|
|
1209
1829
|
});
|
|
1210
1830
|
}
|
|
1211
1831
|
/**
|
|
@@ -1214,92 +1834,211 @@ class x {
|
|
|
1214
1834
|
* @param attributeLists - Any existing attributes to collect and merge with those associated with the owner.
|
|
1215
1835
|
* @internal
|
|
1216
1836
|
*/
|
|
1217
|
-
static collect(
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
for (let n = 0, r =
|
|
1221
|
-
const
|
|
1222
|
-
if (
|
|
1223
|
-
for (let
|
|
1224
|
-
const l =
|
|
1225
|
-
|
|
1837
|
+
static collect(t, ...e) {
|
|
1838
|
+
const s = [];
|
|
1839
|
+
e.push(oe.locate(t));
|
|
1840
|
+
for (let n = 0, r = e.length; n < r; ++n) {
|
|
1841
|
+
const a = e[n];
|
|
1842
|
+
if (a !== void 0)
|
|
1843
|
+
for (let c = 0, d = a.length; c < d; ++c) {
|
|
1844
|
+
const l = a[c];
|
|
1845
|
+
B(l) ? s.push(new W(t, l)) : s.push(new W(t, l.property, l.attribute, l.mode, l.converter));
|
|
1226
1846
|
}
|
|
1227
1847
|
}
|
|
1228
|
-
return
|
|
1848
|
+
return s;
|
|
1229
1849
|
}
|
|
1230
1850
|
}
|
|
1231
|
-
function
|
|
1232
|
-
let
|
|
1233
|
-
function
|
|
1234
|
-
arguments.length > 1 && (
|
|
1851
|
+
function Pe(i, t) {
|
|
1852
|
+
let e;
|
|
1853
|
+
function s(n, r) {
|
|
1854
|
+
arguments.length > 1 && (e.property = r), oe.locate(n.constructor).push(e);
|
|
1235
1855
|
}
|
|
1236
1856
|
if (arguments.length > 1) {
|
|
1237
|
-
|
|
1857
|
+
e = {}, s(i, t);
|
|
1238
1858
|
return;
|
|
1239
1859
|
}
|
|
1240
|
-
return
|
|
1860
|
+
return e = i === void 0 ? {} : i, s;
|
|
1241
1861
|
}
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1862
|
+
var De = function(i, t, e, s) {
|
|
1863
|
+
function n(r) {
|
|
1864
|
+
return r instanceof e ? r : new e(function(a) {
|
|
1865
|
+
a(r);
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
return new (e || (e = Promise))(function(r, a) {
|
|
1869
|
+
function c(o) {
|
|
1870
|
+
try {
|
|
1871
|
+
l(s.next(o));
|
|
1872
|
+
} catch (h) {
|
|
1873
|
+
a(h);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
function d(o) {
|
|
1877
|
+
try {
|
|
1878
|
+
l(s.throw(o));
|
|
1879
|
+
} catch (h) {
|
|
1880
|
+
a(h);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
function l(o) {
|
|
1884
|
+
o.done ? r(o.value) : n(o.value).then(c, d);
|
|
1250
1885
|
}
|
|
1886
|
+
l((s = s.apply(i, t || [])).next());
|
|
1251
1887
|
});
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
const i = x.collect(e, t.attributes), n = new Array(i.length), r = {}, o = {};
|
|
1263
|
-
for (let a = 0, c = i.length; a < c; ++a) {
|
|
1264
|
-
const l = i[a];
|
|
1265
|
-
n[a] = l.attribute, r[l.name] = l, o[l.attribute] = l;
|
|
1888
|
+
};
|
|
1889
|
+
const _t = { mode: "open" }, Rt = {}, et = /* @__PURE__ */ new Set(), R = g.getById(k.elementRegistry, () => Dt());
|
|
1890
|
+
class f {
|
|
1891
|
+
constructor(t, e = t.definition) {
|
|
1892
|
+
var s;
|
|
1893
|
+
this.platformDefined = !1, B(e) && (e = { name: e }), this.type = t, this.name = e.name, this.template = e.template, this.templateOptions = e.templateOptions, this.registry = (s = e.registry) !== null && s !== void 0 ? s : customElements;
|
|
1894
|
+
const n = t.prototype, r = W.collect(t, e.attributes), a = new Array(r.length), c = {}, d = {};
|
|
1895
|
+
for (let l = 0, o = r.length; l < o; ++l) {
|
|
1896
|
+
const h = r[l];
|
|
1897
|
+
a[l] = h.attribute, c[h.name] = h, d[h.attribute] = h, p.defineProperty(n, h);
|
|
1266
1898
|
}
|
|
1267
|
-
|
|
1899
|
+
Reflect.defineProperty(t, "observedAttributes", {
|
|
1900
|
+
value: a,
|
|
1901
|
+
enumerable: !0
|
|
1902
|
+
}), this.attributes = r, this.propertyLookup = c, this.attributeLookup = d, this.shadowOptions = e.shadowOptions === void 0 ? _t : e.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, _t), e.shadowOptions), this.elementOptions = e.elementOptions === void 0 ? Rt : Object.assign(Object.assign({}, Rt), e.elementOptions), this.styles = v.normalize(e.styles), R.register(this), p.defineProperty(f.isRegistered, this.name), f.isRegistered[this.name] = this.type;
|
|
1268
1903
|
}
|
|
1269
1904
|
/**
|
|
1270
1905
|
* Indicates if this element has been defined in at least one registry.
|
|
1271
1906
|
*/
|
|
1272
1907
|
get isDefined() {
|
|
1273
|
-
return
|
|
1908
|
+
return this.platformDefined;
|
|
1274
1909
|
}
|
|
1275
1910
|
/**
|
|
1276
1911
|
* Defines a custom element based on this definition.
|
|
1277
1912
|
* @param registry - The element registry to define the element in.
|
|
1913
|
+
* @remarks
|
|
1914
|
+
* This operation is idempotent per registry.
|
|
1915
|
+
*/
|
|
1916
|
+
define(t = this.registry) {
|
|
1917
|
+
const e = this.type;
|
|
1918
|
+
return t.get(this.name) || (this.platformDefined = !0, t.define(this.name, e, this.elementOptions)), this;
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Creates an instance of FASTElementDefinition.
|
|
1922
|
+
* @param type - The type this definition is being created for.
|
|
1923
|
+
* @param nameOrDef - The name of the element to define or a config object
|
|
1924
|
+
* that describes the element to define.
|
|
1278
1925
|
*/
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1926
|
+
static compose(t, e) {
|
|
1927
|
+
return et.has(t) || R.getByType(t) ? new f(class extends t {
|
|
1928
|
+
}, e) : new f(t, e);
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Registers a FASTElement base type.
|
|
1932
|
+
* @param type - The type to register as a base type.
|
|
1933
|
+
* @internal
|
|
1934
|
+
*/
|
|
1935
|
+
static registerBaseType(t) {
|
|
1936
|
+
et.add(t);
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Creates an instance of FASTElementDefinition asynchronously. This option assumes
|
|
1940
|
+
* that a template and shadowOptions will be provided and completes when those requirements
|
|
1941
|
+
* are met.
|
|
1942
|
+
* @param type - The type this definition is being created for.
|
|
1943
|
+
* @param nameOrDef - The name of the element to define or a config object
|
|
1944
|
+
* that describes the element to define.
|
|
1945
|
+
* @alpha
|
|
1946
|
+
*/
|
|
1947
|
+
static composeAsync(t, e) {
|
|
1948
|
+
return new Promise((s) => {
|
|
1949
|
+
(et.has(t) || R.getByType(t)) && s(new f(class extends t {
|
|
1950
|
+
}, e));
|
|
1951
|
+
const n = new f(t, e);
|
|
1952
|
+
Promise.all([
|
|
1953
|
+
new Promise((r) => {
|
|
1954
|
+
p.getNotifier(n).subscribe({
|
|
1955
|
+
handleChange: () => r()
|
|
1956
|
+
}, "template");
|
|
1957
|
+
})
|
|
1958
|
+
]).then(() => {
|
|
1959
|
+
s(n);
|
|
1288
1960
|
});
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
f.isRegistered = {};
|
|
1965
|
+
f.getByType = R.getByType;
|
|
1966
|
+
f.getForInstance = R.getForInstance;
|
|
1967
|
+
f.registerAsync = (i) => De(void 0, void 0, void 0, function* () {
|
|
1968
|
+
return new Promise((t) => {
|
|
1969
|
+
f.isRegistered[i] && t(f.isRegistered[i]), p.getNotifier(f.isRegistered).subscribe({
|
|
1970
|
+
handleChange: () => t(f.isRegistered[i])
|
|
1971
|
+
}, i);
|
|
1972
|
+
});
|
|
1973
|
+
});
|
|
1974
|
+
p.defineProperty(f.prototype, "template");
|
|
1975
|
+
class ze extends MutationObserver {
|
|
1976
|
+
/**
|
|
1977
|
+
* Creates an instance of UnobservableMutationObserver.
|
|
1978
|
+
* @param callback - The callback to invoke when observed nodes are changed.
|
|
1979
|
+
*/
|
|
1980
|
+
constructor(t) {
|
|
1981
|
+
function e(s) {
|
|
1982
|
+
this.callback.call(null, s.filter((n) => this.observedNodes.has(n.target)));
|
|
1289
1983
|
}
|
|
1290
|
-
|
|
1984
|
+
super(e), this.callback = t, this.observedNodes = /* @__PURE__ */ new Set();
|
|
1985
|
+
}
|
|
1986
|
+
observe(t, e) {
|
|
1987
|
+
this.observedNodes.add(t), super.observe(t, e);
|
|
1988
|
+
}
|
|
1989
|
+
unobserve(t) {
|
|
1990
|
+
this.observedNodes.delete(t), this.observedNodes.size < 1 && this.disconnect();
|
|
1291
1991
|
}
|
|
1292
1992
|
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1993
|
+
const pi = Object.freeze({
|
|
1994
|
+
/**
|
|
1995
|
+
* Creates a ViewBehaviorOrchestrator.
|
|
1996
|
+
* @param source - The source to to associate behaviors with.
|
|
1997
|
+
* @returns A ViewBehaviorOrchestrator.
|
|
1998
|
+
*/
|
|
1999
|
+
create(i) {
|
|
2000
|
+
const t = [], e = {};
|
|
2001
|
+
let s = null, n = !1;
|
|
2002
|
+
return {
|
|
2003
|
+
source: i,
|
|
2004
|
+
context: M.default,
|
|
2005
|
+
targets: e,
|
|
2006
|
+
get isBound() {
|
|
2007
|
+
return n;
|
|
2008
|
+
},
|
|
2009
|
+
addBehaviorFactory(r, a) {
|
|
2010
|
+
var c, d, l, o;
|
|
2011
|
+
const h = r;
|
|
2012
|
+
h.id = (c = h.id) !== null && c !== void 0 ? c : L(), h.targetNodeId = (d = h.targetNodeId) !== null && d !== void 0 ? d : L(), h.targetTagName = (l = a.tagName) !== null && l !== void 0 ? l : null, h.policy = (o = h.policy) !== null && o !== void 0 ? o : $.policy, this.addTarget(h.targetNodeId, a), this.addBehavior(h.createBehavior());
|
|
2013
|
+
},
|
|
2014
|
+
addTarget(r, a) {
|
|
2015
|
+
e[r] = a;
|
|
2016
|
+
},
|
|
2017
|
+
addBehavior(r) {
|
|
2018
|
+
t.push(r), n && r.bind(this);
|
|
2019
|
+
},
|
|
2020
|
+
onUnbind(r) {
|
|
2021
|
+
s === null && (s = []), s.push(r);
|
|
2022
|
+
},
|
|
2023
|
+
connectedCallback(r) {
|
|
2024
|
+
n || (n = !0, t.forEach((a) => a.bind(this)));
|
|
2025
|
+
},
|
|
2026
|
+
disconnectedCallback(r) {
|
|
2027
|
+
n && (n = !1, s !== null && s.forEach((a) => a.unbind(this)));
|
|
2028
|
+
}
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
}), Ue = {
|
|
1295
2032
|
bubbles: !0,
|
|
1296
2033
|
composed: !0,
|
|
1297
2034
|
cancelable: !0
|
|
1298
|
-
};
|
|
1299
|
-
function
|
|
1300
|
-
|
|
2035
|
+
}, P = "isConnected", ae = /* @__PURE__ */ new WeakMap();
|
|
2036
|
+
function V(i) {
|
|
2037
|
+
var t, e;
|
|
2038
|
+
return (e = (t = i.shadowRoot) !== null && t !== void 0 ? t : ae.get(i)) !== null && e !== void 0 ? e : null;
|
|
1301
2039
|
}
|
|
1302
|
-
|
|
2040
|
+
let Vt;
|
|
2041
|
+
class S extends Wt {
|
|
1303
2042
|
/**
|
|
1304
2043
|
* Creates a Controller to control the specified element.
|
|
1305
2044
|
* @param element - The element to be controlled by this controller.
|
|
@@ -1307,19 +2046,14 @@ class D extends ie {
|
|
|
1307
2046
|
* controller in how to handle rendering and other platform integrations.
|
|
1308
2047
|
* @internal
|
|
1309
2048
|
*/
|
|
1310
|
-
constructor(
|
|
1311
|
-
super(
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
if (n.length > 0) {
|
|
1319
|
-
const r = this.boundObservables = /* @__PURE__ */ Object.create(null);
|
|
1320
|
-
for (let o = 0, a = n.length; o < a; ++o) {
|
|
1321
|
-
const c = n[o].name, l = e[c];
|
|
1322
|
-
l !== void 0 && (delete e[c], r[c] = l);
|
|
2049
|
+
constructor(t, e) {
|
|
2050
|
+
super(t), this.boundObservables = null, this.needsInitialization = !0, this.hasExistingShadowRoot = !1, this._template = null, this.stage = 3, this.guardBehaviorConnection = !1, this.behaviors = null, this.behaviorsConnected = !1, this._mainStyles = null, this.$fastController = this, this.view = null, this.source = t, this.definition = e, this.shadowOptions = e.shadowOptions;
|
|
2051
|
+
const s = p.getAccessors(t);
|
|
2052
|
+
if (s.length > 0) {
|
|
2053
|
+
const n = this.boundObservables = /* @__PURE__ */ Object.create(null);
|
|
2054
|
+
for (let r = 0, a = s.length; r < a; ++r) {
|
|
2055
|
+
const c = s[r].name, d = t[c];
|
|
2056
|
+
d !== void 0 && (delete t[c], n[c] = d);
|
|
1323
2057
|
}
|
|
1324
2058
|
}
|
|
1325
2059
|
}
|
|
@@ -1328,10 +2062,28 @@ class D extends ie {
|
|
|
1328
2062
|
* connected to the document.
|
|
1329
2063
|
*/
|
|
1330
2064
|
get isConnected() {
|
|
1331
|
-
return
|
|
2065
|
+
return p.track(this, P), this.stage === 1;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* The context the expression is evaluated against.
|
|
2069
|
+
*/
|
|
2070
|
+
get context() {
|
|
2071
|
+
var t, e;
|
|
2072
|
+
return (e = (t = this.view) === null || t === void 0 ? void 0 : t.context) !== null && e !== void 0 ? e : M.default;
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* Indicates whether the controller is bound.
|
|
2076
|
+
*/
|
|
2077
|
+
get isBound() {
|
|
2078
|
+
var t, e;
|
|
2079
|
+
return (e = (t = this.view) === null || t === void 0 ? void 0 : t.isBound) !== null && e !== void 0 ? e : !1;
|
|
1332
2080
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
2081
|
+
/**
|
|
2082
|
+
* Indicates how the source's lifetime relates to the controller's lifetime.
|
|
2083
|
+
*/
|
|
2084
|
+
get sourceLifetime() {
|
|
2085
|
+
var t;
|
|
2086
|
+
return (t = this.view) === null || t === void 0 ? void 0 : t.sourceLifetime;
|
|
1335
2087
|
}
|
|
1336
2088
|
/**
|
|
1337
2089
|
* Gets/sets the template used to render the component.
|
|
@@ -1339,116 +2091,148 @@ class D extends ie {
|
|
|
1339
2091
|
* This value can only be accurately read after connect but can be set at any time.
|
|
1340
2092
|
*/
|
|
1341
2093
|
get template() {
|
|
2094
|
+
var t;
|
|
2095
|
+
if (this._template === null) {
|
|
2096
|
+
const e = this.definition;
|
|
2097
|
+
this.source.resolveTemplate ? this._template = this.source.resolveTemplate() : e.template && (this._template = (t = e.template) !== null && t !== void 0 ? t : null);
|
|
2098
|
+
}
|
|
1342
2099
|
return this._template;
|
|
1343
2100
|
}
|
|
1344
|
-
set template(
|
|
1345
|
-
this._template !==
|
|
2101
|
+
set template(t) {
|
|
2102
|
+
this._template !== t && (this._template = t, this.needsInitialization || this.renderTemplate(t));
|
|
2103
|
+
}
|
|
2104
|
+
get shadowOptions() {
|
|
2105
|
+
return this._shadowRootOptions;
|
|
2106
|
+
}
|
|
2107
|
+
set shadowOptions(t) {
|
|
2108
|
+
if (this._shadowRootOptions === void 0 && t !== void 0) {
|
|
2109
|
+
this._shadowRootOptions = t;
|
|
2110
|
+
let e = this.source.shadowRoot;
|
|
2111
|
+
e ? this.hasExistingShadowRoot = !0 : (e = this.source.attachShadow(t), t.mode === "closed" && ae.set(this.source, e));
|
|
2112
|
+
}
|
|
1346
2113
|
}
|
|
1347
2114
|
/**
|
|
1348
|
-
*
|
|
1349
|
-
*
|
|
1350
|
-
|
|
2115
|
+
* The main set of styles used for the component, independent
|
|
2116
|
+
* of any dynamically added styles.
|
|
2117
|
+
*/
|
|
2118
|
+
get mainStyles() {
|
|
2119
|
+
var t;
|
|
2120
|
+
if (this._mainStyles === null) {
|
|
2121
|
+
const e = this.definition;
|
|
2122
|
+
this.source.resolveStyles ? this._mainStyles = this.source.resolveStyles() : e.styles && (this._mainStyles = (t = e.styles) !== null && t !== void 0 ? t : null);
|
|
2123
|
+
}
|
|
2124
|
+
return this._mainStyles;
|
|
2125
|
+
}
|
|
2126
|
+
set mainStyles(t) {
|
|
2127
|
+
this._mainStyles !== t && (this._mainStyles !== null && this.removeStyles(this._mainStyles), this._mainStyles = t, this.needsInitialization || this.addStyles(t));
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Registers an unbind handler with the controller.
|
|
2131
|
+
* @param behavior - An object to call when the controller unbinds.
|
|
2132
|
+
*/
|
|
2133
|
+
onUnbind(t) {
|
|
2134
|
+
var e;
|
|
2135
|
+
(e = this.view) === null || e === void 0 || e.onUnbind(t);
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2138
|
+
* Adds the behavior to the component.
|
|
2139
|
+
* @param behavior - The behavior to add.
|
|
1351
2140
|
*/
|
|
1352
|
-
|
|
1353
|
-
|
|
2141
|
+
addBehavior(t) {
|
|
2142
|
+
var e, s;
|
|
2143
|
+
const n = (e = this.behaviors) !== null && e !== void 0 ? e : this.behaviors = /* @__PURE__ */ new Map(), r = (s = n.get(t)) !== null && s !== void 0 ? s : 0;
|
|
2144
|
+
r === 0 ? (n.set(t, 1), t.addedCallback && t.addedCallback(this), t.connectedCallback && !this.guardBehaviorConnection && (this.stage === 1 || this.stage === 0) && t.connectedCallback(this)) : n.set(t, r + 1);
|
|
1354
2145
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
2146
|
+
/**
|
|
2147
|
+
* Removes the behavior from the component.
|
|
2148
|
+
* @param behavior - The behavior to remove.
|
|
2149
|
+
* @param force - Forces removal even if this behavior was added more than once.
|
|
2150
|
+
*/
|
|
2151
|
+
removeBehavior(t, e = !1) {
|
|
2152
|
+
const s = this.behaviors;
|
|
2153
|
+
if (s === null)
|
|
2154
|
+
return;
|
|
2155
|
+
const n = s.get(t);
|
|
2156
|
+
n !== void 0 && (n === 1 || e ? (s.delete(t), t.disconnectedCallback && this.stage !== 3 && t.disconnectedCallback(this), t.removedCallback && t.removedCallback(this)) : s.set(t, n - 1));
|
|
1357
2157
|
}
|
|
1358
2158
|
/**
|
|
1359
2159
|
* Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
|
|
1360
2160
|
* @param styles - The styles to add.
|
|
1361
2161
|
*/
|
|
1362
|
-
addStyles(
|
|
1363
|
-
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
e
|
|
2162
|
+
addStyles(t) {
|
|
2163
|
+
var e;
|
|
2164
|
+
if (!t)
|
|
2165
|
+
return;
|
|
2166
|
+
const s = this.source;
|
|
2167
|
+
if (t instanceof HTMLElement)
|
|
2168
|
+
((e = V(s)) !== null && e !== void 0 ? e : this.source).append(t);
|
|
2169
|
+
else if (!t.isAttachedTo(s)) {
|
|
2170
|
+
const n = t.behaviors;
|
|
2171
|
+
if (t.addStylesTo(s), n !== null)
|
|
2172
|
+
for (let r = 0, a = n.length; r < a; ++r)
|
|
2173
|
+
this.addBehavior(n[r]);
|
|
1369
2174
|
}
|
|
1370
2175
|
}
|
|
1371
2176
|
/**
|
|
1372
2177
|
* Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.
|
|
1373
2178
|
* @param styles - the styles to remove.
|
|
1374
2179
|
*/
|
|
1375
|
-
removeStyles(
|
|
1376
|
-
|
|
1377
|
-
if (
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
e
|
|
2180
|
+
removeStyles(t) {
|
|
2181
|
+
var e;
|
|
2182
|
+
if (!t)
|
|
2183
|
+
return;
|
|
2184
|
+
const s = this.source;
|
|
2185
|
+
if (t instanceof HTMLElement)
|
|
2186
|
+
((e = V(s)) !== null && e !== void 0 ? e : s).removeChild(t);
|
|
2187
|
+
else if (t.isAttachedTo(s)) {
|
|
2188
|
+
const n = t.behaviors;
|
|
2189
|
+
if (t.removeStylesFrom(s), n !== null)
|
|
2190
|
+
for (let r = 0, a = n.length; r < a; ++r)
|
|
2191
|
+
this.removeBehavior(n[r]);
|
|
1382
2192
|
}
|
|
1383
2193
|
}
|
|
1384
2194
|
/**
|
|
1385
|
-
*
|
|
1386
|
-
* @param behaviors - The behaviors to add.
|
|
2195
|
+
* Runs connected lifecycle behavior on the associated element.
|
|
1387
2196
|
*/
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
for (let r = 0; r < i; ++r) {
|
|
1391
|
-
const o = e[r];
|
|
1392
|
-
t.has(o) ? t.set(o, t.get(o) + 1) : (t.set(o, 1), n.push(o));
|
|
1393
|
-
}
|
|
1394
|
-
if (this._isConnected) {
|
|
1395
|
-
const r = this.element;
|
|
1396
|
-
for (let o = 0; o < n.length; ++o)
|
|
1397
|
-
n[o].bind(r, w);
|
|
1398
|
-
}
|
|
2197
|
+
connect() {
|
|
2198
|
+
this.stage === 3 && (this.stage = 0, this.bindObservables(), this.connectBehaviors(), this.needsInitialization ? (this.renderTemplate(this.template), this.addStyles(this.mainStyles), this.needsInitialization = !1) : this.view !== null && this.view.bind(this.source), this.stage = 1, p.notify(this, P));
|
|
1399
2199
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
const i = this.behaviors;
|
|
1407
|
-
if (i === null)
|
|
1408
|
-
return;
|
|
1409
|
-
const n = e.length, r = [];
|
|
1410
|
-
for (let o = 0; o < n; ++o) {
|
|
1411
|
-
const a = e[o];
|
|
1412
|
-
if (i.has(a)) {
|
|
1413
|
-
const c = i.get(a) - 1;
|
|
1414
|
-
c === 0 || t ? i.delete(a) && r.push(a) : i.set(a, c);
|
|
2200
|
+
bindObservables() {
|
|
2201
|
+
if (this.boundObservables !== null) {
|
|
2202
|
+
const t = this.source, e = this.boundObservables, s = Object.keys(e);
|
|
2203
|
+
for (let n = 0, r = s.length; n < r; ++n) {
|
|
2204
|
+
const a = s[n];
|
|
2205
|
+
t[a] = e[a];
|
|
1415
2206
|
}
|
|
2207
|
+
this.boundObservables = null;
|
|
1416
2208
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
2209
|
+
}
|
|
2210
|
+
connectBehaviors() {
|
|
2211
|
+
if (this.behaviorsConnected === !1) {
|
|
2212
|
+
const t = this.behaviors;
|
|
2213
|
+
if (t !== null) {
|
|
2214
|
+
this.guardBehaviorConnection = !0;
|
|
2215
|
+
for (const e of t.keys())
|
|
2216
|
+
e.connectedCallback && e.connectedCallback(this);
|
|
2217
|
+
this.guardBehaviorConnection = !1;
|
|
2218
|
+
}
|
|
2219
|
+
this.behaviorsConnected = !0;
|
|
1421
2220
|
}
|
|
1422
2221
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
const t = this.behaviors;
|
|
1432
|
-
if (t !== null)
|
|
1433
|
-
for (const [i] of t)
|
|
1434
|
-
i.bind(e, w);
|
|
1435
|
-
this.setIsConnected(!0);
|
|
2222
|
+
disconnectBehaviors() {
|
|
2223
|
+
if (this.behaviorsConnected === !0) {
|
|
2224
|
+
const t = this.behaviors;
|
|
2225
|
+
if (t !== null)
|
|
2226
|
+
for (const e of t.keys())
|
|
2227
|
+
e.disconnectedCallback && e.disconnectedCallback(this);
|
|
2228
|
+
this.behaviorsConnected = !1;
|
|
2229
|
+
}
|
|
1436
2230
|
}
|
|
1437
2231
|
/**
|
|
1438
2232
|
* Runs disconnected lifecycle behavior on the associated element.
|
|
1439
2233
|
*/
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
return;
|
|
1443
|
-
this.setIsConnected(!1);
|
|
1444
|
-
const e = this.view;
|
|
1445
|
-
e !== null && e.unbind();
|
|
1446
|
-
const t = this.behaviors;
|
|
1447
|
-
if (t !== null) {
|
|
1448
|
-
const i = this.element;
|
|
1449
|
-
for (const [n] of t)
|
|
1450
|
-
n.unbind(i);
|
|
1451
|
-
}
|
|
2234
|
+
disconnect() {
|
|
2235
|
+
this.stage === 1 && (this.stage = 2, p.notify(this, P), this.view !== null && this.view.unbind(), this.disconnectBehaviors(), this.stage = 3);
|
|
1452
2236
|
}
|
|
1453
2237
|
/**
|
|
1454
2238
|
* Runs the attribute changed callback for the associated element.
|
|
@@ -1456,9 +2240,9 @@ class D extends ie {
|
|
|
1456
2240
|
* @param oldValue - The previous value of the attribute.
|
|
1457
2241
|
* @param newValue - The new value of the attribute.
|
|
1458
2242
|
*/
|
|
1459
|
-
onAttributeChangedCallback(
|
|
1460
|
-
const n = this.definition.attributeLookup[
|
|
1461
|
-
n !== void 0 && n.onAttributeChangedCallback(this.
|
|
2243
|
+
onAttributeChangedCallback(t, e, s) {
|
|
2244
|
+
const n = this.definition.attributeLookup[t];
|
|
2245
|
+
n !== void 0 && n.onAttributeChangedCallback(this.source, s);
|
|
1462
2246
|
}
|
|
1463
2247
|
/**
|
|
1464
2248
|
* Emits a custom HTML event.
|
|
@@ -1468,160 +2252,311 @@ class D extends ie {
|
|
|
1468
2252
|
* @remarks
|
|
1469
2253
|
* Only emits events if connected.
|
|
1470
2254
|
*/
|
|
1471
|
-
emit(
|
|
1472
|
-
return this.
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2255
|
+
emit(t, e, s) {
|
|
2256
|
+
return this.stage === 1 ? this.source.dispatchEvent(new CustomEvent(t, Object.assign(Object.assign({ detail: e }, Ue), s))) : !1;
|
|
2257
|
+
}
|
|
2258
|
+
renderTemplate(t) {
|
|
2259
|
+
var e;
|
|
2260
|
+
const s = this.source, n = (e = V(s)) !== null && e !== void 0 ? e : s;
|
|
2261
|
+
if (this.view !== null)
|
|
2262
|
+
this.view.dispose(), this.view = null;
|
|
2263
|
+
else if (!this.needsInitialization || this.hasExistingShadowRoot) {
|
|
2264
|
+
this.hasExistingShadowRoot = !1;
|
|
2265
|
+
for (let r = n.firstChild; r !== null; r = n.firstChild)
|
|
2266
|
+
n.removeChild(r);
|
|
1483
2267
|
}
|
|
1484
|
-
|
|
1485
|
-
this._template === null && (this.element.resolveTemplate ? this._template = this.element.resolveTemplate() : i.template && (this._template = i.template || null)), this._template !== null && this.renderTemplate(this._template), this._styles === null && (this.element.resolveStyles ? this._styles = this.element.resolveStyles() : i.styles && (this._styles = i.styles || null)), this._styles !== null && this.addStyles(this._styles), this.needsInitialization = !1;
|
|
1486
|
-
}
|
|
1487
|
-
renderTemplate(e) {
|
|
1488
|
-
const t = this.element, i = E(t) || t;
|
|
1489
|
-
this.view !== null ? (this.view.dispose(), this.view = null) : this.needsInitialization || u.removeChildNodes(i), e && (this.view = e.render(t, i, t));
|
|
2268
|
+
t && (this.view = t.render(s, n, s), this.view.sourceLifetime = G.coupled);
|
|
1490
2269
|
}
|
|
1491
2270
|
/**
|
|
1492
2271
|
* Locates or creates a controller for the specified element.
|
|
1493
2272
|
* @param element - The element to return the controller for.
|
|
2273
|
+
* @param override - Reset the controller even if one has been defined.
|
|
1494
2274
|
* @remarks
|
|
1495
2275
|
* The specified element must have a {@link FASTElementDefinition}
|
|
1496
2276
|
* registered either through the use of the {@link customElement}
|
|
1497
2277
|
* decorator or a call to `FASTElement.define`.
|
|
1498
2278
|
*/
|
|
1499
|
-
static forCustomElement(e) {
|
|
1500
|
-
const
|
|
1501
|
-
if (
|
|
1502
|
-
return
|
|
1503
|
-
const
|
|
1504
|
-
if (
|
|
1505
|
-
throw
|
|
1506
|
-
|
|
2279
|
+
static forCustomElement(t, e = !1) {
|
|
2280
|
+
const s = t.$fastController;
|
|
2281
|
+
if (s !== void 0 && !e)
|
|
2282
|
+
return s;
|
|
2283
|
+
const n = f.getForInstance(t);
|
|
2284
|
+
if (n === void 0)
|
|
2285
|
+
throw g.error(
|
|
2286
|
+
1401
|
|
2287
|
+
/* Message.missingElementDefinition */
|
|
2288
|
+
);
|
|
2289
|
+
return p.getNotifier(n).subscribe({
|
|
2290
|
+
handleChange: () => {
|
|
2291
|
+
S.forCustomElement(t, !0), t.$fastController.connect();
|
|
2292
|
+
}
|
|
2293
|
+
}, "template"), p.getNotifier(n).subscribe({
|
|
2294
|
+
handleChange: () => {
|
|
2295
|
+
S.forCustomElement(t, !0), t.$fastController.connect();
|
|
2296
|
+
}
|
|
2297
|
+
}, "shadowOptions"), t.$fastController = new Vt(t, n);
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Sets the strategy that ElementController.forCustomElement uses to construct
|
|
2301
|
+
* ElementController instances for an element.
|
|
2302
|
+
* @param strategy - The strategy to use.
|
|
2303
|
+
*/
|
|
2304
|
+
static setStrategy(t) {
|
|
2305
|
+
Vt = t;
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
x(S);
|
|
2309
|
+
S.setStrategy(S);
|
|
2310
|
+
function q(i) {
|
|
2311
|
+
var t;
|
|
2312
|
+
return "adoptedStyleSheets" in i ? i : (t = V(i)) !== null && t !== void 0 ? t : i.getRootNode();
|
|
2313
|
+
}
|
|
2314
|
+
class Y {
|
|
2315
|
+
constructor(t) {
|
|
2316
|
+
const e = Y.styleSheetCache;
|
|
2317
|
+
this.sheets = t.map((s) => {
|
|
2318
|
+
if (s instanceof CSSStyleSheet)
|
|
2319
|
+
return s;
|
|
2320
|
+
let n = e.get(s);
|
|
2321
|
+
return n === void 0 && (n = new CSSStyleSheet(), n.replaceSync(s), e.set(s, n)), n;
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
addStylesTo(t) {
|
|
2325
|
+
le(q(t), this.sheets);
|
|
2326
|
+
}
|
|
2327
|
+
removeStylesFrom(t) {
|
|
2328
|
+
ce(q(t), this.sheets);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
Y.styleSheetCache = /* @__PURE__ */ new Map();
|
|
2332
|
+
let We = 0;
|
|
2333
|
+
const qe = () => `fast-${++We}`;
|
|
2334
|
+
function Lt(i) {
|
|
2335
|
+
return i === document ? document.body : i;
|
|
2336
|
+
}
|
|
2337
|
+
class Qe {
|
|
2338
|
+
constructor(t) {
|
|
2339
|
+
this.styles = t, this.styleClass = qe();
|
|
2340
|
+
}
|
|
2341
|
+
addStylesTo(t) {
|
|
2342
|
+
t = Lt(q(t));
|
|
2343
|
+
const e = this.styles, s = this.styleClass;
|
|
2344
|
+
for (let n = 0; n < e.length; n++) {
|
|
2345
|
+
const r = document.createElement("style");
|
|
2346
|
+
r.innerHTML = e[n], r.className = s, t.append(r);
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
removeStylesFrom(t) {
|
|
2350
|
+
t = Lt(q(t));
|
|
2351
|
+
const e = t.querySelectorAll(`.${this.styleClass}`);
|
|
2352
|
+
for (let s = 0, n = e.length; s < n; ++s)
|
|
2353
|
+
t.removeChild(e[s]);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
let le = (i, t) => {
|
|
2357
|
+
i.adoptedStyleSheets = [...i.adoptedStyleSheets, ...t];
|
|
2358
|
+
}, ce = (i, t) => {
|
|
2359
|
+
i.adoptedStyleSheets = i.adoptedStyleSheets.filter((e) => t.indexOf(e) === -1);
|
|
2360
|
+
};
|
|
2361
|
+
if (v.supportsAdoptedStyleSheets) {
|
|
2362
|
+
try {
|
|
2363
|
+
document.adoptedStyleSheets.push(), document.adoptedStyleSheets.splice(), le = (i, t) => {
|
|
2364
|
+
i.adoptedStyleSheets.push(...t);
|
|
2365
|
+
}, ce = (i, t) => {
|
|
2366
|
+
for (const e of t) {
|
|
2367
|
+
const s = i.adoptedStyleSheets.indexOf(e);
|
|
2368
|
+
s !== -1 && i.adoptedStyleSheets.splice(s, 1);
|
|
2369
|
+
}
|
|
2370
|
+
};
|
|
2371
|
+
} catch {
|
|
2372
|
+
}
|
|
2373
|
+
v.setDefaultStrategy(Y);
|
|
2374
|
+
} else
|
|
2375
|
+
v.setDefaultStrategy(Qe);
|
|
2376
|
+
const it = "defer-hydration", st = "needs-hydration";
|
|
2377
|
+
class N extends S {
|
|
2378
|
+
static hydrationObserverHandler(t) {
|
|
2379
|
+
for (const e of t)
|
|
2380
|
+
N.hydrationObserver.unobserve(e.target), e.target.$fastController.connect();
|
|
2381
|
+
}
|
|
2382
|
+
static forCustomElement(t, e) {
|
|
2383
|
+
const s = f.getForInstance(t);
|
|
2384
|
+
return s !== void 0 && s.templateOptions === "defer-and-hydrate" && !s.template && (t.setAttribute(it, ""), t.setAttribute(st, "")), super.forCustomElement(t, e);
|
|
2385
|
+
}
|
|
2386
|
+
connect() {
|
|
2387
|
+
var t, e;
|
|
2388
|
+
if (this.needsHydration === void 0 && (this.needsHydration = this.source.getAttribute(st) !== null), this.source.hasAttribute(it)) {
|
|
2389
|
+
N.hydrationObserver.observe(this.source, {
|
|
2390
|
+
attributeFilter: [it]
|
|
2391
|
+
});
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
if (!this.needsHydration) {
|
|
2395
|
+
super.connect();
|
|
2396
|
+
return;
|
|
2397
|
+
}
|
|
2398
|
+
if (this.stage !== 3)
|
|
2399
|
+
return;
|
|
2400
|
+
this.stage = 0, this.bindObservables(), this.connectBehaviors();
|
|
2401
|
+
const s = this.source, n = (t = V(s)) !== null && t !== void 0 ? t : s;
|
|
2402
|
+
if (this.template)
|
|
2403
|
+
if (z(this.template)) {
|
|
2404
|
+
let r = n.firstChild, a = n.lastChild;
|
|
2405
|
+
s.shadowRoot === null && (m.isElementBoundaryStartMarker(r) && (r.data = "", r = r.nextSibling), m.isElementBoundaryEndMarker(a) && (a.data = "", a = a.previousSibling)), this.view = this.template.hydrate(r, a, s), (e = this.view) === null || e === void 0 || e.bind(this.source);
|
|
2406
|
+
} else
|
|
2407
|
+
this.renderTemplate(this.template);
|
|
2408
|
+
this.addStyles(this.mainStyles), this.stage = 1, this.source.removeAttribute(st), this.needsInitialization = this.needsHydration = !1, p.notify(this, P);
|
|
2409
|
+
}
|
|
2410
|
+
disconnect() {
|
|
2411
|
+
super.disconnect(), N.hydrationObserver.unobserve(this.source);
|
|
2412
|
+
}
|
|
2413
|
+
static install() {
|
|
2414
|
+
S.setStrategy(N);
|
|
1507
2415
|
}
|
|
1508
2416
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
2417
|
+
N.hydrationObserver = new ze(N.hydrationObserverHandler);
|
|
2418
|
+
function de(i) {
|
|
2419
|
+
const t = class extends i {
|
|
1511
2420
|
constructor() {
|
|
1512
|
-
super(),
|
|
2421
|
+
super(), S.forCustomElement(this);
|
|
1513
2422
|
}
|
|
1514
|
-
$emit(e,
|
|
1515
|
-
return this.$fastController.emit(e,
|
|
2423
|
+
$emit(e, s, n) {
|
|
2424
|
+
return this.$fastController.emit(e, s, n);
|
|
1516
2425
|
}
|
|
1517
2426
|
connectedCallback() {
|
|
1518
|
-
this.$fastController.
|
|
2427
|
+
this.$fastController.connect();
|
|
1519
2428
|
}
|
|
1520
2429
|
disconnectedCallback() {
|
|
1521
|
-
this.$fastController.
|
|
2430
|
+
this.$fastController.disconnect();
|
|
1522
2431
|
}
|
|
1523
|
-
attributeChangedCallback(e,
|
|
1524
|
-
this.$fastController.onAttributeChangedCallback(e,
|
|
2432
|
+
attributeChangedCallback(e, s, n) {
|
|
2433
|
+
this.$fastController.onAttributeChangedCallback(e, s, n);
|
|
1525
2434
|
}
|
|
1526
2435
|
};
|
|
2436
|
+
return f.registerBaseType(t), t;
|
|
1527
2437
|
}
|
|
1528
|
-
|
|
2438
|
+
function Ge(i, t) {
|
|
2439
|
+
return O(i) ? f.compose(i, t) : f.compose(this, i);
|
|
2440
|
+
}
|
|
2441
|
+
function Je(i, t) {
|
|
2442
|
+
return O(i) ? new Promise((e) => {
|
|
2443
|
+
f.composeAsync(i, t).then((s) => {
|
|
2444
|
+
e(s);
|
|
2445
|
+
});
|
|
2446
|
+
}).then((e) => e.define().type) : new Promise((e) => {
|
|
2447
|
+
f.composeAsync(this, i).then((s) => {
|
|
2448
|
+
e(s);
|
|
2449
|
+
});
|
|
2450
|
+
}).then((e) => e.define().type);
|
|
2451
|
+
}
|
|
2452
|
+
function Ke(i, t) {
|
|
2453
|
+
return O(i) ? f.compose(i, t).define().type : f.compose(this, i).define().type;
|
|
2454
|
+
}
|
|
2455
|
+
function Xe(i) {
|
|
2456
|
+
return de(i);
|
|
2457
|
+
}
|
|
2458
|
+
const Ye = Object.assign(de(HTMLElement), {
|
|
1529
2459
|
/**
|
|
1530
2460
|
* Creates a new FASTElement base class inherited from the
|
|
1531
2461
|
* provided base type.
|
|
1532
2462
|
* @param BaseType - The base element type to inherit from.
|
|
1533
2463
|
*/
|
|
1534
|
-
from
|
|
1535
|
-
return G(s);
|
|
1536
|
-
},
|
|
2464
|
+
from: Xe,
|
|
1537
2465
|
/**
|
|
1538
2466
|
* Defines a platform custom element based on the provided type and definition.
|
|
1539
2467
|
* @param type - The custom element type to define.
|
|
1540
2468
|
* @param nameOrDef - The name of the element to define or a definition object
|
|
1541
2469
|
* that describes the element to define.
|
|
1542
2470
|
*/
|
|
1543
|
-
define
|
|
1544
|
-
|
|
1545
|
-
|
|
2471
|
+
define: Ke,
|
|
2472
|
+
/**
|
|
2473
|
+
* Defines metadata for a FASTElement which can be used to later define the element.
|
|
2474
|
+
* @public
|
|
2475
|
+
*/
|
|
2476
|
+
compose: Ge,
|
|
2477
|
+
/**
|
|
2478
|
+
* Defines metadata for a FASTElement which can be used after it has been resolved to define the element.
|
|
2479
|
+
* @alpha
|
|
2480
|
+
*/
|
|
2481
|
+
defineAsync: Je
|
|
1546
2482
|
});
|
|
1547
|
-
function
|
|
1548
|
-
return
|
|
1549
|
-
}
|
|
1550
|
-
const
|
|
1551
|
-
const
|
|
1552
|
-
const r =
|
|
1553
|
-
let
|
|
1554
|
-
if (
|
|
2483
|
+
function Ze(i, t) {
|
|
2484
|
+
return i instanceof Function ? i(t) : i;
|
|
2485
|
+
}
|
|
2486
|
+
const jt = /* @__PURE__ */ new Set(), nt = /* @__PURE__ */ new Map(), bi = (i) => (t = "vwc") => {
|
|
2487
|
+
const e = (n) => `${t}-${n}`, s = (n) => {
|
|
2488
|
+
const r = e(n.name);
|
|
2489
|
+
let a = n.type;
|
|
2490
|
+
if (a.componentName = n.name, jt.has(r))
|
|
1555
2491
|
return;
|
|
1556
|
-
|
|
1557
|
-
}),
|
|
1558
|
-
for (const
|
|
1559
|
-
|
|
1560
|
-
const
|
|
2492
|
+
nt.has(a) && nt.get(a) !== r && (a = class extends a {
|
|
2493
|
+
}), jt.add(r), nt.set(a, r);
|
|
2494
|
+
for (const o of n.dependencies)
|
|
2495
|
+
s(o);
|
|
2496
|
+
const c = new Map([
|
|
1561
2497
|
[n.type, r],
|
|
1562
2498
|
...n.dependencies.map(
|
|
1563
|
-
(
|
|
2499
|
+
(o) => [o.type, e(o.name)]
|
|
1564
2500
|
)
|
|
1565
|
-
]),
|
|
1566
|
-
tagFor(
|
|
1567
|
-
if (!
|
|
2501
|
+
]), l = {
|
|
2502
|
+
tagFor: (o, h) => {
|
|
2503
|
+
if (!c.has(o))
|
|
1568
2504
|
throw new Error(
|
|
1569
|
-
`Could not get tag for ${
|
|
2505
|
+
`Could not get tag for ${o.name} as it is not a dependency of ${n.name}.`
|
|
1570
2506
|
);
|
|
1571
|
-
|
|
2507
|
+
const u = c.get(o);
|
|
2508
|
+
return h ? u : re.partial(u);
|
|
1572
2509
|
},
|
|
1573
|
-
tagForNonDependency(
|
|
1574
|
-
return
|
|
2510
|
+
tagForNonDependency(o) {
|
|
2511
|
+
return e(o);
|
|
1575
2512
|
}
|
|
1576
2513
|
};
|
|
1577
|
-
|
|
2514
|
+
f.compose(a, {
|
|
1578
2515
|
...n.options,
|
|
1579
|
-
template:
|
|
2516
|
+
template: Ze(
|
|
1580
2517
|
n.template,
|
|
1581
|
-
|
|
2518
|
+
l
|
|
1582
2519
|
),
|
|
1583
|
-
name: `${
|
|
2520
|
+
name: `${t}-${n.name}`
|
|
1584
2521
|
}).define();
|
|
1585
2522
|
};
|
|
1586
|
-
i
|
|
1587
|
-
},
|
|
1588
|
-
name:
|
|
1589
|
-
type:
|
|
1590
|
-
template:
|
|
1591
|
-
dependencies:
|
|
2523
|
+
s(i);
|
|
2524
|
+
}, gi = (i, t, e, s, n) => ({
|
|
2525
|
+
name: i,
|
|
2526
|
+
type: t,
|
|
2527
|
+
template: e,
|
|
2528
|
+
dependencies: s,
|
|
1592
2529
|
options: n
|
|
1593
|
-
}),
|
|
1594
|
-
let
|
|
1595
|
-
return
|
|
1596
|
-
},
|
|
1597
|
-
|
|
1598
|
-
},
|
|
1599
|
-
|
|
1600
|
-
},
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
const t = s[e];
|
|
1605
|
-
s[`_${e}`] = null, s.removeAttribute(V(e)), s[`_${e}`] = t, s[e] !== null ? s.dataset[Y(e)] = s[e] : delete s.dataset[Y(e)];
|
|
2530
|
+
}), Ft = /* @__PURE__ */ new WeakMap(), he = (i) => {
|
|
2531
|
+
let t = Ft.get(i);
|
|
2532
|
+
return t || (t = [], Ft.set(i, t)), t;
|
|
2533
|
+
}, yi = (i, t) => {
|
|
2534
|
+
he(i).push(t);
|
|
2535
|
+
}, ti = (i, t) => {
|
|
2536
|
+
he(i).forEach((e) => e(i, t));
|
|
2537
|
+
}, ei = (i) => i === "delegate", Ht = (i) => `vvd${i.charAt(0).toUpperCase()}${i.slice(1)}`, ue = (i, t) => {
|
|
2538
|
+
if (ei(i._vividAriaBehaviour)) {
|
|
2539
|
+
const e = i[t];
|
|
2540
|
+
i[`_${t}`] = null, i.removeAttribute(at(t)), i[`_${t}`] = e, i[t] !== null ? i.dataset[Ht(t)] = i[t] : delete i.dataset[Ht(t)];
|
|
1606
2541
|
} else
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
2542
|
+
$.setAttribute(
|
|
2543
|
+
i,
|
|
2544
|
+
at(t),
|
|
2545
|
+
i[t]
|
|
1611
2546
|
);
|
|
1612
|
-
},
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1615
|
-
},
|
|
1616
|
-
|
|
1617
|
-
},
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
for (const
|
|
1621
|
-
ue(
|
|
1622
|
-
|
|
1623
|
-
}
|
|
1624
|
-
},
|
|
2547
|
+
}, Q = /* @__PURE__ */ new WeakMap(), ii = (i, t) => {
|
|
2548
|
+
const e = Q.get(i);
|
|
2549
|
+
e ? e.add(t) : Q.set(i, /* @__PURE__ */ new Set([t]));
|
|
2550
|
+
}, si = (i, t) => {
|
|
2551
|
+
i.isConnected ? ue(i, t) : ii(i, t);
|
|
2552
|
+
}, ni = (i) => {
|
|
2553
|
+
const t = Q.get(i);
|
|
2554
|
+
if (t) {
|
|
2555
|
+
for (const e of t)
|
|
2556
|
+
ue(i, e);
|
|
2557
|
+
Q.delete(i);
|
|
2558
|
+
}
|
|
2559
|
+
}, It = [
|
|
1625
2560
|
"role",
|
|
1626
2561
|
"ariaAtomic",
|
|
1627
2562
|
"ariaAutoComplete",
|
|
@@ -1665,65 +2600,70 @@ const J = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map(), et = (s) =>
|
|
|
1665
2600
|
"ariaValueText",
|
|
1666
2601
|
"ariaRelevant"
|
|
1667
2602
|
// Non-standard
|
|
1668
|
-
],
|
|
1669
|
-
class
|
|
1670
|
-
constructor(...
|
|
1671
|
-
super(...
|
|
1672
|
-
for (const n of
|
|
2603
|
+
], at = (i) => i.replace("aria", "aria-").toLowerCase(), ri = (i) => {
|
|
2604
|
+
class t extends i {
|
|
2605
|
+
constructor(...s) {
|
|
2606
|
+
super(...s), this._vividAriaBehaviour = "default";
|
|
2607
|
+
for (const n of It)
|
|
1673
2608
|
this[`_${n}`] = null;
|
|
1674
2609
|
}
|
|
1675
2610
|
connectedCallback() {
|
|
1676
|
-
super.connectedCallback(),
|
|
2611
|
+
super.connectedCallback(), ni(this);
|
|
1677
2612
|
}
|
|
1678
2613
|
}
|
|
1679
|
-
for (const
|
|
1680
|
-
|
|
1681
|
-
attribute:
|
|
2614
|
+
for (const e of It)
|
|
2615
|
+
Pe({
|
|
2616
|
+
attribute: at(e),
|
|
1682
2617
|
mode: "fromView"
|
|
1683
|
-
})(
|
|
1684
|
-
|
|
2618
|
+
})(t.prototype, e), t.prototype[`${e}Changed`] = function() {
|
|
2619
|
+
si(this, e), this._vividAriaBehaviour !== "default" && ti(this, e);
|
|
1685
2620
|
};
|
|
1686
|
-
return
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
2621
|
+
return t;
|
|
2622
|
+
};
|
|
2623
|
+
function oi() {
|
|
2624
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
2625
|
+
return (t) => (i.has(t) || i.set(t, []), i.get(t));
|
|
2626
|
+
}
|
|
2627
|
+
const fe = oi(), vi = (i) => (t, e) => {
|
|
2628
|
+
fe(t.constructor).push({
|
|
2629
|
+
newPropertyName: e,
|
|
2630
|
+
...i
|
|
1691
2631
|
});
|
|
1692
|
-
},
|
|
1693
|
-
class
|
|
1694
|
-
#
|
|
2632
|
+
}, ai = (i) => {
|
|
2633
|
+
class t extends i {
|
|
2634
|
+
#t(s) {
|
|
1695
2635
|
let n = !1, r = !1;
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1698
|
-
) ===
|
|
1699
|
-
handleChange(
|
|
1700
|
-
if (
|
|
1701
|
-
if (n = !0, !
|
|
2636
|
+
const a = (o) => r && s.fromDeprecated(
|
|
2637
|
+
o[s.deprecatedPropertyName]
|
|
2638
|
+
) === o[s.newPropertyName], c = (o) => n && s.toDeprecated && s.toDeprecated(o[s.newPropertyName]) === o[s.deprecatedPropertyName], d = {
|
|
2639
|
+
handleChange(o, h) {
|
|
2640
|
+
if (h === s.newPropertyName) {
|
|
2641
|
+
if (n = !0, !s.toDeprecated || a(o))
|
|
1702
2642
|
return;
|
|
1703
|
-
|
|
2643
|
+
o[s.deprecatedPropertyName] = s.toDeprecated(o[s.newPropertyName]);
|
|
1704
2644
|
}
|
|
1705
|
-
if (
|
|
1706
|
-
if (r = !0,
|
|
2645
|
+
if (h === s.deprecatedPropertyName) {
|
|
2646
|
+
if (r = !0, c(o))
|
|
1707
2647
|
return;
|
|
1708
|
-
|
|
1709
|
-
|
|
2648
|
+
o[s.newPropertyName] = s.fromDeprecated(
|
|
2649
|
+
o[s.deprecatedPropertyName]
|
|
1710
2650
|
);
|
|
1711
2651
|
}
|
|
1712
2652
|
}
|
|
1713
|
-
}, l =
|
|
1714
|
-
l.subscribe(
|
|
2653
|
+
}, l = p.getNotifier(this);
|
|
2654
|
+
l.subscribe(d, s.newPropertyName), l.subscribe(d, s.deprecatedPropertyName);
|
|
1715
2655
|
}
|
|
1716
|
-
constructor(...
|
|
1717
|
-
super(...
|
|
2656
|
+
constructor(...s) {
|
|
2657
|
+
super(...s);
|
|
1718
2658
|
for (const n of fe(this.constructor))
|
|
1719
|
-
this.#
|
|
2659
|
+
this.#t(n);
|
|
1720
2660
|
}
|
|
1721
2661
|
}
|
|
1722
|
-
return
|
|
2662
|
+
return t;
|
|
1723
2663
|
};
|
|
1724
|
-
class
|
|
2664
|
+
class mi extends ri(ai(Ye)) {
|
|
1725
2665
|
static {
|
|
1726
|
-
this.VIVID_VERSION = "5.
|
|
2666
|
+
this.VIVID_VERSION = "5.3.0";
|
|
1727
2667
|
}
|
|
1728
2668
|
/**
|
|
1729
2669
|
* Add data-vvd-component attribute with component name globally,
|
|
@@ -1731,31 +2671,45 @@ class rt extends We(Qe(Le)) {
|
|
|
1731
2671
|
*/
|
|
1732
2672
|
connectedCallback() {
|
|
1733
2673
|
super.connectedCallback();
|
|
1734
|
-
const
|
|
1735
|
-
this.setAttribute("data-vvd-component",
|
|
2674
|
+
const t = this.constructor.componentName;
|
|
2675
|
+
this.setAttribute("data-vvd-component", t);
|
|
1736
2676
|
}
|
|
1737
2677
|
}
|
|
1738
2678
|
export {
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
2679
|
+
ci as A,
|
|
2680
|
+
lt as B,
|
|
2681
|
+
$ as D,
|
|
2682
|
+
M as E,
|
|
2683
|
+
T as H,
|
|
2684
|
+
Kt as M,
|
|
2685
|
+
p as O,
|
|
2686
|
+
we as S,
|
|
2687
|
+
Ut as U,
|
|
2688
|
+
mi as V,
|
|
2689
|
+
Pe as a,
|
|
2690
|
+
pi as b,
|
|
2691
|
+
bi as c,
|
|
2692
|
+
gi as d,
|
|
2693
|
+
di as e,
|
|
2694
|
+
O as f,
|
|
2695
|
+
qt as g,
|
|
2696
|
+
re as h,
|
|
2697
|
+
B as i,
|
|
2698
|
+
at as j,
|
|
2699
|
+
It as k,
|
|
2700
|
+
rt as l,
|
|
2701
|
+
z as m,
|
|
2702
|
+
fi as n,
|
|
2703
|
+
hi as o,
|
|
2704
|
+
A as p,
|
|
2705
|
+
K as q,
|
|
2706
|
+
vi as r,
|
|
2707
|
+
yi as s,
|
|
2708
|
+
m as t,
|
|
2709
|
+
Gt as u,
|
|
2710
|
+
ui as v,
|
|
2711
|
+
v as w,
|
|
2712
|
+
pe as x,
|
|
2713
|
+
li as y,
|
|
2714
|
+
Z as z
|
|
1761
2715
|
};
|