@supersoniks/concorde 4.9.94 → 4.9.95
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/README.md +16 -30
- package/build-infos.json +1 -1
- package/concorde-3d.bundle.js +3911 -0
- package/concorde-3d.es.js +32635 -0
- package/concorde-core.bundle.js +1 -1
- package/concorde-core.es.js +1 -1
- package/concorde-hugging-face-infer.bundle.js +32 -0
- package/concorde-hugging-face-infer.es.js +2952 -0
- package/concorde-shader.bundle.js +105 -0
- package/concorde-shader.es.js +7982 -0
- package/concorde-webgpu.bundle.js +296 -0
- package/concorde-webgpu.es.js +8268 -0
- package/dist/concorde-core.bundle.js +1 -1
- package/dist/concorde-core.es.js +1 -1
- package/docs/assets/{index-D2Q3JyQ6.css → index-BZiZXMU-.css} +1 -1
- package/docs/assets/index-FmK4JaIM.js +11992 -0
- package/docs/crawl/core/components/functional/jsonata/jsonata.html +79 -0
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +1 -1
- package/docs/crawl/docs/_core-concept/dataFlow.html +12 -1
- package/docs/crawl/docs/_misc/docs-mock-api.html +12 -0
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +138 -0
- package/docs/crawl/docs/_misc/html-integration.html +3 -2
- package/docs/crawl/hubs/remote-data.html +3 -5
- package/docs/crawl/index.html +2 -0
- package/docs/docs-mock-api-sw.js +110 -0
- package/docs/docs-mock-api-sw.js.map +3 -3
- package/docs/index.html +2 -2
- package/docs/llms-full.txt +193 -2
- package/docs/llms.txt +2 -0
- package/docs/sitemap.xml +6 -0
- package/docs/src/core/components/functional/jsonata/jsonata.md +56 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +1 -1
- package/docs/src/docs/_core-concept/dataFlow.md +10 -1
- package/docs/src/docs/_misc/docs-mock-api.md +3 -0
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +115 -0
- package/docs/src/docs/_misc/html-integration.md +2 -0
- package/docs/src/docs/search/docs-search.json +180 -0
- package/docs/src/tsconfig.json +18 -0
- package/package.json +379 -1102
- package/scripts/post-build.mjs +0 -43
- package/scripts/pre-build.mjs +4 -33
- package/scripts/pre-publish.mjs +0 -2
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
- package/src/core/components/ui/form/input/input.ts +0 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -0
- package/src/core/components/ui/form/select/select.ts +0 -0
- package/src/core/components/ui/form/textarea/textarea.ts +0 -0
- package/src/docs/_getting-started/create-a-component.md +0 -0
- package/src/docs/search/docs-search.json +2128 -713
- package/src/tsconfig.json +309 -0
- package/vite/config.js +23 -35
- package/dist/js/components.js +0 -12
- package/dist/js/components.js.map +0 -1
- package/dist/js/concorde-loaded.js +0 -5
- package/dist/js/concorde-loaded.js.map +0 -1
- package/dist/js/core/_types/endpoint.js +0 -5
- package/dist/js/core/_types/endpoint.js.map +0 -1
- package/dist/js/core/_types/key.js +0 -2
- package/dist/js/core/_types/key.js.map +0 -1
- package/dist/js/core/_types/types.js +0 -3
- package/dist/js/core/_types/types.js.map +0 -1
- package/dist/js/core/components/functional/date/date.js +0 -272
- package/dist/js/core/components/functional/date/date.js.map +0 -1
- package/dist/js/core/components/functional/example/example.js +0 -44
- package/dist/js/core/components/functional/example/example.js.map +0 -1
- package/dist/js/core/components/functional/fetch/fetch.js +0 -79
- package/dist/js/core/components/functional/fetch/fetch.js.map +0 -1
- package/dist/js/core/components/functional/functional.js +0 -18
- package/dist/js/core/components/functional/functional.js.map +0 -1
- package/dist/js/core/components/functional/if/if.js +0 -39
- package/dist/js/core/components/functional/if/if.js.map +0 -1
- package/dist/js/core/components/functional/jsonata/jsonata.js +0 -119
- package/dist/js/core/components/functional/jsonata/jsonata.js.map +0 -1
- package/dist/js/core/components/functional/list/list.js +0 -341
- package/dist/js/core/components/functional/list/list.js.map +0 -1
- package/dist/js/core/components/functional/mix/mix.js +0 -103
- package/dist/js/core/components/functional/mix/mix.js.map +0 -1
- package/dist/js/core/components/functional/queue/queue.js +0 -450
- package/dist/js/core/components/functional/queue/queue.js.map +0 -1
- package/dist/js/core/components/functional/router/redirect.js +0 -54
- package/dist/js/core/components/functional/router/redirect.js.map +0 -1
- package/dist/js/core/components/functional/router/router.js +0 -179
- package/dist/js/core/components/functional/router/router.js.map +0 -1
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js +0 -216
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js.map +0 -1
- package/dist/js/core/components/functional/sdui/default-library.json +0 -108
- package/dist/js/core/components/functional/sdui/sdui-utils.js +0 -64
- package/dist/js/core/components/functional/sdui/sdui-utils.js.map +0 -1
- package/dist/js/core/components/functional/sdui/sdui.js +0 -266
- package/dist/js/core/components/functional/sdui/sdui.js.map +0 -1
- package/dist/js/core/components/functional/sdui/types.js +0 -2
- package/dist/js/core/components/functional/sdui/types.js.map +0 -1
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js +0 -22
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js.map +0 -1
- package/dist/js/core/components/functional/states/states.js +0 -172
- package/dist/js/core/components/functional/states/states.js.map +0 -1
- package/dist/js/core/components/functional/submit/submit.js +0 -284
- package/dist/js/core/components/functional/submit/submit.js.map +0 -1
- package/dist/js/core/components/functional/subscriber/subscriber.js +0 -39
- package/dist/js/core/components/functional/subscriber/subscriber.js.map +0 -1
- package/dist/js/core/components/functional/translation/translation.js +0 -28
- package/dist/js/core/components/functional/translation/translation.js.map +0 -1
- package/dist/js/core/components/functional/value/value.js +0 -28
- package/dist/js/core/components/functional/value/value.js.map +0 -1
- package/dist/js/core/components/ui/_css/scroll.js +0 -27
- package/dist/js/core/components/ui/_css/scroll.js.map +0 -1
- package/dist/js/core/components/ui/_css/shadow.js +0 -22
- package/dist/js/core/components/ui/_css/shadow.js.map +0 -1
- package/dist/js/core/components/ui/_css/size.js +0 -36
- package/dist/js/core/components/ui/_css/size.js.map +0 -1
- package/dist/js/core/components/ui/_css/type.js +0 -92
- package/dist/js/core/components/ui/_css/type.js.map +0 -1
- package/dist/js/core/components/ui/alert/alert.js +0 -213
- package/dist/js/core/components/ui/alert/alert.js.map +0 -1
- package/dist/js/core/components/ui/alert-messages/alert-messages.js +0 -68
- package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +0 -1
- package/dist/js/core/components/ui/badge/badge.js +0 -199
- package/dist/js/core/components/ui/badge/badge.js.map +0 -1
- package/dist/js/core/components/ui/button/button.js +0 -697
- package/dist/js/core/components/ui/button/button.js.map +0 -1
- package/dist/js/core/components/ui/captcha/altchaStyles.js +0 -226
- package/dist/js/core/components/ui/captcha/altchaStyles.js.map +0 -1
- package/dist/js/core/components/ui/captcha/captcha.js +0 -167
- package/dist/js/core/components/ui/captcha/captcha.js.map +0 -1
- package/dist/js/core/components/ui/card/card-footer.js +0 -26
- package/dist/js/core/components/ui/card/card-footer.js.map +0 -1
- package/dist/js/core/components/ui/card/card-header-descripton.js +0 -30
- package/dist/js/core/components/ui/card/card-header-descripton.js.map +0 -1
- package/dist/js/core/components/ui/card/card-header.js +0 -79
- package/dist/js/core/components/ui/card/card-header.js.map +0 -1
- package/dist/js/core/components/ui/card/card-main.js +0 -26
- package/dist/js/core/components/ui/card/card-main.js.map +0 -1
- package/dist/js/core/components/ui/card/card.js +0 -67
- package/dist/js/core/components/ui/card/card.js.map +0 -1
- package/dist/js/core/components/ui/divider/divider.js +0 -200
- package/dist/js/core/components/ui/divider/divider.js.map +0 -1
- package/dist/js/core/components/ui/form/checkbox/checkbox.js +0 -257
- package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +0 -1
- package/dist/js/core/components/ui/form/css/form-control.js +0 -393
- package/dist/js/core/components/ui/form/css/form-control.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/fieldset.js +0 -124
- package/dist/js/core/components/ui/form/fieldset/fieldset.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/legend-description.js +0 -38
- package/dist/js/core/components/ui/form/fieldset/legend-description.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/legend.js +0 -130
- package/dist/js/core/components/ui/form/fieldset/legend.js.map +0 -1
- package/dist/js/core/components/ui/form/form-actions/form-actions.js +0 -47
- package/dist/js/core/components/ui/form/form-actions/form-actions.js.map +0 -1
- package/dist/js/core/components/ui/form/form-layout/form-layout.js +0 -84
- package/dist/js/core/components/ui/form/form-layout/form-layout.js.map +0 -1
- package/dist/js/core/components/ui/form/input/input.js +0 -316
- package/dist/js/core/components/ui/form/input/input.js.map +0 -1
- package/dist/js/core/components/ui/form/input/password-helper.js +0 -134
- package/dist/js/core/components/ui/form/input/password-helper.js.map +0 -1
- package/dist/js/core/components/ui/form/input/same-value-helper.js +0 -85
- package/dist/js/core/components/ui/form/input/same-value-helper.js.map +0 -1
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +0 -405
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +0 -1
- package/dist/js/core/components/ui/form/radio/radio.js +0 -63
- package/dist/js/core/components/ui/form/radio/radio.js.map +0 -1
- package/dist/js/core/components/ui/form/select/select.js +0 -323
- package/dist/js/core/components/ui/form/select/select.js.map +0 -1
- package/dist/js/core/components/ui/form/switch/switch.js +0 -90
- package/dist/js/core/components/ui/form/switch/switch.js.map +0 -1
- package/dist/js/core/components/ui/form/textarea/textarea.js +0 -162
- package/dist/js/core/components/ui/form/textarea/textarea.js.map +0 -1
- package/dist/js/core/components/ui/group/group.js +0 -128
- package/dist/js/core/components/ui/group/group.js.map +0 -1
- package/dist/js/core/components/ui/icon/icon.js +0 -145
- package/dist/js/core/components/ui/icon/icon.js.map +0 -1
- package/dist/js/core/components/ui/icon/icons.js +0 -184
- package/dist/js/core/components/ui/icon/icons.js.map +0 -1
- package/dist/js/core/components/ui/icon/icons.json +0 -1
- package/dist/js/core/components/ui/image/image.js +0 -160
- package/dist/js/core/components/ui/image/image.js.map +0 -1
- package/dist/js/core/components/ui/link/link.js +0 -125
- package/dist/js/core/components/ui/link/link.js.map +0 -1
- package/dist/js/core/components/ui/loader/loader.js +0 -106
- package/dist/js/core/components/ui/loader/loader.js.map +0 -1
- package/dist/js/core/components/ui/loader/styles/fixed.js +0 -56
- package/dist/js/core/components/ui/loader/styles/fixed.js.map +0 -1
- package/dist/js/core/components/ui/loader/styles/inline.js +0 -70
- package/dist/js/core/components/ui/loader/styles/inline.js.map +0 -1
- package/dist/js/core/components/ui/menu/menu-item.js +0 -35
- package/dist/js/core/components/ui/menu/menu-item.js.map +0 -1
- package/dist/js/core/components/ui/menu/menu.js +0 -436
- package/dist/js/core/components/ui/menu/menu.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-actions.js +0 -44
- package/dist/js/core/components/ui/modal/modal-actions.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-close.js +0 -56
- package/dist/js/core/components/ui/modal/modal-close.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-content.js +0 -27
- package/dist/js/core/components/ui/modal/modal-content.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-subtitle.js +0 -34
- package/dist/js/core/components/ui/modal/modal-subtitle.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-title.js +0 -35
- package/dist/js/core/components/ui/modal/modal-title.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-utils.js +0 -32
- package/dist/js/core/components/ui/modal/modal-utils.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal.js +0 -568
- package/dist/js/core/components/ui/modal/modal.js.map +0 -1
- package/dist/js/core/components/ui/pop/pop.js +0 -337
- package/dist/js/core/components/ui/pop/pop.js.map +0 -1
- package/dist/js/core/components/ui/progress/progress.js +0 -164
- package/dist/js/core/components/ui/progress/progress.js.map +0 -1
- package/dist/js/core/components/ui/table/table-caption.js +0 -29
- package/dist/js/core/components/ui/table/table-caption.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tbody.js +0 -41
- package/dist/js/core/components/ui/table/table-tbody.js.map +0 -1
- package/dist/js/core/components/ui/table/table-td.js +0 -69
- package/dist/js/core/components/ui/table/table-td.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tfoot.js +0 -28
- package/dist/js/core/components/ui/table/table-tfoot.js.map +0 -1
- package/dist/js/core/components/ui/table/table-th.js +0 -80
- package/dist/js/core/components/ui/table/table-th.js.map +0 -1
- package/dist/js/core/components/ui/table/table-thead.js +0 -26
- package/dist/js/core/components/ui/table/table-thead.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tr.js +0 -67
- package/dist/js/core/components/ui/table/table-tr.js.map +0 -1
- package/dist/js/core/components/ui/table/table.js +0 -106
- package/dist/js/core/components/ui/table/table.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js +0 -74
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/dark.js +0 -39
- package/dist/js/core/components/ui/theme/theme-collection/dark.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/light.js +0 -32
- package/dist/js/core/components/ui/theme/theme-collection/light.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme.js +0 -150
- package/dist/js/core/components/ui/theme/theme.js.map +0 -1
- package/dist/js/core/components/ui/toast/message-subscriber.js +0 -41
- package/dist/js/core/components/ui/toast/message-subscriber.js.map +0 -1
- package/dist/js/core/components/ui/toast/toast-item.js +0 -379
- package/dist/js/core/components/ui/toast/toast-item.js.map +0 -1
- package/dist/js/core/components/ui/toast/toast.js +0 -269
- package/dist/js/core/components/ui/toast/toast.js.map +0 -1
- package/dist/js/core/components/ui/toast/types.js +0 -2
- package/dist/js/core/components/ui/toast/types.js.map +0 -1
- package/dist/js/core/components/ui/tooltip/tooltip.js +0 -219
- package/dist/js/core/components/ui/tooltip/tooltip.js.map +0 -1
- package/dist/js/core/components/ui/ui.js +0 -41
- package/dist/js/core/components/ui/ui.js.map +0 -1
- package/dist/js/core/core.js +0 -14
- package/dist/js/core/core.js.map +0 -1
- package/dist/js/core/decorators/Subscriber.js +0 -10
- package/dist/js/core/decorators/Subscriber.js.map +0 -1
- package/dist/js/core/decorators/api.js +0 -806
- package/dist/js/core/decorators/api.js.map +0 -1
- package/dist/js/core/decorators/lifecycle.js +0 -67
- package/dist/js/core/decorators/lifecycle.js.map +0 -1
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js +0 -27
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +0 -1
- package/dist/js/core/decorators/subscriber/autoFill.js +0 -26
- package/dist/js/core/decorators/subscriber/autoFill.js.map +0 -1
- package/dist/js/core/decorators/subscriber/autoSubscribe.js +0 -46
- package/dist/js/core/decorators/subscriber/autoSubscribe.js.map +0 -1
- package/dist/js/core/decorators/subscriber/bind.js +0 -150
- package/dist/js/core/decorators/subscriber/bind.js.map +0 -1
- package/dist/js/core/decorators/subscriber/common.js +0 -44
- package/dist/js/core/decorators/subscriber/common.js.map +0 -1
- package/dist/js/core/decorators/subscriber/derive.js +0 -60
- package/dist/js/core/decorators/subscriber/derive.js.map +0 -1
- package/dist/js/core/decorators/subscriber/dynamicPath.js +0 -75
- package/dist/js/core/decorators/subscriber/dynamicPath.js.map +0 -1
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js +0 -138
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js.map +0 -1
- package/dist/js/core/decorators/subscriber/handle.js +0 -22
- package/dist/js/core/decorators/subscriber/handle.js.map +0 -1
- package/dist/js/core/decorators/subscriber/onAssign.js +0 -199
- package/dist/js/core/decorators/subscriber/onAssign.js.map +0 -1
- package/dist/js/core/decorators/subscriber/publish.js +0 -108
- package/dist/js/core/decorators/subscriber/publish.js.map +0 -1
- package/dist/js/core/decorators/subscriber/publisherPath.js +0 -16
- package/dist/js/core/decorators/subscriber/publisherPath.js.map +0 -1
- package/dist/js/core/decorators/subscriber/subscribe.js +0 -20
- package/dist/js/core/decorators/subscriber/subscribe.js.map +0 -1
- package/dist/js/core/directives/DataProvider.js +0 -127
- package/dist/js/core/directives/DataProvider.js.map +0 -1
- package/dist/js/core/directives/Wording.js +0 -221
- package/dist/js/core/directives/Wording.js.map +0 -1
- package/dist/js/core/mixins/Fetcher.js +0 -325
- package/dist/js/core/mixins/Fetcher.js.map +0 -1
- package/dist/js/core/mixins/FormCheckable.js +0 -313
- package/dist/js/core/mixins/FormCheckable.js.map +0 -1
- package/dist/js/core/mixins/FormElement.js +0 -304
- package/dist/js/core/mixins/FormElement.js.map +0 -1
- package/dist/js/core/mixins/FormInput.js +0 -82
- package/dist/js/core/mixins/FormInput.js.map +0 -1
- package/dist/js/core/mixins/Subscriber.js +0 -354
- package/dist/js/core/mixins/Subscriber.js.map +0 -1
- package/dist/js/core/mixins/TemplatesContainer.js +0 -70
- package/dist/js/core/mixins/TemplatesContainer.js.map +0 -1
- package/dist/js/core/mixins/mixins.js +0 -7
- package/dist/js/core/mixins/mixins.js.map +0 -1
- package/dist/js/core/utils/AncestorAttributeObserver.js +0 -140
- package/dist/js/core/utils/AncestorAttributeObserver.js.map +0 -1
- package/dist/js/core/utils/Arrays.js +0 -141
- package/dist/js/core/utils/Arrays.js.map +0 -1
- package/dist/js/core/utils/DataBindObserver.js +0 -265
- package/dist/js/core/utils/DataBindObserver.js.map +0 -1
- package/dist/js/core/utils/Electron.js +0 -14
- package/dist/js/core/utils/Electron.js.map +0 -1
- package/dist/js/core/utils/Format.js +0 -43
- package/dist/js/core/utils/Format.js.map +0 -1
- package/dist/js/core/utils/HTML.js +0 -272
- package/dist/js/core/utils/HTML.js.map +0 -1
- package/dist/js/core/utils/LocationHandler.js +0 -143
- package/dist/js/core/utils/LocationHandler.js.map +0 -1
- package/dist/js/core/utils/Objects.js +0 -111
- package/dist/js/core/utils/Objects.js.map +0 -1
- package/dist/js/core/utils/PublisherProxy.js +0 -946
- package/dist/js/core/utils/PublisherProxy.js.map +0 -1
- package/dist/js/core/utils/SafariScrollGuard.js +0 -384
- package/dist/js/core/utils/SafariScrollGuard.js.map +0 -1
- package/dist/js/core/utils/Utils.js +0 -19
- package/dist/js/core/utils/Utils.js.map +0 -1
- package/dist/js/core/utils/aesCrypto.js +0 -98
- package/dist/js/core/utils/aesCrypto.js.map +0 -1
- package/dist/js/core/utils/api.js +0 -595
- package/dist/js/core/utils/api.js.map +0 -1
- package/dist/js/core/utils/dataProviderKey.js +0 -64
- package/dist/js/core/utils/dataProviderKey.js.map +0 -1
- package/dist/js/core/utils/derive.js +0 -246
- package/dist/js/core/utils/derive.js.map +0 -1
- package/dist/js/core/utils/endpoint.js +0 -74
- package/dist/js/core/utils/endpoint.js.map +0 -1
- package/dist/js/core/utils/jsonataHelpers.js +0 -69
- package/dist/js/core/utils/jsonataHelpers.js.map +0 -1
- package/dist/js/core/utils/jsonataRuntime.js +0 -75
- package/dist/js/core/utils/jsonataRuntime.js.map +0 -1
- package/dist/js/core/utils/route.js +0 -149
- package/dist/js/core/utils/route.js.map +0 -1
- package/dist/js/core/utils/url-pattern.js +0 -3
- package/dist/js/core/utils/url-pattern.js.map +0 -1
- package/dist/js/dataprovider.js +0 -2
- package/dist/js/dataprovider.js.map +0 -1
- package/dist/js/decorators.js +0 -43
- package/dist/js/decorators.js.map +0 -1
- package/dist/js/directives.js +0 -30
- package/dist/js/directives.js.map +0 -1
- package/dist/js/index.js +0 -8
- package/dist/js/index.js.map +0 -1
- package/dist/js/mixins.js +0 -23
- package/dist/js/mixins.js.map +0 -1
- package/dist/js/test-utils/TestUtils.js +0 -10
- package/dist/js/test-utils/TestUtils.js.map +0 -1
- package/dist/js/utils.js +0 -46
- package/dist/js/utils.js.map +0 -1
- package/dist/types/components.d.ts +0 -5
- package/dist/types/components.d.ts.map +0 -1
- package/dist/types/concorde-loaded.d.ts +0 -2
- package/dist/types/concorde-loaded.d.ts.map +0 -1
- package/dist/types/core/_types/endpoint.d.ts +0 -5
- package/dist/types/core/_types/endpoint.d.ts.map +0 -1
- package/dist/types/core/_types/key.d.ts +0 -2
- package/dist/types/core/_types/key.d.ts.map +0 -1
- package/dist/types/core/_types/types.d.ts +0 -28
- package/dist/types/core/_types/types.d.ts.map +0 -1
- package/dist/types/core/components/functional/date/date.d.ts +0 -52
- package/dist/types/core/components/functional/date/date.d.ts.map +0 -1
- package/dist/types/core/components/functional/example/example.d.ts +0 -15
- package/dist/types/core/components/functional/example/example.d.ts.map +0 -1
- package/dist/types/core/components/functional/fetch/fetch.d.ts +0 -102
- package/dist/types/core/components/functional/fetch/fetch.d.ts.map +0 -1
- package/dist/types/core/components/functional/functional.d.ts +0 -18
- package/dist/types/core/components/functional/functional.d.ts.map +0 -1
- package/dist/types/core/components/functional/if/if.d.ts +0 -13
- package/dist/types/core/components/functional/if/if.d.ts.map +0 -1
- package/dist/types/core/components/functional/jsonata/jsonata.d.ts +0 -29
- package/dist/types/core/components/functional/jsonata/jsonata.d.ts.map +0 -1
- package/dist/types/core/components/functional/list/list.d.ts +0 -149
- package/dist/types/core/components/functional/list/list.d.ts.map +0 -1
- package/dist/types/core/components/functional/mix/mix.d.ts +0 -23
- package/dist/types/core/components/functional/mix/mix.d.ts.map +0 -1
- package/dist/types/core/components/functional/queue/queue.d.ts +0 -93
- package/dist/types/core/components/functional/queue/queue.d.ts.map +0 -1
- package/dist/types/core/components/functional/router/redirect.d.ts +0 -19
- package/dist/types/core/components/functional/router/redirect.d.ts.map +0 -1
- package/dist/types/core/components/functional/router/router.d.ts +0 -46
- package/dist/types/core/components/functional/router/router.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -59
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts +0 -6
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/sdui.d.ts +0 -145
- package/dist/types/core/components/functional/sdui/sdui.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/types.d.ts +0 -38
- package/dist/types/core/components/functional/sdui/types.d.ts.map +0 -1
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -6
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts.map +0 -1
- package/dist/types/core/components/functional/states/states.d.ts +0 -42
- package/dist/types/core/components/functional/states/states.d.ts.map +0 -1
- package/dist/types/core/components/functional/submit/submit.d.ts +0 -37
- package/dist/types/core/components/functional/submit/submit.d.ts.map +0 -1
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts +0 -13
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts.map +0 -1
- package/dist/types/core/components/functional/translation/translation.d.ts +0 -7
- package/dist/types/core/components/functional/translation/translation.d.ts.map +0 -1
- package/dist/types/core/components/functional/value/value.d.ts +0 -8
- package/dist/types/core/components/functional/value/value.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/scroll.d.ts +0 -2
- package/dist/types/core/components/ui/_css/scroll.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/shadow.d.ts +0 -3
- package/dist/types/core/components/ui/_css/shadow.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/size.d.ts +0 -3
- package/dist/types/core/components/ui/_css/size.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/type.d.ts +0 -3
- package/dist/types/core/components/ui/_css/type.d.ts.map +0 -1
- package/dist/types/core/components/ui/alert/alert.d.ts +0 -37
- package/dist/types/core/components/ui/alert/alert.d.ts.map +0 -1
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts +0 -15
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +0 -1
- package/dist/types/core/components/ui/badge/badge.d.ts +0 -27
- package/dist/types/core/components/ui/badge/badge.d.ts.map +0 -1
- package/dist/types/core/components/ui/button/button.d.ts +0 -180
- package/dist/types/core/components/ui/button/button.d.ts.map +0 -1
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts +0 -2
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts.map +0 -1
- package/dist/types/core/components/ui/captcha/captcha.d.ts +0 -30
- package/dist/types/core/components/ui/captcha/captcha.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-footer.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-footer.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-header.d.ts +0 -9
- package/dist/types/core/components/ui/card/card-header.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-main.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-main.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card.d.ts +0 -13
- package/dist/types/core/components/ui/card/card.d.ts.map +0 -1
- package/dist/types/core/components/ui/divider/divider.d.ts +0 -16
- package/dist/types/core/components/ui/divider/divider.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +0 -176
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/css/form-control.d.ts +0 -5
- package/dist/types/core/components/ui/form/css/form-control.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts +0 -24
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts +0 -6
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts +0 -17
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts +0 -8
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts +0 -13
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/input.d.ts +0 -123
- package/dist/types/core/components/ui/form/input/input.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/password-helper.d.ts +0 -26
- package/dist/types/core/components/ui/form/input/password-helper.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts +0 -17
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +0 -155
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/radio/radio.d.ts +0 -15
- package/dist/types/core/components/ui/form/radio/radio.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/select/select.d.ts +0 -59
- package/dist/types/core/components/ui/form/select/select.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/switch/switch.d.ts +0 -6
- package/dist/types/core/components/ui/form/switch/switch.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts +0 -94
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +0 -1
- package/dist/types/core/components/ui/group/group.d.ts +0 -17
- package/dist/types/core/components/ui/group/group.d.ts.map +0 -1
- package/dist/types/core/components/ui/icon/icon.d.ts +0 -30
- package/dist/types/core/components/ui/icon/icon.d.ts.map +0 -1
- package/dist/types/core/components/ui/icon/icons.d.ts +0 -13
- package/dist/types/core/components/ui/icon/icons.d.ts.map +0 -1
- package/dist/types/core/components/ui/image/image.d.ts +0 -16
- package/dist/types/core/components/ui/image/image.d.ts.map +0 -1
- package/dist/types/core/components/ui/link/link.d.ts +0 -30
- package/dist/types/core/components/ui/link/link.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/loader.d.ts +0 -24
- package/dist/types/core/components/ui/loader/loader.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts +0 -2
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/styles/inline.d.ts +0 -2
- package/dist/types/core/components/ui/loader/styles/inline.d.ts.map +0 -1
- package/dist/types/core/components/ui/menu/menu-item.d.ts +0 -6
- package/dist/types/core/components/ui/menu/menu-item.d.ts.map +0 -1
- package/dist/types/core/components/ui/menu/menu.d.ts +0 -52
- package/dist/types/core/components/ui/menu/menu.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-actions.d.ts +0 -9
- package/dist/types/core/components/ui/modal/modal-actions.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-close.d.ts +0 -11
- package/dist/types/core/components/ui/modal/modal-close.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-content.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-content.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-title.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-title.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-utils.d.ts +0 -4
- package/dist/types/core/components/ui/modal/modal-utils.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal.d.ts +0 -79
- package/dist/types/core/components/ui/modal/modal.d.ts.map +0 -1
- package/dist/types/core/components/ui/pop/pop.d.ts +0 -42
- package/dist/types/core/components/ui/pop/pop.d.ts.map +0 -1
- package/dist/types/core/components/ui/progress/progress.d.ts +0 -12
- package/dist/types/core/components/ui/progress/progress.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-caption.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-caption.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tbody.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-tbody.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-td.d.ts +0 -13
- package/dist/types/core/components/ui/table/table-td.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tfoot.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-tfoot.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-th.d.ts +0 -12
- package/dist/types/core/components/ui/table/table-th.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-thead.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-thead.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tr.d.ts +0 -14
- package/dist/types/core/components/ui/table/table-tr.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table.d.ts +0 -18
- package/dist/types/core/components/ui/table/table.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme.d.ts +0 -20
- package/dist/types/core/components/ui/theme/theme.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts +0 -19
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/toast-item.d.ts +0 -41
- package/dist/types/core/components/ui/toast/toast-item.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/toast.d.ts +0 -28
- package/dist/types/core/components/ui/toast/toast.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/types.d.ts +0 -12
- package/dist/types/core/components/ui/toast/types.d.ts.map +0 -1
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts +0 -21
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +0 -1
- package/dist/types/core/components/ui/ui.d.ts +0 -35
- package/dist/types/core/components/ui/ui.d.ts.map +0 -1
- package/dist/types/core/core.d.ts +0 -5
- package/dist/types/core/core.d.ts.map +0 -1
- package/dist/types/core/decorators/Subscriber.d.ts +0 -13
- package/dist/types/core/decorators/Subscriber.d.ts.map +0 -1
- package/dist/types/core/decorators/api.d.ts +0 -155
- package/dist/types/core/decorators/api.d.ts.map +0 -1
- package/dist/types/core/decorators/lifecycle.d.ts +0 -19
- package/dist/types/core/decorators/lifecycle.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +0 -11
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/autoFill.d.ts +0 -2
- package/dist/types/core/decorators/subscriber/autoFill.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts +0 -2
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/bind.d.ts +0 -28
- package/dist/types/core/decorators/subscriber/bind.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/common.d.ts +0 -14
- package/dist/types/core/decorators/subscriber/common.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/derive.d.ts +0 -30
- package/dist/types/core/decorators/subscriber/derive.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts +0 -23
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts +0 -42
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/handle.d.ts +0 -74
- package/dist/types/core/decorators/subscriber/handle.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/onAssign.d.ts +0 -53
- package/dist/types/core/decorators/subscriber/onAssign.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/publish.d.ts +0 -23
- package/dist/types/core/decorators/subscriber/publish.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts +0 -3
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/subscribe.d.ts +0 -20
- package/dist/types/core/decorators/subscriber/subscribe.d.ts.map +0 -1
- package/dist/types/core/directives/DataProvider.d.ts +0 -45
- package/dist/types/core/directives/DataProvider.d.ts.map +0 -1
- package/dist/types/core/directives/Wording.d.ts +0 -44
- package/dist/types/core/directives/Wording.d.ts.map +0 -1
- package/dist/types/core/mixins/Fetcher.d.ts +0 -108
- package/dist/types/core/mixins/Fetcher.d.ts.map +0 -1
- package/dist/types/core/mixins/FormCheckable.d.ts +0 -95
- package/dist/types/core/mixins/FormCheckable.d.ts.map +0 -1
- package/dist/types/core/mixins/FormElement.d.ts +0 -37
- package/dist/types/core/mixins/FormElement.d.ts.map +0 -1
- package/dist/types/core/mixins/FormInput.d.ts +0 -79
- package/dist/types/core/mixins/FormInput.d.ts.map +0 -1
- package/dist/types/core/mixins/Subscriber.d.ts +0 -38
- package/dist/types/core/mixins/Subscriber.d.ts.map +0 -1
- package/dist/types/core/mixins/TemplatesContainer.d.ts +0 -14
- package/dist/types/core/mixins/TemplatesContainer.d.ts.map +0 -1
- package/dist/types/core/mixins/mixins.d.ts +0 -7
- package/dist/types/core/mixins/mixins.d.ts.map +0 -1
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts +0 -38
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +0 -1
- package/dist/types/core/utils/Arrays.d.ts +0 -98
- package/dist/types/core/utils/Arrays.d.ts.map +0 -1
- package/dist/types/core/utils/DataBindObserver.d.ts +0 -84
- package/dist/types/core/utils/DataBindObserver.d.ts.map +0 -1
- package/dist/types/core/utils/Electron.d.ts +0 -8
- package/dist/types/core/utils/Electron.d.ts.map +0 -1
- package/dist/types/core/utils/Format.d.ts +0 -13
- package/dist/types/core/utils/Format.d.ts.map +0 -1
- package/dist/types/core/utils/HTML.d.ts +0 -79
- package/dist/types/core/utils/HTML.d.ts.map +0 -1
- package/dist/types/core/utils/LocationHandler.d.ts +0 -48
- package/dist/types/core/utils/LocationHandler.d.ts.map +0 -1
- package/dist/types/core/utils/Objects.d.ts +0 -31
- package/dist/types/core/utils/Objects.d.ts.map +0 -1
- package/dist/types/core/utils/PublisherProxy.d.ts +0 -230
- package/dist/types/core/utils/PublisherProxy.d.ts.map +0 -1
- package/dist/types/core/utils/SafariScrollGuard.d.ts +0 -36
- package/dist/types/core/utils/SafariScrollGuard.d.ts.map +0 -1
- package/dist/types/core/utils/Utils.d.ts +0 -6
- package/dist/types/core/utils/Utils.d.ts.map +0 -1
- package/dist/types/core/utils/aesCrypto.d.ts +0 -53
- package/dist/types/core/utils/aesCrypto.d.ts.map +0 -1
- package/dist/types/core/utils/api.d.ts +0 -173
- package/dist/types/core/utils/api.d.ts.map +0 -1
- package/dist/types/core/utils/dataProviderKey.d.ts +0 -56
- package/dist/types/core/utils/dataProviderKey.d.ts.map +0 -1
- package/dist/types/core/utils/derive.d.ts +0 -40
- package/dist/types/core/utils/derive.d.ts.map +0 -1
- package/dist/types/core/utils/endpoint.d.ts +0 -37
- package/dist/types/core/utils/endpoint.d.ts.map +0 -1
- package/dist/types/core/utils/jsonataHelpers.d.ts +0 -15
- package/dist/types/core/utils/jsonataHelpers.d.ts.map +0 -1
- package/dist/types/core/utils/jsonataRuntime.d.ts +0 -13
- package/dist/types/core/utils/jsonataRuntime.d.ts.map +0 -1
- package/dist/types/core/utils/route.d.ts +0 -41
- package/dist/types/core/utils/route.d.ts.map +0 -1
- package/dist/types/core/utils/url-pattern.d.ts +0 -3
- package/dist/types/core/utils/url-pattern.d.ts.map +0 -1
- package/dist/types/dataprovider.d.ts +0 -2
- package/dist/types/dataprovider.d.ts.map +0 -1
- package/dist/types/decorators.d.ts +0 -30
- package/dist/types/decorators.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -21
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/mixins.d.ts +0 -204
- package/dist/types/mixins.d.ts.map +0 -1
- package/dist/types/test-utils/TestUtils.d.ts +0 -4
- package/dist/types/test-utils/TestUtils.d.ts.map +0 -1
- package/dist/types/utils.d.ts +0 -20
- package/dist/types/utils.d.ts.map +0 -1
- package/docs/assets/index-DpIkksht.js +0 -11626
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
var ConcordeWebGpu=(function(ue){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/var fe,De;const Qt=globalThis,_r=Qt.ShadowRoot&&(Qt.ShadyCSS===void 0||Qt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Er=Symbol(),Jr=new WeakMap;let Kr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Er)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(_r&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=Jr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Jr.set(t,e))}return e}toString(){return this.cssText}};const Kn=n=>new Kr(typeof n=="string"?n:n+"",void 0,Er),Zn=(n,...e)=>{const t=n.length===1?n[0]:e.reduce(((r,s,u)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[u+1]),n[0]);return new Kr(t,n,Er)},Qn=(n,e)=>{if(_r)n.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const r=document.createElement("style"),s=Qt.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=t.cssText,n.appendChild(r)}},Zr=_r?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Kn(t)})(n):n;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:ei,defineProperty:ti,getOwnPropertyDescriptor:ri,getOwnPropertyNames:ni,getOwnPropertySymbols:ii,getPrototypeOf:si}=Object,er=globalThis,Qr=er.trustedTypes,ai=Qr?Qr.emptyScript:"",oi=er.reactiveElementPolyfillSupport,Ut=(n,e)=>n,tr={toAttribute(n,e){switch(e){case Boolean:n=n?ai:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ar=(n,e)=>!ei(n,e),en={attribute:!0,type:String,converter:tr,reflect:!1,useDefault:!1,hasChanged:Ar};Symbol.metadata??=Symbol("metadata"),er.litPropertyMetadata??=new WeakMap;let Et=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=en){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);s!==void 0&&ti(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:u}=ri(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:s,set(a){const p=s?.call(this);u?.call(this,a),this.requestUpdate(e,p,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??en}static _$Ei(){if(this.hasOwnProperty(Ut("elementProperties")))return;const e=si(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ut("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ut("properties"))){const t=this.properties,r=[...ni(t),...ii(t)];for(const s of r)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,s]of t)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const s=this._$Eu(t,r);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const s of r)t.unshift(Zr(s))}else e!==void 0&&t.push(Zr(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Qn(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){const u=(r.converter?.toAttribute!==void 0?r.converter:tr).toAttribute(t,r.type);this._$Em=e,u==null?this.removeAttribute(s):this.setAttribute(s,u),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const u=r.getPropertyOptions(s),a=typeof u.converter=="function"?{fromAttribute:u.converter}:u.converter?.fromAttribute!==void 0?u.converter:tr;this._$Em=s;const p=a.fromAttribute(t,u.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){const s=this.constructor,u=this[e];if(r??=s.getPropertyOptions(e),!((r.hasChanged??Ar)(u,t)||r.useDefault&&r.reflect&&u===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:u},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),u!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,u]of this._$Ep)this[s]=u;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,u]of r){const{wrapped:a}=u,p=this[s];a!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,u,p)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Et.elementStyles=[],Et.shadowRootOptions={mode:"open"},Et[Ut("elementProperties")]=new Map,Et[Ut("finalized")]=new Map,oi?.({ReactiveElement:Et}),(er.reactiveElementVersions??=[]).push("2.1.1");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const Sr=globalThis,rr=Sr.trustedTypes,tn=rr?rr.createPolicy("lit-html",{createHTML:n=>n}):void 0,rn="$lit$",lt=`lit$${Math.random().toFixed(9).slice(2)}$`,nn="?"+lt,ui=`<${nn}>`,mt=document,Ot=()=>mt.createComment(""),Lt=n=>n===null||typeof n!="object"&&typeof n!="function",kr=Array.isArray,ci=n=>kr(n)||typeof n?.[Symbol.iterator]=="function",Tr=`[
|
|
14
|
+
\f\r]`,Mt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,sn=/-->/g,an=/>/g,gt=RegExp(`>|${Tr}(?:([^\\s"'>=/]+)(${Tr}*=${Tr}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),on=/'/g,un=/"/g,cn=/^(?:script|style|textarea|title)$/i,li=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Pr=li(1),At=Symbol.for("lit-noChange"),Fe=Symbol.for("lit-nothing"),ln=new WeakMap,vt=mt.createTreeWalker(mt,129);function fn(n,e){if(!kr(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return tn!==void 0?tn.createHTML(e):e}const fi=(n,e)=>{const t=n.length-1,r=[];let s,u=e===2?"<svg>":e===3?"<math>":"",a=Mt;for(let p=0;p<t;p++){const b=n[p];let P,O,x=-1,E=0;for(;E<b.length&&(a.lastIndex=E,O=a.exec(b),O!==null);)E=a.lastIndex,a===Mt?O[1]==="!--"?a=sn:O[1]!==void 0?a=an:O[2]!==void 0?(cn.test(O[2])&&(s=RegExp("</"+O[2],"g")),a=gt):O[3]!==void 0&&(a=gt):a===gt?O[0]===">"?(a=s??Mt,x=-1):O[1]===void 0?x=-2:(x=a.lastIndex-O[2].length,P=O[1],a=O[3]===void 0?gt:O[3]==='"'?un:on):a===un||a===on?a=gt:a===sn||a===an?a=Mt:(a=gt,s=void 0);const R=a===gt&&n[p+1].startsWith("/>")?" ":"";u+=a===Mt?b+ui:x>=0?(r.push(P),b.slice(0,x)+rn+b.slice(x)+lt+R):b+lt+(x===-2?p:R)}return[fn(n,u+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class Ft{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let u=0,a=0;const p=e.length-1,b=this.parts,[P,O]=fi(e,t);if(this.el=Ft.createElement(P,r),vt.currentNode=this.el.content,t===2||t===3){const x=this.el.content.firstChild;x.replaceWith(...x.childNodes)}for(;(s=vt.nextNode())!==null&&b.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(const x of s.getAttributeNames())if(x.endsWith(rn)){const E=O[a++],R=s.getAttribute(x).split(lt),L=/([.?@])?(.*)/.exec(E);b.push({type:1,index:u,name:L[2],strings:R,ctor:L[1]==="."?di:L[1]==="?"?pi:L[1]==="@"?mi:nr}),s.removeAttribute(x)}else x.startsWith(lt)&&(b.push({type:6,index:u}),s.removeAttribute(x));if(cn.test(s.tagName)){const x=s.textContent.split(lt),E=x.length-1;if(E>0){s.textContent=rr?rr.emptyScript:"";for(let R=0;R<E;R++)s.append(x[R],Ot()),vt.nextNode(),b.push({type:2,index:++u});s.append(x[E],Ot())}}}else if(s.nodeType===8)if(s.data===nn)b.push({type:2,index:u});else{let x=-1;for(;(x=s.data.indexOf(lt,x+1))!==-1;)b.push({type:7,index:u}),x+=lt.length-1}u++}}static createElement(e,t){const r=mt.createElement("template");return r.innerHTML=e,r}}function St(n,e,t=n,r){if(e===At)return e;let s=r!==void 0?t._$Co?.[r]:t._$Cl;const u=Lt(e)?void 0:e._$litDirective$;return s?.constructor!==u&&(s?._$AO?.(!1),u===void 0?s=void 0:(s=new u(n),s._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=s:t._$Cl=s),s!==void 0&&(e=St(n,s._$AS(n,e.values),s,r)),e}class hi{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,s=(e?.creationScope??mt).importNode(t,!0);vt.currentNode=s;let u=vt.nextNode(),a=0,p=0,b=r[0];for(;b!==void 0;){if(a===b.index){let P;b.type===2?P=new $t(u,u.nextSibling,this,e):b.type===1?P=new b.ctor(u,b.name,b.strings,this,e):b.type===6&&(P=new gi(u,this,e)),this._$AV.push(P),b=r[++p]}a!==b?.index&&(u=vt.nextNode(),a++)}return vt.currentNode=mt,s}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class $t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=Fe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=St(this,e,t),Lt(e)?e===Fe||e==null||e===""?(this._$AH!==Fe&&this._$AR(),this._$AH=Fe):e!==this._$AH&&e!==At&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ci(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Fe&&Lt(this._$AH)?this._$AA.nextSibling.data=e:this.T(mt.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,s=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Ft.createElement(fn(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(t);else{const u=new hi(s,this),a=u.u(this.options);u.p(t),this.T(a),this._$AH=u}}_$AC(e){let t=ln.get(e.strings);return t===void 0&&ln.set(e.strings,t=new Ft(e)),t}k(e){kr(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,s=0;for(const u of e)s===t.length?t.push(r=new $t(this.O(Ot()),this.O(Ot()),this,this.options)):r=t[s],r._$AI(u),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class nr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,u){this.type=1,this._$AH=Fe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=u,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Fe}_$AI(e,t=this,r,s){const u=this.strings;let a=!1;if(u===void 0)e=St(this,e,t,0),a=!Lt(e)||e!==this._$AH&&e!==At,a&&(this._$AH=e);else{const p=e;let b,P;for(e=u[0],b=0;b<u.length-1;b++)P=St(this,p[r+b],t,b),P===At&&(P=this._$AH[b]),a||=!Lt(P)||P!==this._$AH[b],P===Fe?e=Fe:e!==Fe&&(e+=(P??"")+u[b+1]),this._$AH[b]=P}a&&!s&&this.j(e)}j(e){e===Fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class di extends nr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Fe?void 0:e}}class pi extends nr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Fe)}}class mi extends nr{constructor(e,t,r,s,u){super(e,t,r,s,u),this.type=5}_$AI(e,t=this){if((e=St(this,e,t,0)??Fe)===At)return;const r=this._$AH,s=e===Fe&&r!==Fe||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,u=e!==Fe&&(r===Fe||s);s&&this.element.removeEventListener(this.name,this,r),u&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class gi{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){St(this,e)}}const vi=Sr.litHtmlPolyfillSupport;vi?.(Ft,$t),(Sr.litHtmlVersions??=[]).push("3.3.1");const yi=(n,e,t)=>{const r=t?.renderBefore??e;let s=r._$litPart$;if(s===void 0){const u=t?.renderBefore??null;r._$litPart$=s=new $t(e.insertBefore(Ot(),u),u,void 0,t??{})}return s._$AI(n),s};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/const xr=globalThis;class Nt extends Et{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=yi(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return At}}Nt._$litElement$=!0,Nt.finalized=!0,xr.litElementHydrateSupport?.({LitElement:Nt});const bi=xr.litElementPolyfillSupport;bi?.({LitElement:Nt}),(xr.litElementVersions??=[]).push("4.2.1");/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/const wi=n=>(e,t)=>{t!==void 0?t.addInitializer((()=>{customElements.define(n,e)})):customElements.define(n,e)};/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/const _i={attribute:!0,type:String,converter:tr,reflect:!1,hasChanged:Ar},Ei=(n=_i,e,t)=>{const{kind:r,metadata:s}=t;let u=globalThis.litPropertyMetadata.get(s);if(u===void 0&&globalThis.litPropertyMetadata.set(s,u=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),u.set(t.name,n),r==="accessor"){const{name:a}=t;return{set(p){const b=e.get.call(this);e.set.call(this,p),this.requestUpdate(a,b,n)},init(p){return p!==void 0&&this.C(a,void 0,n,p),p}}}if(r==="setter"){const{name:a}=t;return function(p){const b=this[a];e.call(this,p),this.requestUpdate(a,b,n)}}throw Error("Unsupported decorator location: "+r)};function Re(n){return(e,t)=>typeof t=="object"?Ei(n,e,t):((r,s,u)=>{const a=s.hasOwnProperty(u);return s.constructor.createProperty(u,r),a?Object.getOwnPropertyDescriptor(s,u):void 0})(n,e,t)}/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/function hn(n){return Re({...n,state:!0,attribute:!1})}const Ai=4,Si=.001,ki=.45,Ti="rgb(38, 89, 217)";class Cr{constructor(e,t){this.backend="canvas2d",this.images=[null,null,null,null],this.channelUrls=["","","",""],this.channelSizes=[null,null,null,null],this.channelLoadTokens=[0,0,0,0],this.disposed=!1,this.canvas=e,this.ctx=t}static create(e){const t=e.getContext("2d",{alpha:!0});if(!t)throw new Error("Canvas2D indisponible");return new Cr(e,t)}async setShader(e){this.assertAlive()}async setChannel(e,t){this.assertAlive();const r=t.trim();if(this.channelUrls[e]===r&&this.images[e])return;this.channelUrls[e]=r;const s=++this.channelLoadTokens[e];if(!r){this.images[e]=null,this.channelSizes[e]=null;return}const u=await Pi(r);s!==this.channelLoadTokens[e]||this.disposed||(this.images[e]=u,this.channelSizes[e]={width:u.naturalWidth,height:u.naturalHeight})}getTextureSize(e){const t=this.channelUrls.indexOf(e.trim());return t<0?null:this.channelSizes[t]}resize(e,t){this.assertAlive();const r=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t));this.canvas.width===r&&this.canvas.height===s||(this.canvas.width=r,this.canvas.height=s)}draw(e){this.assertAlive();const{ctx:t,canvas:r}=this,s=r.width,u=r.height;t.clearRect(0,0,s,u);const a=this.images[0],p=Math.min(1,Math.max(0,e.params[0]??0));if(a)t.drawImage(a,0,0,s,u),p>Si&&(t.save(),t.globalAlpha=p*ki,t.fillStyle=Ti,t.fillRect(0,0,s,u),t.restore());else{const b=t.createLinearGradient(0,0,s,u);b.addColorStop(0,`rgb(38,${Math.round(40+p*80)},80)`),b.addColorStop(1,`rgb(90,${Math.round(60+p*40)},120)`),t.fillStyle=b,t.fillRect(0,0,s,u)}}dispose(e=!1){if(!this.disposed){this.disposed=!0;for(let t=0;t<Ai;t++)this.channelLoadTokens[t]++;this.images=[null,null,null,null]}}assertAlive(){if(this.disposed)throw new Error("Canvas2D fallback disposed")}}async function Pi(n){const e=new Image;return e.crossOrigin="anonymous",await new Promise((t,r)=>{e.onload=()=>t(),e.onerror=()=>r(new Error(`Failed to load texture: ${n}`)),e.src=n}),e}const Rr="1";function xi(n){const e=n.trim();if(!e)return!1;try{const t=new URL(e,"https://example.invalid/");return t.protocol==="http:"||t.protocol==="https:"||t.protocol==="blob:"}catch{return!1}}let st=class We{static getLanguage(){const e=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||e}static getCookies(){return document.cookie.split(";").reduce((e,t)=>{const r=t.indexOf("=");return e[t.substring(0,r).trim()]=t.substring(r+1),e},{})}static nextComposedAncestor(e){return e instanceof Element&&e.assignedSlot?e.assignedSlot:e.parentNode||e.host||null}static everyAncestors(e,t){let r=e;for(;r;){if(!t(r))return;r=r.parentNode||r.host}}static overflowMatches(e,t){return t.includes(e.overflowY)||t.includes(e.overflowX)}static findAncestorByOverflow(e,t){let r=e;for(;r;){if(r instanceof Element&&r.nodeType===1){const s=window.getComputedStyle(r);if(We.overflowMatches(s,t))return r}r=We.nextComposedAncestor(r)}return null}static getScrollableAncestor(e){return We.findAncestorByOverflow(e,["auto","scroll","hidden","overlay"])}static getScrollingAncestor(e){return We.findAncestorByOverflow(e,["auto","scroll","overlay"])}static scopeAttributeNames(e){const t=e.toLowerCase();return t===e?[e]:[e,t]}static readScopeAttributeOnElement(e,t){for(const r of We.scopeAttributeNames(t))if(e.hasAttribute(r))return e.getAttribute(r)??"";return null}static getAncestorAttributeValue(e,t){if(!e)return null;let r=e;for(;r;){if(r instanceof HTMLElement){const u=We.readScopeAttributeOnElement(r,t);if(u!=null)return u}const s=r.parentNode||r.host;if(!s)break;r=s}return null}static getApiConfiguration(e){const t=We.getAncestorAttributeValue(e,"token"),r=We.getAncestorAttributeValue(e,"addHTTPResponse")!=null,s=We.getAncestorAttributeValue(e,"serviceURL");let u=null,a=null;const p=We.getAncestorAttributeValue(e,"tokenProvider"),b=We.getAncestorAttributeValue(e,"eventsApiToken");t||(u=We.getAncestorAttributeValue(e,"userName"),a=We.getAncestorAttributeValue(e,"password"));const P=We.getAncestorAttributeValue(e,"credentials")||void 0,O=e.getAttribute("cache"),x=e.hasAttribute("blockUntilDone"),E=e.hasAttribute("keepAlive");return{serviceURL:s,token:t,userName:u,password:a,authToken:b,tokenProvider:p,addHTTPResponse:r,credentials:P,cache:O,blockUntilDone:x,keepAlive:E}}static getClosestElement(e,t){let r=e;for(;r&&!(r.nodeName&&r.nodeName.toLowerCase()===t);){const s=r.parentNode||r.host;if(!s){r=null;break}r=s}return r?.nodeName?r:null}static getClosestForm(e){return We.getClosestElement(e,"form")}static getAncestorsByTagNames(e,t){const r=new Set(t.map(a=>a.toLowerCase())),s=[];let u=e.parentNode||e.host;for(;u;)u instanceof Element&&r.has(u.tagName.toLowerCase())&&s.push(u),u=u.parentNode||u.host;return s}static getAncestorsBySelectors(e,t){const r=[];let s=e.parentNode||e.host;for(;s;){if(s instanceof Element)for(const u of t)try{if(s.matches(u)){r.push(s);break}}catch{}s=s.parentNode||s.host}return r}static async loadJS(e){if(!xi(e))return!1;const t=typeof document<"u"?new URL(e,document.baseURI).href:e,r=Array.from(document.scripts).find(u=>u.src===t);if(r)return r.dataset.concordeLoaded===Rr?!0:new Promise(u=>{let a=!1;const p=P=>{a||(a=!0,P&&(r.dataset.concordeLoaded=Rr),u(P))};r.addEventListener("load",()=>p(!0),{once:!0}),r.addEventListener("error",()=>p(!1),{once:!0});const b=r.readyState;if(b==="complete"||b==="loaded"){p(!0);return}Promise.resolve().then(()=>{Promise.resolve().then(()=>{a||p(!0)})})});const s=/\.es\.js(\?|#|$)/.test(e)||/[?&]module(?:&|=|$)/.test(e);return new Promise(u=>{const a=document.createElement("script");a.src=e,s&&(a.type="module"),a.onload=()=>{a.dataset.concordeLoaded=Rr,u(!0)},a.onerror=()=>u(!1),document.head.appendChild(a)})}static async loadCSS(e){return new Promise(t=>{const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=()=>t(!0),r.onerror=()=>t(!0),document.head.appendChild(r)})}},Ci=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(t=>{setTimeout(t,e)})}},dn="sonic";typeof __SONIC_PREFIX__<"u"&&(dn=__SONIC_PREFIX__);let pn=dn.replace(/-([a-z])/g,n=>n[1].toUpperCase());const Ri=pn.charAt(0).toUpperCase()+pn.slice(1);let Di=class _t{static areEqual(e,t){return e.length===t.length?e.every((r,s)=>r===t[s]):!1}static from2d(e){return{to1D:()=>{let t=[];return e.forEach(r=>t=t.concat(r)),this.from(t)}}}static from(e){return{get:()=>e||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:t=>{if(e.length<1)return!0;const r=(e[0]||{})[t];return e.every(s=>(s||{})[t]==r)}})})}),value:()=>({forKey:t=>_t.from(e.map(r=>r[t]))}),copy:()=>({fromKey:t=>({toKey:r=>{e.forEach(s=>{s[r]=Array.isArray(s[t])?[...s[t]]:typeof s[t]=="object"&&s[t]!=null?{...s[t]}:s[t]})}})})}),map:t=>_t.from(e.map(t)),filter:t=>_t.from(e.filter(t)),find:t=>e.find(t),some:t=>e.some(t),every:t=>e.every(t),group:()=>({byKey:t=>{const r=[],s=new Map;for(const u of e){const a=u[t];if(!s.has(a)){const p=r.length;s.set(a,p);const b={items:[]};b[t]=a,r.push(b)}r[s.get(a)].items.push(u)}return _t.from(r)}}),without:()=>({duplicates:()=>({forKey:t=>{const r=[...new Set(e.map(s=>s[t]))];return _t.from(r.map(s=>e.find(u=>u[t]==s)))}}),itemsIn:t=>({havingSameValue:()=>({forKey:r=>{const s=(u,a)=>p=>u[a]!=p[a];return _t.from(e.filter(u=>t.every(s(u,r))))}})})})}}},Dr=class{static ucFirst(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.substring(1)}static minutesDuration(e,t="",r="long"){t||(t=st.getLanguage());const s=(P,O)=>[Math.floor(P/O),P%O];function u(P,O,x){return new Intl.NumberFormat(P,{style:"unit",unit:O,unitDisplay:x}).format}const[a,p]=s(e,60),b=[];return a&&b.push(u(t,"hour",r)(a)),p&&b.push(u(t,"minute",r)(p)),new Intl.ListFormat(t,{style:"long",type:"conjunction"}).format(b)}static js(e){try{return Function("return "+e)()}catch{return""}}};class mn{constructor(e){this.path=e}toString(){return this.path}}function gn(n){return new Proxy(n,{get(e,t){if(t==="path")return e.path;if(t==="toString")return e.toString.bind(e);if(t===Symbol.toStringTag)return"DataProviderKey";if(typeof t=="symbol")return e[t];const r=e.path?`${e.path}.${String(t)}`:String(t);return gn(new mn(r))}})}const Ui=/\$\{|\{\$/;function Oi(n){return Ui.test(n)}function Li(n){const e=n;if(Oi(e))throw new Error("Static publisher path required for get/set/dp. Use @subscribe, @publish, or @handle for dynamic DataProviderKey paths.");return e}const ir=function(n){return this instanceof ir?gn(new mn(n)):new ir(n)};let sr=class ct{static shallowEqual(e,t,r=!0){const s=Object.keys(e),u=Object.keys(t);if(s.length!==u.length&&r)return!1;for(const a of s){const p=e[a],b=t[a];if(r?p!==b:p!=b)return!1}return!0}static deepEqual(e,t,r=!0){const s=Object.keys(e),u=Object.keys(t);if(s.length!==u.length&&r)return!1;for(const a of s){const p=e[a],b=t[a],P=ct.isObject(p)&&ct.isObject(b),O=r?p!==b:p!=b;if(P&&!ct.deepEqual(p,b)||!P&&O)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}static isUndefindOrNull(e){return e==null}static isEmpty(e){return ct.isUndefindOrNull(e)?!0:Object.keys(e).length===0}static traverse(e,t,r=!1){for(const s of t){const u=e[s];if(u===void 0)return;r&&ct.isObject(u)?e=Object.assign(Array.isArray(u)?[]:{},e,u):e=e[s]}return e}static traverseDotNotation(e,t,r=!1){return ct.traverse(e,t.split("."),r)}static getURLSearchArray(e,t=""){let r=[];for(let s in e){const u=e[s];t&&(s=t+"["+s+"]"),ct.isObject(u)?r=[...r,...this.getURLSearchArray(u,s)]:r.push(`${s}=${u}`)}return r}static getURLSearchString(e){return ct.getURLSearchArray(e,"").join("&")}};sr.traverseDotNotation;function Mi(n){return!1}function ar(n){return Object.prototype.hasOwnProperty.call(n,"__value")}function ft(n){return typeof n=="object"&&n!==null}let kt="sonic";typeof __SONIC_PREFIX__>"u"&&(kt="sonic");const Ur=kt=="sonic"?"publisher-proxies-data":kt+"-publisher-proxies-data",ht=class ht{constructor(e,t,r){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=432e5,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=t||null,this._parentKey_=r,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const e in this._proxies_.keys())e!="_parent_"&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),ht.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(t=>t()),this._is_savable_&&!$e.changed){$e.changed=!0,$e.saveId++;const t=$e.saveId;setTimeout(()=>$e.getInstance().saveToLocalStorage(t),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const r=this.get();this._assignListeners_.forEach(s=>{s(r)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,t){this._fillListeners_.forEach(r=>{r[e]!==t&&(r[e]=t)}),this._publishTemplateFilling_(e,t)}_publishTemplateFilling_(e,t){this._templateFillListeners_.forEach(r=>{const s=Object.getOwnPropertyDescriptor(r,e);s&&!s.set&&!s.writable||(r.propertyMap&&r.propertyMap[e]&&(e=r.propertyMap[e]),typeof r[e]<"u"&&r[e]!==t&&(r[e]=t))})}onAssign(e,t=!0){typeof e=="function"&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),t&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e=="function"&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e=="function"&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e=="function"&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e=="function"&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_=="object")for(const t in this._value_){let r=t;const s=this._value_[t];e.propertyMap&&e.propertyMap[t]&&(r=e.propertyMap[t]),typeof e[t]<"u"&&e[t]!==s&&(e[r]=s)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(const t in this._value_){const r=this._value_[t];e[t]!==r&&(e[t]=r)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,t=!1){if(this._value_===e||ft(this._value_)&&ft(e)&&e&&ar(this._value_)&&ar(e)&&this._value_.__value===e.__value||!ft(e)&&e===this._value_.__value)return!0;this._value_=ft(e)?e:{__value:e},this._cachedGet_=void 0;const r=ar(this._value_);if(this._parentKey_&&this.parent){const s=ar(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:s});else{const u=[];u[Number(this._parentKey_)]=s,this.parent.set(u)}else this.parent._value_[this._parentKey_]=s}if(r)return this._proxies_.forEach((s,u)=>{u!="_parent_"&&(s.set(null),this._publishDynamicFilling_(u,null))}),this._publishAssignement_(t),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const s in this._value_)this._value_[s]===void 0&&delete this._value_[s];if(this._proxies_.forEach((s,u)=>{const a=this._value_[u];u!="_parent_"&&a===void 0&&a!==null&&isNaN(Number(u))&&(s.set(null),this._publishDynamicFilling_(u,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ft(this._value_))for(const s in this._value_){const u=e[s],p=ft(u)?u:{__value:u};if(!this._proxies_.has(s)){this._publishDynamicFilling_(s,u);continue}this._proxies_.get(s)?.set(p,!0),this._publishDynamicFilling_(s,u)}return!0}get(){if(Fi(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,"__value")){const e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(ht.instancesCounter++,this._instanceCounter_=ht.instancesCounter),ht.instances.set(this._instanceCounter_,this),"<"+kt+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+kt+"-publisher-proxy>"}};ht.instances=new Map,ht.instancesCounter=0;let or=ht;const vn=[];function Fi(n){vn.length>0&&vn[0].add(n)}const me=class me{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],me.instance!=null)throw"Singleton / use getInstance";me.instance=this,this.isLocalStrorageReady=this.cleanStorageData(),me.initPageShowHandler()}static initPageShowHandler(){me.pageShowHandlerInitialized||(me.pageShowHandlerInitialized=!0,window.addEventListener("pageshow",e=>{e.persisted&&me.getInstance().invalidateAll()}))}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let r=localStorage.getItem(Ur),s=null;if(r&&(s=await this.decompress(r,"gzip")),s)try{this.localStorageData=JSON.parse(s)}catch{this.localStorageData={}}else r=await this.compress("{}","gzip"),localStorage.setItem(Ur,r),this.localStorageData={};const u=1e3*60*60*12;for(const a in this.localStorageData){const p=this.localStorageData[a],b=new Date().getTime()-(p.expirationDelayMs||u);p.lastModifiationMS<b&&delete this.localStorageData[a]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(e){if(e){const t=me.instances.get(e);return t||(console.warn("No PublisherManager instance registered with id:",e,"creating new one"),new me)}return me.instance==null?new me:me.instance}static get(e,t){return me.getInstance().get(e,t)}async setLocalData(e,t){await this.isLocalStrorageReady,e.set(this.localStorageData[t+"¤lang_"+st.getLanguage()]?.data||e.get())}get(e,t){const r=t?.localStorageMode==="enabled",s=t?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){const p=Or({});this.set(e,p)}const u=this.publishers.get(e);return r&&this.initialisedData.indexOf(e)===-1&&(t?.expirationDelayMs&&(u._expiration_delay_=t.expirationDelayMs),u._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(u,e)),s&&(u._invalidate_on_page_show_=s),this.publishers.get(e)}set(e,t){this.publishers.set(e,t)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(e=0){if(!(e!==me.saveId&&e%10!=0))try{if(!me.changed||me.saving)return;me.saving=!0,me.changed=!1;const t=Array.from(this.publishers.keys());let r=!1;for(const s of t){const u=this.publishers.get(s);if(!u?._is_savable_)continue;const a=u?.get();a&&(this.localStorageData[s+"¤lang_"+st.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:u._expiration_delay_,data:a},r=!0)}if(r){const s=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Ur,s)}if(me.saving=!1,me.changed){me.saveId++;const s=me.saveId;setTimeout(()=>this.saveToLocalStorage(s),1e3)}}catch{me.saving=!1}}async compress(e,t){const r=new TextEncoder().encode(e),s=window,u=new s.CompressionStream(t),a=u.writable.getWriter();a.write(r),a.close();const p=await new Response(u.readable).arrayBuffer(),b=new Uint8Array(p);let P="";for(let O=0;O<b.length;O++)P+=String.fromCharCode(b[O]);return btoa(P)}async decompress(e,t){const r=atob(e),u=Uint8Array.from(r,O=>O.charCodeAt(0)).buffer,a=window,p=new a.DecompressionStream(t),b=p.writable.getWriter();b.write(u),b.close();const P=await new Response(p.readable).arrayBuffer();return new TextDecoder().decode(P)}};me.buildDate="Mon Sep 28 2026 08:00:13 GMT+0200 (Central European Summer Time)",me.changed=!1,me.saving=!1,me.saveId=0,me.instance=null,me.instances=new Map,me.pageShowHandlerInitialized=!1;let $e=me;if(typeof window<"u"){const n=window,e=Ri+"PublisherManager",t=n[e]||$e;if(n[e]||(n[e]=$e),t!==$e){const r=["instance","instances","changed","saving","saveId","pageShowHandlerInitialized"];for(const s of r)Object.defineProperty($e,s,{configurable:!0,get(){return t[s]},set(u){t[s]=u}})}}const $i=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_","_invalidate_on_page_show_"]);function Ni(n,e){return{get:function(t,r){if(typeof r=="string"&&$i.has(r))return n[r];if(r==Symbol.toPrimitive)return()=>e().get();if(!n._proxies_.has(r)){const s=n._value_[r],u=Or(ft(s)?s:{__value:s},n,r);u._proxies_.set("_parent_",e()),n._proxies_.set(r,u)}return n._proxies_.get(r)},set:function(t,r,s){if(r=="_value_")return n._value_=s,!0;if(r=="_cachedGet_")return n._cachedGet_=s,!0;if(r=="_assignmentId_")return n._assignmentId_=s,!0;if(r=="_is_savable_")return n._is_savable_=s,!0;if(r=="_expiration_delay_")return n._expiration_delay_=s,!0;if(r=="_invalidate_on_page_show_")return n._invalidate_on_page_show_=s,!0;if(r=="_instanceCounter_")return n._instanceCounter_=s,!0;if(!n._proxies_.has(r)){const a=Or({},n,r);a._proxies_.set("_parent_",e()),n._proxies_.set(r,a)}return n._value_[r]!==s&&(n._value_[r]=s,n._publishDynamicFilling_(r,s),n._proxies_.get(r)?.set(ft(s)?s:{__value:s})),!0},deleteProperty:function(t,r){return n._publishDynamicFilling_(r,null),n._proxies_.get(r)?.set(null),delete n._value_[r]},has:function(t,r){return r in n._value_&&r!="_lockInternalMutationPublishing_"},defineProperty:function(t,r,s){return s&&"value"in s&&(n._value_[r]=s.value),!0},getOwnPropertyDescriptor:function(t,r){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return n._value_.__value?Object.keys(n._value_.__value):Object.keys(n._value_)}}}function Or(n,e=null,t){const r=new or(n,e,t);let s=null;const u=Ni(r,()=>s);return s=new Proxy(r,u),s}class Ii extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute("publisher")||"",this.publisher=or.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}}try{customElements.define(kt+"-publisher-proxy",Ii)}catch{}const Gi=(n,e)=>{{const t=n.split("."),r=t.shift()||"";let s=$e.get(r,e);s=sr.traverse(s,t);const u=new Set;return u.add(s),u}};function yn(n,e,t){const r=Li(n);return Gi(r,t).values().next().value}function Bi(n,e){return Mi()?yn(n,void 0,e):yn(n)}let Lr=(fe=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(fe.observedElements.keys()).forEach(e=>fe.unObserve(e)))}static observe(e){if(!e||!fe.enabled||fe.observedElements.has(e))return;const t=new MutationObserver(fe.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=["data-bind"],t.observe(e,r),e.querySelectorAll("[data-bind]").forEach(s=>fe.addPublisherListeners(s)),fe.observedElements.set(e,t)}static unObserve(e){if(!e)return;const t=this.observedElements.get(e);t&&(t.disconnect(),e.querySelectorAll("[data-bind]").forEach(r=>fe.removePublisherListeners(r)))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&fe.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(t=>fe.addPublisherListeners(t)):e.childNodes.forEach(t=>fe.onAdded(t))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&fe.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(t=>fe.removePublisherListeners(t)):e.childNodes.forEach(t=>fe.onRemoved(t))}static onMutation(e){for(const t of e)switch(t.type){case"attributes":fe.addPublisherListeners(t.target);break;case"childList":t.addedNodes.forEach(r=>{fe.onAdded(r)}),t.removedNodes.forEach(r=>{fe.onRemoved(r)});break}}static removePublisherListeners(e){const t=fe.publisherListeners.get(e);t&&(fe.publisherListeners.delete(e),t.forEach(r=>{r.publisher?.offAssign(r.onAssign)}))}static getVariablesDescriptor(e){let t=e.match(/(\$(?:\w+\\?\.?)+)/g);return t?t=t.map(r=>r.replace("$","")):t=[e],t=t.filter(r=>r.length>0),{expression:e.replace("\\",""),variables:t.map(r=>r.split(/\b\.\b/).map(s=>s.replace("\\","")))}}static getDataBindItems(e){return"attributes"in e?Array.from(e.attributes).filter(t=>t.name.indexOf("::")==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/-((html)|\w)/g,s=>s.substring(1).toUpperCase()),bindedVariablesDescriptor:fe.getVariablesDescriptor(t.value)})):[]}static getSubPublisher(e,t){if(!t)return e;for(const r of t)if(r!="_self_"){if(!e)return null;e=e[r]}return e}static addPublisherListeners(e){fe.removePublisherListeners(e);const t=st.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!t)return;const r=$e.getInstance().get(t),s=fe.getDataBindItems(e),u=[];s.forEach(a=>{const p=a.bindedVariablesDescriptor,b=a.propertyToUpdate;for(const P of p.variables){const O=P;let x=r;x=fe.getSubPublisher(r,O);const E=e,R={publisher:x,onAssign:()=>{const L=p.variables.map(J=>fe.getSubPublisher(r,J)?.get());let G=p.expression,ee=!1;if(L.length==1&&p.variables[0].join(".")==G.substring(1)){let J=L[0];J===null&&(J=""),E[b]=J;return}for(let J=0;J<L.length;J++){let _=L[J];const g=p.variables[J];_===null&&(ee=!0,_=void 0),G=G.replace("$"+g.join("."),_)}if(G.indexOf("|")!=-1){const J=G.indexOf("|");if(J==0)G=Dr.js(G.substring(1));else{const _=G.substring(0,J),g=G.substring(J+1),U=Dr[_];G=ee?"":U?U(g):G}}else G=ee?"":G;E[b]=G}};x?.onAssign(R.onAssign),u.push(R)}}),fe.publisherListeners.set(e,u)}},fe.observedElements=new Map,fe.enabled=!0,fe.publisherListeners=new Map,fe);Lr.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=Lr);let ji=(De=class{static listen(){if(!De.listening)return;const e=document.location?.href.replace(document.location.origin,"");De.prevURL&&De.prevURL!=e&&(De.prevURL=e,De.listeners.forEach(t=>{t.location=e})),window.requestAnimationFrame(De.listen)}static offChange(e){const t=De.listeners.indexOf(e);t!=-1&&(De.listeners.splice(t,1),De.listeners.length==0&&(De.listening=!1))}static onChange(e){De.listening||(De.listening=!0,De.listen()),De.listeners.push(e),e.location=this.prevURL}static changeFromComponent(e){const t=e.goBack,r=document.referrer;if(t!=null){const P=document.location.origin,O=(t||P).toString(),E=r.indexOf("http")==0?new URL(r).origin!=P:!1,R=r=="",L=history.length<3,G=R&&L,ee=O!=document.location.href;if(E&&ee||G){const _=history.state||{};_.concorde=_.concorde||{},_.concorde.hasDoneHistoryBack=!0,history.pushState(_,document.title),history.back(),document.location.replace(O)}else history.back();return}let s=e.getAttribute("to")||"";if(s||(s=e.href?.toString()||""),!s)return;if(s.indexOf("#")==0){document.location.hash=s.substring(1);return}const u=new URL(s,document.location.href),a=u.pathname.split("/"),p=[];let b="";for(const P of a)P!=b&&p.push(P),b=P;s="/"+p.join("/")+u.search+(u.hash?+u.hash:""),e.hasAttribute("pushState")?history.pushState(null,"",s):e.hasAttribute("replaceState")?history.replaceState(null,"",s):document.location.href=s}static updateComponentActiveState(e){if(e.autoActive=="disabled")return;const t=e.href?.toString()||"";if(e.href&&t.indexOf("http")!=0){const r=new URL(t,document.location.href),s=new URL(e.location||"",document.location.origin);let u=!1;e.autoActive=="strict"?u=r.pathname==s.pathname&&r.hash==s.hash&&r.search==s.search:e.autoActive=="strict-path-only"?u=r.pathname==s.pathname&&r.hash==s.hash:u=s.href.indexOf(r.href)==0,u?e.setAttribute("active","true"):e.removeAttribute("active")}}},De.listeners=[],De.listening=!1,De.prevURL=document.location?.href.replace(document.location.origin,""),De);function bn(n){if(n==null||typeof n!="object"||Array.isArray(n))return n;const e={...n};return delete e._sonic_http_response_,e}const ve=class ve{constructor(e){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=e.serviceURL,this.blockUntilDone=e.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=e.userName,this.password=e.password,e.token&&(this.token=e.token),this.tokenProvider=e.tokenProvider,this.authToken=e.authToken,this.addHTTPResponse=e.addHTTPResponse||!1,this.credentials=e.credentials,this.cache=e.cache||"default",this.keepAlive=e.keepAlive||!1}set token(e){if(this._token=e,!e){ve.tokens.delete(this.serviceURL);return}ve.invalidTokens.includes(e)||ve.tokens.set(this.serviceURL,e)}get token(){return ve.invalidTokens.includes(this._token)?ve.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(ve.invalidTokens.includes(e)||(ve.invalidTokens.push(e),this.token=null))}async handleResult(e,t){ve.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=e;const r=e.headers.get("content-type")?.toLowerCase(),s=e.status;let u={};if(!r||r.indexOf("text/")==0)u={text:await e.text()};else try{u=await e.json()}catch{u={}}if(this.addHTTPResponse&&sr.isObject(u)&&(u._sonic_http_response_=e),s===498&&!ve.failledTokenUpdates.has(this.serviceURL))if(this.handleInvalidToken(this.token),t.apiMethod==="get"){const p=await this.get(t.path,t.additionalHeaders);if(p==null)throw new Error("GET retry failed after token refresh");u=p}else u=await this[t.apiMethod](t.path,t.data,t.method,t.additionalHeaders);return Bi("sonic-api").lastResponse.set({http:e,processed:u}),u}async auth(){if(this.token)return;if(ve.tokens.has(this.serviceURL)){this.token=ve.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let e={};this.userName&&this.password?e={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(e={Authorization:"Bearer "+this.authToken});const t=new URL(this.serviceURL),r=t.protocol+"//"+t.host,s=await fetch(this.computeURL(this.tokenProvider,{serviceHost:r}),{headers:e,credentials:this.credentials,keepalive:this.keepAlive});try{const u=await s.json();u.token?this.token=u.token:ve.failledTokenUpdates.set(this.serviceURL,!0)}catch{ve.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,t){const r=$e.get(e),s=new URLSearchParams(t.split("?")[1]||""),u=r.get();let a=[];Array.isArray(u)?a=u:a=[u];const p=[];let b=Number.POSITIVE_INFINITY,P=0,O=0;if(s.has("limit")&&(b=parseInt(s.get("limit")||"0"),O++),s.has("offset")&&(P=parseInt(s.get("offset")||"0"),O++),O>0&&(s.delete("limit"),s.delete("offset")),s.size===0)return a.slice(P,P+b);for(const[x,E]of s.entries()){const R=E.split(",").map(L=>L.trim());for(const L of R)for(const G of a)if(typeof G!="object")isNaN(+G)?G.toString().toLowerCase().includes(E.toLowerCase())&&p.push(G):G===E&&p.push(G);else{const ee=G;if(!ee[x])continue;isNaN(+ee[x])?ee[x]?.toString().toLowerCase().includes(L.toLowerCase())&&p.push(G):ee[x]===L&&p.push(G)}}return p.slice(P,P+b)}firstCallDone(){return new Promise(e=>{if(!ve.firstCallDoneFlags.has(this.serviceURL))ve.firstCallDoneFlags.set(this.serviceURL,"loading"),e(!0);else{const t=()=>{[void 0,"loading"].includes(ve.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(t):e(!0)};t()}})}async get(e,t){const r=/dataProvider\((.*?)\)(.*?)$/;if(r.test(e)){this.blockUntilDone&&(await this.firstCallDone(),ve.firstCallDoneFlags.set(this.serviceURL,"loading"));const P=e.match(r);if(!P)throw new Error("dataProvider path is not valid");return await this.localGet(P[1],P[2])}const s={apiMethod:"get",path:e,additionalHeaders:t},u=await this.createHeaders(t),a=this.computeURL(e),p=JSON.stringify({url:a,headers:u,credentials:this.credentials,cache:this.cache,keepAlive:this.keepAlive});if(this.blockUntilDone&&(await this.firstCallDone(),ve.firstCallDoneFlags.set(this.serviceURL,"loading")),!ve.loadingGetPromises.has(p)){const P=new Promise(async O=>{try{const x=await fetch(a,{headers:u,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),E=await this.handleResult(x,s);O({processed:E,response:this.lastResult})}catch{ve.firstCallDoneFlags.set(this.serviceURL,"error"),O(null)}});ve.loadingGetPromises.set(p,P)}const b=await ve.loadingGetPromises.get(p);return ve.loadingGetPromises.delete(p),b?(this.lastResult=b.response,b.processed):null}async getDetailed(e,t){const r=/dataProvider\((.*?)\)(.*?)$/.test(e),s=await this.get(e,t);if(s==null)return;const u=bn(s),a=this.computeURL(e);if(r)return{request:new Request(a,{method:"GET"}),result:u};const p=await this.createHeaders(t);return{request:new Request(a,{method:"GET",headers:new Headers(p),credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),response:this.lastResult,result:u}}async sendDetailed(e,t,r,s){const u=await this.send(e,t,r,s);if(u==null)return;const a=bn(u),p=this.computeURL(e),b=await this.createHeaders({Accept:"application/json","Content-Type":"application/json",...s});return{request:new Request(p,{method:r,headers:new Headers(b),credentials:this.credentials,body:JSON.stringify(t),keepalive:this.keepAlive}),response:this.lastResult,result:a}}async postDetailed(e,t,r){return this.sendDetailed(e,t,"POST",r)}async putDetailed(e,t,r){return this.sendDetailed(e,t,"PUT",r)}async patchDetailed(e,t,r){return this.sendDetailed(e,t,"PATCH",r)}async createHeaders(e){await this.auth();const t={};return this.token&&(t.Authorization="Bearer "+this.token),t["Accept-Language"]=st.getLanguage(),e&&Object.assign(t,e),t}computeURL(e,t={}){let r="";e.startsWith("http")?r=e:r=this.serviceURL+"/"+e,r.startsWith("http")||(r=window.location.origin+r);const s=new URL(r);for(const u in t)s.searchParams.set(u,t[u]);return s.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(e,t,r="POST",s){const u={apiMethod:"send",path:e,additionalHeaders:s,method:r,data:t},a=await this.createHeaders(s);a.Accept="application/json",a["Content-Type"]="application/json";const p=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:r,body:JSON.stringify(t),keepalive:this.keepAlive});return await this.handleResult(p,u)}async submitFormData(e,t,r="POST",s){const u={apiMethod:"submitFormData",path:e,additionalHeaders:s,method:r,data:t},a=await this.createHeaders(s);a.Accept="application/json";const p=new FormData,b=t;for(const O in b)p.set(O,b[O]);const P=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:r,body:p,keepalive:this.keepAlive});return await this.handleResult(P,u)}async put(e,t,r){return this.send(e,t,"PUT",r)}async post(e,t,r){return this.send(e,t,"POST",r)}async patch(e,t,r){return this.send(e,t,"PATCH",r)}async delete(e,t,r){return this.send(e,t,"delete",r)}};ve.loadingGetPromises=new Map,ve.tokens=new Map,ve.invalidTokens=[],ve.failledTokenUpdates=new Map,ve.firstCallDoneFlags=new Map;let Mr=ve;st.getApiConfiguration(document.body||document.documentElement);var wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var It={exports:{}},zi=It.exports,_n;function Wi(){return _n||(_n=1,(function(n,e){var t=[].slice;(function(r,s){return e!==null?n.exports=s():r.UrlPattern=s()})(zi,function(){var r,s,u,a,p,b,P,O,x,E,R,L,G,ee,J;return x=function(_){return _.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},P=function(_,g){var U,w,T;for(T=[],U=-1,w=_.length;++U<w;)T=T.concat(g(_[U]));return T},ee=function(_,g){var U,w,T;for(T="",U=-1,w=_.length;++U<w;)T+=g(_[U]);return T},G=function(_){return new RegExp(_.toString()+"|").exec("").length-1},R=function(_,g){var U,w,T,z,F;for(z={},U=-1,T=_.length;++U<T;)w=_[U],F=g[U],F!=null&&(z[w]!=null?(Array.isArray(z[w])||(z[w]=[z[w]]),z[w].push(F)):z[w]=F);return z},r={},r.Result=function(_,g){this.value=_,this.rest=g},r.Tagged=function(_,g){this.tag=_,this.value=g},r.tag=function(_,g){return function(U){var w,T;if(w=g(U),w!=null)return T=new r.Tagged(_,w.value),new r.Result(T,w.rest)}},r.regex=function(_){return function(g){var U,w;if(U=_.exec(g),U!=null)return w=U[0],new r.Result(w,g.slice(w.length))}},r.sequence=function(){var _;return _=1<=arguments.length?t.call(arguments,0):[],function(g){var U,w,T,z,F,Z;for(U=-1,w=_.length,Z=[],z=g;++U<w;){if(T=_[U],F=T(z),F==null)return;Z.push(F.value),z=F.rest}return new r.Result(Z,z)}},r.pick=function(){var _,g;return _=arguments[0],g=2<=arguments.length?t.call(arguments,1):[],function(U){var w,T;if(T=r.sequence.apply(r,g)(U),T!=null)return w=T.value,T.value=w[_],T}},r.string=function(_){var g;return g=_.length,function(U){if(U.slice(0,g)===_)return new r.Result(_,U.slice(g))}},r.lazy=function(_){var g;return g=null,function(U){return g==null&&(g=_()),g(U)}},r.baseMany=function(_,g,U,w,T){var z,F,Z,ne;for(Z=T,ne=U?"":[];!(g!=null&&(z=g(Z),z!=null)||(F=_(Z),F==null));)U?ne+=F.value:ne.push(F.value),Z=F.rest;if(!(w&&ne.length===0))return new r.Result(ne,Z)},r.many1=function(_){return function(g){return r.baseMany(_,null,!1,!0,g)}},r.concatMany1Till=function(_,g){return function(U){return r.baseMany(_,g,!0,!0,U)}},r.firstChoice=function(){var _;return _=1<=arguments.length?t.call(arguments,0):[],function(g){var U,w,T,z;for(U=-1,w=_.length;++U<w;)if(T=_[U],z=T(g),z!=null)return z}},L=function(_){var g;return g={},g.wildcard=r.tag("wildcard",r.string(_.wildcardChar)),g.optional=r.tag("optional",r.pick(1,r.string(_.optionalSegmentStartChar),r.lazy(function(){return g.pattern}),r.string(_.optionalSegmentEndChar))),g.name=r.regex(new RegExp("^["+_.segmentNameCharset+"]+")),g.named=r.tag("named",r.pick(1,r.string(_.segmentNameStartChar),r.lazy(function(){return g.name}))),g.escapedChar=r.pick(1,r.string(_.escapeChar),r.regex(/^./)),g.static=r.tag("static",r.concatMany1Till(r.firstChoice(r.lazy(function(){return g.escapedChar}),r.regex(/^./)),r.firstChoice(r.string(_.segmentNameStartChar),r.string(_.optionalSegmentStartChar),r.string(_.optionalSegmentEndChar),g.wildcard))),g.token=r.lazy(function(){return r.firstChoice(g.wildcard,g.optional,g.named,g.static)}),g.pattern=r.many1(r.lazy(function(){return g.token})),g},O={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},b=function(_,g){if(Array.isArray(_))return ee(_,function(U){return b(U,g)});switch(_.tag){case"wildcard":return"(.*?)";case"named":return"(["+g+"]+)";case"static":return x(_.value);case"optional":return"(?:"+b(_.value,g)+")?"}},p=function(_,g){return g==null&&(g=O.segmentValueCharset),"^"+b(_,g)+"$"},a=function(_){if(Array.isArray(_))return P(_,a);switch(_.tag){case"wildcard":return["_"];case"named":return[_.value];case"static":return[];case"optional":return a(_.value)}},E=function(_,g,U,w){var T,z,F,Z;if(w==null&&(w=!1),Z=_[g],Z==null){if(w)throw new Error("no values provided for key `"+g+"`");return}if(T=U[g]||0,z=Array.isArray(Z)?Z.length-1:0,T>z){if(w)throw new Error("too few values provided for key `"+g+"`");return}return F=Array.isArray(Z)?Z[T]:Z,w&&(U[g]=T+1),F},u=function(_,g,U){var w,T;if(Array.isArray(_)){for(w=-1,T=_.length;++w<T;)if(u(_[w],g,U))return!0;return!1}switch(_.tag){case"wildcard":return E(g,"_",U,!1)!=null;case"named":return E(g,_.value,U,!1)!=null;case"static":return!1;case"optional":return u(_.value,g,U)}},J=function(_,g,U){if(Array.isArray(_))return ee(_,function(w){return J(w,g,U)});switch(_.tag){case"wildcard":return E(g,"_",U,!0);case"named":return E(g,_.value,U,!0);case"static":return _.value;case"optional":return u(_.value,g,U)?J(_.value,g,U):""}},s=function(_,g){var U,w,T,z,F;if(_ instanceof s){this.isRegex=_.isRegex,this.regex=_.regex,this.ast=_.ast,this.names=_.names;return}if(this.isRegex=_ instanceof RegExp,!(typeof _=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=_,g!=null){if(!Array.isArray(g))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(U=G(this.regex),g.length!==U)throw new Error("regex contains "+U+" groups but array of group names contains "+g.length);this.names=g}return}if(_==="")throw new Error("argument must not be the empty string");if(F=_.replace(/\s+/g,""),F!==_)throw new Error("argument must not contain whitespace");if(w={escapeChar:g?.escapeChar||O.escapeChar,segmentNameStartChar:g?.segmentNameStartChar||O.segmentNameStartChar,segmentNameCharset:g?.segmentNameCharset||O.segmentNameCharset,segmentValueCharset:g?.segmentValueCharset||O.segmentValueCharset,optionalSegmentStartChar:g?.optionalSegmentStartChar||O.optionalSegmentStartChar,optionalSegmentEndChar:g?.optionalSegmentEndChar||O.optionalSegmentEndChar,wildcardChar:g?.wildcardChar||O.wildcardChar},z=L(w),T=z.pattern(_),T==null)throw new Error("couldn't parse pattern");if(T.rest!=="")throw new Error("could only partially parse pattern");this.ast=T.value,this.regex=new RegExp(p(this.ast,w.segmentValueCharset)),this.names=a(this.ast)},s.prototype.match=function(_){var g,U;return U=this.regex.exec(_),U==null?null:(g=U.slice(1),this.names?R(this.names,g):g)},s.prototype.stringify=function(_){if(_==null&&(_={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(_!==Object(_))throw new Error("argument must be an object or undefined");return J(this.ast,_,{})},s.escapeForRegex=x,s.concatMap=P,s.stringConcatMap=ee,s.regexGroupCount=G,s.keysAndValuesToObject=R,s.P=r,s.newParser=L,s.defaultOptions=O,s.astNodeToRegexString=p,s.astNodeToNames=a,s.getParam=E,s.astNodeContainsSegmentsForProvidedParams=u,s.stringify=J,s})})(It,It.exports)),It.exports}var Vi=Wi();const Hi=qi(Vi);class Fr{constructor(e){this.path=Fr.normalizePath(e)}getDataProviderKey(){return new ir(this.path)}static normalizePath(e){const t=String(e).trim();if(!t)throw new RangeError("Endpoint: path cannot be empty");if(/^https?:\/\//i.test(t)){let b;try{b=new URL(t)}catch{throw new RangeError("Endpoint: invalid absolute URL")}return b.pathname=b.pathname.replace(/\/+/g,"/"),b.href}const r=t.indexOf("?"),s=t.indexOf("#");let u=t.length;r>=0&&(u=Math.min(u,r)),s>=0&&(u=Math.min(u,s));let a=t.slice(0,u);const p=t.slice(u);if(a=a.replace(/^\/+/,""),a=a.replace(/\/+/g,"/"),!a&&p)throw new RangeError("Endpoint: path cannot be empty");return a+p}static isNonEmpty(e){return String(e).trim().length>0}static looksLikeDataProviderPath(e){return/^\s*dataProvider\s*\(/i.test(String(e))}toString(){return this.path}}function ur(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $r={exports:{}},En;function Yi(){return En||(En=1,(function(n,e){(function(t){n.exports=t()})(function(){return(function(){function t(r,s,u){function a(P,O){if(!s[P]){if(!r[P]){var x=typeof ur=="function"&&ur;if(!O&&x)return x(P,!0);if(p)return p(P,!0);var E=new Error("Cannot find module '"+P+"'");throw E.code="MODULE_NOT_FOUND",E}var R=s[P]={exports:{}};r[P][0].call(R.exports,function(L){var G=r[P][1][L];return a(G||L)},R,R.exports,t,r,s,u)}return s[P].exports}for(var p=typeof ur=="function"&&ur,b=0;b<u.length;b++)a(u[b]);return a}return t})()({1:[function(t,r,s){const u=t("./utils"),a=(function(){const p=u.stringToArray,b=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],P=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],O=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],x=["Thousand","Million","Billion","Trillion"];function E(A,C){var k=function(B,N,D){var j="";if(B<=19)j=(N?" and ":"")+(D?P[B]:b[B]);else if(B<100){const le=Math.floor(B/10),se=B%10;j=(N?" and ":"")+O[le-2],se>0?j+="-"+k(se,!1,D):D&&(j=j.substring(0,j.length-1)+"ieth")}else if(B<1e3){const le=Math.floor(B/100),se=B%100;j=(N?", ":"")+b[le]+" Hundred",se>0?j+=k(se,!0,D):D&&(j+="th")}else{var H=Math.floor(Math.log10(B)/3);H>x.length&&(H=x.length);const le=Math.pow(10,H*3),se=Math.floor(B/le),K=B-se*le;j=(N?", ":"")+k(se,!1,!1)+" "+x[H-1],K>0?j+=k(K,!0,D):D&&(j+="th")}return j},M=k(A,!1,C);return M}const R=Object.create(null);b.forEach(function(A,C){R[A.toLowerCase()]=C}),P.forEach(function(A,C){R[A.toLowerCase()]=C}),O.forEach(function(A,C){const k=A.toLowerCase();R[k]=(C+2)*10,R[k.substring(0,A.length-1)+"ieth"]=R[k]}),R.hundredth=100,x.forEach(function(A,C){const k=A.toLowerCase(),M=Math.pow(10,(C+1)*3);R[k]=M,R[k+"th"]=M});function L(A){const k=A.split(/,\s|\sand\s|[\s\\-]/).map(N=>R[N]);let M=[0];return k.forEach(N=>{if(N<100){let D=M.pop();D>=1e3&&(M.push(D),D=0),M.push(D+N)}else M.push(M.pop()*N)}),M.reduce((N,D)=>N+D,0)}const G=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],ee={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function J(A){for(var C=0;C<G.length;C++){const k=G[C];if(A>=k[0])return k[1]+J(A-k[0])}return""}function _(A){for(var C=0,k=1,M=A.length-1;M>=0;M--){const B=A[M],N=ee[B];N<k?C-=N:(k=N,C+=N)}return C}function g(A,C){for(var k=[],M=C.charCodeAt(0);A>0;)k.unshift(String.fromCharCode((A-1)%26+M)),A=Math.floor((A-1)/26);return k.join("")}function U(A,C){for(var k=C.charCodeAt(0),M=0,B=0;B<A.length;B++)M+=(A.charCodeAt(A.length-B-1)-k+1)*Math.pow(26,B);return M}function w(A,C){if(typeof A>"u")return;A=Math.floor(A);const k=ne(C);return F(A,k)}const T={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},z={UPPER:"upper",LOWER:"lower",TITLE:"title"};function F(A,C){let k;const M=A<0;switch(A=Math.abs(A),C.primary){case T.LETTERS:k=g(A,C.case===z.UPPER?"A":"a");break;case T.ROMAN:k=J(A),C.case===z.UPPER&&(k=k.toUpperCase());break;case T.WORDS:k=E(A,C.ordinal),C.case===z.UPPER?k=k.toUpperCase():C.case===z.LOWER&&(k=k.toLowerCase());break;case T.DECIMAL:k=""+A;var B=C.mandatoryDigits-k.length;if(B>0){var N=new Array(B+1).join("0");k=N+k}if(C.zeroCode!==48&&(k=p(k).map(le=>String.fromCodePoint(le.codePointAt(0)+C.zeroCode-48)).join("")),C.regular){const le=Math.floor((k.length-1)/C.groupingSeparators.position);for(let se=le;se>0;se--){const K=k.length-se*C.groupingSeparators.position;k=k.substr(0,K)+C.groupingSeparators.character+k.substr(K)}}else C.groupingSeparators.reverse().forEach(le=>{const se=k.length-le.position;k=k.substr(0,se)+le.character+k.substr(se)});if(C.ordinal){var D={1:"st",2:"nd",3:"rd"},j=k[k.length-1],H=D[j];(!H||k.length>1&&k[k.length-2]==="1")&&(H="th"),k=k+H}break;case T.SEQUENCE:throw{code:"D3130",value:C.token}}return M&&(k="-"+k),k}const Z=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function ne(A){const C={type:"integer",primary:T.DECIMAL,case:z.LOWER,ordinal:!1};let k,M;const B=A.lastIndexOf(";");switch(B===-1?k=A:(k=A.substring(0,B),M=A.substring(B+1),M[0]==="o"&&(C.ordinal=!0)),k){case"A":C.case=z.UPPER;case"a":C.primary=T.LETTERS;break;case"I":C.case=z.UPPER;case"i":C.primary=T.ROMAN;break;case"W":C.case=z.UPPER,C.primary=T.WORDS;break;case"Ww":C.case=z.TITLE,C.primary=T.WORDS;break;case"w":C.primary=T.WORDS;break;default:{let N=null,D=0,j=0,H=[],le=0;if(p(k).map(K=>K.codePointAt(0)).reverse().forEach(K=>{let Y=!1;for(let oe=0;oe<Z.length;oe++){const X=Z[oe];if(K>=X&&K<=X+9){if(Y=!0,D++,le++,N===null)N=X;else if(X!==N)throw{code:"D3131"};break}}Y||(K===35?(le++,j++):H.push({position:le,character:String.fromCodePoint(K)}))}),D>0){C.primary=T.DECIMAL,C.zeroCode=N,C.mandatoryDigits=D,C.optionalDigits=j;const Y=function(oe){if(oe.length===0)return 0;const X=oe[0].character;for(let Ue=1;Ue<oe.length;Ue++)if(oe[Ue].character!==X)return 0;const Ne=oe.map(Ue=>Ue.position),Ze=function(Ue,Be){return Be===0?Ue:Ze(Be,Ue%Be)},Ge=Ne.reduce(Ze);for(let Ue=1;Ue<=Ne.length;Ue++)if(Ne.indexOf(Ue*Ge)===-1)return 0;return Ge}(H);Y>0?(C.regular=!0,C.groupingSeparators={position:Y,character:H[0].character}):(C.regular=!1,C.groupingSeparators=H)}else C.primary=T.SEQUENCE,C.token=k}}return C}const we={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function pe(A){var C=[];const k={type:"datetime",parts:C},M=function(Y,oe){if(oe>Y){let X=A.substring(Y,oe);X=X.split("]]").join("]"),C.push({type:"literal",value:X})}};for(var B=0,N=0;N<A.length;){if(A.charAt(N)==="["){if(A.charAt(N+1)==="["){M(B,N),C.push({type:"literal",value:"["}),N+=2,B=N;continue}if(M(B,N),B=N,N=A.indexOf("]",B),N===-1)throw{code:"D3135"};let Y=A.substring(B+1,N);Y=Y.split(/\s+/).join("");var D={type:"marker",component:Y.charAt(0)},j=Y.lastIndexOf(","),H;if(j!==-1){const oe=Y.substring(j+1),X=oe.indexOf("-");let Ne,Ze;const Ge=function(Be){if(!(typeof Be>"u"||Be==="*"))return parseInt(Be)};X===-1?Ne=oe:(Ne=oe.substring(0,X),Ze=oe.substring(X+1));const Ue={min:Ge(Ne),max:Ge(Ze)};D.width=Ue,H=Y.substring(1,j)}else H=Y.substring(1);if(H.length===1)D.presentation1=H;else if(H.length>1){var le=H.charAt(H.length-1);"atco".indexOf(le)!==-1?(D.presentation2=le,le==="o"&&(D.ordinal=!0),D.presentation1=H.substring(0,H.length-1)):D.presentation1=H}else D.presentation1=we[D.component];if(typeof D.presentation1>"u")throw{code:"D3132",value:D.component};if(D.presentation1[0]==="n")D.names=z.LOWER;else if(D.presentation1[0]==="N")D.presentation1[1]==="n"?D.names=z.TITLE:D.names=z.UPPER;else if("YMDdFWwXxHhmsf".indexOf(D.component)!==-1){var se=D.presentation1;if(D.presentation2&&(se+=";"+D.presentation2),D.integerFormat=ne(se),D.width&&D.width.min!==void 0&&D.integerFormat.mandatoryDigits<D.width.min&&(D.integerFormat.mandatoryDigits=D.width.min),D.component==="Y")if(D.n=-1,D.width&&D.width.max!==void 0)D.n=D.width.max,D.integerFormat.mandatoryDigits=D.n;else{var K=D.integerFormat.mandatoryDigits+D.integerFormat.optionalDigits;K>=2&&(D.n=K)}const oe=C[C.length-1];oe&&oe.integerFormat&&(oe.integerFormat.parseWidth=oe.integerFormat.mandatoryDigits)}(D.component==="Z"||D.component==="z")&&(D.integerFormat=ne(D.presentation1)),C.push(D),B=N+1}N++}return M(B,N),k}const he=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Pe=["January","February","March","April","May","June","July","August","September","October","November","December"],Xe=1e3*60*60*24,ae=function(A){const C=Date.UTC(A.year,A.month);var k=new Date(C).getUTCDay();return k===0&&(k=7),k>4?C+(8-k)*Xe:C-(k-1)*Xe},de=function(A,C){return{year:A,month:C,nextMonth:function(){return C===11?de(A+1,0):de(A,C+1)},previousMonth:function(){return C===0?de(A-1,11):de(A,C-1)},nextYear:function(){return de(A+1,C)},previousYear:function(){return de(A-1,C)}}},Ve=function(A,C){return(C-A)/(Xe*7)+1},te=(A,C)=>{let k;switch(C){case"Y":k=A.getUTCFullYear();break;case"M":k=A.getUTCMonth()+1;break;case"D":k=A.getUTCDate();break;case"d":{const M=Date.UTC(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()),B=Date.UTC(A.getUTCFullYear(),0);k=(M-B)/Xe+1;break}case"F":k=A.getUTCDay(),k===0&&(k=7);break;case"W":{const M=de(A.getUTCFullYear(),0),B=ae(M),N=Date.UTC(M.year,A.getUTCMonth(),A.getUTCDate());let D=Ve(B,N);if(D>52){const j=ae(M.nextYear());N>=j&&(D=1)}else if(D<1){const j=ae(M.previousYear());D=Ve(j,N)}k=Math.floor(D);break}case"w":{const M=de(A.getUTCFullYear(),A.getUTCMonth()),B=ae(M),N=Date.UTC(M.year,M.month,A.getUTCDate());let D=Ve(B,N);if(D>4){const j=ae(M.nextMonth());N>=j&&(D=1)}else if(D<1){const j=ae(M.previousMonth());D=Ve(j,N)}k=Math.floor(D);break}case"X":{const M=de(A.getUTCFullYear(),0),B=ae(M),N=ae(M.nextYear()),D=A.getTime();D<B?k=M.year-1:D>=N?k=M.year+1:k=M.year;break}case"x":{const M=de(A.getUTCFullYear(),A.getUTCMonth()),B=ae(M),N=M.nextMonth(),D=ae(N),j=A.getTime();j<B?k=M.previousMonth().month+1:j>=D?k=N.month+1:k=M.month+1;break}case"H":k=A.getUTCHours();break;case"h":k=A.getUTCHours(),k=k%12,k===0&&(k=12);break;case"P":k=A.getUTCHours()>=12?"pm":"am";break;case"m":k=A.getUTCMinutes();break;case"s":k=A.getUTCSeconds();break;case"f":k=A.getUTCMilliseconds();break;case"Z":case"z":break;case"C":k="ISO";break;case"E":k="ISO";break}return k};let xe=null;function rt(A,C,k){var M=0,B=0;if(typeof k<"u"){const se=parseInt(k);M=Math.floor(se/100),B=se%100}var N=function(se,K){var Y=te(se,K.component);if("YMDdFWwXxHhms".indexOf(K.component)!==-1)if(K.component==="Y"&&K.n!==-1&&(Y=Y%Math.pow(10,K.n)),K.names){if(K.component==="M"||K.component==="x")Y=Pe[Y-1];else if(K.component==="F")Y=he[Y];else throw{code:"D3133",value:K.component};K.names===z.UPPER?Y=Y.toUpperCase():K.names===z.LOWER&&(Y=Y.toLowerCase()),K.width&&Y.length>K.width.max&&(Y=Y.substring(0,K.width.max))}else Y=F(Y,K.integerFormat);else if(K.component==="f")Y=F(Y,K.integerFormat);else if(K.component==="Z"||K.component==="z"){const oe=M*100+B;if(K.integerFormat.regular)Y=F(oe,K.integerFormat);else{const X=K.integerFormat.mandatoryDigits;if(X===1||X===2)Y=F(M,K.integerFormat),B!==0&&(Y+=":"+w(B,"00"));else if(X===3||X===4)Y=F(oe,K.integerFormat);else throw{code:"D3134",value:X}}oe>=0&&(Y="+"+Y),K.component==="z"&&(Y="GMT"+Y),oe===0&&K.presentation2==="t"&&(Y="Z")}else K.component==="P"&&K.names===z.UPPER&&(Y=Y.toUpperCase());return Y};let D;typeof C>"u"?(xe===null&&(xe=pe("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),D=xe):D=pe(C);const j=(60*M+B)*60*1e3,H=new Date(A+j);let le="";return D.parts.forEach(function(se){se.type==="literal"?le+=se.value:le+=N(H,se)}),le}function h(A){var C=Object.create(null);if(A.type==="datetime")C.type="datetime",C.parts=A.parts.map(function(k){var M=Object.create(null);if(k.type==="literal")M.regex=k.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if(k.component==="Z"||k.component==="z"){let N;Array.isArray(k.integerFormat.groupingSeparators)||(N=k.integerFormat.groupingSeparators),M.regex="",k.component==="z"&&(M.regex="GMT"),M.regex+="[-+][0-9]+",N&&(M.regex+=N.character+"[0-9]+"),M.parse=function(D){k.component==="z"&&(D=D.substring(3));let j=0,H=0;return N?(j=Number.parseInt(D.substring(0,D.indexOf(N.character))),H=Number.parseInt(D.substring(D.indexOf(N.character)+1))):D.length-1<=2?j=Number.parseInt(D):(j=Number.parseInt(D.substring(0,3)),H=Number.parseInt(D.substring(3))),j*60+H}}else if(k.component==="f")M.regex="[0-9]+",M.parse=function(N){return parseFloat("0."+N.substring(0,3))*1e3};else if(k.integerFormat)M=h(k.integerFormat);else{M.regex="[a-zA-Z]+";var B=Object.create(null);if(k.component==="M"||k.component==="x")Pe.forEach(function(N,D){k.width&&k.width.max?B[N.substring(0,k.width.max)]=D+1:B[N]=D+1});else if(k.component==="F")he.forEach(function(N,D){D>0&&(k.width&&k.width.max?B[N.substring(0,k.width.max)]=D:B[N]=D)});else if(k.component==="P")B={am:0,AM:0,pm:1,PM:1};else throw{code:"D3133",value:k.component};M.parse=function(N){return B[N]}}return M.component=k.component,M});else{C.type="integer";const k=A.case===z.UPPER;switch(A.primary){case T.LETTERS:C.regex=k?"[A-Z]+":"[a-z]+",C.parse=function(M){return U(M,k?"A":"a")};break;case T.ROMAN:C.regex=k?"[MDCLXVI]+":"[mdclxvi]+",C.parse=function(M){return _(k?M:M.toUpperCase())};break;case T.WORDS:C.regex="(?:"+u.keys(R).concat("and","[\\-, ]").join("|")+")+",C.parse=function(M){return L(M.toLowerCase())};break;case T.DECIMAL:C.regex="[0-9]",A.parseWidth?C.regex+=`{${A.parseWidth}}`:C.regex+="+",A.ordinal&&(C.regex+="(?:th|st|nd|rd)"),C.parse=function(M){let B=M;return A.ordinal&&(B=M.substring(0,M.length-2)),A.regular?B=B.split(",").join(""):A.groupingSeparators.forEach(N=>{B=B.split(N.character).join("")}),A.zeroCode!==48&&(B=B.split("").map(N=>String.fromCodePoint(N.codePointAt(0)-A.zeroCode+48)).join("")),parseInt(B)};break;case T.SEQUENCE:throw{code:"D3130",value:A.token}}}return C}function y(A,C){if(typeof A>"u")return;const k=ne(C);return h(k).parse(A)}function W(A,C){const k=pe(C),M=h(k),B="^"+M.parts.map(H=>"("+H.regex+")").join("")+"$";var D=new RegExp(B,"i").exec(A);if(D!==null){const X=Object.create(null);for(let c=1;c<D.length;c++){const f=M.parts[c-1];f.parse&&(X[f.component]=f.parse(D[c]))}if(Object.getOwnPropertyNames(X).length===0)return;let Ne=0;const Ze=c=>{Ne<<=1,Ne+=c?1:0},Ge=c=>!(~c&Ne)&&!!(c&Ne);"YXMxWwdD".split("").forEach(c=>Ze(X[c]));const Be=!Ge(161)&&Ge(130),ot=Ge(84),xt=!ot&&Ge(72);Ne=0,"PHhmsf".split("").forEach(c=>Ze(X[c]));const q=!Ge(23)&&Ge(47),et=(Be?"YD":ot?"XxwF":xt?"XWF":"YMD")+(q?"Phmsf":"Hmsf"),Xt=this.environment.timestamp;let nt=!1,bt=!1;if(et.split("").forEach(c=>{if(typeof X[c]>"u")nt?(X[c]="MDd".indexOf(c)!==-1?1:0,bt=!0):X[c]=te(Xt,c);else if(nt=!0,bt)throw{code:"D3136"}}),X.M>0?X.M-=1:X.M=0,Be){const c=Date.UTC(X.Y,0),f=(X.d-1)*1e3*60*60*24,d=new Date(c+f);X.M=d.getUTCMonth(),X.D=d.getUTCDate()}if(ot)throw{code:"D3136"};if(xt)throw{code:"D3136"};q&&(X.H=X.h===12?0:X.h,X.P===1&&(X.H+=12));var j=Date.UTC(X.Y,X.M,X.D,X.H,X.m,X.s,X.f);return(X.Z||X.z)&&(j-=(X.Z||X.z)*60*1e3),j}}var ce=new RegExp("^\\d{4}(-[01]\\d)?(-[0-3]\\d)?(T[0-2]\\d:[0-5]\\d:[0-5]\\d)?(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function _e(A,C){if(!(typeof A>"u"))if(typeof C>"u"){if(!ce.test(A))throw{stack:new Error().stack,code:"D3110",value:A};return Date.parse(A)}else return W.call(this,A,C)}function ye(A,C,k){if(!(typeof A>"u"))return rt.call(this,A,C,k)}return{formatInteger:w,parseInteger:y,fromMillis:ye,toMillis:_e}})();r.exports=a},{"./utils":6}],2:[function(t,r,s){(function(u){(function(){var a=t("./utils");const p=(()=>{var b=a.isNumeric,P=a.isArrayOfStrings,O=a.isArrayOfNumbers,x=a.isSequence,E=a.isFunction,R=a.isLambda,L=a.isPromise,G=a.getFunctionArity,ee=a.isDeepEqual,J=a.stringToArray;function _(i){if(!(typeof i>"u")){var o=0;return i.forEach(function(l){o+=l}),o}}function g(i){return typeof i>"u"?0:i.length}function U(i){if(!(typeof i>"u"||i.length===0))return Math.max.apply(Math,i)}function w(i){if(!(typeof i>"u"||i.length===0))return Math.min.apply(Math,i)}function T(i){if(!(typeof i>"u"||i.length===0)){var o=0;return i.forEach(function(l){o+=l}),o/i.length}}function z(i,o=!1){if(!(typeof i>"u")){var l;if(typeof i=="string")l=i;else if(E(i))l="";else{if(typeof i=="number"&&!isFinite(i))throw{code:"D3001",value:i,stack:new Error().stack};var v=o?2:0;Array.isArray(i)&&i.outerWrapper&&(i=i[0]),l=JSON.stringify(i,function(m,S){return typeof S<"u"&&S!==null&&b(S)?S.toPrecision&&!Number.isInteger(S)?Number(S.toPrecision(15)):S:S&&E(S)?"":S},v)}return l}}function F(i,o,l){if(!(typeof i>"u")){var v=J(i),m=v.length;if(m+o<0&&(o=0),typeof l<"u"){if(l<=0)return"";var S=o>=0?o+l:m+o+l;return v.slice(o,S).join("")}return v.slice(o).join("")}}function Z(i,o){if(!(typeof i>"u")){var l=i.indexOf(o);return l>-1?i.substr(0,l):i}}function ne(i,o){if(!(typeof i>"u")){var l=i.indexOf(o);return l>-1?i.substr(l+o.length):i}}function we(i){if(!(typeof i>"u"))return i.toLowerCase()}function pe(i){if(!(typeof i>"u"))return i.toUpperCase()}function he(i){if(!(typeof i>"u"))return J(i).length}function Pe(i){if(!(typeof i>"u")){var o=i.replace(/[ \t\n\r]+/gm," ");return o.charAt(0)===" "&&(o=o.substring(1)),o.charAt(o.length-1)===" "&&(o=o.substring(0,o.length-1)),o}}function Xe(i,o,l){if(!(typeof i>"u")){(typeof l>"u"||l.length===0)&&(l=" ");var v;o=Math.trunc(o);var m=Math.abs(o)-he(i);if(m>0){var S=new Array(m+1).join(l);l.length>1&&(S=F(S,0,m)),o>0?v=i+S:v=S+i}else v=i;return v}}async function ae(i,o){var l=i.apply(this,[o]);if(L(l)&&(l=await l),l&&!(typeof l.start=="number"||l.end==="number"||Array.isArray(l.groups)||E(l.next)))throw{code:"T1010",stack:new Error().stack};return l}async function de(i,o){if(!(typeof i>"u"||typeof o>"u")){var l;if(typeof o=="string")l=i.indexOf(o)!==-1;else{var v=await ae(o,i);l=typeof v<"u"}return l}}async function Ve(i,o,l){if(!(typeof i>"u")){if(l<0)throw{stack:new Error().stack,value:l,code:"D3040",index:3};var v=this.createSequence();if(typeof l>"u"||l>0){var m=0,S=await ae(o,i);if(typeof S<"u")for(;typeof S<"u"&&(typeof l>"u"||m<l);)v.push({match:S.match,index:S.start,groups:S.groups}),S=await ae(S.next),m++}return v}}async function te(i,o,l,v){if(!(typeof i>"u")){var m=this;if(o==="")throw{code:"D3010",stack:new Error().stack,value:o,index:2};if(v<0)throw{code:"D3011",stack:new Error().stack,value:v,index:4};var S;typeof l=="string"?S=function(Ae){for(var Oe="",ge=0,Ce=l.indexOf("$",ge);Ce!==-1&&ge<l.length;){Oe+=l.substring(ge,Ce),ge=Ce+1;var Qe=l.charAt(ge);if(Qe==="$")Oe+="$",ge++;else if(Qe==="0")Oe+=Ae.match,ge++;else{var je;if(Ae.groups.length===0?je=1:je=Math.floor(Math.log(Ae.groups.length)*Math.LOG10E)+1,Ce=parseInt(l.substring(ge,ge+je),10),je>1&&Ce>Ae.groups.length&&(Ce=parseInt(l.substring(ge,ge+je-1),10)),isNaN(Ce))Oe+="$";else{if(Ae.groups.length>0){var it=Ae.groups[Ce-1];typeof it<"u"&&(Oe+=it)}ge+=Ce.toString().length}}Ce=l.indexOf("$",ge)}return Oe+=l.substring(ge),Oe}:S=l;var $="",I=0;if(typeof v>"u"||v>0){var re=0;if(typeof o=="string"){for(var V=i.indexOf(o,I);V!==-1&&(typeof v>"u"||re<v);)$+=i.substring(I,V),$+=l,I=V+o.length,re++,V=i.indexOf(o,I);$+=i.substring(I)}else{var be=await ae(o,i);if(typeof be<"u"){for(;typeof be<"u"&&(typeof v>"u"||re<v);){$+=i.substring(I,be.start);var Ee=S.apply(m,[be]);if(L(Ee)&&(Ee=await Ee),typeof Ee=="string")$+=Ee;else throw{code:"D3012",stack:new Error().stack,value:Ee};I=be.start+be.match.length,re++,be=await ae(be.next)}$+=i.substring(I)}else $=i}}else $=i;return $}}function xe(i){if(!(typeof i>"u")){var o=typeof window<"u"?window.btoa:function(l){return new u.Buffer.from(l,"binary").toString("base64")};return o(i)}}function rt(i){if(!(typeof i>"u")){var o=typeof window<"u"?window.atob:function(l){return new u.Buffer.from(l,"base64").toString("binary")};return o(i)}}function h(i){if(!(typeof i>"u")){var o;try{o=encodeURIComponent(i)}catch{throw{code:"D3140",stack:new Error().stack,value:i,functionName:"encodeUrlComponent"}}return o}}function y(i){if(!(typeof i>"u")){var o;try{o=encodeURI(i)}catch{throw{code:"D3140",stack:new Error().stack,value:i,functionName:"encodeUrl"}}return o}}function W(i){if(!(typeof i>"u")){var o;try{o=decodeURIComponent(i)}catch{throw{code:"D3140",stack:new Error().stack,value:i,functionName:"decodeUrlComponent"}}return o}}function ce(i){if(!(typeof i>"u")){var o;try{o=decodeURI(i)}catch{throw{code:"D3140",stack:new Error().stack,value:i,functionName:"decodeUrl"}}return o}}async function _e(i,o,l){if(!(typeof i>"u")){if(l<0)throw{code:"D3020",stack:new Error().stack,value:l,index:3};var v=[];if(typeof l>"u"||l>0)if(typeof o=="string")v=i.split(o,l);else{var m=0,S=await ae(o,i);if(typeof S<"u"){for(var $=0;typeof S<"u"&&(typeof l>"u"||m<l);)v.push(i.substring($,S.start)),$=S.end,S=await ae(S.next),m++;(typeof l>"u"||m<l)&&v.push(i.substring($))}else v.push(i)}return v}}function ye(i,o){if(!(typeof i>"u"))return typeof o>"u"&&(o=""),i.join(o)}function A(i,o,l){if(!(typeof i>"u")){var v={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"},m=v;typeof l<"u"&&a.keys(l).forEach(function(Q){m[Q]=l[Q]});for(var S=[],$=m["zero-digit"].charCodeAt(0),I=$;I<$+10;I++)S.push(String.fromCharCode(I));var re=S.concat([m["decimal-separator"],m["exponent-separator"],m["grouping-separator"],m.digit,m["pattern-separator"]]),V=o.split(m["pattern-separator"]);if(V.length>2)throw{code:"D3080",stack:new Error().stack};var be=function(Q){var Te=(function(){for(var Me,Ke=0;Ke<Q.length;Ke++)if(Me=Q.charAt(Ke),re.indexOf(Me)!==-1&&Me!==m["exponent-separator"])return Q.substring(0,Ke);return""})(),ze=(function(){for(var Me,Ke=Q.length-1;Ke>=0;Ke--)if(Me=Q.charAt(Ke),re.indexOf(Me)!==-1&&Me!==m["exponent-separator"])return Q.substring(Ke+1);return""})(),Se=Q.substring(Te.length,Q.length-ze.length),He,pt,Ye,wt,Je=Q.indexOf(m["exponent-separator"],Te.length);Je===-1||Je>Q.length-ze.length?(He=Se,pt=void 0):(He=Se.substring(0,Je),pt=Se.substring(Je+1));var tt=He.indexOf(m["decimal-separator"]);return tt===-1?(Ye=He,wt=ze):(Ye=He.substring(0,tt),wt=He.substring(tt+1)),{prefix:Te,suffix:ze,activePart:Se,mantissaPart:He,exponentPart:pt,integerPart:Ye,fractionalPart:wt,subpicture:Q}},Ee=function(Q){var Te,ze,Se=Q.subpicture,He=Se.indexOf(m["decimal-separator"]);He!==Se.lastIndexOf(m["decimal-separator"])&&(Te="D3081"),Se.indexOf(m.percent)!==Se.lastIndexOf(m.percent)&&(Te="D3082"),Se.indexOf(m["per-mille"])!==Se.lastIndexOf(m["per-mille"])&&(Te="D3083"),Se.indexOf(m.percent)!==-1&&Se.indexOf(m["per-mille"])!==-1&&(Te="D3084");var pt=!1;for(ze=0;ze<Q.mantissaPart.length;ze++){var Ye=Q.mantissaPart.charAt(ze);if(S.indexOf(Ye)!==-1||Ye===m.digit){pt=!0;break}}pt||(Te="D3085");var wt=Q.activePart.split("").map(function(Me){return re.indexOf(Me)===-1?"p":"a"}).join("");wt.indexOf("p")!==-1&&(Te="D3086"),He!==-1?(Se.charAt(He-1)===m["grouping-separator"]||Se.charAt(He+1)===m["grouping-separator"])&&(Te="D3087"):Q.integerPart.charAt(Q.integerPart.length-1)===m["grouping-separator"]&&(Te="D3088"),Se.indexOf(m["grouping-separator"]+m["grouping-separator"])!==-1&&(Te="D3089");var Je=Q.integerPart.indexOf(m.digit);Je!==-1&&Q.integerPart.substring(0,Je).split("").filter(function(Me){return S.indexOf(Me)>-1}).length>0&&(Te="D3090"),Je=Q.fractionalPart.lastIndexOf(m.digit),Je!==-1&&Q.fractionalPart.substring(Je).split("").filter(function(Me){return S.indexOf(Me)>-1}).length>0&&(Te="D3091");var tt=typeof Q.exponentPart=="string";if(tt&&Q.exponentPart.length>0&&(Se.indexOf(m.percent)!==-1||Se.indexOf(m["per-mille"])!==-1)&&(Te="D3092"),tt&&(Q.exponentPart.length===0||Q.exponentPart.split("").filter(function(Me){return S.indexOf(Me)===-1}).length>0)&&(Te="D3093"),Te)throw{code:Te,stack:new Error().stack}},Ae=function(Q){var Te=function(Ie,br){for(var Zt=[],ut=Ie.indexOf(m["grouping-separator"]);ut!==-1;){var wr=(br?Ie.substring(0,ut):Ie.substring(ut)).split("").filter(function(Dt){return S.indexOf(Dt)!==-1||Dt===m.digit}).length;Zt.push(wr),ut=Q.integerPart.indexOf(m["grouping-separator"],ut+1)}return Zt},ze=Te(Q.integerPart),Se=function(Ie){if(Ie.length===0)return 0;for(var br=function(wr,Dt){return Dt===0?wr:br(Dt,wr%Dt)},Zt=Ie.reduce(br),ut=1;ut<=Ie.length;ut++)if(Ie.indexOf(ut*Zt)===-1)return 0;return Zt},He=Se(ze),pt=Te(Q.fractionalPart,!0),Ye=Q.integerPart.split("").filter(function(Ie){return S.indexOf(Ie)!==-1}).length,wt=Ye,Je=Q.fractionalPart.split(""),tt=Je.filter(function(Ie){return S.indexOf(Ie)!==-1}).length,Me=Je.filter(function(Ie){return S.indexOf(Ie)!==-1||Ie===m.digit}).length,Ke=typeof Q.exponentPart=="string";Ye===0&&Me===0&&(Ke?(tt=1,Me=1):Ye=1),Ke&&Ye===0&&Q.integerPart.indexOf(m.digit)!==-1&&(Ye=1),Ye===0&&tt===0&&(tt=1);var Jn=0;return Ke&&(Jn=Q.exponentPart.split("").filter(function(Ie){return S.indexOf(Ie)!==-1}).length),{integerPartGroupingPositions:ze,regularGrouping:He,minimumIntegerPartSize:Ye,scalingFactor:wt,prefix:Q.prefix,fractionalPartGroupingPositions:pt,minimumFactionalPartSize:tt,maximumFactionalPartSize:Me,minimumExponentSize:Jn,suffix:Q.suffix,picture:Q.subpicture}},Oe=V.map(be);Oe.forEach(Ee);var ge=Oe.map(Ae),Ce=m["minus-sign"],Qe=m["zero-digit"],je=m["decimal-separator"],it=m["grouping-separator"];ge.length===1&&(ge.push(JSON.parse(JSON.stringify(ge[0]))),ge[1].prefix=Ce+ge[1].prefix);var Le;i>=0?Le=ge[0]:Le=ge[1];var Jt;Le.picture.indexOf(m.percent)!==-1?Jt=i*100:Le.picture.indexOf(m["per-mille"])!==-1?Jt=i*1e3:Jt=i;var dt,Rt;if(Le.minimumExponentSize===0)dt=Jt;else{var Xs=Math.pow(10,Le.scalingFactor),Js=Math.pow(10,Le.scalingFactor-1);if(dt=Jt,Rt=0,dt!==0){for(;Math.abs(dt)<Js;)dt*=10,Rt-=1;for(;Math.abs(dt)>Xs;)dt/=10,Rt+=1}}var Ks=D(dt,Le.maximumFactionalPartSize),Yn=function(Q,Te){var ze=Math.abs(Q).toFixed(Te);return Qe!=="0"&&(ze=ze.split("").map(function(Se){return Se>="0"&&Se<="9"?S[Se.charCodeAt(0)-48]:Se}).join("")),ze},ie=Yn(Ks,Le.maximumFactionalPartSize),qe=ie.indexOf(".");for(qe===-1?ie=ie+je:ie=ie.replace(".",je);ie.charAt(0)===Qe;)ie=ie.substring(1);for(;ie.charAt(ie.length-1)===Qe;)ie=ie.substring(0,ie.length-1);qe=ie.indexOf(je);var Kt=Le.minimumIntegerPartSize-qe,Xn=Le.minimumFactionalPartSize-(ie.length-qe-1);if(ie=(Kt>0?new Array(Kt+1).join(Qe):"")+ie,ie=ie+(Xn>0?new Array(Xn+1).join(Qe):""),qe=ie.indexOf(je),Le.regularGrouping>0)for(var Zs=Math.floor((qe-1)/Le.regularGrouping),vr=1;vr<=Zs;vr++)ie=[ie.slice(0,qe-vr*Le.regularGrouping),it,ie.slice(qe-vr*Le.regularGrouping)].join("");else Le.integerPartGroupingPositions.forEach(function(Q){ie=[ie.slice(0,qe-Q),it,ie.slice(qe-Q)].join(""),qe++});if(qe=ie.indexOf(je),Le.fractionalPartGroupingPositions.forEach(function(Q){ie=[ie.slice(0,Q+qe+1),it,ie.slice(Q+qe+1)].join("")}),qe=ie.indexOf(je),(Le.picture.indexOf(je)===-1||qe===ie.length-1)&&(ie=ie.substring(0,ie.length-1)),typeof Rt<"u"){var yr=Yn(Rt,0);Kt=Le.minimumExponentSize-yr.length,Kt>0&&(yr=new Array(Kt+1).join(Qe)+yr),ie=ie+m["exponent-separator"]+(Rt<0?Ce:"")+yr}return ie=Le.prefix+ie+Le.suffix,ie}}function C(i,o){if(!(typeof i>"u")){if(i=D(i),typeof o>"u"?o=10:o=D(o),o<2||o>36)throw{code:"D3100",stack:new Error().stack,value:o};var l=i.toString(o);return l}}function k(i){var o;if(!(typeof i>"u")){if(typeof i=="number")o=i;else if(typeof i=="string"&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(i)&&!isNaN(parseFloat(i))&&isFinite(i))o=parseFloat(i);else if(typeof i=="string"&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(i))o=Number(i);else if(i===!0)o=1;else if(i===!1)o=0;else throw{code:"D3030",value:i,stack:new Error().stack,index:1};return o}}function M(i){var o;if(!(typeof i>"u"))return o=Math.abs(i),o}function B(i){var o;if(!(typeof i>"u"))return o=Math.floor(i),o}function N(i){var o;if(!(typeof i>"u"))return o=Math.ceil(i),o}function D(i,o){var l;if(!(typeof i>"u")){if(o){var v=i.toString().split("e");i=+(v[0]+"e"+(v[1]?+v[1]+o:o))}l=Math.round(i);var m=l-i;return Math.abs(m)===.5&&Math.abs(l%2)===1&&(l=l-1),o&&(v=l.toString().split("e"),l=+(v[0]+"e"+(v[1]?+v[1]-o:-o))),Object.is(l,-0)&&(l=0),l}}function j(i){var o;if(!(typeof i>"u")){if(i<0)throw{stack:new Error().stack,code:"D3060",index:1,value:i};return o=Math.sqrt(i),o}}function H(i,o){var l;if(!(typeof i>"u")){if(l=Math.pow(i,o),!isFinite(l))throw{stack:new Error().stack,code:"D3061",index:1,value:i,exp:o};return l}}function le(){return Math.random()}function se(i){if(!(typeof i>"u")){var o=!1;if(Array.isArray(i)){if(i.length===1)o=se(i[0]);else if(i.length>1){var l=i.filter(function(v){return se(v)});o=l.length>0}}else typeof i=="string"?i.length>0&&(o=!0):b(i)?i!==0&&(o=!0):i!==null&&typeof i=="object"&&!E(i)?a.keys(i).length>0&&(o=!0):typeof i=="boolean"&&i===!0&&(o=!0);return o}}function K(i){if(!(typeof i>"u"))return!se(i)}function Y(i,o,l,v){var m=[o],S=G(i);return S>=2&&m.push(l),S>=3&&m.push(v),m}async function oe(i,o){if(!(typeof i>"u")){for(var l=this.createSequence(),v=0;v<i.length;v++){var m=Y(o,i[v],v,i),S=await o.apply(this,m);typeof S<"u"&&l.push(S)}return l}}async function X(i,o){if(!(typeof i>"u")){for(var l=this.createSequence(),v=0;v<i.length;v++){var m=i[v],S=Y(o,m,v,i),$=await o.apply(this,S);se($)&&l.push(m)}return l}}async function Ne(i,o){if(!(typeof i>"u")){for(var l=!1,v,m=0;m<i.length;m++){var S=i[m],$=!0;if(typeof o<"u"){var I=Y(o,S,m,i),re=await o.apply(this,I);$=se(re)}if($)if(!l)v=S,l=!0;else throw{stack:new Error().stack,code:"D3138",index:m}}if(!l)throw{stack:new Error().stack,code:"D3139"};return v}}function Ze(){for(var i=[],o=Array.prototype.slice.call(arguments),l=Math.min.apply(Math,o.map(function(S){return Array.isArray(S)?S.length:0})),v=0;v<l;v++){var m=o.map(S=>S[v]);i.push(m)}return i}async function Ge(i,o,l){if(!(typeof i>"u")){var v,m=G(o);if(m<2)throw{stack:new Error().stack,code:"D3050",index:1};var S;for(typeof l>"u"&&i.length>0?(v=i[0],S=1):(v=l,S=0);S<i.length;){var $=[v,i[S]];m>=3&&$.push(S),m>=4&&$.push(i),v=await o.apply(this,$),S++}return v}}function Ue(i){var o=this.createSequence();if(Array.isArray(i)){for(var l=Object.create(null),v=0;v<i.length;v++){var m=Ue.call(this,i[v]);m.forEach(function(S){l[S]=!0})}o=Ue.call(this,l)}else i!==null&&typeof i=="object"&&!E(i)&&a.keys(i).forEach(S=>o.push(S));return o}function Be(i,o){var l;if(Array.isArray(i)){l=this.createSequence();for(var v=0;v<i.length;v++){var m=Be.call(this,i[v],o);typeof m<"u"&&(Array.isArray(m)?m.forEach(S=>l.push(S)):l.push(m))}}else i!==null&&typeof i=="object"&&Object.prototype.hasOwnProperty.call(i,o)&&!E(i)&&(l=i[o]);return l}function ot(i,o){if(typeof i>"u")return o;if(typeof o>"u")return i;Array.isArray(i)||(i=this.createSequence(i)),Array.isArray(o)||(o=[o]);const l=i.length+o.length;if(this.options&&l>this.options.sequence)throw{code:"D2015",stack:new Error().stack,value:l};return i.concat(o)}function xt(i){return!(typeof i>"u")}function Ct(i){var o=this.createSequence();if(Array.isArray(i))for(var l=0;l<i.length;l++)o=ot.call(this,o,Ct.call(this,i[l]));else if(i!==null&&typeof i=="object"&&!R(i))for(const m of a.keys(i)){var v=Object.create(null);v[m]=i[m],o.push(v)}else o=i;return o}function q(i){if(!(typeof i>"u")){var o=Object.create(null);return i.forEach(function(l){for(const v of a.keys(l))o[v]=l[v]}),o}}function mr(i){if(!(typeof i>"u")){if(i.length<=1)return i;for(var o=i.length,l=new Array(o),v=0;v<o;v++)l[o-v-1]=i[v];return l}}async function gr(i,o){var l=this.createSequence();for(const S of a.keys(i)){var v=Y(o,i[S],S,i),m=await o.apply(this,v);typeof m<"u"&&l.push(m)}return l}function et(i){throw{code:"D3137",stack:new Error().stack,message:i||"$error() function evaluated"}}function Xt(i,o){if(!i)throw{code:"D3141",stack:new Error().stack,message:o||"$assert() statement failed"}}function nt(i){if(i!==void 0)return i===null?"null":b(i)?"number":typeof i=="string"?"string":typeof i=="boolean"?"boolean":Array.isArray(i)?"array":E(i)?"function":"object"}async function bt(i,o){if(!(typeof i>"u")){if(i.length<=1)return i;var l;if(typeof o>"u"){if(!O(i)&&!P(i))throw{stack:new Error().stack,code:"D3070",index:1};l=async function($,I){return $>I}}else l=o;var v=async function($,I){var re=async function(be,Ee,Ae){Ee.length===0?Array.prototype.push.apply(be,Ae):Ae.length===0?Array.prototype.push.apply(be,Ee):await l(Ee[0],Ae[0])?(be.push(Ae[0]),await re(be,Ee,Ae.slice(1))):(be.push(Ee[0]),await re(be,Ee.slice(1),Ae))},V=[];return await re(V,$,I),V},m=async function($){if(!Array.isArray($)||$.length<=1)return $;var I=Math.floor($.length/2),re=$.slice(0,I),V=$.slice(I);return re=await m(re),V=await m(V),await v(re,V)},S=await m(i);return S}}function c(i){if(!(typeof i>"u")){if(i.length<=1)return i;for(var o=new Array(i.length),l=0;l<i.length;l++){var v=Math.floor(Math.random()*(l+1));l!==v&&(o[l]=o[v]),o[v]=i[l]}return o}}function f(i){if(!(typeof i>"u")){if(!Array.isArray(i)||i.length<=1)return i;for(var o=x(i)?this.createSequence():[],l=0;l<i.length;l++){for(var v=i[l],m=!1,S=0;S<o.length;S++)if(ee(v,o[S])){m=!0;break}m||o.push(v)}return o}}async function d(i,o){var l=Object.create(null);for(const $ of a.keys(i)){var v=i[$],m=Y(o,v,$,i),S=await o.apply(this,m);se(S)&&(l[$]=v)}return a.keys(l).length===0&&(l=void 0),l}return{sum:_,count:g,max:U,min:w,average:T,string:z,substring:F,substringBefore:Z,substringAfter:ne,lowercase:we,uppercase:pe,length:he,trim:Pe,pad:Xe,match:Ve,contains:de,replace:te,split:_e,join:ye,formatNumber:A,formatBase:C,number:k,floor:B,ceil:N,round:D,abs:M,sqrt:j,power:H,random:le,boolean:se,not:K,map:oe,zip:Ze,filter:X,single:Ne,foldLeft:Ge,sift:d,keys:Ue,lookup:Be,append:ot,exists:xt,spread:Ct,merge:q,reverse:mr,each:gr,error:et,assert:Xt,type:nt,sort:bt,shuffle:c,distinct:f,base64encode:xe,base64decode:rt,encodeUrlComponent:h,encodeUrl:y,decodeUrlComponent:W,decodeUrl:ce}})();r.exports=p}).call(this)}).call(this,typeof wn<"u"?wn:typeof self<"u"?self:typeof window<"u"?window:{})},{"./utils":6}],3:[function(t,r,s){var u=t("./datetime"),a=t("./functions"),p=t("./utils"),b=t("./parser"),P=t("./signature"),O=(function(){var x=p.isNumeric,E=p.isArrayOfStrings,R=p.isArrayOfNumbers,L=p.isSequence,G=p.isFunction,ee=p.isLambda,J=p.isIterable,_=p.isPromise,g=p.getFunctionArity,U=p.isDeepEqual,w=et(null);async function T(c,f,d){var i;d.base.depth++,d.base.guardrails();var o=d.lookup(Symbol.for("jsonata.__evaluate_entry"));switch(o&&await o(c,f,d),c.type){case"path":i=await z(c,f,d);break;case"binary":i=await he(c,f,d);break;case"unary":i=await Pe(c,f,d);break;case"name":i=Xe(c,f,d);break;case"string":case"number":case"value":i=ae(c);break;case"wildcard":i=de(c,f,d);break;case"descendant":i=te(c,f,d);break;case"parent":i=d.lookup(c.slot.label);break;case"condition":i=await B(c,f,d);break;case"block":i=await N(c,f,d);break;case"bind":i=await M(c,f,d);break;case"regex":i=D(c,f,d);break;case"function":i=await Y(c,f,d);break;case"variable":i=j(c,f,d);break;case"lambda":i=Ne(c,f,d);break;case"partial":i=await Ze(c,f,d);break;case"apply":i=await K(c,f,d);break;case"transform":i=le(c,f,d);break}if(Object.prototype.hasOwnProperty.call(c,"predicate"))for(var l=0;l<c.predicate.length;l++)i=await pe(c.predicate[l].expr,i,d);c.type!=="path"&&Object.prototype.hasOwnProperty.call(c,"group")&&(i=await A(c.group,i,d));var v=d.lookup(Symbol.for("jsonata.__evaluate_exit"));return v&&await v(c,f,d,i),i&&L(i)&&!i.tupleStream&&(c.keepArray&&(i.keepSingleton=!0),i.length===0?i=void 0:i.length===1&&(i=i.keepSingleton?i:i[0])),d.base.depth--,i}async function z(c,f,d){var i;Array.isArray(f)&&c.steps[0].type!=="variable"?i=f:i=d.base.createSequence(f);for(var o,l=!1,v=void 0,m=0;m<c.steps.length;m++){var S=c.steps[m];if(S.tuple&&(l=!0),m===0&&S.consarray?o=await T(S,i,d):l?v=await we(S,i,v,d):o=await Z(S,i,d,m===c.steps.length-1),!l&&(typeof o>"u"||o.length===0))break;typeof S.focus>"u"&&(i=o)}if(l)if(c.tuple)o=v;else for(o=d.base.createSequence(),m=0;m<v.length;m++)o.push(v[m]["@"]);return c.keepSingletonArray&&(Array.isArray(o)&&o.cons&&!o.sequence&&(o=d.base.createSequence(o)),o.keepSingleton=!0),Object.prototype.hasOwnProperty.call(c,"group")&&(o=await A(c.group,l?v:o,d)),o}function F(c,f){var d=et(c);for(const i of p.keys(f))d.bind(i,f[i]);return d}async function Z(c,f,d,i){var o;if(c.type==="sort")return o=await H(c,f,d),c.stages&&(o=await ne(c.stages,o,d)),o;o=d.base.createSequence();for(var l=0;l<f.length;l++){var v=await T(c,f[l],d);if(c.stages)for(var m=0;m<c.stages.length;m++)v=await pe(c.stages[m].expr,v,d);typeof v<"u"&&o.push(v)}var S=d.base.createSequence();return i&&o.length===1&&Array.isArray(o[0])&&!L(o[0])?S=o[0]:Array.prototype.forEach.call(o,function($){!Array.isArray($)||$.cons?S.push($):Array.prototype.forEach.call($,I=>S.push(I))}),S}async function ne(c,f,d){for(var i=f,o=0;o<c.length;o++){var l=c[o];switch(l.type){case"filter":i=await pe(l.expr,i,d);break;case"index":for(var v=0;v<i.length;v++){var m=i[v];m[l.value]=v}break}}return i}async function we(c,f,d,i){var o;if(c.type==="sort"){if(d)o=await H(c,d,i);else{var l=await H(c,f,i);o=i.base.createSequence(),o.tupleStream=!0;for(var v=0;v<l.length;v++){var m={"@":l[v]};m[c.index]=v,o.push(m)}}return c.stages&&(o=await ne(c.stages,o,i)),o}o=i.base.createSequence(),o.tupleStream=!0;var S=i;d===void 0&&(d=f.map(V=>({"@":V})));for(var $=0;$<d.length;$++){S=F(i,d[$]);var I=await T(c,d[$]["@"],S);if(typeof I<"u"){Array.isArray(I)||(I=[I]);for(var re=0;re<I.length;re++)m=Object.create(null),Object.assign(m,d[$]),I.tupleStream?Object.assign(m,I[re]):(c.focus?(m[c.focus]=I[re],m["@"]=d[$]["@"]):m["@"]=I[re],c.index&&(m[c.index]=re),c.ancestor&&(m[c.ancestor.label]=d[$]["@"])),o.push(m)}}return c.stages&&(o=await ne(c.stages,o,i)),o}async function pe(c,f,d){var i=d.base.createSequence();if(f&&f.tupleStream&&(i.tupleStream=!0),Array.isArray(f)||(f=d.base.createSequence(f)),c.type==="number"){var o=Math.floor(c.value);o<0&&(o=f.length+o);var l=await f[o];typeof l<"u"&&(Array.isArray(l)?i=l:i.push(l))}else for(o=0;o<f.length;o++){var l=f[o],v=l,m=d;f.tupleStream&&(v=l["@"],m=F(d,l));var S=await T(c,v,m);x(S)&&(S=[S]),R(S)?Array.prototype.forEach.call(S,function(I){var re=Math.floor(I);re<0&&(re=f.length+re),re===o&&i.push(l)}):a.boolean(S)&&i.push(l)}return i}async function he(c,f,d){var i,o=await T(c.lhs,f,d),l=c.value,v=async()=>await T(c.rhs,f,d);if(l==="and"||l==="or")try{return await ce(o,v,l)}catch(S){throw S.position=c.position,S.token=l,S}var m=await v();try{switch(l){case"+":case"-":case"*":case"/":case"%":i=rt(o,m,l);break;case"=":case"!=":i=h(o,m,l);break;case"<":case"<=":case">":case">=":i=y(o,m,l);break;case"&":i=ye(o,m);break;case"..":i=k(o,m,d);break;case"in":i=W(o,m);break}}catch(S){throw S.position=c.position,S.token=l,S}return i}async function Pe(c,f,d){var i,o={options:d.base.options,createSequence:d.base.createSequence};switch(c.value){case"-":if(i=await T(c.expression,f,d),typeof i>"u")i=void 0;else if(x(i))i=-i;else throw{code:"D1002",stack:new Error().stack,position:c.position,token:c.value,value:i};break;case"[":i=[];let m=await Promise.all(c.expressions.map(async(S,$)=>(d.isParallelCall=$>0,[S,await T(S,f,d)])));for(let S of m){var[l,v]=S;typeof v<"u"&&(l.value==="["?i.push(v):i=a.append.call(o,i,v))}c.consarray&&Object.defineProperty(i,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":i=await A(c,f,d);break}return i}function Xe(c,f,d){var i={createSequence:d.base.createSequence};return a.lookup.call(i,f,c.value)}function ae(c){return c.value}function de(c,f,d){var i={options:d.base.options,createSequence:d.base.createSequence},o=i.createSequence();return Array.isArray(f)&&f.outerWrapper&&f.length>0&&(f=f[0]),f!==null&&typeof f=="object"&&!G(f)&&p.keys(f).forEach(function(l){var v=f[l];Array.isArray(v)?(v=Ve(v),o=a.append.call(i,o,v)):o.push(v)}),o}function Ve(c,f){return typeof f>"u"&&(f=[]),Array.isArray(c)?Array.prototype.forEach.call(c,function(d){Ve(d,f)}):f.push(c),f}function te(c,f,d){var i,o=d.base.createSequence();return typeof f<"u"&&(xe(f,o),o.length===1?i=o[0]:i=o),i}function xe(c,f){Array.isArray(c)||f.push(c),Array.isArray(c)?Array.prototype.forEach.call(c,function(d){xe(d,f)}):c!==null&&typeof c=="object"&&!G(c)&&p.keys(c).forEach(function(d){xe(c[d],f)})}function rt(c,f,d){var i;if(typeof c<"u"&&!x(c))throw{code:"T2001",stack:new Error().stack,value:c};if(typeof f<"u"&&!x(f))throw{code:"T2002",stack:new Error().stack,value:f};if(typeof c>"u"||typeof f>"u")return i;switch(d){case"+":i=c+f;break;case"-":i=c-f;break;case"*":i=c*f;break;case"/":i=c/f;break;case"%":i=c%f;break}return i}function h(c,f,d){var i,o=typeof c,l=typeof f;if(o==="undefined"||l==="undefined")return!1;switch(d){case"=":i=U(c,f);break;case"!=":i=!U(c,f);break}return i}function y(c,f,d){var i,o=typeof c,l=typeof f,v=o==="undefined"||o==="string"||o==="number",m=l==="undefined"||l==="string"||l==="number";if(!v||!m)throw{code:"T2010",stack:new Error().stack,value:o==="string"||o==="number"?f:c};if(!(o==="undefined"||l==="undefined")){if(o!==l)throw{code:"T2009",stack:new Error().stack,value:c,value2:f};switch(d){case"<":i=c<f;break;case"<=":i=c<=f;break;case">":i=c>f;break;case">=":i=c>=f;break}return i}}function W(c,f){var d=!1;if(typeof c>"u"||typeof f>"u")return!1;Array.isArray(f)||(f=[f]);for(var i=0;i<f.length;i++)if(f[i]===c){d=!0;break}return d}async function ce(c,f,d){var i,o=_e(c);switch(d){case"and":i=o&&_e(await f());break;case"or":i=o||_e(await f());break}return i}function _e(c){var f=a.boolean(c);return typeof f>"u"?!1:f}function ye(c,f){var d,i="",o="";return typeof c<"u"&&(i=a.string(c)),typeof f<"u"&&(o=a.string(f)),d=i.concat(o),d}async function A(c,f,d){var i=Object.create(null),o=Object.create(null),l=!!(f&&f.tupleStream),v={options:d.base.options,createSequence:d.base.createSequence};Array.isArray(f)||(d.base.options,f=v.createSequence(f)),f.length===0&&!l&&f.push(void 0);for(var m=0;m<f.length;m++)for(var S=f[m],$=l?F(d,S):d,I=0;I<c.lhs.length;I++){var re=c.lhs[I],V=await T(re[0],l?S["@"]:S,$);if(typeof V!="string"&&V!==void 0)throw{code:"T1003",stack:new Error().stack,position:c.position,value:V};if(V!==void 0){if(V==="_jsonata_lambda"||V==="_jsonata_function")throw{code:"D1013",stack:new Error().stack,position:c.position,value:V};var be={data:S,exprIndex:I};if(Object.prototype.hasOwnProperty.call(o,V)){if(o[V].exprIndex!==I)throw{code:"D1009",stack:new Error().stack,position:c.position,value:V};o[V].data=a.append.call(v,o[V].data,S)}else o[V]=be}}let Ee=await Promise.all(p.keys(o).map(async(Oe,ge)=>{let Ce=o[Oe];var Qe=Ce.data,je=d;if(l){var it=C(Ce.data,d);Qe=it["@"],delete it["@"],je=F(d,it)}return d.isParallelCall=ge>0,[Oe,await T(c.lhs[Ce.exprIndex][1],Qe,je)]}));for(let Oe of Ee){var[V,Ae]=await Oe;typeof Ae<"u"&&(i[V]=Ae)}return i}function C(c,f){if(!Array.isArray(c))return c;var d=Object.create(null),i={options:f.base.options,createSequence:f.base.createSequence};Object.assign(d,c[0]);for(var o=1;o<c.length;o++)for(const l of p.keys(c[o]))d[l]=a.append.call(i,d[l],c[o][l]);return d}function k(c,f,d){var i;if(typeof c<"u"&&!Number.isInteger(c))throw{code:"T2003",stack:new Error().stack,value:c};if(typeof f<"u"&&!Number.isInteger(f))throw{code:"T2004",stack:new Error().stack,value:f};if(typeof c>"u"||typeof f>"u"||c>f)return i;var o=f-c+1;if(o>1e7)throw{code:"D2014",stack:new Error().stack,value:o};if(d.base.options&&o>d.base.options.sequence)throw{code:"D2015",stack:new Error().stack,value:o};i=new Array(o);for(var l=c,v=0;l<=f;l++,v++)i[v]=l;return i.sequence=!0,i}async function M(c,f,d){var i=await T(c.rhs,f,d);return d.bind(c.lhs.value,i),i}async function B(c,f,d){var i,o=await T(c.condition,f,d);return a.boolean(o)?i=await T(c.then,f,d):typeof c.else<"u"&&(i=await T(c.else,f,d)),i}async function N(c,f,d){for(var i,o=et(d),l=0;l<c.expressions.length;l++)i=await T(c.expressions[l],f,o);return i}function D(c,f,d){var i=new d.base.RegexEngine(c.value),o=function(l,v){var m;i.lastIndex=v||0;var S=i.exec(l);if(S!==null){if(m={match:S[0],start:S.index,end:S.index+S[0].length,groups:[]},S.length>1)for(var $=1;$<S.length;$++)m.groups.push(S[$]);m.next=function(){if(!(i.lastIndex>=l.length)){var I=o(l,i.lastIndex);if(I&&I.match==="")throw{code:"D1004",stack:new Error().stack,position:c.position,value:c.value.source};return I}}}return m};return o}function j(c,f,d){var i;return c.value===""?i=f&&f.outerWrapper?f[0]:f:i=d.lookup(c.value),i}async function H(c,f,d){var i,o=f,l=!!f.tupleStream,v=async function(S,$){for(var I=0,re=0;I===0&&re<c.terms.length;re++){var V=c.terms[re],be=S,Ee=d;l&&(be=S["@"],Ee=F(d,S));var Ae=await T(V.expression,be,Ee);be=$,Ee=d,l&&(be=$["@"],Ee=F(d,$));var Oe=await T(V.expression,be,Ee),ge=typeof Ae,Ce=typeof Oe;if(ge==="undefined"){I=Ce==="undefined"?0:1;continue}if(Ce==="undefined"){I=-1;continue}if(!(ge==="string"||ge==="number")||!(Ce==="string"||Ce==="number"))throw{code:"T2008",stack:new Error().stack,position:c.position,value:ge==="string"||ge==="number"?Oe:Ae};if(ge!==Ce)throw{code:"T2007",stack:new Error().stack,position:c.position,value:Ae,value2:Oe};Ae!==Oe&&(Ae<Oe?I=-1:I=1,V.descending===!0&&(I=-I))}return I===1},m={environment:d,input:f};return i=await a.sort.apply(m,[o,v]),i}function le(c,f,d){var i=async function(o){if(!(typeof o>"u")){var l=d.lookup("clone");if(!G(l))throw{code:"T2013",stack:new Error().stack,position:c.position};var v=await oe(l,[o],null,d),m=await T(c.pattern,v,d);if(typeof m<"u"){Array.isArray(m)||(m=[m]);for(var S=0;S<m.length;S++){var $=m[S],I=await T(c.update,$,d),re=typeof I;if(re!=="undefined"){if(re!=="object"||I===null||Array.isArray(I))throw{code:"T2011",stack:new Error().stack,position:c.update.position,value:I};for(const Ae of p.keys(I))$[Ae]=I[Ae]}if(typeof c.delete<"u"){var V=await T(c.delete,$,d);if(typeof V<"u"){var be=V;if(Array.isArray(V)||(V=[V]),!E(V))throw{code:"T2012",stack:new Error().stack,position:c.delete.position,value:be};for(var Ee=0;Ee<V.length;Ee++)typeof $=="object"&&$!==null&&delete $[V[Ee]]}}}}return v}};return q(i,"<(oa):o>")}var se=b("function($f, $g) { function($x){ $g($f($x)) } }");async function K(c,f,d){var i,o=await T(c.lhs,f,d);if(c.rhs.type==="function")i=await Y(c.rhs,f,d,{context:o});else{var l=await T(c.rhs,f,d);if(!G(l))throw{code:"T2006",stack:new Error().stack,position:c.position,value:l};if(G(o)){var v=await T(se,null,d);i=await oe(v,[o,l],null,d)}else i=await oe(l,[o],null,d)}return i}async function Y(c,f,d,i){var o,l=await T(c.procedure,f,d);if(typeof l>"u"&&c.procedure.type==="path"&&d.lookup(c.procedure.steps[0].value))throw{code:"T1005",stack:new Error().stack,position:c.position,token:c.procedure.steps[0].value};var v=[];typeof i<"u"&&v.push(i.context);for(var m=0;m<c.arguments.length;m++){const $=await T(c.arguments[m],f,d);if(G($)){const I=async function(...re){return await oe($,re,null,d)};I.arity=g($),v.push(I)}else v.push($)}var S=c.procedure.type==="path"?c.procedure.steps[0].value:c.procedure.value;try{typeof l=="object"&&(l.token=S,l.position=c.position),o=await oe(l,v,f,d)}catch($){throw $.position||($.position=c.position),$.token||($.token=S),$}return o}async function oe(c,f,d,i){var o;for(o=await X(c,f,d,i);ee(o)&&o.thunk===!0;){var l=await T(o.body.procedure,o.input,o.environment);o.body.procedure.type==="variable"&&(l.token=o.body.procedure.value),l.position=o.body.procedure.position;for(var v=[],m=0;m<o.body.arguments.length;m++)v.push(await T(o.body.arguments[m],o.input,o.environment));o=await X(l,v,d,i)}return o}async function X(c,f,d,i){var o;try{var l=f;if(c&&(l=Ge(c.signature,f,d)),ee(c))o=await Ue(c,l);else if(c&&c._jsonata_function===!0){var v={environment:i,input:d,options:i.base.options,createSequence:i.base.createSequence};o=c.implementation.apply(v,l),J(o)&&(o=o.next().value),_(o)&&(o=await o)}else if(typeof c=="function")o=c.apply(d,l),_(o)&&(o=await o);else throw{code:"T1006",stack:new Error().stack}}catch(m){throw c&&(typeof m.token>"u"&&typeof c.token<"u"&&(m.token=c.token),m.position=c.position||m.position),m}return o}function Ne(c,f,d){var i={_jsonata_lambda:!0,input:f,environment:d,arguments:c.arguments,signature:c.signature,body:c.body};return c.thunk===!0&&(i.thunk=!0),i.apply=async function(o,l){return await oe(i,l,f,o?o.environment:d)},i}async function Ze(c,f,d){for(var i,o=[],l=0;l<c.arguments.length;l++){var v=c.arguments[l];v.type==="operator"&&v.value==="?"?o.push(v):o.push(await T(v,f,d))}var m=await T(c.procedure,f,d);if(typeof m>"u"&&c.procedure.type==="path"&&d.lookup(c.procedure.steps[0].value))throw{code:"T1007",stack:new Error().stack,position:c.position,token:c.procedure.steps[0].value};if(ee(m))i=Be(m,o,d);else if(m&&m._jsonata_function===!0)i=ot(m.implementation,o,d);else if(typeof m=="function")i=ot(m,o,d);else throw{code:"T1008",stack:new Error().stack,position:c.position,token:c.procedure.type==="path"?c.procedure.steps[0].value:c.procedure.value};return i}function Ge(c,f,d){if(typeof c>"u")return f;var i=c.validate(f,d);return i}async function Ue(c,f){var d,i=et(c.environment);return Array.prototype.forEach.call(c.arguments,function(o,l){i.bind(o.value,f[l])}),typeof c.body=="function"?d=await xt(c.body,i):d=await T(c.body,c.input,i),d}function Be(c,f,d){var i=et(c.environment||d),o=[];Array.prototype.forEach.call(c.arguments,function(v,m){var S=f[m];S&&S.type==="operator"&&S.value==="?"?o.push(v):i.bind(v.value,S)});var l={_jsonata_lambda:!0,input:c.input,environment:i,arguments:o,body:c.body};return l}function ot(c,f,d){var i=Ct(c);i=i.map(function(m){return"$"+m.trim()});var o="function("+i.join(", ")+"){ _ }",l=b(o);l.body=c;var v=Be(l,f,d);return v}async function xt(c,f){var d=Ct(c),i=d.map(function(v){return f.lookup(v.trim())}),o={environment:f,createSequence:f.base.createSequence},l=c.apply(o,i);return _(l)&&(l=await l),l}function Ct(c){var f=c.toString(),d=/\(([^)]*)\)/.exec(f)[1],i=d.split(",");return i}function q(c,f){var d={_jsonata_function:!0,implementation:c};return typeof f<"u"&&(d.signature=P(f)),d}async function mr(c,f){if(!(typeof c>"u")){var d=this.input;typeof f<"u"&&(d=f,Array.isArray(d)&&!L(d)&&(d=this.createSequence(d),d.outerWrapper=!0));try{var i=b(c,!1)}catch(l){throw nt(l),{stack:new Error().stack,code:"D3120",value:l.message,error:l}}try{var o=await T(i,d,this.environment)}catch(l){throw nt(l),{stack:new Error().stack,code:"D3121",value:l.message,error:l}}return o}}function gr(c){if(!(typeof c>"u"))return JSON.parse(a.string(c))}function et(c){var f=Object.create(null);const d={bind:function(o,l){f[o]=l},lookup:function(o){var l;return Object.prototype.hasOwnProperty.call(f,o)?l=f[o]:c&&(l=c.lookup(o)),l},timestamp:c?c.timestamp:null,async:c?c.async:!1,isParallelCall:c?c.isParallelCall:!1,global:c?c.global:{ancestry:[null]}};if(c){var i=c.lookup(Symbol.for("jsonata.__createFrame_push"));i&&i(c,d),d.base=c.base}return d}w.bind("sum",q(a.sum,"<a<n>:n>")),w.bind("count",q(a.count,"<a:n>")),w.bind("max",q(a.max,"<a<n>:n>")),w.bind("min",q(a.min,"<a<n>:n>")),w.bind("average",q(a.average,"<a<n>:n>")),w.bind("string",q(a.string,"<x-b?:s>")),w.bind("substring",q(a.substring,"<s-nn?:s>")),w.bind("substringBefore",q(a.substringBefore,"<s-s:s>")),w.bind("substringAfter",q(a.substringAfter,"<s-s:s>")),w.bind("lowercase",q(a.lowercase,"<s-:s>")),w.bind("uppercase",q(a.uppercase,"<s-:s>")),w.bind("length",q(a.length,"<s-:n>")),w.bind("trim",q(a.trim,"<s-:s>")),w.bind("pad",q(a.pad,"<s-ns?:s>")),w.bind("match",q(a.match,"<s-f<s:o>n?:a<o>>")),w.bind("contains",q(a.contains,"<s-(sf):b>")),w.bind("replace",q(a.replace,"<s-(sf)(sf)n?:s>")),w.bind("split",q(a.split,"<s-(sf)n?:a<s>>")),w.bind("join",q(a.join,"<a<s>s?:s>")),w.bind("formatNumber",q(a.formatNumber,"<n-so?:s>")),w.bind("formatBase",q(a.formatBase,"<n-n?:s>")),w.bind("formatInteger",q(u.formatInteger,"<n-s:s>")),w.bind("parseInteger",q(u.parseInteger,"<s-s:n>")),w.bind("number",q(a.number,"<(nsb)-:n>")),w.bind("floor",q(a.floor,"<n-:n>")),w.bind("ceil",q(a.ceil,"<n-:n>")),w.bind("round",q(a.round,"<n-n?:n>")),w.bind("abs",q(a.abs,"<n-:n>")),w.bind("sqrt",q(a.sqrt,"<n-:n>")),w.bind("power",q(a.power,"<n-n:n>")),w.bind("random",q(a.random,"<:n>")),w.bind("boolean",q(a.boolean,"<x-:b>")),w.bind("not",q(a.not,"<x-:b>")),w.bind("map",q(a.map,"<af>")),w.bind("zip",q(a.zip,"<a+>")),w.bind("filter",q(a.filter,"<af>")),w.bind("single",q(a.single,"<af?>")),w.bind("reduce",q(a.foldLeft,"<afj?:j>")),w.bind("sift",q(a.sift,"<o-f?:o>")),w.bind("keys",q(a.keys,"<x-:a<s>>")),w.bind("lookup",q(a.lookup,"<x-s:x>")),w.bind("append",q(a.append,"<xx:a>")),w.bind("exists",q(a.exists,"<x:b>")),w.bind("spread",q(a.spread,"<x-:a<o>>")),w.bind("merge",q(a.merge,"<a<o>:o>")),w.bind("reverse",q(a.reverse,"<a:a>")),w.bind("each",q(a.each,"<o-f:a>")),w.bind("error",q(a.error,"<s?:x>")),w.bind("assert",q(a.assert,"<bs?:x>")),w.bind("type",q(a.type,"<x:s>")),w.bind("sort",q(a.sort,"<af?:a>")),w.bind("shuffle",q(a.shuffle,"<a:a>")),w.bind("distinct",q(a.distinct,"<x:x>")),w.bind("base64encode",q(a.base64encode,"<s-:s>")),w.bind("base64decode",q(a.base64decode,"<s-:s>")),w.bind("encodeUrlComponent",q(a.encodeUrlComponent,"<s-:s>")),w.bind("encodeUrl",q(a.encodeUrl,"<s-:s>")),w.bind("decodeUrlComponent",q(a.decodeUrlComponent,"<s-:s>")),w.bind("decodeUrl",q(a.decodeUrl,"<s-:s>")),w.bind("eval",q(mr,"<sx?:x>")),w.bind("toMillis",q(u.toMillis,"<s-s?:n>")),w.bind("fromMillis",q(u.fromMillis,"<n-s?s?:s>")),w.bind("clone",q(gr,"<(oa)-:o>"));var Xt={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",D1011:"Stack overflow. Check for non-terminating recursive function. Consider rewriting as tail-recursive",D1012:"Evaluation timeout after {{value}} milliseconds. Check for infinite loop",D1013:"Object property names starting with _jsonata_ are reserved for internal use: {{value}}",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e7. Attempted to allocate {{value}}.",D2015:"The maximum sequence length of {{value}} was exceeded.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function nt(c){var f=Xt[c.code];if(typeof f<"u"){var d=f.replace(/\{\{\{([^}]+)}}}/g,function(){return c[arguments[1]]});d=d.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(c[arguments[1]])}),c.message=d}}function bt(c,f){var d,i;try{d=b(c,f&&f.recover),i=d.errors,delete d.errors}catch(v){throw nt(v),v}var o=et(w),l=new Date;return o.bind("now",q(function(v,m){return u.fromMillis(l.getTime(),v,m)},"<s?s?:s>")),o.bind("millis",q(function(){return l.getTime()},"<:n>")),{evaluate:async function(v,m,S){if(typeof i<"u"){var $={code:"S0500",position:0};throw nt($),$}const I=et(o);for(const V of p.keys(m))I.bind(V,m[V]);if(I.bind("$",v),l=new Date,I.timestamp=l,I.options=f,I.createSequence=function(){var V=[];return f&&f.sequence&&(V.push=function(...be){if(V.length+be.length>f.sequence)throw{code:"D2015",stack:new Error().stack,value:f.sequence};return Array.prototype.push.apply(V,be)}),V.sequence=!0,arguments.length===1&&V.push(arguments[0]),V},Array.isArray(v)&&!L(v)&&(v=I.createSequence(v),v.outerWrapper=!0),f&&(f.timeout||f.stack)){const V=Date.now();I.guardrails=function(){if(f.stack>0&&I.depth>f.stack)throw{code:"D1011",value:f.stack,stack:new Error().stack};if(f.timeout>0&&Date.now()-V>f.timeout)throw{code:"D1012",value:f.timeout,stack:new Error().stack}}}else I.guardrails=function(){};I.base=I,I.depth=0,f&&f.RegexEngine?I.RegexEngine=f.RegexEngine:I.RegexEngine=RegExp;var re;try{return re=await T(d,v,I),typeof S=="function"&&S(null,re),re}catch(V){throw nt(V),V}},assign:function(v,m){o.bind(v,m)},registerFunction:function(v,m,S){var $=q(m,S);o.bind(v,$)},ast:function(){return d},errors:function(){return i}}}return bt.parser=b,bt})();r.exports=O},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(t,r,s){var u=t("./signature");const a=(()=>{var p={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,"?:":40,"??":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},b={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
32
|
+
`,r:"\r",t:" "},P=function(x){var E=0,R=x.length,L=function(J,_){var g={type:J,value:_,position:E};return g},G=function(){for(var J=E,_=0,g,U,w=function(z){if(x.charAt(z)==="/"&&_===0){for(var F=0;x.charAt(z-(F+1))==="\\";)F++;if(F%2===0)return!0}return!1};E<R;){var T=x.charAt(E);if(w(E)){if(g=x.substring(J,E),g==="")throw{code:"S0301",stack:new Error().stack,position:E};for(E++,T=x.charAt(E),J=E;T==="i"||T==="m";)E++,T=x.charAt(E);return U=x.substring(J,E)+"g",new RegExp(g,U)}(T==="("||T==="["||T==="{")&&x.charAt(E-1)!=="\\"&&_++,(T===")"||T==="]"||T==="}")&&x.charAt(E-1)!=="\\"&&_--,E++}throw{code:"S0302",stack:new Error().stack,position:E}},ee=function(J){if(E>=R)return null;for(var _=x.charAt(E);E<R&&`
|
|
33
|
+
\r\v`.indexOf(_)>-1;)E++,_=x.charAt(E);if(_==="/"&&x.charAt(E+1)==="*"){var g=E;for(E+=2,_=x.charAt(E);!(_==="*"&&x.charAt(E+1)==="/");)if(_=x.charAt(++E),E>=R)throw{code:"S0106",stack:new Error().stack,position:g};return E+=2,_=x.charAt(E),ee(J)}if(J!==!0&&_==="/")return E++,L("regex",G());if(_==="."&&x.charAt(E+1)===".")return E+=2,L("operator","..");if(_===":"&&x.charAt(E+1)==="=")return E+=2,L("operator",":=");if(_==="!"&&x.charAt(E+1)==="=")return E+=2,L("operator","!=");if(_===">"&&x.charAt(E+1)==="=")return E+=2,L("operator",">=");if(_==="<"&&x.charAt(E+1)==="=")return E+=2,L("operator","<=");if(_==="*"&&x.charAt(E+1)==="*")return E+=2,L("operator","**");if(_==="~"&&x.charAt(E+1)===">")return E+=2,L("operator","~>");if(_==="?"&&x.charAt(E+1)===":")return E+=2,L("operator","?:");if(_==="?"&&x.charAt(E+1)==="?")return E+=2,L("operator","??");if(Object.prototype.hasOwnProperty.call(p,_))return E++,L("operator",_);if(_==='"'||_==="'"){var U=_;E++;for(var w="";E<R;){if(_=x.charAt(E),_==="\\")if(E++,_=x.charAt(E),Object.prototype.hasOwnProperty.call(b,_))w+=b[_];else if(_==="u"){var T=x.substr(E+1,4);if(/^[0-9a-fA-F]+$/.test(T)){var z=parseInt(T,16);w+=String.fromCharCode(z),E+=4}else throw{code:"S0104",stack:new Error().stack,position:E}}else throw{code:"S0103",stack:new Error().stack,position:E,token:_};else{if(_===U)return E++,L("string",w);w+=_}E++}throw{code:"S0101",stack:new Error().stack,position:E}}var F=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/,Z=F.exec(x.substring(E));if(Z!==null){var ne=parseFloat(Z[0]);if(!isNaN(ne)&&isFinite(ne))return E+=Z[0].length,L("number",ne);throw{code:"S0102",stack:new Error().stack,position:E,token:Z[0]}}var we;if(_==="`"){E++;var pe=x.indexOf("`",E);if(pe!==-1)return we=x.substring(E,pe),E=pe+1,L("name",we);throw E=R,{code:"S0105",stack:new Error().stack,position:E}}for(var he=E,Pe;;)if(Pe=x.charAt(he),he===R||`
|
|
34
|
+
\r\v`.indexOf(Pe)>-1||Object.prototype.hasOwnProperty.call(p,Pe)){if(x.charAt(E)==="$")return we=x.substring(E+1,he),E=he,L("variable",we);switch(we=x.substring(E,he),E=he,we){case"or":case"in":case"and":return L("operator",we);case"true":return L("value",!0);case"false":return L("value",!1);case"null":return L("value",null);default:return E===R&&we===""?null:L("name",we)}}else he++};return ee},O=function(x,E){var R,L,G=Object.create(null),ee=[],J=function(){var h=[];R.id!=="(end)"&&h.push({type:R.type,value:R.value,position:R.position});for(var y=L();y!==null;)h.push(y),y=L();return h},_={nud:function(){var h={code:"S0211",token:this.value,position:this.position};if(E)return h.remaining=J(),h.type="error",ee.push(h),h;throw h.stack=new Error().stack,h}},g=function(h,y){var W=G[h];return y=y||0,W?y>=W.lbp&&(W.lbp=y):(W=Object.create(_),W.id=W.value=h,W.lbp=y,G[h]=W),W},U=function(h){if(E){h.remaining=J(),ee.push(h);var y=G["(error)"];return R=Object.create(y),R.error=h,R.type="(error)",R}else throw h.stack=new Error().stack,h},w=function(h,y){if(h&&R.id!==h){var W;R.id==="(end)"?W="S0203":W="S0202";var ce={code:W,position:R.position,token:R.value,value:h};return U(ce)}var _e=L(y);if(_e===null)return R=G["(end)"],R.position=x.length,R;var ye=_e.value,A=_e.type,C;switch(A){case"name":case"variable":C=G["(name)"];break;case"operator":if(C=G[ye],!C)return U({code:"S0204",stack:new Error().stack,position:_e.position,token:ye});break;case"string":case"number":case"value":C=G["(literal)"];break;case"regex":A="regex",C=G["(regex)"];break;default:return U({code:"S0205",stack:new Error().stack,position:_e.position,token:ye})}return R=Object.create(C),R.value=ye,R.type=A,R.position=_e.position,R},T=function(h){var y,W=R;for(w(null,!0),y=W.nud();h<R.lbp;)W=R,w(),y=W.led(y);return y},z=function(h){var y=g(h,0);y.nud=function(){return this}},F=function(h,y,W){var ce=y||p[h],_e=g(h,ce);return _e.led=W||function(ye){return this.lhs=ye,this.rhs=T(ce),this.type="binary",this},_e},Z=function(h,y,W){var ce=g(h,y);return ce.led=W,ce},ne=function(h,y){var W=g(h);return W.nud=y||function(){return this.expression=T(70),this.type="unary",this},W};z("(end)"),z("(name)"),z("(literal)"),z("(regex)"),g(":"),g(";"),g(","),g(")"),g("]"),g("}"),g(".."),F("."),F("+"),F("-"),F("*"),F("/"),F("%"),F("="),F("<"),F(">"),F("!="),F("<="),F(">="),F("&"),F("and"),F("or"),F("in"),z("and"),z("or"),z("in"),ne("-"),F("~>"),F("??",p["??"],function(h){return this.type="condition",this.condition={type:"function",value:"(",procedure:{type:"variable",value:"exists"},arguments:[JSON.parse(JSON.stringify(h))]},this.then=h,this.else=T(0),this}),Z("(error)",10,function(h){return this.lhs=h,this.error=R.error,this.remaining=J(),this.type="error",this}),ne("*",function(){return this.type="wildcard",this}),ne("**",function(){return this.type="descendant",this}),ne("%",function(){return this.type="parent",this}),F("(",p["("],function(h){if(this.procedure=h,this.type="function",this.arguments=[],R.id!==")")for(;R.type==="operator"&&R.id==="?"?(this.type="partial",this.arguments.push(R),w("?")):this.arguments.push(T(0)),R.id===",";)w(",");if(w(")",!0),h.type==="name"&&(h.value==="function"||h.value==="λ")){if(this.arguments.forEach(function(ye,A){if(ye.type!=="variable")return U({code:"S0208",stack:new Error().stack,position:ye.position,token:ye.value,value:A+1})}),this.type="lambda",R.id==="<"){for(var y=R.position,W=1,ce="<";W>0&&R.id!=="{"&&R.id!=="(end)";){var _e=w();_e.id===">"?W--:_e.id==="<"&&W++,ce+=_e.value}w(">");try{this.signature=u(ce)}catch(ye){return ye.position=y+ye.offset,U(ye)}}w("{"),this.body=T(0),w("}")}return this}),ne("(",function(){for(var h=[];R.id!==")"&&(h.push(T(0)),R.id===";");)w(";");return w(")",!0),this.type="block",this.expressions=h,this}),ne("[",function(){var h=[];if(R.id!=="]")for(;;){var y=T(0);if(R.id===".."){var W={type:"binary",value:"..",position:R.position,lhs:y};w(".."),W.rhs=T(0),y=W}if(h.push(y),R.id!==",")break;w(",")}return w("]",!0),this.expressions=h,this.type="unary",this}),F("[",p["["],function(h){if(R.id==="]"){for(var y=h;y&&y.type==="binary"&&y.value==="[";)y=y.lhs;return y.keepArray=!0,w("]"),h}else return this.lhs=h,this.rhs=T(p["]"]),this.type="binary",w("]",!0),this}),F("^",p["^"],function(h){w("(");for(var y=[];;){var W={descending:!1};if(R.id==="<"?w("<"):R.id===">"&&(W.descending=!0,w(">")),W.expression=T(0),y.push(W),R.id!==",")break;w(",")}return w(")"),this.lhs=h,this.rhs=y,this.type="binary",this});var we=function(h){var y=[];if(R.id!=="}")for(;;){var W=T(0);w(":");var ce=T(0);if(y.push([W,ce]),R.id!==",")break;w(",")}return w("}",!0),typeof h>"u"?(this.lhs=y,this.type="unary"):(this.lhs=h,this.rhs=y,this.type="binary"),this};ne("{",we),F("{",p["{"],we),Z(":=",p[":="],function(h){return h.type!=="variable"?U({code:"S0212",stack:new Error().stack,position:h.position,token:h.value}):(this.lhs=h,this.rhs=T(p[":="]-1),this.type="binary",this)}),F("@",p["@"],function(h){return this.lhs=h,this.rhs=T(p["@"]),this.rhs.type!=="variable"?U({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),F("#",p["#"],function(h){return this.lhs=h,this.rhs=T(p["#"]),this.rhs.type!=="variable"?U({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),F("?",p["?"],function(h){return this.type="condition",this.condition=h,this.then=T(0),R.id===":"&&(w(":"),this.else=T(0)),this}),F("?:",p["?:"],function(h){return this.type="condition",this.condition=JSON.parse(JSON.stringify(h)),this.then=h,this.else=T(0),this}),ne("|",function(){return this.type="transform",this.pattern=T(0),w("|"),this.update=T(0),R.id===","&&(w(","),this.delete=T(0)),w("|"),this});var pe=function(h){var y;if(h.type==="function"&&!h.predicate){var W={type:"lambda",thunk:!0,arguments:[],position:h.position};W.body=h,y=W}else if(h.type==="condition")h.then=pe(h.then),typeof h.else<"u"&&(h.else=pe(h.else)),y=h;else if(h.type==="block"){var ce=h.expressions.length;ce>0&&(h.expressions[ce-1]=pe(h.expressions[ce-1])),y=h}else y=h;return y},he=0,Pe=0,Xe=[],ae=function(h,y){switch(h.type){case"name":case"wildcard":y.level--,y.level===0&&(typeof h.ancestor>"u"||(Xe[y.index].slot.label=h.ancestor.label),h.ancestor=y,h.tuple=!0);break;case"parent":y.level++;break;case"block":h.expressions.length>0&&(h.tuple=!0,y=ae(h.expressions[h.expressions.length-1],y));break;case"path":h.tuple=!0;var W=h.steps.length-1;for(y=ae(h.steps[W--],y);y.level>0&&W>=0;)y=ae(h.steps[W--],y);break;default:throw{code:"S0217",token:h.type,position:h.position}}return y},de=function(h,y){if(typeof y.seekingParent<"u"||y.type==="parent"){var W=typeof y.seekingParent<"u"?y.seekingParent:[];y.type==="parent"&&W.push(y.slot),typeof h.seekingParent>"u"?h.seekingParent=W:Array.prototype.push.apply(h.seekingParent,W)}},Ve=function(h){var y=h.steps.length-1,W=h.steps[y],ce=typeof W.seekingParent<"u"?W.seekingParent:[];W.type==="parent"&&ce.push(W.slot);for(var _e=0;_e<ce.length;_e++){var ye=ce[_e];for(y=h.steps.length-2;ye.level>0;){if(y<0){typeof h.seekingParent>"u"?h.seekingParent=[ye]:h.seekingParent.push(ye);break}for(var A=h.steps[y--];y>=0&&A.focus&&h.steps[y].focus;)A=h.steps[y--];ye=ae(A,ye)}}},te=function(h){var y;switch(h.type){case"binary":switch(h.value){case".":var W=te(h.lhs);W.type==="path"?y=W:y={type:"path",steps:[W]},W.type==="parent"&&(y.seekingParent=[W.slot]);var ce=te(h.rhs);ce.type==="path"?Array.prototype.push.apply(y.steps,ce.steps):(typeof ce.predicate<"u"&&(ce.stages=ce.predicate,delete ce.predicate),y.steps.push(ce)),y.steps.filter(function(j){if(j.type==="number"||j.type==="value")throw{code:"S0213",stack:new Error().stack,position:j.position,value:j.value};return j.type==="string"}).forEach(function(j){j.type="name"}),y.steps.filter(function(j){return j.keepArray===!0}).length>0&&(y.keepSingletonArray=!0);var _e=y.steps[0];_e.type==="unary"&&_e.value==="["&&(_e.consarray=!0);var ye=y.steps[y.steps.length-1];ye.type==="unary"&&ye.value==="["&&(ye.consarray=!0),Ve(y);break;case"[":y=te(h.lhs);var A=y,C="predicate";if(y.type==="path"&&(A=y.steps[y.steps.length-1],C="stages"),typeof A.group<"u")throw{code:"S0209",stack:new Error().stack,position:h.position};typeof A[C]>"u"&&(A[C]=[]);var k=te(h.rhs);typeof k.seekingParent<"u"&&(k.seekingParent.forEach(j=>{j.level===1?ae(A,j):j.level--}),de(A,k)),A[C].push({type:"filter",expr:k,position:h.position});break;case"{":if(y=te(h.lhs),typeof y.group<"u")throw{code:"S0210",stack:new Error().stack,position:h.position};y.group={lhs:h.rhs.map(function(j){return[te(j[0]),te(j[1])]}),position:h.position};break;case"^":y=te(h.lhs),y.type!=="path"&&(y={type:"path",steps:[y]});var M={type:"sort",position:h.position};M.terms=h.rhs.map(function(j){var H=te(j.expression);return de(M,H),{descending:j.descending,expression:H}}),y.steps.push(M),Ve(y);break;case":=":y={type:"bind",value:h.value,position:h.position},y.lhs=te(h.lhs),y.rhs=te(h.rhs),de(y,y.rhs);break;case"@":if(y=te(h.lhs),A=y,y.type==="path"&&(A=y.steps[y.steps.length-1]),typeof A.stages<"u"||typeof A.predicate<"u")throw{code:"S0215",stack:new Error().stack,position:h.position};if(A.type==="sort")throw{code:"S0216",stack:new Error().stack,position:h.position};h.keepArray&&(A.keepArray=!0),A.focus=h.rhs.value,A.tuple=!0;break;case"#":y=te(h.lhs),A=y,y.type==="path"?A=y.steps[y.steps.length-1]:(y={type:"path",steps:[y]},typeof A.predicate<"u"&&(A.stages=A.predicate,delete A.predicate)),typeof A.stages>"u"?A.index=h.rhs.value:A.stages.push({type:"index",value:h.rhs.value,position:h.position}),A.tuple=!0;break;case"~>":y={type:"apply",value:h.value,position:h.position},y.lhs=te(h.lhs),y.rhs=te(h.rhs),y.keepArray=y.lhs.keepArray||y.rhs.keepArray;break;default:y={type:h.type,value:h.value,position:h.position},y.lhs=te(h.lhs),y.rhs=te(h.rhs),de(y,y.lhs),de(y,y.rhs)}break;case"unary":y={type:h.type,value:h.value,position:h.position},h.value==="["?y.expressions=h.expressions.map(function(j){var H=te(j);return de(y,H),H}):h.value==="{"?y.lhs=h.lhs.map(function(j){var H=te(j[0]);de(y,H);var le=te(j[1]);return de(y,le),[H,le]}):(y.expression=te(h.expression),h.value==="-"&&y.expression.type==="number"?(y=y.expression,y.value=-y.value):de(y,y.expression));break;case"function":case"partial":y={type:h.type,name:h.name,value:h.value,position:h.position},y.arguments=h.arguments.map(function(j){var H=te(j);return de(y,H),H}),y.procedure=te(h.procedure);break;case"lambda":y={type:h.type,arguments:h.arguments,signature:h.signature,position:h.position};var B=te(h.body);y.body=pe(B);break;case"condition":y={type:h.type,position:h.position},y.condition=te(h.condition),de(y,y.condition),y.then=te(h.then),de(y,y.then),typeof h.else<"u"&&(y.else=te(h.else),de(y,y.else));break;case"transform":y={type:h.type,position:h.position},y.pattern=te(h.pattern),y.update=te(h.update),typeof h.delete<"u"&&(y.delete=te(h.delete));break;case"block":y={type:h.type,position:h.position},y.expressions=h.expressions.map(function(j){var H=te(j);return de(y,H),(H.consarray||H.type==="path"&&H.steps[0].consarray)&&(y.consarray=!0),H});break;case"name":y={type:"path",steps:[h]},h.keepArray&&(y.keepSingletonArray=!0);break;case"parent":y={type:"parent",slot:{label:"!"+he++,level:1,index:Pe++}},Xe.push(y);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":y=h;break;case"operator":if(h.value==="and"||h.value==="or"||h.value==="in")h.type="name",y=te(h);else if(h.value==="?")y=h;else throw{code:"S0201",stack:new Error().stack,position:h.position,token:h.value};break;case"error":y=h,h.lhs&&(y=te(h.lhs));break;default:var N="S0206";h.id==="(end)"&&(N="S0207");var D={code:N,position:h.position,token:h.value};if(E)return ee.push(D),{type:"error",error:D};throw D.stack=new Error().stack,D}return h.keepArray&&(y.keepArray=!0),y};L=P(x),w();var xe=T(0);if(R.id!=="(end)"){var rt={code:"S0201",position:R.position,token:R.value};U(rt)}if(xe=te(xe),xe.type==="parent"||typeof xe.seekingParent<"u")throw{code:"S0217",token:xe.type,position:xe.position};return ee.length>0&&(xe.errors=ee),xe};return O})();r.exports=a},{"./signature":5}],5:[function(t,r,s){var u=t("./utils");const a=(()=>{var p={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function b(P){for(var O=1,x=[],E=Object.create(null),R=E;O<P.length;){var L=P.charAt(O);if(L===":")break;var G=function(){x.push(E),R=E,E=Object.create(null)},ee=function(F,Z,ne,we){for(var pe=1,he=Z;he<F.length;)if(he++,L=F.charAt(he),L===we){if(pe--,pe===0)break}else L===ne&&pe++;return he};switch(L){case"s":case"n":case"b":case"l":case"o":E.regex="["+L+"m]",E.type=L,G();break;case"a":E.regex="[asnblfom]",E.type=L,E.array=!0,G();break;case"f":E.regex="f",E.type=L,G();break;case"j":E.regex="[asnblom]",E.type=L,G();break;case"x":E.regex="[asnblfom]",E.type=L,G();break;case"-":R.context=!0,R.contextRegex=new RegExp(R.regex),R.regex+="?";break;case"?":case"+":R.regex+=L;break;case"(":var J=ee(P,O,"(",")"),_=P.substring(O+1,J);if(_.indexOf("<")===-1)E.regex="["+_+"m]";else throw{code:"S0402",stack:new Error().stack,value:_,offset:O};E.type="("+_+")",O=J,G();break;case"<":if(R.type==="a"||R.type==="f"){var g=ee(P,O,"<",">");R.subtype=P.substring(O+1,g),O=g}else throw{code:"S0401",stack:new Error().stack,value:R.type,offset:O};break}O++}var U="^"+x.map(function(F){return"("+F.regex+")"}).join("")+"$",w=new RegExp(U),T=function(F){var Z;if(u.isFunction(F))Z="f";else{var ne=typeof F;switch(ne){case"string":Z="s";break;case"number":Z="n";break;case"boolean":Z="b";break;case"object":F===null?Z="l":Array.isArray(F)?Z="a":Z="o";break;case"undefined":default:Z="m"}}return Z},z=function(F,Z){for(var ne="^",we=0,pe=0;pe<x.length;pe++){ne+=x[pe].regex;var he=Z.match(ne);if(he===null)throw{code:"T0410",stack:new Error().stack,value:F[we],index:we+1};we=he[0].length}throw{code:"T0410",stack:new Error().stack,value:F[we],index:we+1}};return{definition:P,validate:function(F,Z){var ne="";F.forEach(function(Pe){ne+=T(Pe)});var we=w.exec(ne);if(we){var pe=[],he=0;return x.forEach(function(Pe,Xe){var ae=F[he],de=we[Xe+1];if(de==="")if(Pe.context&&Pe.contextRegex){var Ve=T(Z);if(Pe.contextRegex.test(Ve))pe.push(Z);else throw{code:"T0411",stack:new Error().stack,value:Z,index:he+1}}else pe.push(ae),he++;else de.split("").forEach(function(te){if(ae=F[he],Pe.type==="a"){if(te==="m")ae=void 0;else{var xe=!0;if(typeof Pe.subtype<"u"){if(te!=="a"&&de!==Pe.subtype)xe=!1;else if(te==="a"&&ae.length>0){var rt=T(ae[0]);if(rt!==Pe.subtype.charAt(0))xe=!1;else{var h=ae.filter(function(y){return T(y)!==rt});xe=h.length===0}}}if(!xe)throw{code:"T0412",stack:new Error().stack,value:ae,index:he+1,type:p[Pe.subtype]};te!=="a"&&(ae=[ae])}pe.push(ae),he++}else pe.push(ae),he++})}),pe}z(F,ne)}}}return b})();r.exports=a},{"./utils":6}],6:[function(t,r,s){const u=(()=>{function a(g){var U=!1;if(typeof g=="number"&&(U=!isNaN(g),U&&!isFinite(g)))throw{code:"D1001",value:g,stack:new Error().stack};return U}function p(g){var U=!1;return Array.isArray(g)&&(U=g.filter(function(w){return typeof w!="string"}).length===0),U}function b(g){var U=!1;return Array.isArray(g)&&(U=g.filter(function(w){return!a(w)}).length===0),U}function P(g){return g.sequence===!0&&Array.isArray(g)}function O(g){return g&&(g._jsonata_function===!0||g._jsonata_lambda===!0)||typeof g=="function"}function x(g){var U=typeof g.arity=="number"?g.arity:typeof g.implementation=="function"?g.implementation.length:typeof g.length=="number"?g.length:g.arguments.length;return U}function E(g){return g&&g._jsonata_lambda===!0}var R=(typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator";function L(g){return typeof g=="object"&&g!==null&&R in g&&"next"in g&&typeof g.next=="function"}function G(g,U){if(g===U)return!0;if(typeof g=="object"&&typeof U=="object"&&g!==null&&U!==null){if(Array.isArray(g)&&Array.isArray(U)){if(g.length!==U.length)return!1;for(var w=0;w<g.length;w++)if(!G(g[w],U[w]))return!1;return!0}var T=Object.getOwnPropertyNames(g),z=Object.getOwnPropertyNames(U);if(T.length!==z.length)return!1;for(T=T.sort(),z=z.sort(),w=0;w<T.length;w++)if(T[w]!==z[w])return!1;for(w=0;w<T.length;w++){var F=T[w];if(!G(g[F],U[F]))return!1}return!0}return!1}function ee(g){return typeof g=="object"&&g!==null&&"then"in g&&typeof g.then=="function"}function J(g){var U=[];for(let w of g)U.push(w);return U}function _(g){return typeof g=="object"&&g!==null?Object.keys(g):[]}return{isNumeric:a,isArrayOfStrings:p,isArrayOfNumbers:b,isSequence:P,isFunction:O,isLambda:E,isIterable:L,getFunctionArity:x,isDeepEqual:G,stringToArray:J,isPromise:ee,keys:_}})();r.exports=u},{}]},{},[3])(3)})})($r)),$r.exports}Yi();function Nr(n){return typeof n!="string"?null:n.trim()||null}function Xi(n){if(n==null||n==="")return null;if(typeof n=="string")return Nr(n);if(typeof n!="object")return null;const e=n;return Nr(e.url)??Nr(e.blobUrl)}function Ji(n){for(const e of n)try{URL.revokeObjectURL(e)}catch{}}const Ki=150,An=10,Zi=200,Qi=16,Sn=new WeakMap;let kn=!1;function cr(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Gt(n){if(n===window)return{x:window.scrollX,y:window.scrollY};const e=n;return{x:e.scrollLeft,y:e.scrollTop}}function es(n,e,t){if(n===window){window.scrollTo(e,t);return}const r=n;typeof r.scrollTo=="function"?r.scrollTo(e,t):(r.scrollLeft=e,r.scrollTop=t)}function ts(n){if(n===window){const t=document.documentElement;return Math.max(0,t.scrollHeight-window.innerHeight)}const e=n;return Math.max(0,e.scrollHeight-e.clientHeight)}function Tt(n){let e=Sn.get(n);if(!e){const t=Gt(n);e={x:t.x,y:t.y,restoring:!1,watching:!1,userEngaged:!1,raf:0,stickyFrames:0},Sn.set(n,e)}return e}function lr(n){Tt(n).userEngaged=!0}function fr(n){const e=Tt(n);clearTimeout(e.settleTimer),e.settleTimer=setTimeout(()=>{e.userEngaged=!1,e.settleTimer=void 0},Ki)}function Tn(n,e){return e-n>=Zi}function Pt(n){if(!cr())return;const e=Tt(n);if(e.restoring)return;const t=Gt(n);if(Tn(t.y,e.y)){Ir(n);return}e.x=t.x,e.y=t.y}function rs(n){if(!cr())return;const e=Tt(n),t=ts(n),r=e.x,s=t>0?Math.min(e.y,t):e.y,{x:u,y:a}=Gt(n);if(!(Math.abs(r-u)<=An&&Math.abs(s-a)<=An)){e.restoring=!0;try{es(n,r,s)}finally{requestAnimationFrame(()=>{e.restoring=!1})}}}function Ir(n){const e=Tt(n);if(e.stickyFrames=Qi,e.raf)return;const t=()=>{e.raf=0,rs(n),e.stickyFrames>0&&(e.stickyFrames--,e.raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)}function Gr(n){Ir(n)}function Bt(n){if(!cr())return;const e=Tt(n);if(e.watching)return;e.watching=!0;const t=n===window?window:n,r=()=>{if(e.restoring)return;const{y:L}=Gt(n);if(Tn(L,e.y)){Ir(n);return}if(e.userEngaged){Pt(n),fr(n);return}Pt(n)},s=L=>Pn(L)===n,u=L=>{s(L)&&(Pt(n),lr(n))},a=L=>{s(L)&&fr(n)},p=L=>{s(L)&&(Pt(n),lr(n),fr(n))};t.addEventListener("scroll",r,{passive:!0}),t.addEventListener("touchstart",u,{passive:!0}),t.addEventListener("touchend",a,{passive:!0}),t.addEventListener("touchcancel",a,{passive:!0}),t.addEventListener("wheel",p,{passive:!0}),t.addEventListener("pointerdown",u,{passive:!0}),t.addEventListener("pointerup",a,{passive:!0}),t.addEventListener("pointercancel",a,{passive:!0});const b=Gt(n);if(e.x=b.x,e.y=b.y,n===window){const L=new ResizeObserver(()=>Gr(window));L.observe(document.documentElement),e.resizeObserver=L;return}const P=n,O=new ResizeObserver(()=>Gr(P));O.observe(P);for(const L of Array.from(P.children))O.observe(L);e.resizeObserver=O;const x=()=>Gr(P),E=new MutationObserver(L=>{for(const G of L)if(G.type==="childList")for(const ee of Array.from(G.addedNodes))ee instanceof Element&&O.observe(ee);x()});E.observe(P,{childList:!0,subtree:!0,characterData:!0});const R=P.getRootNode();R instanceof ShadowRoot&&R.host&&E.observe(R.host,{childList:!0,subtree:!0,characterData:!0}),e.mutationObserver=E}function Pn(n){for(const e of n.composedPath())if(!(e===window||e===document)&&e instanceof HTMLElement&&xn(e))return e;return window}function xn(n){if(!(n instanceof HTMLElement)||n===document.documentElement||n===document.body)return!1;const e=getComputedStyle(n).overflowY;return e==="auto"||e==="scroll"||e==="overlay"}function Br(n){for(const t of n.composedPath())t===window||t===document||t instanceof HTMLElement&&xn(t)&&Bt(t);const e=Pn(n);Bt(e),n.type==="wheel"?(Pt(e),lr(e),fr(e)):(n.type==="touchstart"||n.type==="pointerdown")&&(Pt(e),lr(e))}function hr(n){n instanceof Element&&n.classList?.contains("custom-scroll")&&Bt(n),n.querySelectorAll?.(".custom-scroll").forEach(e=>{e instanceof HTMLElement&&Bt(e)})}function jr(n){hr(n),new MutationObserver(t=>{for(const r of t)for(const s of Array.from(r.addedNodes))s instanceof Element&&hr(s)}).observe(n,{childList:!0,subtree:!0})}function qr(n){n.querySelectorAll?.("*").forEach(e=>{e.shadowRoot&&(jr(e.shadowRoot),qr(e.shadowRoot))})}function ns(){const n=Element.prototype;if(n.__safariScrollGuardPatched)return;n.__safariScrollGuardPatched=!0;const e=n.attachShadow;n.attachShadow=function(r){const s=e.call(this,r);return jr(s),s}}function is(){if(typeof window>"u"||kn||(kn=!0,!cr()))return;Bt(window),ns();const n={capture:!0,passive:!0};window.addEventListener("wheel",Br,n),window.addEventListener("touchstart",Br,n),window.addEventListener("pointerdown",Br,n);const e=()=>{hr(document),qr(document)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e(),new MutationObserver(r=>{for(const s of r)for(const u of Array.from(s.addedNodes))u instanceof Element&&(hr(u),u.shadowRoot&&jr(u.shadowRoot),qr(u))}).observe(document.documentElement,{childList:!0,subtree:!0})}const ss=Ci,as=Di,os=Lr,us=Dr,cs=st,ls=ji,fs=sr,hs=Mr,ds=Hi;is(),window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:ss,Arrays:as,DataBindObserver:os,Format:us,HTML:cs,LocationHandler:ls,Objects:fs,PublisherManager:$e,api:hs,URLPattern:ds,Endpoint:Fr,DataProviderKey:ir};const jt="[sonic-webgpu]",ps=["time","frame","mouseX","mouseY","hovering"],Cn=["param0","param1","param2","param3"],Rn=["channel0","channel1","channel2","channel3"],ms=["frameUrl","snapshot"];function gs(){return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function zr(n,e){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"&&n.trim()!==""){const t=Number(n);if(Number.isFinite(t))return t}return e}function vs(n){if(n===null||n==="")return"";if(typeof n=="string")return n.trim();const e=Xi(n);if(e)return e;if(!(n&&typeof n=="object"))return""}function Wr(n){const e=n.dataProvider?.trim();return e||st.getAncestorAttributeValue(n,"dataProvider")||st.getAncestorAttributeValue(n,"formDataProvider")||""}function Dn(n){n.formPublisher&&(n.formPublisher.offInternalMutation(n.onFormMutation),n.formPublisher=null)}function ys(n){Dn(n);const e=Wr(n);e&&(n.formPublisher=$e.get(e),n.formPublisher.onInternalMutation(n.onFormMutation),n.onFormMutation())}function bs(n){const e=n.outDataProvider?.trim()||Wr(n)||"";n.outPublisher=e?$e.get(e):null}function ws(n,e){for(const t of Rn){if(!(t in e))continue;const r=vs(e[t]);r!==void 0&&n[t]!==r&&(n[t]=r)}for(const t of Cn){if(!(t in e))continue;const r=zr(e[t],NaN);Number.isFinite(r)&&n[t]!==r&&(n[t]=r)}if("targetX"in e||"targetY"in e){const t=zr(e.targetX,NaN),r=zr(e.targetY,NaN);Number.isFinite(t)&&Number.isFinite(r)&&t>=0&&t<=1&&r>=0&&r<=1?(n.remoteTarget={x:t,y:r},Un(n)):(n.remoteTarget=null,n.mouseVec[0]=0,n.mouseVec[1]=0)}}function Un(n){if(!n.remoteTarget||!n.runtime||n.mouse&&n.hovering)return;const e=n.runtime.canvas.width,t=n.runtime.canvas.height;e<2||t<2||(n.mouseVec[0]=n.remoteTarget.x*e,n.mouseVec[1]=(1-n.remoteTarget.y)*t)}const yt={resolveFormProviderId:Wr,unbindFormProvider:Dn,bindFormProvider:ys,bindOutPublisher:bs,applyFormParams:ws,applyRemoteMouse:Un},_s=`#version 300 es
|
|
35
|
+
precision highp float;
|
|
36
|
+
precision highp int;
|
|
37
|
+
precision mediump sampler2D;
|
|
38
|
+
|
|
39
|
+
uniform vec3 iResolution;
|
|
40
|
+
uniform float iTime;
|
|
41
|
+
uniform float iTimeDelta;
|
|
42
|
+
uniform float iFrameRate;
|
|
43
|
+
uniform int iFrame;
|
|
44
|
+
uniform float iChannelTime[4];
|
|
45
|
+
uniform vec3 iChannelResolution[4];
|
|
46
|
+
uniform vec4 iMouse;
|
|
47
|
+
uniform vec4 iDate;
|
|
48
|
+
uniform float iSampleRate;
|
|
49
|
+
uniform sampler2D iChannel0;
|
|
50
|
+
uniform sampler2D iChannel1;
|
|
51
|
+
uniform sampler2D iChannel2;
|
|
52
|
+
uniform sampler2D iChannel3;
|
|
53
|
+
uniform float uParam0;
|
|
54
|
+
uniform float uParam1;
|
|
55
|
+
uniform float uParam2;
|
|
56
|
+
uniform float uParam3;
|
|
57
|
+
|
|
58
|
+
out vec4 sonicFragColor;
|
|
59
|
+
|
|
60
|
+
`,Es=`
|
|
61
|
+
void main() {
|
|
62
|
+
mainImage(sonicFragColor, gl_FragCoord.xy);
|
|
63
|
+
}
|
|
64
|
+
`,As=`#version 300 es
|
|
65
|
+
precision highp float;
|
|
66
|
+
layout(location = 0) in vec2 aPos;
|
|
67
|
+
void main() {
|
|
68
|
+
gl_Position = vec4(aPos, 0.0, 1.0);
|
|
69
|
+
}
|
|
70
|
+
`;function Ss(n,e){return _s+(n?n+`
|
|
71
|
+
`:"")+e+`
|
|
72
|
+
`+Es}class qt extends Error{constructor(e,t,r){super(e),this.pass=t,this.infoLog=r,this.name="ShaderCompileError"}}const ks=["bufferA","bufferB","bufferC","bufferD","image"],Ts=["bufferA","bufferB","bufferC","bufferD"];function Ps(n){return/\.(webm|mp4|ogg|mov)(\?|#|$)/i.test(n)}function On(n,e,t,r){const s=n.createShader(e);if(!s)throw new qt("Unable to create shader",r,"");if(n.shaderSource(s,t),n.compileShader(s),!n.getShaderParameter(s,n.COMPILE_STATUS)){const u=n.getShaderInfoLog(s)||"";throw n.deleteShader(s),new qt(`Compile error (${r}): ${u}`,r,u)}return s}function xs(n,e,t,r){const s=n.createProgram();if(!s)throw new qt("Unable to create program","link","");if(n.attachShader(s,e),n.attachShader(s,t),n.linkProgram(s),!n.getProgramParameter(s,n.LINK_STATUS)){const u=n.getProgramInfoLog(s)||"";throw n.deleteProgram(s),new qt(`Link error (${r}): ${u}`,"link",u)}return s}function Cs(n,e){return{iResolution:n.getUniformLocation(e,"iResolution"),iTime:n.getUniformLocation(e,"iTime"),iTimeDelta:n.getUniformLocation(e,"iTimeDelta"),iFrameRate:n.getUniformLocation(e,"iFrameRate"),iFrame:n.getUniformLocation(e,"iFrame"),iMouse:n.getUniformLocation(e,"iMouse"),iDate:n.getUniformLocation(e,"iDate"),iSampleRate:n.getUniformLocation(e,"iSampleRate"),iChannelTime:n.getUniformLocation(e,"iChannelTime[0]")||n.getUniformLocation(e,"iChannelTime"),iChannelResolution:n.getUniformLocation(e,"iChannelResolution[0]")||n.getUniformLocation(e,"iChannelResolution"),iChannel:[0,1,2,3].map(t=>n.getUniformLocation(e,`iChannel${t}`)),uParam:[0,1,2,3].map(t=>n.getUniformLocation(e,`uParam${t}`))}}function Vr(n,e,t){const r=n.createTexture();if(!r)throw new Error("Unable to create texture");return n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(n.TEXTURE_2D,0,n.RGBA8,e,t,0,n.RGBA,n.UNSIGNED_BYTE,null),r}function Ln(n,e){const t=n.createFramebuffer();if(!t)throw new Error("Unable to create framebuffer");n.bindFramebuffer(n.FRAMEBUFFER,t),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);const r=n.checkFramebufferStatus(n.FRAMEBUFFER);if(r!==n.FRAMEBUFFER_COMPLETE)throw new Error(`Incomplete framebuffer: ${r}`);return n.bindFramebuffer(n.FRAMEBUFFER,null),t}function Mn(n,e,t){const r=[Vr(n,e,t),Vr(n,e,t)],s=[Ln(n,r[0]),Ln(n,r[1])];return{textures:r,framebuffers:s,index:0}}function Hr(n,e){for(const t of e.textures)n.deleteTexture(t);for(const t of e.framebuffers)n.deleteFramebuffer(t)}function dr(n,e){const t=(n??"").trim();if(!t)return{kind:"none"};const r=t.toLowerCase();return r==="self"?{kind:"self"}:r==="buffer-a"||r==="buffera"||r==="a"?{kind:"buffer",buffer:"bufferA"}:r==="buffer-b"||r==="bufferb"||r==="b"?{kind:"buffer",buffer:"bufferB"}:r==="buffer-c"||r==="bufferc"||r==="c"?{kind:"buffer",buffer:"bufferC"}:r==="buffer-d"||r==="bufferd"||r==="d"?{kind:"buffer",buffer:"bufferD"}:r==="none"||r==="null"?{kind:"none"}:{kind:"url",url:t}}class Rs{constructor(e){this.vao=null,this.vertexShader=null,this.programs=new Map,this.buffers=new Map,this.external=new Map,this.width=0,this.height=0,this.passChannels=new Map,this.activePasses=[],this.blackTexture=null;const t=e.getContext("webgl2",{antialias:!1,alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0,powerPreference:"default"});if(!t||t.isContextLost())throw new Error("WebGL2 not available");this.canvas=e,this.gl=t,this.initGeometry(),this.blackTexture=Vr(t,1,1),t.bindTexture(t.TEXTURE_2D,this.blackTexture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA8,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,255]))}get isLost(){return this.gl.isContextLost()}initGeometry(){const e=this.gl,t=e.createVertexArray();if(!t)throw new Error("Unable to create VAO");this.vao=t,e.bindVertexArray(t);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.bindVertexArray(null)}resize(e,t){const r=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t));if(!(r===this.width&&s===this.height)){this.width=r,this.height=s,this.canvas.width=r,this.canvas.height=s;for(const u of Ts){const a=this.buffers.get(u);a&&Hr(this.gl,a),this.programs.has(u)&&this.buffers.set(u,Mn(this.gl,r,s))}}}setSources(e,t){if(this.gl.isContextLost())throw new Error("WebGL context lost");this.disposePrograms(),this.passChannels=t,this.activePasses=[],this.vertexShader=On(this.gl,this.gl.VERTEX_SHADER,As,"vertex");for(const r of ks){const s=r==="image"?e.image:e[r];if(!s?.trim())continue;const u=Ss(e.common||"",s),a=On(this.gl,this.gl.FRAGMENT_SHADER,u,r),p=xs(this.gl,this.vertexShader,a,r);if(this.gl.deleteShader(a),this.programs.set(r,{program:p,uniforms:Cs(this.gl,p)}),this.activePasses.push(r),r!=="image"&&this.width>0){const b=this.buffers.get(r);b&&Hr(this.gl,b),this.buffers.set(r,Mn(this.gl,this.width,this.height))}}if(!this.programs.has("image"))throw new qt("image pass is required","image","Missing image shader source")}async ensureTextures(e){const t=[...new Set(e.filter(Boolean))];await Promise.all(t.map(r=>this.loadTexture(r)))}updateVideoTextures(){const e=this.gl;for(const t of this.external.values()){const r=t.video;!r||r.readyState<2||(e.bindTexture(e.TEXTURE_2D,t.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA8,e.RGBA,e.UNSIGNED_BYTE,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,0),t.width=r.videoWidth||t.width,t.height=r.videoHeight||t.height)}}setVideosPlaying(e){for(const t of this.external.values())t.video&&(e?t.video.play().catch(()=>{}):t.video.pause())}getTextureSize(e){const t=this.external.get(e);return!t||t.width<1||t.height<1?null:{width:t.width,height:t.height}}loadTexture(e){return this.external.get(e)?Promise.resolve():Ps(e)?this.loadVideoTexture(e):new Promise((r,s)=>{const u=new Image;u.crossOrigin="anonymous",u.onload=()=>{const a=this.gl,p=a.createTexture();if(!p){s(new Error("Unable to create texture"));return}a.bindTexture(a.TEXTURE_2D,p),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,1),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.RGBA8,a.RGBA,a.UNSIGNED_BYTE,u),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,0),this.external.set(e,{texture:p,width:u.naturalWidth||u.width,height:u.naturalHeight||u.height,url:e}),r()},u.onerror=()=>s(new Error(`Failed to load texture: ${e}`)),u.src=e})}loadVideoTexture(e){return new Promise((t,r)=>{const s=document.createElement("video");s.crossOrigin="anonymous",s.muted=!0,s.loop=!0,s.playsInline=!0,s.preload="auto";let u=!1;const a=()=>{u||(u=!0,r(new Error(`Failed to load video: ${e}`)))},p=()=>{if(u||!s.videoWidth)return;u=!0;const b=this.gl,P=b.createTexture();if(!P){r(new Error("Unable to create texture"));return}b.bindTexture(b.TEXTURE_2D,P),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,1),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texImage2D(b.TEXTURE_2D,0,b.RGBA8,b.RGBA,b.UNSIGNED_BYTE,s),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,0),this.external.set(e,{texture:P,width:s.videoWidth,height:s.videoHeight,url:e,video:s}),s.play().catch(()=>{}),t()};s.addEventListener("loadeddata",p),s.addEventListener("error",a),s.src=e,s.load()})}resolveChannel(e,t){const r={texture:this.blackTexture,width:1,height:1};if(t.kind==="none")return r;if(t.kind==="url"){const a=this.external.get(t.url);return a?{texture:a.texture,width:a.width,height:a.height}:r}const s=t.kind==="self"?e==="image"?null:e:t.buffer;if(!s)return r;const u=this.buffers.get(s);return u?{texture:u.textures[u.index],width:this.width,height:this.height}:r}bindChannels(e,t){const r=this.gl,s=this.passChannels.get(e)||[{kind:"none"},{kind:"none"},{kind:"none"},{kind:"none"}],u=[];for(let a=0;a<4;a++){const p=this.resolveChannel(e,s[a]);r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,p.texture),t.iChannel[a]&&r.uniform1i(t.iChannel[a],a),u.push(p.width,p.height,1)}t.iChannelResolution&&r.uniform3fv(t.iChannelResolution,u),t.iChannelTime&&r.uniform1fv(t.iChannelTime,[0,0,0,0])}setCommonUniforms(e,t){const r=this.gl,s=this.width,u=this.height;if(e.iResolution&&r.uniform3f(e.iResolution,s,u,1),e.iTime&&r.uniform1f(e.iTime,t.time),e.iTimeDelta&&r.uniform1f(e.iTimeDelta,t.timeDelta),e.iFrameRate&&r.uniform1f(e.iFrameRate,t.timeDelta>0?1/t.timeDelta:60),e.iFrame&&r.uniform1i(e.iFrame,t.frame),e.iMouse&&r.uniform4f(e.iMouse,t.mouse[0],t.mouse[1],t.mouse[2],t.mouse[3]),e.iDate){const a=new Date;r.uniform4f(e.iDate,a.getFullYear(),a.getMonth(),a.getDate(),a.getHours()*3600+a.getMinutes()*60+a.getSeconds()+a.getMilliseconds()*.001)}e.iSampleRate&&r.uniform1f(e.iSampleRate,44100);for(let a=0;a<4;a++)e.uParam[a]&&r.uniform1f(e.uParam[a],t.params[a])}render(e){const t=this.gl;if(!this.vao||this.width<1||this.height<1)return;this.updateVideoTextures(),t.bindVertexArray(this.vao),t.viewport(0,0,this.width,this.height),t.disable(t.DEPTH_TEST),t.disable(t.BLEND);for(const s of this.activePasses){if(s==="image")continue;const u=this.programs.get(s),a=this.buffers.get(s);if(!u||!a)continue;const p=1-a.index;t.bindFramebuffer(t.FRAMEBUFFER,a.framebuffers[p]),t.viewport(0,0,this.width,this.height),t.useProgram(u.program),this.setCommonUniforms(u.uniforms,e),this.bindChannels(s,u.uniforms),t.drawArrays(t.TRIANGLES,0,3),a.index=p}const r=this.programs.get("image");r&&(t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.width,this.height),t.useProgram(r.program),this.setCommonUniforms(r.uniforms,e),this.bindChannels("image",r.uniforms),t.drawArrays(t.TRIANGLES,0,3),t.bindVertexArray(null))}readRect(e,t,r,s){return this.readFramebufferRect(null,e,t,r,s)}readBufferRect(e,t,r,s,u){if(e==="image")return this.readRect(t,r,s,u);const a=this.buffers.get(e);return a?this.readFramebufferRect(a.framebuffers[a.index],t,r,s,u):null}readPixel(e,t){const r=this.readRect(Math.floor(e),Math.floor(t),1,1);return!r||r.data.length<4?[0,0,0,0]:[r.data[0],r.data[1],r.data[2],r.data[3]]}readFramebufferRect(e,t,r,s,u){const a=this.gl;if(a.isContextLost()||this.width<1||this.height<1)return null;let p=Math.floor(t),b=Math.floor(r),P=Math.floor(s),O=Math.floor(u);if(P<1||O<1||(p<0&&(P+=p,p=0),b<0&&(O+=b,b=0),p+P>this.width&&(P=this.width-p),b+O>this.height&&(O=this.height-b),P<1||O<1))return null;const x=new Uint8Array(P*O*4);return a.bindFramebuffer(a.FRAMEBUFFER,e),a.readPixels(p,b,P,O,a.RGBA,a.UNSIGNED_BYTE,x),a.bindFramebuffer(a.FRAMEBUFFER,null),{x:p,y:b,width:P,height:O,data:x}}get size(){return{width:this.width,height:this.height}}disposePrograms(){for(const e of this.programs.values())this.gl.deleteProgram(e.program);this.programs.clear(),this.activePasses=[],this.vertexShader&&(this.gl.deleteShader(this.vertexShader),this.vertexShader=null)}dispose(e=!0){if(this.gl.isContextLost())this.programs.clear(),this.buffers.clear(),this.external.clear(),this.blackTexture=null,this.vao=null,this.vertexShader=null;else{this.disposePrograms();for(const t of this.buffers.values())Hr(this.gl,t);this.buffers.clear();for(const t of this.external.values())t.video&&(t.video.pause(),t.video.removeAttribute("src"),t.video.load()),this.gl.deleteTexture(t.texture);this.external.clear(),this.blackTexture&&(this.gl.deleteTexture(this.blackTexture),this.blackTexture=null),this.vao&&(this.gl.deleteVertexArray(this.vao),this.vao=null),e&&this.gl.getExtension("WEBGL_lose_context")?.loseContext()}}}const Ds={common:"",image:`
|
|
73
|
+
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
74
|
+
vec2 uv = fragCoord / iResolution.xy;
|
|
75
|
+
vec4 c = texture(iChannel0, uv);
|
|
76
|
+
float has = step(0.001, c.a + c.r + c.g + c.b);
|
|
77
|
+
// Souris en UV (origine bas-gauche, comme fragCoord)
|
|
78
|
+
vec2 muv = iMouse.xy / max(iResolution.xy, vec2(1.0));
|
|
79
|
+
float m = length(uv - muv);
|
|
80
|
+
// Halo souris toujours visible + mix global via uParam0
|
|
81
|
+
float glow = exp(-m * 8.0) * (0.35 + 0.65 * uParam0);
|
|
82
|
+
vec4 tint = vec4(0.15, 0.45, 0.95, 1.0);
|
|
83
|
+
vec4 mixed = mix(c, tint, clamp(uParam0 * 0.35 + glow, 0.0, 1.0));
|
|
84
|
+
float g = 0.15 + 0.25 * uv.y;
|
|
85
|
+
vec4 grad = vec4(g, g * 0.85 + 0.08 * uParam0, 0.35 + 0.4 * uv.x, 1.0);
|
|
86
|
+
fragColor = mix(grad, mixed, has);
|
|
87
|
+
}
|
|
88
|
+
`,bufferA:"",bufferB:"",bufferC:"",bufferD:""};class zt{constructor(e,t){this.backend="webgl2",this.channelUrls=["","","",""],this.lastTime=0,this.disposed=!1,this.channelQueue=Promise.resolve(),this.canvas=e,this.toy=t,this.applySources()}static create(e){const t=new Rs(e);return new zt(e,t)}async setShader(e){this.assertAlive()}async setChannel(e,t){return this.channelQueue=this.channelQueue.then(()=>this.setChannelNow(e,t)),this.channelQueue}async setChannelNow(e,t){this.assertAlive();const r=t.trim();if(this.channelUrls[e]===r){r&&!this.toy.getTextureSize(r)&&await this.toy.ensureTextures([r]);return}this.channelUrls[e]=r,this.applySources();const s=this.channelUrls.filter(Boolean);s.length&&await this.toy.ensureTextures(s)}async setChannels(e){return this.channelQueue=this.channelQueue.then(async()=>{this.assertAlive(),this.channelUrls=[e[0].trim(),e[1].trim(),e[2].trim(),e[3].trim()],this.applySources();const t=this.channelUrls.filter(Boolean);t.length&&await this.toy.ensureTextures(t)}),this.channelQueue}getTextureSize(e){return this.toy.getTextureSize(e.trim())}resize(e,t){this.assertAlive(),this.toy.resize(e,t)}draw(e){if(this.assertAlive(),this.toy.isLost)return;const t=this.lastTime>0?Math.max(0,e.time-this.lastTime):0;this.lastTime=e.time;const r={time:e.time,timeDelta:t,frame:Math.floor(e.frame),mouse:e.mouse,params:e.params};this.toy.render(r)}dispose(e=!0){this.disposed||(this.disposed=!0,this.toy.dispose(e))}applySources(){const e=new Map([["image",[dr(this.channelUrls[0]),dr(this.channelUrls[1]),dr(this.channelUrls[2]),dr(this.channelUrls[3])]]]);this.toy.setSources(Ds,e)}assertAlive(){if(this.disposed)throw new Error("WebGL2 fallback disposed")}}class Wt extends Error{constructor(e,t){super(e),this.infoLog=t,this.name="WebGpuCompileError"}}function Fn(n){const e=String(n??"auto").trim().toLowerCase();return e==="webgpu"||e==="webgl2"||e==="auto"?e:"auto"}function Us(n){const e=String(n??"").trim().toLowerCase();return e==="particles"||e==="image"?e:""}const $n=`
|
|
89
|
+
fn mainImage(uv: vec2f, fragCoord: vec2f) -> vec4f {
|
|
90
|
+
_ = fragCoord;
|
|
91
|
+
let c = iChannel0(uv);
|
|
92
|
+
if (c.a > 0.001 || c.r + c.g + c.b > 0.001) {
|
|
93
|
+
return c;
|
|
94
|
+
}
|
|
95
|
+
let g = 0.15 + 0.25 * uv.y;
|
|
96
|
+
return vec4f(g, g * 0.85 + 0.08 * u.params.x, 0.35 + 0.4 * uv.x, 1.0);
|
|
97
|
+
}
|
|
98
|
+
`.trim(),Os=`
|
|
99
|
+
struct SonicUniforms {
|
|
100
|
+
resolution: vec2f,
|
|
101
|
+
time: f32,
|
|
102
|
+
frame: f32,
|
|
103
|
+
mouse: vec4f,
|
|
104
|
+
params: vec4f,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@group(0) @binding(0) var<uniform> u: SonicUniforms;
|
|
108
|
+
@group(0) @binding(1) var channel0Tex: texture_2d<f32>;
|
|
109
|
+
@group(0) @binding(2) var channel1Tex: texture_2d<f32>;
|
|
110
|
+
@group(0) @binding(3) var channel2Tex: texture_2d<f32>;
|
|
111
|
+
@group(0) @binding(4) var channel3Tex: texture_2d<f32>;
|
|
112
|
+
@group(0) @binding(5) var texSampler: sampler;
|
|
113
|
+
|
|
114
|
+
fn iChannel0(uv: vec2f) -> vec4f {
|
|
115
|
+
return textureSample(channel0Tex, texSampler, uv);
|
|
116
|
+
}
|
|
117
|
+
fn iChannel1(uv: vec2f) -> vec4f {
|
|
118
|
+
return textureSample(channel1Tex, texSampler, uv);
|
|
119
|
+
}
|
|
120
|
+
fn iChannel2(uv: vec2f) -> vec4f {
|
|
121
|
+
return textureSample(channel2Tex, texSampler, uv);
|
|
122
|
+
}
|
|
123
|
+
fn iChannel3(uv: vec2f) -> vec4f {
|
|
124
|
+
return textureSample(channel3Tex, texSampler, uv);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
struct VsOut {
|
|
128
|
+
@builtin(position) position: vec4f,
|
|
129
|
+
@location(0) uv: vec2f,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@vertex
|
|
133
|
+
fn vs_main(@builtin(vertex_index) vi: u32) -> VsOut {
|
|
134
|
+
var pos = array<vec2f, 3>(
|
|
135
|
+
vec2f(-1.0, -1.0),
|
|
136
|
+
vec2f(3.0, -1.0),
|
|
137
|
+
vec2f(-1.0, 3.0),
|
|
138
|
+
);
|
|
139
|
+
var out: VsOut;
|
|
140
|
+
out.position = vec4f(pos[vi], 0.0, 1.0);
|
|
141
|
+
out.uv = pos[vi] * 0.5 + vec2f(0.5);
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@fragment
|
|
146
|
+
fn fs_main(in: VsOut) -> @location(0) vec4f {
|
|
147
|
+
let fragCoord = vec2f(in.uv.x * u.resolution.x, in.uv.y * u.resolution.y);
|
|
148
|
+
return mainImage(in.uv, fragCoord);
|
|
149
|
+
}
|
|
150
|
+
`.trim();function Nn(n){const e=n.trim()||$n;if(!/\bfn\s+mainImage\s*\(/.test(e))throw new Error("WGSL invalide : définir `fn mainImage(uv: vec2f, fragCoord: vec2f) -> vec4f`.");return`${Os}
|
|
151
|
+
|
|
152
|
+
${e}
|
|
153
|
+
`}const In=64,Ls=4;async function Yr(n=navigator.gpu){return await n.requestAdapter({powerPreference:"high-performance"})??await n.requestAdapter({powerPreference:"low-power"})??await n.requestAdapter()}async function Ms(n){const e=n.createTexture({size:[1,1],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return n.queue.writeTexture({texture:e},new Uint8Array([0,0,0,0]),{bytesPerRow:4},[1,1]),e}class Vt{constructor(e,t,r,s){this.backend="webgpu",this.pipeline=null,this.channelTextures=[null,null,null,null],this.channelViews=[null,null,null,null],this.channelSizes=[null,null,null,null],this.channelUrls=["","","",""],this.placeholder=null,this.placeholderView=null,this.bindGroup=null,this.disposed=!1,this.channelLoadTokens=[0,0,0,0],this.canvas=e,this.device=t,this.context=r,this.format=s,this.uniformBuffer=t.createBuffer({size:In,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.sampler=t.createSampler({magFilter:"linear",minFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"})}static async probe(){const e=navigator.gpu;if(!e)return"WebGPU indisponible (pas de navigator.gpu)";try{const t=await Yr(e);return t?((await t.requestDevice()).destroy(),null):"WebGPU adapter indisponible"}catch(t){return t instanceof Error?t.message:String(t)}}static async create(e){const t=navigator.gpu;if(!t)throw new Error("WebGPU indisponible (pas de navigator.gpu)");const r=await Yr(t);if(!r)throw new Error("WebGPU adapter indisponible");const s=await r.requestDevice(),u=e.getContext("webgpu");if(!u)throw s.destroy(),new Error("WebGPU canvas context indisponible");const a=navigator.gpu.getPreferredCanvasFormat();u.configure({device:s,format:a,alphaMode:"premultiplied"});const p=new Vt(e,s,u,a);return p.placeholder=await Ms(s),p.placeholderView=p.placeholder.createView(),p}async setShader(e){this.assertAlive();let t;try{t=Nn(e)}catch(a){const p=a instanceof Error?a.message:String(a);throw new Wt(p)}const r=this.device.createShaderModule({code:t}),u=(await r.getCompilationInfo()).messages.filter(a=>a.type==="error");if(u.length)throw new Wt("WGSL compile error",u.map(a=>a.message).join(`
|
|
154
|
+
`));this.pipeline=this.device.createRenderPipeline({layout:"auto",vertex:{module:r,entryPoint:"vs_main"},fragment:{module:r,entryPoint:"fs_main",targets:[{format:this.format}]},primitive:{topology:"triangle-list"}}),this.bindGroup=null}async setChannel(e,t){this.assertAlive();const r=t.trim();if(this.channelUrls[e]===r&&this.channelTextures[e])return;this.channelUrls[e]=r;const s=++this.channelLoadTokens[e];if(!r){this.destroyChannel(e),this.bindGroup=null;return}const u=await Fs(r);if(s!==this.channelLoadTokens[e]||this.disposed)return;const a=this.device.createTexture({size:[u.width,u.height],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});this.device.queue.copyExternalImageToTexture({source:u},{texture:a},[u.width,u.height]),this.destroyChannel(e),this.channelTextures[e]=a,this.channelViews[e]=a.createView(),this.channelSizes[e]={width:u.width,height:u.height},this.bindGroup=null}getTextureSize(e){const t=this.channelUrls.indexOf(e.trim());return t<0?null:this.channelSizes[t]}resize(e,t){this.assertAlive();const r=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t));this.canvas.width===r&&this.canvas.height===s||(this.canvas.width=r,this.canvas.height=s,this.context.configure({device:this.device,format:this.format,alphaMode:"premultiplied"}))}draw(e){if(this.assertAlive(),!this.pipeline||!this.placeholderView)return;this.writeUniforms(e),this.bindGroup||(this.bindGroup=this.device.createBindGroup({layout:this.pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:this.channelViews[0]??this.placeholderView},{binding:2,resource:this.channelViews[1]??this.placeholderView},{binding:3,resource:this.channelViews[2]??this.placeholderView},{binding:4,resource:this.channelViews[3]??this.placeholderView},{binding:5,resource:this.sampler}]}));const t=this.device.createCommandEncoder(),r=t.beginRenderPass({colorAttachments:[{view:this.context.getCurrentTexture().createView(),clearValue:{r:0,g:0,b:0,a:1},loadOp:"clear",storeOp:"store"}]});r.setPipeline(this.pipeline),r.setBindGroup(0,this.bindGroup),r.draw(3),r.end(),this.device.queue.submit([t.finish()])}dispose(e=!1){if(!this.disposed){this.disposed=!0;for(let t=0;t<Ls;t++)this.channelLoadTokens[t]++,this.destroyChannel(t);this.placeholder?.destroy(),this.placeholder=null,this.placeholderView=null,this.uniformBuffer.destroy(),this.pipeline=null,this.bindGroup=null;try{this.context.unconfigure()}catch{}if(e)try{this.device.destroy()}catch{}}}writeUniforms(e){const t=new ArrayBuffer(In),r=new Float32Array(t);r[0]=e.width,r[1]=e.height,r[2]=e.time,r[3]=e.frame,r[4]=e.mouse[0],r[5]=e.mouse[1],r[6]=e.mouse[2],r[7]=e.mouse[3],r[8]=e.params[0],r[9]=e.params[1],r[10]=e.params[2],r[11]=e.params[3],this.device.queue.writeBuffer(this.uniformBuffer,0,t)}destroyChannel(e){this.channelTextures[e]?.destroy(),this.channelTextures[e]=null,this.channelViews[e]=null,this.channelSizes[e]=null}assertAlive(){if(this.disposed)throw new Error("WebGPU runtime disposed")}}async function Fs(n){const e=await fetch(n);if(!e.ok)throw new Error(`Failed to load texture: ${n}`);const t=await e.blob();return createImageBitmap(t)}function Gn(n){if(n.outEventListeners>0||n.frameOut&&n.outPublisher)return!0;const e=n.outPublisher;if(!e?._proxies_)return!1;for(const t of[...ps,...ms])if(e._proxies_.get(t)?.hasListener?.())return!0;return!1}function $s(n,e,t){if(!Gn(n)||e-n.lastOutAt<n.outInterval)return;n.lastOutAt=e;const r={time:t,frame:n.frame,mouseX:n.mouseVec[0],mouseY:n.mouseVec[1],hovering:n.hovering,param0:n.param0,param1:n.param1,param2:n.param2,param3:n.param3,backend:n.runtime?.backend};n.dispatchEvent(new CustomEvent("out",{detail:r,bubbles:!0,composed:!0}));const s=n.outPublisher;if(s){const u=yt.resolveFormProviderId(n)===(n.outDataProvider?.trim()||yt.resolveFormProviderId(n)),a={time:r.time,frame:r.frame,mouseX:r.mouseX,mouseY:r.mouseY,hovering:r.hovering};if(!u)for(const p of Cn)a[p]=r[p];s.set(a)}n.frameOut&&Bn(n)}async function Bn(n){if(n.frameOutBusy||!n.runtime)return;const e=n.runtime.canvas;if(e.width<1||e.height<1)return;n.frameOutBusy=!0;const t=++n.frameOutSeq,r=e.width,s=e.height;try{const u=await new Promise(p=>{try{e.toBlob(b=>p(b),"image/png")}catch{p(null)}});if(t!==n.frameOutSeq||!u||!n.outPublisher)return;const a=URL.createObjectURL(u);jn(n),n.lastFrameUrl=a,n.outPublisher.set({frameUrl:a,snapshot:{url:a,width:r,height:s,mime:"image/png"}})}finally{t===n.frameOutSeq&&(n.frameOutBusy=!1)}}function jn(n){n.lastFrameUrl&&(Ji([n.lastFrameUrl]),n.lastFrameUrl="")}const qn={hasOutConsumer:Gn,maybePublishOut:$s,publishFrameSnapshot:Bn,revokeFrameUrl:jn},at=1200,Ht=4,zn=4,Wn=64,Ns=6,Vn=16,Hn=`
|
|
155
|
+
struct Uniforms {
|
|
156
|
+
resolution: vec2f,
|
|
157
|
+
time: f32,
|
|
158
|
+
dt: f32,
|
|
159
|
+
mouse: vec2f,
|
|
160
|
+
_pad: vec2f,
|
|
161
|
+
params: vec4f,
|
|
162
|
+
}
|
|
163
|
+
`,Is=`
|
|
164
|
+
${Hn}
|
|
165
|
+
struct Particle {
|
|
166
|
+
pos: vec2f,
|
|
167
|
+
vel: vec2f,
|
|
168
|
+
}
|
|
169
|
+
const COUNT: u32 = ${at}u;
|
|
170
|
+
@group(0) @binding(0) var<uniform> u: Uniforms;
|
|
171
|
+
@group(0) @binding(1) var<storage, read_write> particles: array<Particle, COUNT>;
|
|
172
|
+
|
|
173
|
+
@compute @workgroup_size(${Wn})
|
|
174
|
+
fn cs_main(@builtin(global_invocation_id) id: vec3u) {
|
|
175
|
+
let i = id.x;
|
|
176
|
+
if (i >= COUNT) { return; }
|
|
177
|
+
var p = particles[i];
|
|
178
|
+
let speed = 0.35 + u.params.x * 2.2;
|
|
179
|
+
let attract = u.params.y;
|
|
180
|
+
let damp = 0.98;
|
|
181
|
+
var force = vec2f(0.0);
|
|
182
|
+
if (attract > 0.001 && length(u.mouse) > 0.5) {
|
|
183
|
+
let toM = u.mouse - p.pos;
|
|
184
|
+
let d = max(length(toM), 12.0);
|
|
185
|
+
force += normalize(toM) * (attract * 6000.0 / (d * d));
|
|
186
|
+
}
|
|
187
|
+
let c = u.resolution * 0.5;
|
|
188
|
+
let toC = p.pos - c;
|
|
189
|
+
force += vec2f(-toC.y, toC.x) * 0.0025 * speed;
|
|
190
|
+
let stepDt = max(u.dt, 0.008);
|
|
191
|
+
p.vel = (p.vel + force * stepDt) * damp;
|
|
192
|
+
p.pos += p.vel * stepDt * 60.0 * speed;
|
|
193
|
+
if (p.pos.x < 0.0) { p.pos.x += u.resolution.x; }
|
|
194
|
+
if (p.pos.x > u.resolution.x) { p.pos.x -= u.resolution.x; }
|
|
195
|
+
if (p.pos.y < 0.0) { p.pos.y += u.resolution.y; }
|
|
196
|
+
if (p.pos.y > u.resolution.y) { p.pos.y -= u.resolution.y; }
|
|
197
|
+
particles[i] = p;
|
|
198
|
+
}
|
|
199
|
+
`,Gs=`
|
|
200
|
+
${Hn}
|
|
201
|
+
struct Particle {
|
|
202
|
+
pos: vec2f,
|
|
203
|
+
vel: vec2f,
|
|
204
|
+
}
|
|
205
|
+
const COUNT: u32 = ${at}u;
|
|
206
|
+
struct VsOut {
|
|
207
|
+
@builtin(position) position: vec4f,
|
|
208
|
+
@location(0) speed: f32,
|
|
209
|
+
@location(1) local: vec2f,
|
|
210
|
+
}
|
|
211
|
+
@group(0) @binding(0) var<uniform> u: Uniforms;
|
|
212
|
+
@group(0) @binding(1) var<storage, read> particles: array<Particle, COUNT>;
|
|
213
|
+
|
|
214
|
+
@vertex
|
|
215
|
+
fn vs_main(@builtin(vertex_index) vi: u32) -> VsOut {
|
|
216
|
+
let i = vi / 6u;
|
|
217
|
+
let c = vi % 6u;
|
|
218
|
+
var local = vec2f(0.0);
|
|
219
|
+
if (c == 0u) { local = vec2f(-1.0, -1.0); }
|
|
220
|
+
else if (c == 1u) { local = vec2f(1.0, -1.0); }
|
|
221
|
+
else if (c == 2u) { local = vec2f(-1.0, 1.0); }
|
|
222
|
+
else if (c == 3u) { local = vec2f(-1.0, 1.0); }
|
|
223
|
+
else if (c == 4u) { local = vec2f(1.0, -1.0); }
|
|
224
|
+
else { local = vec2f(1.0, 1.0); }
|
|
225
|
+
|
|
226
|
+
let p = particles[i];
|
|
227
|
+
let radius = 2.8;
|
|
228
|
+
let pos = p.pos + local * radius;
|
|
229
|
+
let ndc = (pos / max(u.resolution, vec2f(1.0))) * 2.0 - vec2f(1.0);
|
|
230
|
+
var out: VsOut;
|
|
231
|
+
out.position = vec4f(ndc.x, -ndc.y, 0.0, 1.0);
|
|
232
|
+
out.speed = length(p.vel);
|
|
233
|
+
out.local = local;
|
|
234
|
+
return out;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@fragment
|
|
238
|
+
fn fs_main(in: VsOut) -> @location(0) vec4f {
|
|
239
|
+
let d = length(in.local);
|
|
240
|
+
if (d > 1.0) { discard; }
|
|
241
|
+
let soft = 1.0 - smoothstep(0.55, 1.0, d);
|
|
242
|
+
let t = clamp(in.speed * 0.08, 0.0, 1.0);
|
|
243
|
+
let col = mix(vec3f(0.25, 0.65, 1.0), vec3f(1.0, 0.5, 0.2), t);
|
|
244
|
+
return vec4f(col * soft, soft);
|
|
245
|
+
}
|
|
246
|
+
`;class pr{constructor(e,t){this.device=null,this.context=null,this.format="bgra8unorm",this.uniformBuffer=null,this.particleBuffer=null,this.computePipeline=null,this.renderPipeline=null,this.bindGroup=null,this.ctx2d=null,this.lastTime=0,this.disposed=!1,this.seeded=!1,this.canvas=e,this.backend=t,this.cpu=new Float32Array(at*Ht)}static async create(e){const t=navigator.gpu;if(t)try{const u=await Yr(t);if(u){const a=await u.requestDevice(),p=e.getContext("webgpu");if(p){const b=t.getPreferredCanvasFormat();p.configure({device:a,format:b,alphaMode:"premultiplied"});const P=new pr(e,"webgpu");return P.device=a,P.context=p,P.format=b,P.initGpu(),P}a.destroy()}}catch{}const r=e.getContext("2d",{alpha:!0});if(!r)throw new Error("Particles: ni WebGPU ni Canvas2D");const s=new pr(e,"canvas2d");return s.ctx2d=r,s}async setShader(e){}async setChannel(e,t){}getTextureSize(e){return null}resize(e,t){const r=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t));this.canvas.width===r&&this.canvas.height===s||(this.canvas.width=r,this.canvas.height=s,this.context&&this.device&&this.context.configure({device:this.device,format:this.format,alphaMode:"premultiplied"}),this.seed(r,s))}draw(e){if(this.disposed||e.width<2||e.height<2)return;this.seeded||this.seed(e.width,e.height);const t=this.lastTime>0?Math.min(.05,Math.max(.001,e.time-this.lastTime)):.016;this.lastTime=e.time,this.backend==="webgpu"?this.drawGpu(e,t):this.drawCpu(e,t)}dispose(e=!0){if(!this.disposed){this.disposed=!0,this.uniformBuffer?.destroy(),this.particleBuffer?.destroy();try{this.context?.unconfigure()}catch{}this.device?.destroy(),this.device=null}}initGpu(){const e=this.device;this.uniformBuffer=e.createBuffer({size:Vn*zn,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.particleBuffer=e.createBuffer({size:at*Ht*zn,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});const t=e.createShaderModule({code:Is}),r=e.createShaderModule({code:Gs});this.computePipeline=e.createComputePipeline({layout:"auto",compute:{module:t,entryPoint:"cs_main"}}),this.renderPipeline=e.createRenderPipeline({layout:"auto",vertex:{module:r,entryPoint:"vs_main"},fragment:{module:r,entryPoint:"fs_main",targets:[{format:this.format,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}}}]},primitive:{topology:"triangle-list"}})}ensureBindGroups(){const e=this.device;!this.computePipeline||!this.renderPipeline||this.bindGroup||(this.bindGroup=e.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:this.particleBuffer}}]}))}drawGpu(e,t){const r=this.device,s=this.context;if(!this.computePipeline||!this.renderPipeline)return;const u={...e,mouse:[e.mouse[0],e.height-e.mouse[1],e.mouse[2],e.height-e.mouse[3]]};this.writeUniforms(u,t),this.ensureBindGroups();const a=r.createBindGroup({layout:this.renderPipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this.uniformBuffer}},{binding:1,resource:{buffer:this.particleBuffer}}]}),p=r.createCommandEncoder(),b=p.beginComputePass();b.setPipeline(this.computePipeline),b.setBindGroup(0,this.bindGroup),b.dispatchWorkgroups(Math.ceil(at/Wn)),b.end();const P=p.beginRenderPass({colorAttachments:[{view:s.getCurrentTexture().createView(),clearValue:{r:.04,g:.05,b:.08,a:1},loadOp:"clear",storeOp:"store"}]});P.setPipeline(this.renderPipeline),P.setBindGroup(0,a),P.draw(at*Ns),P.end(),r.queue.submit([p.finish()])}drawCpu(e,t){const r=this.ctx2d,s=e.width,u=e.height,a=.35+e.params[0]*2.2,p=e.params[1],b=e.mouse[0],P=u-e.mouse[1];for(let O=0;O<at;O++){const x=O*Ht;let E=this.cpu[x],R=this.cpu[x+1],L=this.cpu[x+2],G=this.cpu[x+3],ee=0,J=0;if(p>.001&&(b>.5||P>.5)){const U=b-E,w=P-R,T=Math.max(Math.hypot(U,w),8),z=p*4e3/(T*T);ee+=U/T*z,J+=w/T*z}const _=s*.5,g=u*.5;ee+=-(R-g)*8e-4*a,J+=(E-_)*8e-4*a,L=(L+ee*t)*.985,G=(G+J*t)*.985,E+=L*t*60*a,R+=G*t*60*a,E<0&&(E+=s),E>s&&(E-=s),R<0&&(R+=u),R>u&&(R-=u),this.cpu[x]=E,this.cpu[x+1]=R,this.cpu[x+2]=L,this.cpu[x+3]=G}r.fillStyle="rgb(10, 12, 20)",r.fillRect(0,0,s,u);for(let O=0;O<at;O++){const x=O*Ht,E=Math.hypot(this.cpu[x+2],this.cpu[x+3]),R=Math.min(1,E*.08),L=Math.round(51+R*204),G=Math.round(140-R*25),ee=Math.round(255-R*204);r.fillStyle=`rgba(${L},${G},${ee},0.85)`,r.fillRect(this.cpu[x],this.cpu[x+1],2,2)}}writeUniforms(e,t){const r=new Float32Array(Vn);r[0]=e.width,r[1]=e.height,r[2]=e.time,r[3]=t,r[4]=e.mouse[0],r[5]=e.mouse[1],r[6]=0,r[7]=0,r[8]=e.params[0],r[9]=e.params[1],r[10]=e.params[2],r[11]=e.params[3],this.device.queue.writeBuffer(this.uniformBuffer,0,r.buffer,r.byteOffset,r.byteLength)}seed(e,t){for(let r=0;r<at;r++){const s=r*Ht;this.cpu[s]=Math.random()*e,this.cpu[s+1]=Math.random()*t,this.cpu[s+2]=(Math.random()-.5)*2,this.cpu[s+3]=(Math.random()-.5)*2}this.device&&this.particleBuffer&&this.device.queue.writeBuffer(this.particleBuffer,0,this.cpu.buffer,this.cpu.byteOffset,this.cpu.byteLength),this.seeded=!0}}function Xr(n,e){if(!n.mouse||!n.runtime)return;const t=n.getBoundingClientRect();if(t.width<1||t.height<1)return;const r=n.runtime.canvas.width/Math.max(t.width,1),s=(e.clientX-t.left)*r,u=(t.height-(e.clientY-t.top))*r;if(n.mouseVec[0]=s,n.mouseVec[1]=u,!n.raf&&n.ready&&n.runtime){const a=n.startTime?(performance.now()-n.startTime)/1e3:0;n.runtime.draw({width:n.runtime.canvas.width,height:n.runtime.canvas.height,time:a,frame:n.frame,mouse:n.mouseVec,params:[n.param0,n.param1,n.param2,n.param3]})}}function Bs(n,e){Xr(n,e)}function js(n,e){Xr(n,e),n.mouseVec[2]=n.mouseVec[0],n.mouseVec[3]=n.mouseVec[1]}function qs(n){n.mouseVec[2]=0,n.mouseVec[3]=0}function zs(n){n.hovering=!0}function Ws(n){n.hovering=!1,n.mouseVec[2]=0,n.mouseVec[3]=0}const Yt={pointerToMouse:Xr,onMove:Bs,onDown:js,onUp:qs,onEnter:zs,onLeave:Ws};var Vs=Object.defineProperty,Hs=Object.getOwnPropertyDescriptor,ke=(n,e,t,r)=>{for(var s=r>1?void 0:r?Hs(e,t):e,u=n.length-1,a;u>=0;u--)(a=n[u])&&(s=(r?a(e,t,s):a(s))||s);return r&&s&&Vs(e,t,s),s};const Ys="sonic-webgpu";return ue.SonicWebGpu=class extends Nt{constructor(){super(...arguments),this.shader="",this.kernel="",this.backendPrefer="auto",this.activeBackend="",this.channel0="",this.channel1="",this.channel2="",this.channel3="",this.play=!0,this.mouse=!0,this.releaseOffscreen=!1,this.dprMax=2,this.param0=0,this.param1=0,this.param2=0,this.param3=0,this.dataProvider="",this.outDataProvider="",this.outInterval=80,this.frameOut=!1,this.aspectRatio="",this.errorMessage="",this.fallbackNotice="",this.canvasEl=null,this.runtime=null,this.raf=0,this.startTime=0,this.frame=0,this.mouseVec=[0,0,0,0],this.remoteTarget=null,this.hovering=!1,this.outEventListeners=0,this.releasing=!1,this.inView=!0,this.resizeObserver=null,this.intersectionObserver=null,this.rebuildToken=0,this.ready=!1,this.boot=null,this.formPublisher=null,this.outPublisher=null,this.lastOutAt=0,this.lastFrameUrl="",this.frameOutBusy=!1,this.frameOutSeq=0,this.onFormMutation=()=>{const e=this.formPublisher?.get()??{};yt.applyFormParams(this,e)},this.onPointerMove=e=>Yt.onMove(this,e),this.onPointerDown=e=>Yt.onDown(this,e),this.onPointerUp=()=>Yt.onUp(this),this.onPointerEnter=()=>Yt.onEnter(this),this.onPointerLeave=()=>Yt.onLeave(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("pointermove",this.onPointerMove),this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointerup",this.onPointerUp),this.addEventListener("pointerleave",this.onPointerLeave),this.addEventListener("pointerenter",this.onPointerEnter),this.bindFormProvider(),this.bindOutPublisher()}addEventListener(e,t,r){e==="out"&&t&&this.outEventListeners++,super.addEventListener(e,t,r)}removeEventListener(e,t,r){e==="out"&&t&&(this.outEventListeners=Math.max(0,this.outEventListeners-1)),super.removeEventListener(e,t,r)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("pointermove",this.onPointerMove),this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointerup",this.onPointerUp),this.removeEventListener("pointerleave",this.onPointerLeave),this.removeEventListener("pointerenter",this.onPointerEnter),this.unbindFormProvider(),this.revokeFrameUrl(),this.frameOutSeq++,this.frameOutBusy=!1,this.resizeObserver?.disconnect(),this.intersectionObserver?.disconnect(),this.rebuildToken++,this.releasing=!0,this.releaseRuntime(),this.outPublisher=null,this.releasing=!1}firstUpdated(){this.ensureCanvas(),this.resizeObserver=new ResizeObserver(()=>{this.syncSize(),this.ready&&this.runtime&&this.syncPlayback()}),this.resizeObserver.observe(this),this.intersectionObserver=new IntersectionObserver(e=>{this.inView=e.some(t=>t.isIntersecting),this.syncVisibility()},{threshold:0,rootMargin:"80px 0px"}),this.intersectionObserver.observe(this),this.bindFormProvider(),this.bindOutPublisher(),requestAnimationFrame(()=>{this.ensureRuntime()})}updated(e){if((e.has("backendPrefer")||e.has("kernel"))&&(this.runtime||this.boot)){this.releaseRuntime(),this.activeBackend="",this.ensureRuntime();return}if(!this.runtime)return;["shader",...Rn].some(r=>e.has(r))&&(e.has("shader")&&this.runtime.backend==="webgl2"&&(this.fallbackNotice=this.shader.trim()?"WebGL2 (fallback) — WGSL ignoré, canaux/params OK":"WebGL2 (fallback)"),this.rebuild()),e.has("play")&&this.syncPlayback(),(e.has("dataProvider")||e.has("outDataProvider"))&&(this.bindFormProvider(),this.bindOutPublisher()),e.has("aspectRatio")&&this.applyAspectRatio()}applyAspectRatio(e){const t=this.aspectRatio.trim();if(t){this.style.setProperty("--sonic-webgpu-ar",t.includes("/")?t:t.replace(":"," / "));return}const r=e||this.channel0,s=r?this.runtime?.getTextureSize(r):null;if(s){this.style.setProperty("--sonic-webgpu-ar",`${s.width} / ${s.height}`);return}this.style.removeProperty("--sonic-webgpu-ar")}unbindFormProvider(){yt.unbindFormProvider(this)}bindFormProvider(){yt.bindFormProvider(this)}bindOutPublisher(){yt.bindOutPublisher(this)}applyRemoteMouse(){yt.applyRemoteMouse(this)}ensureRuntime(){return this.runtime||this.releasing?this.boot??Promise.resolve():(this.boot||(this.boot=this.bootRuntime().finally(()=>{this.boot=null})),this.boot)}async bootRuntime(){this.ensureCanvas();const e=Fn(this.backendPrefer),t=Us(this.kernel),r=[];try{let s=null;if(t==="particles")try{s=await pr.create(this.ensureCanvas()),r.push(`particles:${s.backend}`)}catch(p){const b=p instanceof Error?p.message:String(p);throw new Error(`particles:${b}`)}else{const p=()=>{try{return s=zt.create(this.ensureCanvas()),r.push("webgl2:ok"),!0}catch(P){const O=P instanceof Error?P.message:String(P);return r.push(`webgl2:${O}`),console.warn(`${jt} WebGL2 failed:`,O),this.replaceCanvas(),!1}},b=async()=>{if(typeof navigator.gpu>"u")return r.push("webgpu:no-navigator.gpu"),!1;const P=await Vt.probe();if(P)return r.push(`webgpu:probe:${P}`),!1;try{return s=await Vt.create(this.ensureCanvas()),r.push("webgpu:ok"),!0}catch(O){const x=O instanceof Error?O.message:String(O);return r.push(`webgpu:create:${x}`),console.warn(`${jt} WebGPU failed:`,x),this.replaceCanvas(),!1}};if(e==="webgpu"){if(!await b())throw new Error(r.join(" → ")||"WebGPU indisponible")}else if(e==="webgl2"){if(!p())throw new Error(r.join(" → ")||"WebGL2 indisponible")}else if(!(!!this.shader.trim()?await b()||p():p()||await b()))try{s=Cr.create(this.ensureCanvas()),r.push("canvas2d:ok")}catch(x){const E=x instanceof Error?x.message:String(x);throw new Error([...r,`canvas2d:${E}`].join(" → "))}}if(!s)throw new Error(r.join(" → ")||"Aucun backend GPU");if(this.releasing){s.dispose(!0);return}this.runtime=s;const u=s.backend;this.activeBackend=u;let a="";t==="particles"?a=u==="webgpu"?"Compute particles (WebGPU)":"Particles (Canvas2D fallback)":u==="webgl2"&&this.shader.trim()?a="WebGL2 — WGSL ignoré (canaux/params OK)":u==="canvas2d"&&(a=`Canvas2D — ${r.filter(p=>!p.endsWith(":ok")).join(" · ")||"GPU indisponible"}`),this.fallbackNotice=a,this.errorMessage="",console.info(`${jt} backend:`,u,"kernel:",t,r),this.dispatchEvent(new CustomEvent("backend",{detail:{backend:u,prefer:e,kernel:t,log:r},bubbles:!0,composed:!0})),await this.rebuild()}catch(s){this.errorMessage=s instanceof Error?s.message:String(s),this.activeBackend="",this.fallbackNotice="",console.error(`${jt} boot failed:`,this.errorMessage,r),this.dispatchEvent(new CustomEvent("error",{detail:{message:this.errorMessage,log:r},bubbles:!0,composed:!0}))}}ensureCanvas(){if(this.canvasEl?.isConnected)return this.canvasEl;const e=this.renderRoot.querySelector(".stage")??this.renderRoot;let t=e.querySelector?.("canvas");return t||(t=document.createElement("canvas"),t.setAttribute("part","canvas"),e.appendChild(t)),t.style.touchAction="none",t.style.cursor=this.mouse?"crosshair":"default",this.canvasEl=t,t}replaceCanvas(){const e=this.renderRoot.querySelector(".stage")??this.renderRoot;this.canvasEl?.parentNode&&this.canvasEl.parentNode.removeChild(this.canvasEl);const t=document.createElement("canvas");return t.setAttribute("part","canvas"),e.appendChild(t),this.canvasEl=t,t}releaseRuntime(){this.stopLoop(),this.ready=!1,this.runtime?.dispose(!0),this.runtime=null,this.canvasEl?.parentNode&&this.canvasEl.parentNode.removeChild(this.canvasEl),this.canvasEl=null}async rebuild(){if(!this.runtime)return;const e=++this.rebuildToken;this.ready=!1;try{if(await this.runtime.setShader(this.shader),e!==this.rebuildToken||(this.runtime instanceof zt?await this.runtime.setChannels([this.channel0,this.channel1,this.channel2,this.channel3]):await Promise.all([this.runtime.setChannel(0,this.channel0),this.runtime.setChannel(1,this.channel1),this.runtime.setChannel(2,this.channel2),this.runtime.setChannel(3,this.channel3)]),e!==this.rebuildToken))return;this.errorMessage="",this.ready=!0,this.syncSize(),this.applyAspectRatio(this.channel0),this.startTime=performance.now(),this.frame=0,this.syncPlayback()}catch(t){const r=t instanceof Wt?t.infoLog?`${t.message}
|
|
247
|
+
${t.infoLog}`:t.message:t instanceof Error?t.message:String(t);this.errorMessage=r,this.dispatchEvent(new CustomEvent("error",{detail:{message:r,infoLog:t instanceof Wt?t.infoLog:void 0},bubbles:!0,composed:!0}))}}syncSize(){if(!this.runtime)return;const e=this.getBoundingClientRect(),t=Math.min(typeof devicePixelRatio=="number"?devicePixelRatio:1,Number.isFinite(this.dprMax)&&this.dprMax>0?this.dprMax:2);this.runtime.resize(e.width*t,e.height*t)}syncVisibility(){if(!this.inView&&this.releaseOffscreen){this.stopLoop();return}if(!this.runtime){this.ensureRuntime();return}this.syncSize(),this.syncPlayback()}shouldPlay(){return!!this.play&&!!this.runtime&&this.ready&&!this.errorMessage&&!gs()&&(this.inView||!this.releaseOffscreen)}syncPlayback(){!this.ready||!this.runtime||(this.shouldPlay()?this.startLoop():this.stopLoop())}startLoop(){if(this.raf)return;const e=t=>{if(this.raf=0,this.runtime&&this.ready){this.syncSize();const r=this.runtime.canvas.width,s=this.runtime.canvas.height;if(r>=2&&s>=2)try{this.startTime||(this.startTime=t);const u=(t-this.startTime)/1e3;this.applyRemoteMouse(),this.runtime.draw({width:r,height:s,time:u,frame:this.frame,mouse:this.mouseVec,params:[this.param0,this.param1,this.param2,this.param3]}),this.frame++,this.maybePublishOut(t,u)}catch(u){console.warn(`${jt} frame skip:`,u)}}this.shouldPlay()&&(this.raf=requestAnimationFrame(e))};this.raf=requestAnimationFrame(e)}stopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0)}maybePublishOut(e,t){qn.maybePublishOut(this,e,t)}revokeFrameUrl(){qn.revokeFrameUrl(this)}render(){return Pr`
|
|
248
|
+
<div class="stage" part="stage"></div>
|
|
249
|
+
${this.errorMessage?Pr`<div class="err" part="error">${this.errorMessage}</div>`:this.fallbackNotice?Pr`<div class="notice" part="notice">${this.fallbackNotice}</div>`:null}
|
|
250
|
+
`}},ue.SonicWebGpu.styles=Zn`
|
|
251
|
+
:host {
|
|
252
|
+
display: block;
|
|
253
|
+
position: relative;
|
|
254
|
+
width: 100%;
|
|
255
|
+
max-width: 100%;
|
|
256
|
+
height: auto;
|
|
257
|
+
aspect-ratio: var(--sonic-webgpu-ar, 16 / 9);
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
background: #0a0a0a;
|
|
260
|
+
color: #f87171;
|
|
261
|
+
font: 12px/1.4 ui-monospace, monospace;
|
|
262
|
+
}
|
|
263
|
+
canvas {
|
|
264
|
+
position: absolute;
|
|
265
|
+
inset: 0;
|
|
266
|
+
width: 100%;
|
|
267
|
+
height: 100%;
|
|
268
|
+
display: block;
|
|
269
|
+
touch-action: none;
|
|
270
|
+
}
|
|
271
|
+
.stage {
|
|
272
|
+
position: absolute;
|
|
273
|
+
inset: 0;
|
|
274
|
+
}
|
|
275
|
+
.err {
|
|
276
|
+
position: absolute;
|
|
277
|
+
inset: 0;
|
|
278
|
+
z-index: 1;
|
|
279
|
+
padding: 0.75rem;
|
|
280
|
+
background: rgba(0, 0, 0, 0.85);
|
|
281
|
+
white-space: pre-wrap;
|
|
282
|
+
overflow: auto;
|
|
283
|
+
}
|
|
284
|
+
.notice {
|
|
285
|
+
position: absolute;
|
|
286
|
+
left: 0.5rem;
|
|
287
|
+
bottom: 0.5rem;
|
|
288
|
+
z-index: 1;
|
|
289
|
+
padding: 0.25rem 0.5rem;
|
|
290
|
+
border-radius: 0.25rem;
|
|
291
|
+
background: rgba(0, 0, 0, 0.65);
|
|
292
|
+
color: #fbbf24;
|
|
293
|
+
font-size: 11px;
|
|
294
|
+
pointer-events: none;
|
|
295
|
+
}
|
|
296
|
+
`,ke([Re()],ue.SonicWebGpu.prototype,"shader",2),ke([Re({type:String})],ue.SonicWebGpu.prototype,"kernel",2),ke([Re({type:String,attribute:"backend"})],ue.SonicWebGpu.prototype,"backendPrefer",2),ke([Re({type:String,reflect:!0,attribute:"active-backend"})],ue.SonicWebGpu.prototype,"activeBackend",2),ke([Re()],ue.SonicWebGpu.prototype,"channel0",2),ke([Re()],ue.SonicWebGpu.prototype,"channel1",2),ke([Re()],ue.SonicWebGpu.prototype,"channel2",2),ke([Re()],ue.SonicWebGpu.prototype,"channel3",2),ke([Re({type:Boolean,reflect:!0})],ue.SonicWebGpu.prototype,"play",2),ke([Re({type:Boolean})],ue.SonicWebGpu.prototype,"mouse",2),ke([Re({type:Boolean,attribute:"release-offscreen"})],ue.SonicWebGpu.prototype,"releaseOffscreen",2),ke([Re({type:Number,attribute:"dpr-max"})],ue.SonicWebGpu.prototype,"dprMax",2),ke([Re({type:Number,attribute:"param0"})],ue.SonicWebGpu.prototype,"param0",2),ke([Re({type:Number,attribute:"param1"})],ue.SonicWebGpu.prototype,"param1",2),ke([Re({type:Number,attribute:"param2"})],ue.SonicWebGpu.prototype,"param2",2),ke([Re({type:Number,attribute:"param3"})],ue.SonicWebGpu.prototype,"param3",2),ke([Re({type:String})],ue.SonicWebGpu.prototype,"dataProvider",2),ke([Re({type:String,attribute:"out-data-provider"})],ue.SonicWebGpu.prototype,"outDataProvider",2),ke([Re({type:Number,attribute:"out-interval"})],ue.SonicWebGpu.prototype,"outInterval",2),ke([Re({type:Boolean,attribute:"frame-out"})],ue.SonicWebGpu.prototype,"frameOut",2),ke([Re({type:String,attribute:"aspect-ratio"})],ue.SonicWebGpu.prototype,"aspectRatio",2),ke([hn()],ue.SonicWebGpu.prototype,"errorMessage",2),ke([hn()],ue.SonicWebGpu.prototype,"fallbackNotice",2),ue.SonicWebGpu=ke([wi(Ys)],ue.SonicWebGpu),ue.DEFAULT_MAIN_IMAGE=$n,ue.WebGl2FallbackRuntime=zt,ue.WebGpuCompileError=Wt,ue.WebGpuRuntime=Vt,ue.buildWgslSource=Nn,ue.parseBackendPrefer=Fn,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"}),ue})({});
|